mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
constraints: Make zero sized windows be placed in the correct monitor
Wayland windows can be zero sized until clients attach a buffer, but our rectangle code doesn't deal with this case well, in particular, meta_screen_get_monitor_for_rect() might end up choosing the wrong monitor for a zero sized rectangle since meta_rectangle_contains_rect() considers a zero sized rectangle at the right or bottom edges of another rectangle (the monitor's) to be contained there. Since out size limits constraint will enforce a minimum size of 1x1, we might as well enforce that when setting up the constraint info so that the correct monitor gets chosen and the single monitor constraint doesn't move these windows to the wrong one. https://bugzilla.gnome.org/show_bug.cgi?id=772525
This commit is contained in:
parent
bb2e8ff09a
commit
8f5a0ec83d
@ -340,6 +340,11 @@ setup_constraint_info (ConstraintInfo *info,
|
||||
info->orig = *orig;
|
||||
info->current = *new;
|
||||
|
||||
if (info->current.width < 1)
|
||||
info->current.width = 1;
|
||||
if (info->current.height < 1)
|
||||
info->current.height = 1;
|
||||
|
||||
if (flags & META_MOVE_RESIZE_MOVE_ACTION && flags & META_MOVE_RESIZE_RESIZE_ACTION)
|
||||
info->action_type = ACTION_MOVE_AND_RESIZE;
|
||||
else if (flags & META_MOVE_RESIZE_RESIZE_ACTION)
|
||||
|
Loading…
Reference in New Issue
Block a user