aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog34
-rw-r--r--configure.ac2
-rw-r--r--matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c50
-rw-r--r--matchbox/comp-mgr/mb-wm-comp-mgr-default.c14
-rw-r--r--matchbox/comp-mgr/mb-wm-comp-mgr.c46
-rw-r--r--matchbox/comp-mgr/mb-wm-comp-mgr.h4
-rw-r--r--matchbox/core/mb-window-manager.c36
7 files changed, 109 insertions, 77 deletions
diff --git a/ChangeLog b/ChangeLog
index cd3948f..faf81f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,39 @@
2008-02-27 Tomas Frydrych <tf@o-hand.com>
+ * configure.ac:
+ Fixed incorrect string quoting.
+
+ * matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:
+ * matchbox/comp-mgr/mb-wm-comp-mgr-default.c:
+ * matchbox/comp-mgr/mb-wm-comp-mgr.c:
+ (mb_wm_comp_mgr_unregister_client):
+ Moved shared code into the public function, and removed
+ unnecessary implementations from the default and clutter managers.
+ Removed call to mb_wm_comp_mgr_client_hide() as this interfers
+ with managers implementing an unmap effect.
+
+ * matchbox/comp-mgr/mb-wm-comp-mgr.h:
+ Added MBWMCompMgr::unmap_notify virtual.
+
+ * matchbox/comp-mgr/mb-wm-comp-mgr.c:
+ (mb_wm_comp_mgr_map_notify):
+ (mb_wm_comp_mgr_unmap_notify):
+ Moved the effects handling for map and umap events out of
+ MBWindowManager into the CM.
+
+ (mb_wm_comp_mgr_client_run_effect):
+ Take a temporary reference of the CM client object to enusure that
+ it is not destroyed while an effect is running.
+
+ * matchbox/core/mb-window-manager.c:
+ (mb_wm_handle_unmap_notify):
+ Removed handling of CM unmap effect.
+
+ (mb_wm_unmanage_client):
+ Extra comments.
+
+2008-02-27 Tomas Frydrych <tf@o-hand.com>
+
* matchbox/core/mb-wm-debug.c:
* matchbox/core/mb-wm-debug.h:
Added DAMAGE debug domain.
diff --git a/configure.ac b/configure.ac
index 41b06ad..cecd632 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,7 +90,7 @@ case $comp_mgr in
framework-only ) comp_mgr="yes (framework only)" ;;
- * ) comp_mgr = no ;;
+ * ) comp_mgr ="no" ;;
esac
if test "x$want_debug" = "xyes"; then
diff --git a/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c b/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
index 3ea3402..3a5f535 100644
--- a/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
+++ b/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
@@ -523,17 +523,6 @@ mb_wm_comp_mgr_clutter_register_client_real (MBWMCompMgr * mgr,
}
static void
-mb_wm_comp_mgr_clutter_unregister_client_real (MBWMCompMgr * mgr,
- MBWindowManagerClient * client)
-{
- if (!client || !client->cm_client)
- return;
-
- mb_wm_object_unref (MB_WM_OBJECT (client->cm_client));
- client->cm_client = NULL;
-}
-
-static void
mb_wm_comp_mgr_clutter_turn_on_real (MBWMCompMgr *mgr);
static void
@@ -562,7 +551,6 @@ mb_wm_comp_mgr_clutter_class_init (MBWMObjectClass *klass)
#endif
cm_klass->register_client = mb_wm_comp_mgr_clutter_register_client_real;
- cm_klass->unregister_client = mb_wm_comp_mgr_clutter_unregister_client_real;
cm_klass->turn_on = mb_wm_comp_mgr_clutter_turn_on_real;
cm_klass->turn_off = mb_wm_comp_mgr_clutter_turn_off_real;
cm_klass->render = mb_wm_comp_mgr_clutter_render_real;
@@ -681,7 +669,7 @@ mb_wm_comp_mgr_clutter_turn_off_real (MBWMCompMgr *mgr)
mb_wm_stack_enumerate (wm, c)
{
- mb_wm_comp_mgr_clutter_unregister_client_real (mgr, c);
+ mb_wm_comp_mgr_unregister_client (mgr, c);
}
}
@@ -951,14 +939,6 @@ mb_wm_comp_mgr_clutter_map_notify_real (MBWMCompMgr *mgr,
clutter_actor_set_position (actor, geom.x, geom.y);
mb_wm_comp_mgr_clutter_add_actor (cmgr, actor);
-
- /*
- * Run map event effect *before* we call show() on the actor
- * (the effect will take care of showing the actor, and if not, show() gets
- * called by mb_wm_comp_mgr_map_notify()).
- */
- mb_wm_comp_mgr_client_run_effect (c->cm_client,
- MBWMCompMgrEffectEventMap, NULL, NULL);
}
/*
@@ -1026,6 +1006,7 @@ struct completed_cb_data
MBWMCompMgrEffectCallback completed_cb;
void * cb_data;
gulong my_id;
+ MBWMCompMgrClient * cclient;
};
@@ -1045,6 +1026,12 @@ mb_wm_comp_mgr_clutter_effect_completed_cb (ClutterTimeline * t, void * data)
g_signal_handler_disconnect (t, d->my_id);
+ /*
+ * Release the extra reference on the CM client that was added for the sake
+ * of the effect
+ */
+ mb_wm_object_unref (MB_WM_OBJECT (d->cclient));
+
free (d);
}
@@ -1075,20 +1062,19 @@ mb_wm_comp_mgr_clutter_effect_run_real (MBWMList * effects,
{
GSList * actors;
ClutterActor *a;
- Bool dont_run = False;
+ Bool dont_run = False;
- if (completed_cb)
- {
- struct completed_cb_data * d =
- mb_wm_util_malloc0 (sizeof (struct completed_cb_data));
+ struct completed_cb_data * d;
- d->completed_cb = completed_cb;
- d->cb_data = data;
+ d = mb_wm_util_malloc0 (sizeof (struct completed_cb_data));
- d->my_id = g_signal_connect (ceff->timeline, "completed",
+ d->completed_cb = completed_cb;
+ d->cb_data = data;
+ d->cclient = cm_client;
+
+ d->my_id = g_signal_connect (ceff->timeline, "completed",
G_CALLBACK (mb_wm_comp_mgr_clutter_effect_completed_cb),
d);
- }
/*
* This is bit of a pain; we know that our actor is attached to
@@ -1110,7 +1096,7 @@ mb_wm_comp_mgr_clutter_effect_run_real (MBWMList * effects,
clutter_actor_move_anchor_point_from_gravity (a, eff->gravity);
}
else if (CLUTTER_IS_BEHAVIOUR_PATH (ceff->behaviour) &&
- !CLUTTER_ACTOR_IS_VISIBLE (ceff->behaviour))
+ !CLUTTER_ACTOR_IS_VISIBLE (a))
{
/*
* At this stage, if the actor is not yet visible, move it to
@@ -1123,6 +1109,7 @@ mb_wm_comp_mgr_clutter_effect_run_real (MBWMList * effects,
* the first knot of the path to avoid messing about with copies
* of the list.
*/
+
GSList * knots =
clutter_behaviour_path_get_knots (
CLUTTER_BEHAVIOUR_PATH (ceff->behaviour));
@@ -1130,6 +1117,7 @@ mb_wm_comp_mgr_clutter_effect_run_real (MBWMList * effects,
if (knots)
{
ClutterKnot * k = knots->data;
+
clutter_actor_set_position (a, k->x, k->y);
g_slist_free (knots);
diff --git a/matchbox/comp-mgr/mb-wm-comp-mgr-default.c b/matchbox/comp-mgr/mb-wm-comp-mgr-default.c
index 067567d..a52961b 100644
--- a/matchbox/comp-mgr/mb-wm-comp-mgr-default.c
+++ b/matchbox/comp-mgr/mb-wm-comp-mgr-default.c
@@ -375,19 +375,6 @@ mb_wm_comp_mgr_default_register_client_real (MBWMCompMgr * mgr,
}
static void
-mb_wm_comp_mgr_default_unregister_client_real (MBWMCompMgr * mgr,
- MBWindowManagerClient * client)
-{
- MBWMCompMgrDefaultPrivate * priv = MB_WM_COMP_MGR_DEFAULT (mgr)->priv;
-
- if (!client || !client->cm_client)
- return;
-
- mb_wm_object_unref (MB_WM_OBJECT (client->cm_client));
- client->cm_client = NULL;
-}
-
-static void
mb_wm_comp_mgr_default_turn_on_real (MBWMCompMgr *mgr);
static void
@@ -409,7 +396,6 @@ mb_wm_comp_mgr_default_class_init (MBWMObjectClass *klass)
#endif
cm_klass->register_client = mb_wm_comp_mgr_default_register_client_real;
- cm_klass->unregister_client = mb_wm_comp_mgr_default_unregister_client_real;
cm_klass->turn_on = mb_wm_comp_mgr_default_turn_on_real;
cm_klass->turn_off = mb_wm_comp_mgr_default_turn_off_real;
cm_klass->render = mb_wm_comp_mgr_default_render_real;
diff --git a/matchbox/comp-mgr/mb-wm-comp-mgr.c b/matchbox/comp-mgr/mb-wm-comp-mgr.c
index 512c216..cf8e177 100644
--- a/matchbox/comp-mgr/mb-wm-comp-mgr.c
+++ b/matchbox/comp-mgr/mb-wm-comp-mgr.c
@@ -216,6 +216,13 @@ mb_wm_comp_mgr_client_run_effect (MBWMCompMgrClient * client,
if (!client)
return;
+ /*
+ * Take a reference to the CM client object, so that it does not disappear
+ * underneath us while the effect is running; it is the responsibility
+ * of the subclassed run() to release this reference when it is done.
+ */
+ mb_wm_object_ref (MB_WM_OBJECT (client));
+
while (l)
{
MBWMCompMgrEffectAssociation * a = l->data;
@@ -353,12 +360,10 @@ mb_wm_comp_mgr_unregister_client (MBWMCompMgr * mgr,
MBWMCompMgrClass *klass
= MB_WM_COMP_MGR_CLASS (MB_WM_OBJECT_GET_CLASS (mgr));
- MBWM_ASSERT (klass->unregister_client != NULL);
-
- mb_wm_comp_mgr_client_hide (client->cm_client);
-
- klass->unregister_client (mgr, client);
+ if (klass->unregister_client)
+ klass->unregister_client (mgr, client);
+ mb_wm_object_unref (MB_WM_OBJECT (client->cm_client));
client->cm_client = NULL;
}
@@ -395,11 +400,42 @@ mb_wm_comp_mgr_map_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c)
if (klass->map_notify)
klass->map_notify (mgr, c);
+ /*
+ * Run map event effect *before* we call show() on the actor
+ * (the effect will take care of showing the actor, and if not, show() gets
+ * called by mb_wm_comp_mgr_map_notify()).
+ */
+ mb_wm_comp_mgr_client_run_effect (c->cm_client,
+ MBWMCompMgrEffectEventMap, NULL, NULL);
+
if (c->cm_client)
mb_wm_comp_mgr_client_show (c->cm_client);
}
void
+mb_wm_comp_mgr_unmap_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c)
+{
+ MBWMCompMgrClass *klass;
+
+ if (!mgr || !c || !c->cm_client)
+ return;
+
+ klass = MB_WM_COMP_MGR_CLASS (MB_WM_OBJECT_GET_CLASS (mgr));
+
+ mb_wm_comp_mgr_client_run_effect (c->cm_client,
+ MBWMCompMgrEffectEventUnmap, NULL, NULL);
+
+ if (klass->unmap_notify)
+ klass->unmap_notify (mgr, c);
+
+ /*
+ * NB: cannot call hide() here, as at this point an effect could be running
+ * -- the subclass needs to take care of this from the effect and/or
+ * unmap_notify() function.
+ */
+}
+
+void
mb_wm_comp_mgr_turn_on (MBWMCompMgr *mgr)
{
MBWMCompMgrClass *klass
diff --git a/matchbox/comp-mgr/mb-wm-comp-mgr.h b/matchbox/comp-mgr/mb-wm-comp-mgr.h
index fb79984..43f7061 100644
--- a/matchbox/comp-mgr/mb-wm-comp-mgr.h
+++ b/matchbox/comp-mgr/mb-wm-comp-mgr.h
@@ -53,6 +53,7 @@ struct MBWMCompMgrClass
void (*turn_off) (MBWMCompMgr * mgr);
void (*render) (MBWMCompMgr * mgr);
void (*map_notify) (MBWMCompMgr * mgr, MBWindowManagerClient *c);
+ void (*unmap_notify) (MBWMCompMgr * mgr, MBWindowManagerClient *c);
Bool (*handle_events) (MBWMCompMgr * mgr, XEvent *ev);
Bool (*my_window) (MBWMCompMgr * mgr, Window xwin);
};
@@ -79,6 +80,9 @@ mb_wm_comp_mgr_render (MBWMCompMgr *mgr);
void
mb_wm_comp_mgr_map_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c);
+void
+mb_wm_comp_mgr_unmap_notify (MBWMCompMgr *mgr, MBWindowManagerClient *c);
+
Bool
mb_wm_comp_mgr_enabled (MBWMCompMgr *mgr);
diff --git a/matchbox/core/mb-window-manager.c b/matchbox/core/mb-window-manager.c
index 731b94d..22ebf1c 100644
--- a/matchbox/core/mb-window-manager.c
+++ b/matchbox/core/mb-window-manager.c
@@ -418,16 +418,6 @@ test_destroy_notify (XDestroyWindowEvent *xev,
return True;
}
-#if ENABLE_COMPOSITE
-static void
-mb_wm_unmap_effect_completed (void *data)
-{
- MBWindowManagerClient *client = data;
-
- mb_wm_unmanage_client (client->wmref, client, True);
-}
-#endif
-
static Bool
mb_wm_handle_unmap_notify (XUnmapEvent *xev,
void *userdata)
@@ -470,23 +460,11 @@ mb_wm_handle_unmap_notify (XUnmapEvent *xev,
MBWMClientWindowEWMHStateHidden))
{
#if ENABLE_COMPOSITE
- /*
- * Run unmap effect and do the actual un-managing from the
- * completion call back.
- */
if (mb_wm_compositing_enabled (wm))
- {
- mb_wm_comp_mgr_client_run_effect (client->cm_client,
- MBWMCompMgrEffectEventUnmap,
- mb_wm_unmap_effect_completed,
- client);
- }
- else
+ mb_wm_comp_mgr_unmap_notify (wm->comp_mgr, client);
#endif
- {
- MBWM_DBG ("removing client %p\n", client);
- mb_wm_unmanage_client (wm, client, True);
- }
+ MBWM_DBG ("removing client %p\n", client);
+ mb_wm_unmanage_client (wm, client, True);
}
}
}
@@ -1100,8 +1078,14 @@ mb_wm_unmanage_client (MBWindowManager *wm,
#if ENABLE_COMPOSITE
if (mb_wm_comp_mgr_enabled (wm->comp_mgr))
{
+ /*
+ * If destroy == False, this unmap was triggered by iconizing the
+ * client; in that case, we do not destory the CM client data, only
+ * make sure the client is hidden (note that any 'minimize' effect
+ * has already completed by the time we get here).
+ */
if (destroy)
- mb_wm_comp_mgr_unregister_client (wm->comp_mgr, client);
+ mb_wm_comp_mgr_unregister_client (wm->comp_mgr, client);
else
mb_wm_comp_mgr_client_hide (client->cm_client);
}