Set LXPanel widget properties rather on creation instead of panel_start_gui().
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 17 Nov 2014 20:49:50 +0000 (22:49 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 17 Nov 2014 20:49:50 +0000 (22:49 +0200)
src/panel.c

index 391f056..57c3e8e 100644 (file)
@@ -342,13 +342,20 @@ static void lxpanel_init(PanelToplevel *self)
     p->icon_theme = gtk_icon_theme_get_default();
     p->config = config_new();
     p->defstyle = gtk_widget_get_default_style();
-    gtk_window_set_type_hint(GTK_WINDOW(self), GDK_WINDOW_TYPE_HINT_DOCK);
 }
 
 /* Allocate and initialize new Panel structure. */
 static LXPanel* panel_allocate(void)
 {
-    return g_object_new(LX_TYPE_PANEL, NULL);
+    return g_object_new(LX_TYPE_PANEL,
+                        "border-width", 0,
+                        "decorated", FALSE,
+                        "name", "PanelToplevel",
+                        "resizable", FALSE,
+                        "title", "panel",
+                        "type-hint", GDK_WINDOW_TYPE_HINT_DOCK,
+                        "window-position", GTK_WIN_POS_NONE,
+                        NULL);
 }
 
 void _panel_emit_icon_size_changed(LXPanel *p)
@@ -1283,16 +1290,8 @@ panel_start_gui(LXPanel *panel, config_setting_t *list)
     p->workarea = get_xaproperty (GDK_ROOT_WINDOW(), a_NET_WORKAREA, XA_CARDINAL, &p->wa_len);
     p->ax = p->ay = p->aw = p->ah = 0;
 
-    /* main toplevel window */
-    /* p->topgwin =  gtk_window_new(GTK_WINDOW_TOPLEVEL); */
-    gtk_widget_set_name(w, "PanelToplevel");
     p->display = gdk_display_get_default();
-    gtk_container_set_border_width(GTK_CONTAINER(panel), 0);
-    gtk_window_set_resizable(GTK_WINDOW(panel), FALSE);
     gtk_window_set_wmclass(GTK_WINDOW(panel), "panel", "lxpanel");
-    gtk_window_set_title(GTK_WINDOW(panel), "panel");
-    gtk_window_set_position(GTK_WINDOW(panel), GTK_WIN_POS_NONE);
-    gtk_window_set_decorated(GTK_WINDOW(panel), FALSE);
 
     if (G_UNLIKELY(win_grp == NULL))
     {
@@ -1333,7 +1332,7 @@ panel_start_gui(LXPanel *panel, config_setting_t *list)
     panel_set_dock_type(p);
 
     /* window mapping point */
-    gtk_widget_show_all(w);
+    gtk_window_present(GTK_WINDOW(panel));
 
     /* the settings that should be done after window is mapped */
     _panel_establish_autohide(panel);