qubes-issues icon indicating copy to clipboard operation
qubes-issues copied to clipboard

Support for maximizing windows in GUI protocol

Open DemiMarie opened this issue 1 year ago • 2 comments

How to file a helpful issue

The problem you're addressing (if any)

The Qubes OS GUI protocol does not support maximizing windows. This causes problems for the Wayland agent I am working on, which needs to tell clients that a window has been maximized so that they know to use the window size they have been told. It also prevents applications from requesting that they be maximized. This is not a security feature, because applications can already request that they be made fullscreen, which will be treated as a maximize request by default.

The solution you'd like

Support window maximizing. This is a very simple change in the GUI protocol.

The value to a user, and who that user might be

Applications will know they are maximized. Users of applications that rely on this will not have compatibility problems.

Completion criteria checklist

(This section is for developer use only. Please do not modify it.)

  • [ ] Implement WINDOW_FLAGS_MAXIMIZED in GUI daemon.
  • [ ] Implement WINDOW_FLAGS_MAXIMIZED in GUI agent.
  • [ ] (Optional) Backport to R4.2.

DemiMarie avatar Oct 06 '24 00:10 DemiMarie

needs to tell clients that a window has been maximized so that they know to use the window size they have been told

How is maximized window any special here? What if user intentionally resize it to half of the screen for example, shouldn't application listen to that too? And also, I'm pretty sure applications not honoring user (or window manager/compositor) requested sizes will wreak havoc on tiling layouts...

marmarek avatar Oct 06 '24 00:10 marmarek

needs to tell clients that a window has been maximized so that they know to use the window size they have been told

How is maximized window any special here? What if user intentionally resize it to half of the screen for example, shouldn't application listen to that too? And also, I'm pretty sure applications not honoring user (or window manager/compositor) requested sizes will wreak havoc on tiling layouts...

Some applications (like terminal emulators and image viewers) cannot really support arbitrary sizes. For terminal emulators, the constraint is that the window must be an integer number of rows and columns. For image viewers, the constraint is that the aspect ratio of the image must be preserved.

X11 clients use EWMH to inform the compositor of these constraints, but Wayland has no similar mechanism. Instead, Wayland compositors are expected to normally use client-provided sizes. However, there are various exceptions:

  • If the window is resized, the compositor-provided size is a maximum. The client is allowed to use a smaller value but not a larger one.
  • If the window is maximized, the compositor-provided size must be used. If the client does not use it, the client is disconnected.
  • If the window is fullscreen, the client must use the compositor-provided size or there will be gaps around it.
  • If the window is tiled, the client is probably expected to use the compositor-provided size. If it doesn’t, the compositor will use a fallback behavior, such as clipping the surface or drawing a black border.

DemiMarie avatar Oct 06 '24 01:10 DemiMarie