After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772525 - mutter ignores the wl_output parameter to set_fullscreen in both wl_shell and zxdg_shell_v6 protocols
mutter ignores the wl_output parameter to set_fullscreen in both wl_shell and...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-10-06 19:35 UTC by Philipp Zabel
Modified: 2017-02-21 19:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland-xdg-shell: Handle the wl_output on the set_fullscreen request (1.32 KB, patch)
2016-11-02 17:01 UTC, Rui Matos
none Details | Review
wayland-xdg-shell: Handle the wl_output on the set_fullscreen request (1.32 KB, patch)
2016-11-02 17:38 UTC, Rui Matos
committed Details | Review
window: Make move_to_monitor work for zero sized and offscreen windows (3.40 KB, patch)
2016-11-15 14:22 UTC, Rui Matos
committed Details | Review
constraints: Make zero sized windows be placed in the correct monitor (1.57 KB, patch)
2016-11-15 14:24 UTC, Rui Matos
committed Details | Review

Description Philipp Zabel 2016-10-06 19:35:12 UTC
Both wl_shell_surface_set_fullscreen (wl_shell) and xdg_toplevel_set_fullscreen (zxdg_shell_v6) ignore their struct wl_resource *output_resource parameter, and with it any clients' requests to be fullscreened on a certain output.
Comment 1 Rui Matos 2016-11-02 17:01:50 UTC
Created attachment 338968 [details] [review]
wayland-xdg-shell: Handle the wl_output on the set_fullscreen request

This makes us fullscreen wayland windows on the requested monitor.
Comment 2 Rui Matos 2016-11-02 17:38:00 UTC
Created attachment 338977 [details] [review]
wayland-xdg-shell: Handle the wl_output on the set_fullscreen request

--

I just noticed in the protocol that the wl_output may be NULL so
updated the patch accordingly.
Comment 3 Rui Matos 2016-11-15 14:22:46 UTC
Created attachment 339940 [details] [review]
window: Make move_to_monitor work for zero sized and offscreen windows

Wayland windows are initially zero sized until clients commit the
first buffer. Despite being invisible, clients are allowed to request
such windows to be fullscreened on a specific output before they
attach the first buffer which means we need to be able to move them.

meta_window_move_to_monitor() doesn't handle this case because these
windows' initial monitor is a placeholder since their initial
coordinates are 0,0+0+0, which results in us using a rectangle as
old_area for meta_window_move_between_rects() that might be to the "right"
of the window causing the move to go further out of the visible
screen's coordinates. This is later "corrected" by the constraints
system but the window might end up in the wrong monitor.

To fix this, we can make meta_window_move_between_rects() accept a
NULL old_area, meaning that we move the window to the new_area without
trying to keep a relative position.
--

The previous patch isn't enough with some output geometries. This and
the next patch should fix it.
Comment 4 Rui Matos 2016-11-15 14:24:34 UTC
Created attachment 339941 [details] [review]
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.
--

Alternatively we could fix the boxes.c code to handle zero sized
rectangles better, but I'm not sure we could determine what "better"
means generically at that level.
Comment 5 Jonas Ådahl 2017-02-20 02:09:19 UTC
Review of attachment 338977 [details] [review]:

Looks good to me.
Comment 6 Jonas Ådahl 2017-02-20 02:09:29 UTC
Review of attachment 339940 [details] [review]:

Looks good to me.
Comment 7 Jonas Ådahl 2017-02-20 02:09:35 UTC
Review of attachment 339941 [details] [review]:

Looks good to me.
Comment 8 Rui Matos 2017-02-21 19:02:30 UTC
Attachment 338977 [details] pushed as 1fe10f0 - wayland-xdg-shell: Handle the wl_output on the set_fullscreen request
Attachment 339940 [details] pushed as bb2e8ff - window: Make move_to_monitor work for zero sized and offscreen windows
Attachment 339941 [details] pushed as 8f5a0ec - constraints: Make zero sized windows be placed in the correct monitor