[maemo-commits] [maemo-commits] r15136 - in projects/haf/trunk/hildon-input-method-framework: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 5 14:03:23 EET 2008
Author: tjunnone
Date: 2008-02-05 14:03:21 +0200 (Tue, 05 Feb 2008)
New Revision: 15136

Modified:
   projects/haf/trunk/hildon-input-method-framework/ChangeLog
   projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c
Log:
2008-02-04  Tomas Junnonen  <tomas.junnonen at nokia.com>

        * src/hildon-im-context.c: Allow applications to supply the
          window ID the IM will be set transient to, for children of
          GtkPlug. Fixes NB#80146.



Modified: projects/haf/trunk/hildon-input-method-framework/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-input-method-framework/ChangeLog	2008-02-05 11:46:49 UTC (rev 15135)
+++ projects/haf/trunk/hildon-input-method-framework/ChangeLog	2008-02-05 12:03:21 UTC (rev 15136)
@@ -5,6 +5,12 @@
 	  the queue and the mainloop iteration does not run between
 	  their processing. Fixes NB#79664.
 
+2008-02-04  Tomas Junnonen  <tomas.junnonen at nokia.com>
+
+	* src/hildon-im-context.c: Allow applications to supply the
+	  window ID the IM will be set transient to, for children of
+	  GtkPlug. Fixes NB#80146.
+
 2008-01-11  Richard Sun  <richard.sun at nokia.com>
 
 	* Version 1:2.0.0

Modified: projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c
===================================================================
--- projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c	2008-02-05 11:46:49 UTC (rev 15135)
+++ projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c	2008-02-05 12:03:21 UTC (rev 15136)
@@ -37,6 +37,7 @@
 #include <pango/pango.h>
 #include <cairo/cairo.h>
 
+#include <gtk/gtksocket.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtkcomboboxentry.h>
 #include <gtk/gtktoolbar.h>
@@ -2069,7 +2070,26 @@
   if (cmd != HILDON_IM_HIDE)
   {
     msg->input_window = GDK_WINDOW_XID(input_window);
-    msg->app_window = GDK_WINDOW_XID(gdk_window_get_toplevel(input_window));
+
+    /* When the client widget is a child of GtkPlug, the application can
+       override the ID of the window the IM will be set transient to */
+    if (GTK_IS_PLUG(gtk_widget_get_toplevel(self->client_gtk_widget)))
+    {
+      GtkPlug *plug = (GtkPlug *)gtk_widget_get_toplevel(self->client_gtk_widget);
+      guint32 transient_window_xid;
+
+      transient_window_xid =
+        GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(plug),
+                                           "hildon_im_transient_xid"));
+      if (transient_window_xid)
+        msg->app_window = transient_window_xid;
+      else
+        msg->app_window = GDK_WINDOW_XID(gdk_window_get_toplevel(input_window));
+    }
+    else
+    {
+      msg->app_window = GDK_WINDOW_XID(gdk_window_get_toplevel(input_window));
+    }
   }
 
   msg->cmd = cmd;


More information about the maemo-commits mailing list