[maemo-commits] [maemo-commits] r12286 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jun 14 09:20:19 EEST 2007
Author: moimart
Date: 2007-06-14 09:19:33 +0300 (Thu, 14 Jun 2007)
New Revision: 12286

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c
Log:
2007-06-14  Moises Martinez  <moises.martinez at nokia.com>

        * libhildondesktop/hildon-desktop-panel-window-dialog.c:
        - Setting matchbox specific hints shouldn't rely on patched gtk.
        Patch provided by Tommi Komulainen. Fixes: MB#1538



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-13 21:57:11 UTC (rev 12285)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-14 06:19:33 UTC (rev 12286)
@@ -1,3 +1,9 @@
+2007-06-14  Moises Martinez  <moises.martinez at nokia.com>
+
+	* libhildondesktop/hildon-desktop-panel-window-dialog.c:
+	- Setting matchbox specific hints shouldn't rely on patched gtk.
+	Patch provided by Tommi Komulainen. Fixes: MB#1538
+
 2007-06-13  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* src/hn-others-button.c, src/hd-applications-menu.c: keep track of changes 

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c	2007-06-13 21:57:11 UTC (rev 12285)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c	2007-06-14 06:19:33 UTC (rev 12286)
@@ -62,10 +62,30 @@
 
 static void hildon_desktop_window_dialog_fullscreen_cb (HDWM *hdwm, gboolean fullscreen, gpointer _window);
 
+static void
+hildon_desktop_panel_window_dialog_realize (GtkWidget *widget)
+{
+  GdkDisplay *display = gtk_widget_get_display (widget);
+  Atom atoms[2];
+
+  GTK_WIDGET_CLASS (hildon_desktop_panel_window_dialog_parent_class)->realize (widget);
+
+  atoms[0] = gdk_x11_get_xatom_by_name_for_display (display, "_MB_WM_STATE_DOCK_TITLEBAR");
+  atoms[1] = gdk_x11_get_xatom_by_name_for_display (display, "_MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP");
+
+  XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
+		   GDK_WINDOW_XID (widget->window),
+		   gdk_x11_get_xatom_by_name_for_display (display, "_MB_WM_STATE"),
+		   XA_ATOM, 32,
+		   PropModeReplace,
+		   (guchar*) atoms, 2);
+}
+
 static void 
 hildon_desktop_panel_window_dialog_class_init (HildonDesktopPanelWindowDialogClass *dskwindow_class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (dskwindow_class);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (dskwindow_class);
 
   g_type_class_add_private (dskwindow_class, sizeof (HildonDesktopPanelWindowDialogPrivate));
 
@@ -73,6 +93,8 @@
   object_class->set_property = hildon_desktop_panel_window_dialog_set_property;
   object_class->get_property = hildon_desktop_panel_window_dialog_get_property;
 
+  widget_class->realize = hildon_desktop_panel_window_dialog_realize;
+
   g_object_class_install_property (object_class,
  				   PROP_FULLSCREEN,
 				   g_param_spec_boolean(
@@ -227,9 +249,6 @@
   {
     if (window->priv->old_titlebar)
     {
-       Atom atoms[3];
-       Display *dpy;
-       Window  win;
        gint width, height;
 
        g_debug ("Using DOCK_TITLEBAR SHOW_ON_DESKTOP");
@@ -240,22 +259,9 @@
        gtk_window_set_type_hint( GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DOCK);
 
        gtk_widget_realize (GTK_WIDGET (window));
-
-       g_object_set_data (G_OBJECT (GTK_WIDGET (window)->window),
-                          "_NET_WM_STATE", (gpointer)PropModeAppend);
        
-       dpy = GDK_DISPLAY();
-       win = GDK_WINDOW_XID (GTK_WIDGET (window)->window);
+       /* custom WM hints are set in realize */
 
-       atoms[0] = XInternAtom(dpy, "_NET_WM_STATE", False);
-       atoms[1] = XInternAtom(dpy, "_MB_WM_STATE_DOCK_TITLEBAR", False);
-       atoms[2] = XInternAtom(dpy, "_MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP", False);
-
-       XChangeProperty (dpy, win, 
-		        atoms[0], XA_ATOM, 
-			32, PropModeReplace,
-			(unsigned char *) &atoms[1], 2);
-
        gdk_window_get_geometry (GTK_WIDGET (window)->window,
 		       		NULL,NULL,&width, &height, NULL);
 


More information about the maemo-commits mailing list