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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jun 11 10:28:35 EEST 2009
Author: kihamala
Date: 2009-06-11 10:28:12 +0300 (Thu, 11 Jun 2009)
New Revision: 18700

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/debian/changelog
   projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.h
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h
Log:

        * matchbox/client-types/mb-wm-client-menu.c (mb_wm_client_menu_init):
        Add support for the new atom for legacy menus. Fixes: NB#121678. Also
        returned the dynamic placement code since it does not break submenus
        anymore.
        * matchbox/core/mb-wm-client-window.c
        (mb_wm_client_window_sync_properties),
        matchbox/core/mb-wm-client-window.h, matchbox/core/mb-wm-types.h,
        matchbox/core/mb-wm-atoms.c: Add support for _HILDON_WM_WINDOW_TYPE
        and _HILDON_WM_WINDOW_TYPE_LEGACY_MENU atoms.



Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-06-11 07:28:12 UTC (rev 18700)
@@ -1,3 +1,15 @@
+2009-06-11  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/client-types/mb-wm-client-menu.c (mb_wm_client_menu_init):
+	Add support for the new atom for legacy menus. Fixes: NB#121678. Also
+	returned the dynamic placement code since it does not break submenus
+	anymore.
+	* matchbox/core/mb-wm-client-window.c
+	(mb_wm_client_window_sync_properties),
+	matchbox/core/mb-wm-client-window.h, matchbox/core/mb-wm-types.h,
+	matchbox/core/mb-wm-atoms.c: Add support for _HILDON_WM_WINDOW_TYPE
+	and _HILDON_WM_WINDOW_TYPE_LEGACY_MENU atoms.
+
 2009-06-08  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	Release 0.2.42

Modified: projects/haf/trunk/libmatchbox2/debian/changelog
===================================================================
--- projects/haf/trunk/libmatchbox2/debian/changelog	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/debian/changelog	2009-06-11 07:28:12 UTC (rev 18700)
@@ -1,6 +1,7 @@
 matchbox-window-manager-2 (0.2.43-1~unreleased) unstable; urgency=low
 
-  * foo
+  Kimmo:
+  * Fixes: NB#121678 - Need WM support for _HILDON_WM_WINDOW_TYPE_LEGACY_MENU
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Mon,  8 Jun 2009 09:53:28 +0300
 

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-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/matchbox/client-types/mb-wm-client-menu.c	2009-06-11 07:28:12 UTC (rev 18700)
@@ -120,24 +120,20 @@
 	geom.x = 0;
       }
   }
-  else
+  else if (win->hildon_type ==
+                wm->atoms[MBWM_ATOM_HILDON_WM_WINDOW_TYPE_LEGACY_MENU])
   {
-    /* hard-coded due to NB#117301 --- violates the Layout Guide a bit,
-     * but otherwise submenus can be placed on top of the main menu, making
-     * them unusable. */
-    int title_x;
+    /* placement code for legacy application menu, only for the main menu,
+     * not for the submenus */
+    gint title_x, title_y;
 
-    if (wm->xdpy_width > wm->xdpy_height)
-      title_x = 2 * 112 + 45;
-    else
-      /* portrait orientation */
-      title_x = 112 + 45;
+    mb_wm_theme_get_title_xy (wm->theme, &title_x, &title_y);
 
     if (geom.x < title_x)
       geom.x = title_x;
 
-    if (geom.y < 56)
-      geom.y = 56;
+    if (geom.y < title_y)
+      geom.y = title_y;
   }
 
   g_debug ("%s: Menu will be at %d %d %d %d", __func__, geom.x, geom.y,

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c	2009-06-11 07:28:12 UTC (rev 18700)
@@ -105,6 +105,8 @@
     "_HILDON_STACKING_LAYER",
     "_HILDON_WM_NAME",
     "_HILDON_WM_WINDOW_TYPE_ANIMATION_ACTOR",
+    "_HILDON_WM_WINDOW_TYPE",
+    "_HILDON_WM_WINDOW_TYPE_LEGACY_MENU",
   };
 
   /* FIXME: Error Traps */

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-06-11 07:28:12 UTC (rev 18700)
@@ -43,6 +43,7 @@
   COOKIE_WIN_NET_STATE,
   COOKIE_WIN_MWM_HINTS,
   COOKIE_WIN_HILDON_STACKING,
