← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~mterry/appmenu-gtk/rebuild-if-realized into lp:appmenu-gtk

 

Michael Terry has proposed merging lp:~mterry/appmenu-gtk/rebuild-if-realized into lp:appmenu-gtk.

Requested reviews:
  Canonical Desktop Experience Team (canonical-dx-team)

For more details, see:
https://code.launchpad.net/~mterry/appmenu-gtk/rebuild-if-realized/+merge/48827

This fixes issues with Java SWT apps that I hit when debugging eclipse's menus.  This doesn't fix eclipse, but does fix simple SWT-using apps.

The problem was that the insert() function was ignoring already-realized toplevels and assuming that they would be realized only in the future.  This patch fixes that.  See bug 618587 for context and a sample app.
-- 
https://code.launchpad.net/~mterry/appmenu-gtk/rebuild-if-realized/+merge/48827
Your team ayatana-commits is subscribed to branch lp:appmenu-gtk.
=== modified file 'src/bridge.c'
--- src/bridge.c	2011-02-07 15:42:49 +0000
+++ src/bridge.c	2011-02-07 19:17:54 +0000
@@ -779,9 +779,16 @@
 
   if (GTK_IS_WINDOW (toplevel))
     {
-      g_signal_connect (toplevel, "realize",
-                        G_CALLBACK (toplevel_realized),
-                        bridge);
+      if (gtk_widget_get_realized (toplevel))
+        {
+          rebuild (bridge, toplevel);
+        }
+      else
+        {
+          g_signal_connect (toplevel, "realize",
+                            G_CALLBACK (toplevel_realized),
+                            bridge);
+        }
     }
 }
 


Follow ups