Skip to content

[Linux] Implement Window::SetMinimumSize / SetMaximumSize #55

Description

@lijy91

Window::SetMinimumSize() and Window::SetMaximumSize() are stubs on Linux (src/platform/linux/window_linux.cpp), so min/max size constraints set through nativeapi have no effect there. The getters return whatever was stored.

Expected: enforce the constraints with gtk_window_set_geometry_hints() (GDK_HINT_MIN_SIZE / GDK_HINT_MAX_SIZE), combined with the aspect-ratio hints that SetAspectRatio() already sets. Otherwise one call would overwrite the other's hints. Check that:

  • the constraints survive maximize → unmaximize
  • they apply when set before the window is mapped
  • they work with client-side decorations (the hints are in window-frame coordinates)

Background, from window_manager (which is moving onto nativeapi in 0.6.0):

Activity

  1. lijy91 commented on Sep 22, 2026

    @lijy91
    MemberAuthor

    Fixed in 10ac6fe (Linux) and 4ef0521 (Windows + tests).

    • Linux: min/max sizes are applied as GTK geometry hints and combined with SetAspectRatio, so setting one no longer clears the other. The public frame size is converted to the GDK surface (CSD shadows, server-side frames). Hints are refreshed after mapping and layout changes, deferred until GTK finishes its resize.
    • Windows (found while testing): WM_GETMINMAXINFO read the limits from the WindowRegistry wrapper, which may not be the instance that set them, so they could be silently ignored. The handler now reads the setter's state, and width and height can be bounded independently.

    Verified with the new desktop tests (no synthetic input): window_size_constraints_linux_test on GNOME Wayland (36 checks), Xwayland (48), Xvfb/Openbox and Weston; window_size_constraints_windows_test on Windows (7). Also checked by hand with window_example (min 400×300, max 1000×700) on macOS, Windows and Linux.

  2. added 2 commits that reference this issue on Sep 22, 2026
    4ef0521
    676f518
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions