mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
window: Don't queue move/resizes if the extents are the same
GTK+ sets the frame extents on every allocation, so don't bother doing any extra work if things are the same.
This commit is contained in:
parent
0cde7879d6
commit
d87093fe29
@ -338,17 +338,33 @@ reload_icon_geometry (MetaWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_border_equal (GtkBorder *a,
|
||||
GtkBorder *b)
|
||||
{
|
||||
return (a->left == b->left &&
|
||||
a->right == b->right &&
|
||||
a->top == b->top &&
|
||||
a->bottom == b->bottom);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_set_custom_frame_extents (MetaWindow *window,
|
||||
GtkBorder *extents)
|
||||
{
|
||||
if (extents)
|
||||
{
|
||||
if (window->has_custom_frame_extents && gtk_border_equal (&window->custom_frame_extents, extents))
|
||||
return;
|
||||
|
||||
window->has_custom_frame_extents = TRUE;
|
||||
window->custom_frame_extents = *extents;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!window->has_custom_frame_extents)
|
||||
return;
|
||||
|
||||
window->has_custom_frame_extents = FALSE;
|
||||
memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
|
||||
}
|
||||
@ -382,9 +398,6 @@ reload_gtk_frame_extents (MetaWindow *window,
|
||||
{
|
||||
meta_window_set_custom_frame_extents (window, NULL);
|
||||
}
|
||||
|
||||
if (!initial)
|
||||
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user