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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 5 15:09:34 EEST 2009
Author: kihamala
Date: 2009-05-05 15:09:22 +0300 (Tue, 05 May 2009)
New Revision: 18236

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
Log:
remove 'monster hack', prepare for negative coordinates in legacy menus


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-05-05 11:15:57 UTC (rev 18235)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-05-05 12:09:22 UTC (rev 18236)
@@ -1,3 +1,13 @@
+2009-05-05  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/core/mb-wm-client-window.c
+	(mb_wm_client_window_sync_properties): Remove the 'monster hack' for
+	800x480 windows, everything seems to work without it.
+	* matchbox/client-types/mb-wm-client-menu.c (mb_wm_client_menu_init):
+	Add support for fixing NB#101437 -- some parts of the code need to be
+	removed after the widget side uses the negative coordinates system for
+	legacy application menus.
+
 2009-05-04  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	Applied two patches from Laszlo Pere for NB#110527 and NB#106208.

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-05-05 11:15:57 UTC (rev 18235)
+++ projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c	2009-05-05 12:09:22 UTC (rev 18236)
@@ -108,23 +108,31 @@
     geom.x = wm->xdpy_width / 2 - geom.width / 2;
     geom.y = 0;
   }
-  else
+  else if (geom.x < 0 && geom.y < 0) /* magic marker for
+                                        legacy application menu */
   {
-#if 0  /* FIXME Return this code when Gtk+ sets the legacy menu to different
-          type than the CSM pop-up menu */
-    if (win->net_type != wm->atoms[MBWM_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU])
-#endif
-      {
-	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;
+    geom.x += wm->xdpy_width;
+    geom.y += wm->xdpy_height;
 
-	if (geom.y < 56)
-	  geom.y = 56; /* shouldn't this be taken from the theme? */
-      }
+    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? */
   }
+  else /* FIXME: remove this else branch after the widget side does
+          negative coordinates for legacy application menus,
+          see NB#101437 */
+  {
+    if (geom.x < 112 * 2)
+      geom.x = 112 * 2;
 
+    if (geom.y < 56)
+      geom.y = 56; /* shouldn't this be taken from the theme? */
+  }
+
   g_debug ("%s: Menu will be at %d %d %d %d", __func__, geom.x, geom.y,
            geom.width, geom.height);
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-05-05 11:15:57 UTC (rev 18235)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-05-05 12:09:22 UTC (rev 18236)
@@ -564,12 +564,6 @@
 	  goto abort;
 	}
 
-      /* FIXME: Monster Hack to make Browser visible (800x480 was a problem) */
-      if (win->x_geometry.width >= wm->xdpy_width)
-	      win->x_geometry.width = wm->xdpy_width - 1;
-      if (win->x_geometry.height >= wm->xdpy_height)
-	      win->x_geometry.height = wm->xdpy_height - 1;
-
       MBWM_DBG("@@@ New Window Obj @@@");
       MBWM_DBG("Win:  %lx", win->xwindow);
       MBWM_DBG("Type: %lx",win->net_type);


More information about the maemo-commits mailing list