+  COOKIE_WIN_HILDON_TYPE,
 
   N_COOKIES
 };
@@ -224,6 +225,11 @@
       = mb_wm_property_atom_req(wm, xwin,
 				wm->atoms[MBWM_ATOM_NET_WM_WINDOW_TYPE]);
 
+  if (props_req & MBWM_WINDOW_PROP_WIN_HILDON_TYPE)
+    cookies[COOKIE_WIN_HILDON_TYPE]
+      = mb_wm_property_atom_req(wm, xwin,
+				wm->atoms[MBWM_ATOM_HILDON_WM_WINDOW_TYPE]);
+
   if (props_req & MBWM_WINDOW_PROP_NET_STATE)
     cookies[COOKIE_WIN_NET_STATE]
       = mb_wm_property_atom_req(wm, xwin,
@@ -475,6 +481,42 @@
       result_atom = NULL;
     }
 
+  if (props_req & MBWM_WINDOW_PROP_WIN_HILDON_TYPE)
+    {
+      mb_wm_property_reply (wm,
+			    cookies[COOKIE_WIN_HILDON_TYPE],
+			    &actual_type_return,
+			    &actual_format_return,
+			    &nitems_return,
+			    &bytes_after_return,
+			    &result_atom,
+			    &x_error_code);
+
+      if (x_error_code
+	  || actual_type_return != XA_ATOM
+	  || actual_format_return != 32
+	  || nitems_return != 1
+	  || result_atom == NULL
+	  )
+	{
+	  g_debug ("%s: ### Warning hildon type prop failed ###", __func__);
+	  if (x_error_code == BadWindow)
+	    goto badwindow_error;
+	}
+      else
+	{
+	  if (win->hildon_type != ((Atom *)result_atom)[0])
+	    changes |= MBWM_WINDOW_PROP_WIN_HILDON_TYPE;
+
+	  win->hildon_type = ((Atom*)result_atom)[0];
+	}
+
+      if (result_atom)
+	XFree(result_atom);
+
+      result_atom = NULL;
+    }
+
   if (props_req & MBWM_WINDOW_PROP_NET_STATE)
     {
       mb_wm_property_reply (wm,

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.h	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.h	2009-06-11 07:28:12 UTC (rev 18700)
@@ -47,6 +47,7 @@
 #define MBWM_WINDOW_PROP_CM_TRANSLUCENCY (1<<17)
 #define MBWM_WINDOW_PROP_MWM_HINTS       (1<<18)
 #define MBWM_WINDOW_PROP_HILDON_STACKING (1<<19)
+#define MBWM_WINDOW_PROP_WIN_HILDON_TYPE (1<<20)
 
 #define MBWM_WINDOW_PROP_ALL        (0xffffffff)
 
@@ -131,6 +132,7 @@
   MBWindowManager               *wm;
 
   Atom                           net_type;
+  Atom                           hildon_type;
   Bool                           want_key_input;
   Window                         xwin_group;
   Pixmap                         icon_pixmap, icon_pixmap_mask;

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h	2009-06-11 06:41:30 UTC (rev 18699)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h	2009-06-11 07:28:12 UTC (rev 18700)
@@ -300,6 +300,11 @@
   MBWM_ATOM_HILDON_WM_NAME,
   MBWM_ATOM_HILDON_WM_WINDOW_TYPE_ANIMATION_ACTOR,
 
+  /* "hildon window type", currently used to tell apart legacy menus from
+   * CSMs. */
+  MBWM_ATOM_HILDON_WM_WINDOW_TYPE,
+  MBWM_ATOM_HILDON_WM_WINDOW_TYPE_LEGACY_MENU,
+
   MBWM_ATOM_COUNT
 
 } MBWMAtom;

More information about the maemo-commits mailing list