Adjusted code style slightly for SDL_ibus.c

This commit is contained in:
Ryan C. Gordon 2014-08-21 23:15:17 -04:00
parent da4c3d54d6
commit 5e1f15892f
1 changed files with 98 additions and 95 deletions

View File

@ -129,6 +129,7 @@ IBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *user_data)
if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "CommitText")) { if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "CommitText")) {
DBusMessageIter iter; DBusMessageIter iter;
dbus->message_iter_init(msg, &iter); dbus->message_iter_init(msg, &iter);
const char *text = IBus_GetVariantText(conn, &iter, dbus); const char *text = IBus_GetVariantText(conn, &iter, dbus);
@ -583,12 +584,16 @@ SDL_IBus_UpdateTextRect(SDL_Rect *rect)
SDL_Window *focused_win = SDL_GetKeyboardFocus(); SDL_Window *focused_win = SDL_GetKeyboardFocus();
if(!focused_win) return; if (!focused_win) {
return;
}
SDL_SysWMinfo info; SDL_SysWMinfo info;
SDL_VERSION(&info.version); SDL_VERSION(&info.version);
if(!SDL_GetWindowWMInfo(focused_win, &info)) return; if (!SDL_GetWindowWMInfo(focused_win, &info)) {
return;
}
int x = 0, y = 0; int x = 0, y = 0;
@ -596,16 +601,14 @@ SDL_IBus_UpdateTextRect(SDL_Rect *rect)
#if SDL_VIDEO_DRIVER_X11 #if SDL_VIDEO_DRIVER_X11
if (info.subsystem == SDL_SYSWM_X11) { if (info.subsystem == SDL_SYSWM_X11) {
SDL_DisplayData *displaydata = SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata;
(SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata;
Display *x_disp = info.info.x11.display; Display *x_disp = info.info.x11.display;
Window x_win = info.info.x11.window; Window x_win = info.info.x11.window;
int x_screen = displaydata->screen; int x_screen = displaydata->screen;
Window unused; Window unused;
X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);
0, 0, &x, &y, &unused);
} }
#endif #endif