[yocto] [matchbox-panel-2][PATCH 24/25] mb-panel: size request needs to be set before realize

Jussi Kukkonen jussi.kukkonen at intel.com
Tue May 3 04:30:43 PDT 2016


GtkWindow will default to 200 height on realize unless we request
otherwise  before that. On the other hand, struts can only be set
after the window has been realized.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen at intel.com>
---
 matchbox-panel/mb-panel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/matchbox-panel/mb-panel.c b/matchbox-panel/mb-panel.c
index 3f7e3b4..4f5fb74 100644
--- a/matchbox-panel/mb-panel.c
+++ b/matchbox-panel/mb-panel.c
@@ -387,8 +387,6 @@ main (int argc, char **argv)
                 gtk_window_set_accept_focus (GTK_WINDOW (window), FALSE);
         }
 
-        gtk_widget_realize (window);
-
         /* Set size */
         switch (mode) {
         case MODE_DOCK:
@@ -427,8 +425,6 @@ main (int argc, char **argv)
                                          screen_geom.x,
                                          screen_geom.y + screen_geom.height - size);
                 }
-
-                set_struts (window, edge, size);
                 break;
         case MODE_TITLEBAR:
                 /* TODO */
@@ -453,6 +449,10 @@ main (int argc, char **argv)
                 break;
         }
 
+        gtk_widget_realize (window);
+        if (mode == MODE_DOCK)
+		set_struts (window, edge, size);
+
         /* Add frame */
         frame = gtk_frame_new (NULL);
         gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
-- 
2.8.1




More information about the yocto mailing list