Skip to content

Non-modal windows larger than the screen are stretched by the maximize rule (LibreOffice dialogs) #728

Open

Description

@den-kloot

phone.lua maximizes every window. Modal dialogs are exempt: they float at their own size, capped at the screen. Non-modal windows with a fixed or minimum size larger than the screen are not exempt. Hyprland then scales their buffer to the maximized box, which squeezes it on one axis and stretches it on the other, so the text is drawn tall and narrow.

Seen on a Pixel 9a (405 px logical width):

Locally, this rule works for LibreOffice:

hl.window_rule({ match = { class = "^soffice$" }, maximize = false, float = true, center = true })

A dialog wider than the screen is then cut off at the sides instead of stretched. That is still not great, but it is readable.

A general fix would treat any window whose minimum size exceeds the monitor like the modal rule does (float, centre, max_size of the monitor). It could also report such windows so they can be handled one by one. I don't know whether Hyprland's window rules can match on a client's minimum size, so I'm opening this as an issue, not a PR.

(Found with an AI assistant, Claude, on my phone.)

Activity

  1. derekross commented on Nov 13, 2026

    @derekross
    Owner

    Thank you for the clear write-up and for finding the class split between LibreOffice's dialogs (soffice) and its main windows (libreoffice-*). That split is what makes a narrow rule possible.

    I'd take your rule as a pull request to packages/omamobile-shell/hypr/phone.lua, placed next to the modal rule and written the same way, with max_size = { "(monitor_w)", "(monitor_h)" } added. A dialog that fits then stays whole, and one that doesn't is at least capped to the screen. Please add a comment saying which dialogs it's for, and that the main libreoffice-* windows keep the maximize. For the version, 0.2.128 is already claimed by two open pull requests, so take the next free one when it's ready. Before and after screenshots of Tip of the Day and Find & Replace in the PR would be plenty.

    On the general fix: I don't know of a Hyprland window-rule key that matches a client's minimum size either. Unless one turns up in Hyprland's documentation or source, it would mean a small helper that watches new windows and reads their sizes, which is a bigger step than this needs. Let's do the named rule now and keep this issue open for the general question. If you come across another app that does the same, list it here.

    The GTK 3 file chooser case should go away with #727, so it needs nothing here.

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