Skip to content

[Linux] Implement Window::SetResizable without breaking programmatic resizing #56

Description

@lijy91

Window::SetResizable() is a stub on Linux (src/platform/linux/window_linux.cpp), so setResizable(false) does nothing there.

Implementing it with gtk_window_set_resizable() runs into a known GTK behaviour: a non-resizable GtkWindow is sized from its default size or size request, so later SetSize() / SetContentSize() calls stop taking effect. The implementation needs to keep programmatic resizing working while the user can't resize. One option is to pin min = max size hints to the requested size instead of toggling resizable, or to update the default size together with the size.

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

Activity

  1. lijy91 commented on Sep 22, 2026

    @lijy91
    MemberAuthor

    Fixed in 10ac6fe.

    SetResizable() / IsResizable() now use GTK's resizable property. To avoid the GTK fixed-size trap, disabling resize first sets the default size to the current size, and SetSize / SetContentSize update the default size while the window is non-resizable. So programmatic grow and shrink still work, toggling keeps the current size, and #55's min/max limits survive the toggle. IsResizable() reads the native property.

    Verified with window_resizable_linux_test on GNOME: Wayland 54 checks, Xwayland 66. Cases covered: CSD and SSD, empty windows, and disabling before or after mapping. window_resizable_desktop_test confirms the same behaviour on macOS and Windows (32 checks each); no changes were needed there.

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