[maemo-commits] [maemo-commits] r17269 - in projects/haf/trunk/libmatchbox2: . debian matchbox/client-types

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jan 23 14:30:43 EET 2009
Author: kihamala
Date: 2009-01-23 14:30:42 +0200 (Fri, 23 Jan 2009)
New Revision: 17269

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/debian/changelog
   projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c
Log:
fix menu positioning


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-23 10:57:12 UTC (rev 17268)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-23 12:30:42 UTC (rev 17269)
@@ -1,3 +1,9 @@
+2009-01-23  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/client-types/mb-wm-client-menu.c (mb_wm_client_menu_init):
+	Fix positioning of new-style menus. Old-style menus are positioned
+	better, but not yet according to layout guide. Fixes: NB#92248
+
 2009-01-23  Adam Endrodi  <adam.endrodi at blumsoft.eu>
 
 	* matchbox/core/mb-wm-decor.c:

Modified: projects/haf/trunk/libmatchbox2/debian/changelog
===================================================================
--- projects/haf/trunk/libmatchbox2/debian/changelog	2009-01-23 10:57:12 UTC (rev 17268)
+++ projects/haf/trunk/libmatchbox2/debian/changelog	2009-01-23 12:30:42 UTC (rev 17269)
@@ -4,6 +4,7 @@
   * Depend on libclutter-0.8-dev > 0.8.2-0maemo13 because of new API for
     shaped windows.
   * Patch from Laszlo to focus next client when unfocusing. Fixes: NB#93431
+  * Fix menu positioning. Fixes: NB#92248
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Mon, 12 Jan 2009 17:46:43 +0200
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c	2009-01-23 10:57:12 UTC (rev 17268)
+++ projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c	2009-01-23 12:30:42 UTC (rev 17269)
@@ -41,8 +41,6 @@
 {
 }
 
-#define MENU_GUTTER 50
-
 static int
 mb_wm_client_menu_init (MBWMObject *this, va_list vap)
 {
@@ -56,8 +54,6 @@
     wm->atoms[MBWM_ATOM_NET_WM_ACTION_RESIZE],
   };
 
-  g_debug("This is a menu.\n");
-
   XChangeProperty (wm->xdpy, win->xwindow,
 		   wm->atoms[MBWM_ATOM_NET_WM_ALLOWED_ACTIONS],
 		   XA_ATOM, 32, PropModeReplace,
@@ -94,26 +90,36 @@
       /* Stack with 'always on top' */
       client->stacking_layer = MBWMStackLayerTopMid;
     }
-#else
+#endif
+
   if (win->hildon_stacking_layer == 0)
     client->stacking_layer = MBWMStackLayerTop;
   else
     client->stacking_layer = win->hildon_stacking_layer
                              + MBWMStackLayerHildon1 - 1;
-#endif
 
   geom = client->window->geometry;
-  
-  /* NOTE: Fremantle old-style menus set their width and height themselves,
-   * only ensure minimum x and y here to avoid obstructing the title bar. */
 
-  if (geom.x < MENU_GUTTER)
-    geom.x = MENU_GUTTER;
+  if (((MBWindowManagerClientClass*)mb_wm_object_get_class(this))->client_type
+      != MBWMClientTypeMenu)
+  {
+    /* new-style menu */
+    geom.width = wm->xdpy_width - 100;
+    geom.x = wm->xdpy_width / 2 - geom.width / 2;
+    geom.y = 0;
+  }
+  else
+  {
+    if (geom.x < 112 * 2)
+        /* TODO: this should be dynamic, depending on status area.
+         * Also, submenus need to be handled differently */
+        geom.x = 112 * 2;
 
-  if (geom.y < 56)
-    geom.y = 56; /* shouldn't this be taken from the theme? */
+    if (geom.y < 56)
+        geom.y = 56; /* shouldn't this be taken from the theme? */
+  }
 
-  g_debug ("Menu will be at %d %d %d %d", geom.x, geom.y,
+  printf ("%s: Menu will be at %d %d %d %d\n", __func__, geom.x, geom.y,
            geom.width, geom.height);
 
   mb_wm_client_menu_request_geometry (client, &geom,


More information about the maemo-commits mailing list