xdg-shell: Allow fullscreen surfaces to not cover the whole screen
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Wed, 13 May 2020 13:33:03 +0000 (16:33 +0300)
committerDaniel Stone <daniels@collabora.com>
Mon, 25 May 2020 10:11:09 +0000 (10:11 +0000)
commitf6bd2129245b6c949dfeb50c722834050876f529
tree0d8b925bf6619e47780b8847da76a90a182d1f68
parenta2086bba6602408efda3b65ce3930111f049adcb
xdg-shell: Allow fullscreen surfaces to not cover the whole screen

The wording of the xdg-shell protocol allows surfaces to not cover the
whole screen when they are made fullscreen. From the description of the
fullscreen state in xdg-shell:

  The window geometry specified in the configure event is a maximum; the
  client cannot resize beyond it. For a surface to cover the whole
  fullscreened area, the geometry dimensions must be obeyed by the
  client.

The last sentence is the condition for fullscreen coverage, not a
requirement.

This commit updates the code to not flag size mismatches for fullscreen
surfaces as a protocol error when the surface fits within the screen. In
such cases, the shell is responsible for centering surfaces
appropriately and also for obscuring other screen content as described
in the xdg_toplevel.set_fullscreen request description (and, indeed,
desktop-shell does all this).

For reference, contrast with the corresponding, stricter wording in the
obsolete xdg-shell-unstable-v6 protocol for the fullscreen state:

  The window geometry specified in the configure event must be obeyed by
  the client.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
libweston-desktop/xdg-shell.c