mirror of
				https://git.yoctoproject.org/libmatchboxwm2
				synced 2025-11-04 21:25:44 +08:00 
			
		
		
		
	[MBWMCompMgrClutter] Implement compositor stack freezing
Some effects (notably the Unmap one) need to be able to freeze the compositor stack for duration of the effect, otherwise the animated actor disappears below the top.
This commit is contained in:
		@@ -380,6 +380,10 @@ struct _MBWMCompMgrClutterPrivate
 | 
			
		||||
  ClutterActor * shadow;
 | 
			
		||||
 | 
			
		||||
  Window         overlay_window;
 | 
			
		||||
 | 
			
		||||
  int            freeze_stack;
 | 
			
		||||
 | 
			
		||||
  unsigned int   restack_pending : 1;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -743,15 +747,44 @@ mb_wm_comp_mgr_clutter_handle_damage (XDamageNotifyEvent * de,
 | 
			
		||||
  return False;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
mb_wm_comp_mgr_clutter_freeze_stack (MBWMCompMgr *mgr)
 | 
			
		||||
{
 | 
			
		||||
  MB_WM_COMP_MGR_CLUTTER (mgr)->priv->freeze_stack++;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
mb_wm_comp_mgr_clutter_unfreeze_stack (MBWMCompMgr *mgr)
 | 
			
		||||
{
 | 
			
		||||
  MBWMCompMgrClutterPrivate *priv = MB_WM_COMP_MGR_CLUTTER (mgr)->priv;
 | 
			
		||||
 | 
			
		||||
  priv->freeze_stack--;
 | 
			
		||||
 | 
			
		||||
  if (priv->freeze_stack < 0)
 | 
			
		||||
    priv->freeze_stack = 0;
 | 
			
		||||
 | 
			
		||||
  if (!priv->freeze_stack && priv->restack_pending)
 | 
			
		||||
    mb_wm_comp_mgr_clutter_restack_real ((MBWMCompMgr *)mgr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
mb_wm_comp_mgr_clutter_restack_real (MBWMCompMgr *mgr)
 | 
			
		||||
{
 | 
			
		||||
  MBWindowManager    * wm = mgr->wm;
 | 
			
		||||
  MBWMCompMgrClutter * cmgr = MB_WM_COMP_MGR_CLUTTER (mgr);
 | 
			
		||||
  MBWMList           * l;
 | 
			
		||||
  int                  i = 0;
 | 
			
		||||
  MBWindowManager           *wm = mgr->wm;
 | 
			
		||||
  MBWMCompMgrClutter        *cmgr = MB_WM_COMP_MGR_CLUTTER (mgr);
 | 
			
		||||
  MBWMCompMgrClutterPrivate *priv = cmgr->priv;
 | 
			
		||||
  MBWMList                  *l;
 | 
			
		||||
  int                        i = 0;
 | 
			
		||||
 | 
			
		||||
  l = cmgr->priv->desktops;
 | 
			
		||||
  if (priv->freeze_stack)
 | 
			
		||||
    {
 | 
			
		||||
      priv->restack_pending = 1;
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  priv->restack_pending = 0;
 | 
			
		||||
 | 
			
		||||
  l = priv->desktops;
 | 
			
		||||
 | 
			
		||||
  if (!mb_wm_stack_empty (wm))
 | 
			
		||||
    {
 | 
			
		||||
@@ -1093,9 +1126,12 @@ static void
 | 
			
		||||
mb_wm_comp_mgr_clutter_client_event_completed_hide_cb (ClutterAnimation *anim,
 | 
			
		||||
                                                  MBWMCompMgrClutterClient *client)
 | 
			
		||||
{
 | 
			
		||||
  MBWMCompMgrClient *c = MB_WM_COMP_MGR_CLIENT (client);
 | 
			
		||||
 | 
			
		||||
  client->priv->flags &= ~MBWMCompMgrClutterClientEffectRunning;
 | 
			
		||||
  clutter_actor_hide (client->priv->actor);
 | 
			
		||||
  clutter_actor_set_scale (client->priv->actor, 1.0, 1.0);
 | 
			
		||||
  mb_wm_comp_mgr_clutter_unfreeze_stack (c->wm->comp_mgr);
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * Release the extra reference on the CM client that was added for the sake
 | 
			
		||||
@@ -1133,6 +1169,8 @@ mb_wm_comp_mgr_clutter_client_event_real (MBWMCompMgr            * mgr,
 | 
			
		||||
  switch (event)
 | 
			
		||||
    {
 | 
			
		||||
    case MBWMCompMgrClientEventMinimize:
 | 
			
		||||
      mb_wm_comp_mgr_clutter_freeze_stack (mgr);
 | 
			
		||||
 | 
			
		||||
      mb_wm_object_ref (MB_WM_OBJECT (cclient));
 | 
			
		||||
      cclient->priv->flags |= MBWMCompMgrClutterClientEffectRunning;
 | 
			
		||||
 | 
			
		||||
@@ -1147,6 +1185,8 @@ mb_wm_comp_mgr_clutter_client_event_real (MBWMCompMgr            * mgr,
 | 
			
		||||
                              cclient);
 | 
			
		||||
      break;
 | 
			
		||||
    case MBWMCompMgrClientEventUnmap:
 | 
			
		||||
      mb_wm_comp_mgr_clutter_freeze_stack (mgr);
 | 
			
		||||
 | 
			
		||||
      mb_wm_object_ref (MB_WM_OBJECT (cclient));
 | 
			
		||||
      cclient->priv->flags |= MBWMCompMgrClutterClientEffectRunning;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user