[gtk: 1/2] gtkimcontextxim: fix gtk_im_context_xim_set_client_widget not handling widget=NULL
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 1/2] gtkimcontextxim: fix gtk_im_context_xim_set_client_widget not handling widget=NULL
- Date: Sun, 4 Mar 2018 18:30:51 +0000 (UTC)
commit 8c2c748c1171009f8a063aec2fe1f2d193be682c
Author: Christoph Reiter <creiter src gnome org>
Date: Sun Mar 4 18:40:12 2018 +0100
gtkimcontextxim: fix gtk_im_context_xim_set_client_widget not handling widget=NULL
gtk_im_context_set_client_widget() allows passing NULL as widget to signal that
the widget no longer exists. The xim implementation didn't handle that
case which led to the test suite on gitlab-ci failing.
gtk/gtkimcontextxim.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkimcontextxim.c b/gtk/gtkimcontextxim.c
index 15e3cce131..8c84c54146 100644
--- a/gtk/gtkimcontextxim.c
+++ b/gtk/gtkimcontextxim.c
@@ -575,9 +575,12 @@ gtk_im_context_xim_set_client_widget (GtkIMContext *context,
GtkWidget *widget)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
- GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
+ GdkWindow *window = NULL;
- set_ic_client_window (context_xim, gtk_widget_get_window (toplevel));
+ if (widget != NULL)
+ window = gtk_widget_get_window (gtk_widget_get_toplevel (widget));
+
+ set_ic_client_window (context_xim, window);
}
GtkIMContext *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]