diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-06-27 18:37:41 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-06-27 18:37:41 +0000 |
commit | c719b4bf3d66b117003e4703eea5e15cfac8ebe5 (patch) | |
tree | 442577d6e5e3bbbb7070682fa6872ba63dceafe3 /modules | |
parent | ddd27f21a68f8f941adfd1f7781d2a882936e768 (diff) | |
download | gtk+-c719b4bf3d66b117003e4703eea5e15cfac8ebe5.tar.gz |
Avoid a segfault. (#309054)
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* modules/input/gtkimcontextxim.c (gtk_im_context_xim_finalize):
Avoid a segfault. (#309054)
* gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add
fields for grab timestamps.
* gdk/x11/gdkmain-x11.c (gdk_pointer_grab, gdk_keyboard_grab):
Store grab timestamps when grabbing.
* gdk/x11/gdkdisplay-x11.c (gdk_display_keyboard_ungrab)
(gdk_display_pointer_ungrab): Don't unset the grab_window
if the timestamps indicate that the ungrab will fails.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/input/gtkimcontextxim.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c index 86c972d238..c210a2c52e 100644 --- a/modules/input/gtkimcontextxim.c +++ b/modules/input/gtkimcontextxim.c @@ -567,20 +567,26 @@ gtk_im_context_xim_finalize (GObject *obj) if (context_xim->im_info) { - GdkDisplay *display; - XIMCallback im_destroy_callback; - - display = gdk_screen_get_display (context_xim->im_info->screen); - XUnregisterIMInstantiateCallback (GDK_DISPLAY_XDISPLAY (display), - NULL, NULL, NULL, - xim_instantiate_callback, - (XPointer)context_xim->im_info); - - im_destroy_callback.client_data = NULL; - im_destroy_callback.callback = NULL; - XSetIMValues (context_xim->im_info->im, - XNDestroyCallback, &im_destroy_callback, - NULL); + if (context_xim->im_info->reconnecting) + { + GdkDisplay *display; + + display = gdk_screen_get_display (context_xim->im_info->screen); + XUnregisterIMInstantiateCallback (GDK_DISPLAY_XDISPLAY (display), + NULL, NULL, NULL, + xim_instantiate_callback, + (XPointer)context_xim->im_info); + } + else + { + XIMCallback im_destroy_callback; + + im_destroy_callback.client_data = NULL; + im_destroy_callback.callback = NULL; + XSetIMValues (context_xim->im_info->im, + XNDestroyCallback, &im_destroy_callback, + NULL); + } } set_ic_client_window (context_xim, NULL); |