mirror of
https://github.com/brl/mutter.git
synced 2025-02-08 17:44:09 +00:00
MetaStackTracker: Avoid queueing resync for obvious no-ops
Since we can't distinguish a ConfigureEvent that indicates a raise from a ConfigureEvent that indicates a move, we get lots of STACK_OP_RAISE_ABOVE events for windows that are already in the right place in the stacking order. Avoid queueing a restack in that case. https://bugzilla.gnome.org/show_bug.cgi?id=634771
This commit is contained in:
parent
8b24711bba
commit
f372fa29b2
@ -54,8 +54,8 @@
|
|||||||
*
|
*
|
||||||
* When we receive a new event: a) we compare the serial in the event to
|
* When we receive a new event: a) we compare the serial in the event to
|
||||||
* the serial of the queued requests and remove any that are now
|
* the serial of the queued requests and remove any that are now
|
||||||
* no longer pending b) drop the predicted stacking order to recompute
|
* no longer pending b) if necessary, drop the predicted stacking
|
||||||
* it at the next opportunity.
|
* order to recompute it at the next opportunity.
|
||||||
*
|
*
|
||||||
* Possible optimizations:
|
* Possible optimizations:
|
||||||
* Keep the stacks as an array + reverse-mapping hash table to avoid
|
* Keep the stacks as an array + reverse-mapping hash table to avoid
|
||||||
@ -505,6 +505,8 @@ static void
|
|||||||
stack_tracker_event_received (MetaStackTracker *tracker,
|
stack_tracker_event_received (MetaStackTracker *tracker,
|
||||||
MetaStackOp *op)
|
MetaStackOp *op)
|
||||||
{
|
{
|
||||||
|
gboolean need_sync = FALSE;
|
||||||
|
|
||||||
meta_stack_op_dump (op, "Stack op event received: ", "\n");
|
meta_stack_op_dump (op, "Stack op event received: ", "\n");
|
||||||
|
|
||||||
if (op->any.serial < tracker->server_serial)
|
if (op->any.serial < tracker->server_serial)
|
||||||
@ -512,7 +514,8 @@ stack_tracker_event_received (MetaStackTracker *tracker,
|
|||||||
|
|
||||||
tracker->server_serial = op->any.serial;
|
tracker->server_serial = op->any.serial;
|
||||||
|
|
||||||
meta_stack_op_apply (op, tracker->server_stack);
|
if (meta_stack_op_apply (op, tracker->server_stack))
|
||||||
|
need_sync = TRUE;
|
||||||
|
|
||||||
while (tracker->queued_requests->head)
|
while (tracker->queued_requests->head)
|
||||||
{
|
{
|
||||||
@ -522,17 +525,21 @@ stack_tracker_event_received (MetaStackTracker *tracker,
|
|||||||
|
|
||||||
g_queue_pop_head (tracker->queued_requests);
|
g_queue_pop_head (tracker->queued_requests);
|
||||||
meta_stack_op_free (queued_op);
|
meta_stack_op_free (queued_op);
|
||||||
|
need_sync = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tracker->predicted_stack)
|
if (need_sync)
|
||||||
{
|
{
|
||||||
g_array_free (tracker->predicted_stack, TRUE);
|
if (tracker->predicted_stack)
|
||||||
tracker->predicted_stack = NULL;
|
{
|
||||||
|
g_array_free (tracker->predicted_stack, TRUE);
|
||||||
|
tracker->predicted_stack = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
meta_stack_tracker_queue_sync_stack (tracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_stack_tracker_dump (tracker);
|
meta_stack_tracker_dump (tracker);
|
||||||
|
|
||||||
meta_stack_tracker_queue_sync_stack (tracker);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user