Bug 461063 - xdg_toplevel.set_fullscreen does not center surface and doesn't add black background/padding/bars
Summary: xdg_toplevel.set_fullscreen does not center surface and doesn't add black bac...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.26.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 452731 489546 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-27 11:14 UTC by Robert Mader
Modified: 2024-07-01 12:57 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Mader 2022-10-27 11:14:11 UTC
SUMMARY

From the xdg-shell spec:
```
If the surface doesn't cover the whole output, the compositor will
position the surface in the center of the output and compensate with
with border fill covering the rest of the output. The content of the
border fill is undefined, but should be assumed to be in some way that
attempts to blend into the surrounding area (e.g. solid black).

If the fullscreened surface is not opaque, the compositor must make
sure that other screen content not part of the same surface tree (made
up of subsurfaces, popups or similarly coupled surfaces) are not
visible below the fullscreened surface.
```

STEPS TO REPRODUCE
1. run `weston-simple-egl -f -r` (requires very recent weston version, not released yet)

OBSERVED RESULT
The client surface is not centered, content behind it is visible.

EXPECTED RESULT
The client surface is not centered, content behind it is covered.

ADDITIONAL INFORMATION
This is currently not widely used by clients, however Wine-Wayland, once merged and enabled, will rely on it. Similar bugs are or where present in Mutter and Exo.
Comment 1 Frank Praznik 2022-11-26 18:18:51 UTC
For the record, SDL could use this as well, as currently the Wayland mode-switching emulation stretches everything to the display dimensions, which distorts things (especially on ultrawide displays).  Attempts to implement aspect-correct scaling with subsurfaces were made, but were dropped as they proved too buggy to be usable across all desktops.  Now that almost all compositors center and mask around fullscreen windows, this can be revisited, but KWin missing support means that it either couldn't be enabled by default, or KDE would need to be detected and fall back to stretching the image instead of using the correct aspect ratio.
Comment 2 Vlad Zahorodnii 2024-06-12 09:14:28 UTC
*** Bug 452731 has been marked as a duplicate of this bug. ***
Comment 3 Vlad Zahorodnii 2024-07-01 12:57:43 UTC
*** Bug 489546 has been marked as a duplicate of this bug. ***