[maemo-commits] [maemo-commits] r18764 - projects/haf/trunk/libmatchbox2/matchbox/core
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Sun Jun 21 19:39:33 EEST 2009
- Previous message: [maemo-commits] r18763 - in projects/haf/trunk/sapwood: . engine
- Next message: [maemo-commits] r18765 - projects/haf/trunk/libmatchbox2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: tthurman Date: 2009-06-21 19:39:26 +0300 (Sun, 21 Jun 2009) New Revision: 18764 Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.c projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.h Log: 2009-06-21 Thomas Thurman <thomas.thurman at collabora.co.uk> * matchbox/core/mb-wm-client.c: anything descended from a dialogue can be system-modal. * matchbox/core/mb-wm-object.[ch]: new method mb_wm_object_is_descendant(). Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c =================================================================== --- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c 2009-06-19 11:46:17 UTC (rev 18763) +++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c 2009-06-21 16:39:26 UTC (rev 18764) @@ -21,6 +21,7 @@ #include "mb-wm.h" #include "mb-wm-theme.h" #include "mb-wm-comp-mgr.h" +#include "mb-wm-client-dialog.h" #include <unistd.h> #include <signal.h> @@ -730,7 +731,8 @@ if (!client) return FALSE; - if (MB_WM_CLIENT_CLIENT_TYPE (client)!=MBWMClientTypeDialog) + if (!mb_wm_object_is_descendant ((MBWMObject*)client, + MB_WM_TYPE_CLIENT_DIALOG)) return FALSE; return Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.c =================================================================== --- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.c 2009-06-19 11:46:17 UTC (rev 18763) +++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.c 2009-06-21 16:39:26 UTC (rev 18764) @@ -411,6 +411,26 @@ } } +gboolean +mb_wm_object_is_descendant (MBWMObject *obj, int type) +{ + const MBWMObjectClass *considering = MB_WM_OBJECT_GET_CLASS (obj); + + while (1) + { + if (considering->type == type) { + return TRUE; + } + + if (considering->parent) { + considering = considering->parent; + } else { + /* ran out of options */ + return FALSE; + } + } +} + #if 0 /* ----- Test code -------- */ Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.h =================================================================== --- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.h 2009-06-19 11:46:17 UTC (rev 18763) +++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-object.h 2009-06-21 16:39:26 UTC (rev 18764) @@ -135,6 +135,9 @@ void mb_wm_object_signal_emit (MBWMObject *obj, unsigned long signal); +gboolean +mb_wm_object_is_descendant (MBWMObject *obj, int type); + #if MBWM_WANT_DEBUG void mb_wm_object_dump ();
- Previous message: [maemo-commits] r18763 - in projects/haf/trunk/sapwood: . engine
- Next message: [maemo-commits] r18765 - projects/haf/trunk/libmatchbox2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]