Skip to content

X11: App.Maximize() / App.IsMaximized() are no-ops #498

Description

@unxed

Hi! A follow-up to #397 (thanks for RequestSize!).

On X11, App.Maximize() does nothing and App.IsMaximized() always returns false. Both are // TODO stubs in internal/platform/x11/platform.go (lines 2394 and 2398 at 12620c9, same in v0.54.0). Windows, macOS and Wayland implement them.

Use case: in f4 (a Go file manager), Alt+F9 maximizes or restores the window, as in far2l. We now call App.Maximize() on every platform, so on X11 the key currently does nothing: unxed/f4#199

Expected:

  • IsMaximized() reports whether the window manager lists both _NET_WM_STATE_MAXIMIZED_VERT and _NET_WM_STATE_MAXIMIZED_HORZ in the window's _NET_WM_STATE.
  • Maximize() toggles based on that state. Reading the state from the WM rather than a local flag keeps the toggle right after the user maximizes with the title bar button.

Everything needed already seems to be there: the atoms in StandardAtoms, Connection.GetProperty, and Connection.Unmaximize / SetFullscreen, which send the same _NET_WM_STATE client message. Maximize would be Unmaximize with _NET_WM_STATE_ADD.

Environment: gogpu v0.53.0 (also checked v0.54.0 and main), Linux Mint (Cinnamon, X11).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions