[maemo-commits] [maemo-commits] r18832 - in projects/haf/trunk/libmatchbox2: . matchbox/core

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jul 3 09:58:59 EEST 2009
Author: aendrodi
Date: 2009-07-03 09:58:43 +0300 (Fri, 03 Jul 2009)
New Revision: 18832

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h
Log:
	* matchbox/core/mb-wm-types.h
	* matchbox/core/mb-wm-atoms.c:
	  Moved _MAEMO_SUPPRESS_ROOT_RECONFIGURATION so we can use to to...
	* matchbox/core/mb-window-manager.c:
	  ...fake a root window reconfig when we see the toggle offed.
	  Do it so that it works both with dummy (current) and with working
	  (experimental) fbdev_drv.so.


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-07-02 23:43:20 UTC (rev 18831)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-07-03 06:58:43 UTC (rev 18832)
@@ -1,3 +1,13 @@
+2009-06-18  Adam Endrodi  <adam.endrodi at blumsoft.eu>
+
+	* matchbox/core/mb-wm-types.h
+	* matchbox/core/mb-wm-atoms.c:
+	  Moved _MAEMO_SUPPRESS_ROOT_RECONFIGURATION so we can use to to...
+	* matchbox/core/mb-window-manager.c:
+	  ...fake a root window reconfig when we see the toggle offed.
+	  Do it so that it works both with dummy (current) and with working
+	  (experimental) fbdev_drv.so.
+
 2009-07-02  Thomas Thurman  <thomas.thurman at collabora.co.uk>
 
 	* matchbox/core/mb-wm-client-base.c: Add check that a window is

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-07-02 23:43:20 UTC (rev 18831)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-07-03 06:58:43 UTC (rev 18832)
@@ -66,6 +66,10 @@
 static void
 mb_wm_update_root_win_rectangles (MBWindowManager *wm);
 
+static  Bool
+mb_wm_handle_root_config_notify (XConfigureEvent *xev,
+			    void            *userdata);
+
 static Bool
 mb_wm_is_my_window (MBWindowManager *wm, Window xwin,
 		    MBWindowManagerClient **client);
@@ -545,7 +549,37 @@
 
 	  XFree (theme_path);
 	}
+      else if (xev->atom == wm->atoms[MBWM_ATOM_MAEMO_SUPPRESS_ROOT_RECONFIGURATION])
+        {
+          static Bool toggled;
+          static unsigned orig_width, orig_height;
 
+          /*
+           * hildon-desktop sets this property before and after calling RandR.
+           * We may or may not get ConfigureNotify about the root window.
+           * If not, we need to emulate it (so we resize the affected windows,
+           * ie. the ones supporting portrait-mode), but if we do, make sure
+           * we don't interfere.  Let us assume the toggle is initially off.
+           * If it's not hildon-desktop is borked anyway.
+           */
+          if (!toggled)
+            { /* We're before rotation. */
+              orig_width  = wm->xdpy_width;
+              orig_height = wm->xdpy_height;
+            }
+          else if (wm->xdpy_width != orig_height && wm->xdpy_height != orig_width)
+            {
+              XConfigureEvent fake;
+
+              /* We're after rotation, and the root window hasn't been
+               * reconfigured it seems. */
+              fake.width = orig_height;
+              fake.height = orig_width;
+              mb_wm_handle_root_config_notify (&fake, wm);
+            }
+          toggled = !toggled;
+        }
+
       return True;
     }
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c	2009-07-02 23:43:20 UTC (rev 18831)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-atoms.c	2009-07-03 06:58:43 UTC (rev 18832)
@@ -107,6 +107,8 @@
     "_HILDON_WM_WINDOW_TYPE_ANIMATION_ACTOR",
     "_HILDON_WM_WINDOW_TYPE",
     "_HILDON_WM_WINDOW_TYPE_LEGACY_MENU",
+
+    "_MAEMO_SUPPRESS_ROOT_RECONFIGURATION",
   };
 
   /* FIXME: Error Traps */

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h	2009-07-02 23:43:20 UTC (rev 18831)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-types.h	2009-07-03 06:58:43 UTC (rev 18832)
@@ -305,6 +305,15 @@
   MBWM_ATOM_HILDON_WM_WINDOW_TYPE,
   MBWM_ATOM_HILDON_WM_WINDOW_TYPE_LEGACY_MENU,
 
+  /*
+   * This doesn't exactly suppress root reconfigs, but almost.
+   * More importantly it enables/disables Expose event generation
+   * by the X server.  Used during rotation and serves as a kind
+   * of lock.  It work as a toggle: the property value does not
+   * actually matter, but the number of times it is changed.
+   */
+  MBWM_ATOM_MAEMO_SUPPRESS_ROOT_RECONFIGURATION,
+
   MBWM_ATOM_COUNT
 
 } MBWMAtom;

More information about the maemo-commits mailing list