Skip to content

steamcompmgr: handle EWMH maximize - #2533

Open
eerii wants to merge 1 commit into
ValveSoftware:masterfrom
eerii:net-wm-state-maximized-rebased
Open

eerii wants to merge 1 commit into
ValveSoftware:masterfrom
eerii:net-wm-state-maximized-rebased

Conversation

@eerii

@eerii eerii commented Nov 3, 2026 •

Copy link
Copy Markdown

Gamescope advertises and handles the EWMH maximize states, so clients that maximize fill the output instead of staying at their default size. GTK3 has no client-side fallback, it sends _NET_WM_STATE and waits for the compositor. This made Firefox not fill the screen properly in Game Mode.

A maximized window is resized to the output like a fullscreen one, and its pre-maximize size is restored when the state is removed. This continues the NET_WM_STATE work from #2322.

Before After
2026-11-03 01-47-57 2026-11-03 01-47-07
Maximize not working, wrong size, blurry Maximize works, size fits screen

KogasaPls added a commit to KogasaPls/gamescope that referenced this pull request Nov 3, 2026
Advertise _NET_WM_STATE_MAXIMIZED_HORZ and _VERT and track them as one
maximized state, read at map and changed through _NET_WM_STATE messages.
GTK3 has no client-side fallback: it sends the message and waits, so a
maximized Firefox kept its default size.

A maximized window fills the output like a fullscreen one. Both resize
paths share that decision, so desktop windows without an app ID, which
otherwise keep the size their hints fix, are maximized too. Unmaximized,
a desktop window returns to the size gamescope always gives it (its hint
size, or the output). A game window's unmaximized size is its own, so
its geometry is saved before the first maximize resize and restored once
neither maximize nor fullscreen applies; a window that was never
maximized has nothing to restore.

A message naming both axes changes the state once, so TOGGLE no longer
flips it twice. A message naming one axis changes the whole state, as
gamescope has no half-maximize, and the property written back names
both axes or neither.

Patch-Name: ewmh-maximize
Patch-Kind: compat
Patch-Source: ValveSoftware#2533 (eerii), reworked
Patch-Summary: Handle the EWMH maximize states, so windows that maximize
 through _NET_WM_STATE, such as GTK3 apps, fill the output and get their
 previous size back when unmaximized.
KogasaPls added a commit to KogasaPls/gamescope that referenced this pull request Nov 3, 2026
Advertise _NET_WM_STATE_MAXIMIZED_HORZ and _VERT and track them as one
maximized state, read at map and changed through _NET_WM_STATE messages.
GTK3 has no client-side fallback: it sends the message and waits, so a
maximized Firefox kept its default size.

A maximized window fills the output like a fullscreen one. Both resize
paths share that decision, so desktop windows without an app ID, which
otherwise keep the size their hints fix, are maximized too. Unmaximized,
a desktop window returns to the size gamescope always gives it (its hint
size, or the output). A game window's unmaximized size is its own, so
its geometry is saved before the first maximize resize and restored once
neither maximize nor fullscreen applies; a window that was never
maximized has nothing to restore.

A message naming both axes changes the state once, so TOGGLE no longer
flips it twice. A message naming one axis changes the whole state, as
gamescope has no half-maximize, and the property written back names
both axes or neither.

Patch-Name: ewmh-maximize
Patch-Kind: compat
Patch-Source: ValveSoftware#2533 (eerii), reworked
Patch-Summary: Handle the EWMH maximize states, so windows that maximize
 through _NET_WM_STATE, such as GTK3 apps, fill the output and get their
 previous size back when unmaximized.
KogasaPls added a commit to KogasaPls/gamescope that referenced this pull request Nov 4, 2026
Advertise _NET_WM_STATE_MAXIMIZED_HORZ and _VERT and track them as one
maximized state, read at map and changed through _NET_WM_STATE messages.
GTK3 has no client-side fallback: it sends the message and waits, so a
maximized Firefox kept its default size.

A maximized window fills the output like a fullscreen one. Both resize
paths share that decision, so desktop windows without an app ID, which
otherwise keep the size their hints fix, are maximized too. Unmaximized,
a desktop window returns to the size gamescope always gives it (its hint
size, or the output). A game window's unmaximized size is its own, so
its geometry is saved before the first maximize resize and restored once
neither maximize nor fullscreen applies; a window that was never
maximized has nothing to restore.

A message naming both axes changes the state once, so TOGGLE no longer
flips it twice. A message naming one axis changes the whole state, as
gamescope has no half-maximize, and the property written back names
both axes or neither.

Patch-Name: ewmh-maximize
Patch-Kind: compat
Patch-Source: ValveSoftware#2533 (eerii), reworked
Patch-Summary: Handle the EWMH maximize states, so windows that maximize
 through _NET_WM_STATE, such as GTK3 apps, fill the output and get their
 previous size back when unmaximized.
KogasaPls added a commit to KogasaPls/gamescope that referenced this pull request Nov 8, 2026
Advertise _NET_WM_STATE_MAXIMIZED_HORZ and _VERT and track them as one
maximized state, read at map and changed through _NET_WM_STATE messages.
GTK3 has no client-side fallback: it sends the message and waits, so a
maximized Firefox kept its default size.

A maximized window fills the output like a fullscreen one. Both resize
paths share that decision, so desktop windows without an app ID, which
otherwise keep the size their hints fix, are maximized too. Unmaximized,
a desktop window returns to the size gamescope always gives it (its hint
size, or the output). A game window's unmaximized size is its own, so
its geometry is saved before the first maximize resize and restored once
neither maximize nor fullscreen applies; a window that was never
maximized has nothing to restore.

A message naming both axes changes the state once, so TOGGLE no longer
flips it twice. A message naming one axis changes the whole state, as
gamescope has no half-maximize, and the property written back names
both axes or neither.

Patch-Name: ewmh-maximize
Patch-Kind: compat
Patch-Source: ValveSoftware#2533 (eerii), reworked
Patch-Summary: Handle the EWMH maximize states, so windows that maximize
 through _NET_WM_STATE, such as GTK3 apps, fill the output and get their
 previous size back when unmaximized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant