From bdecba0cf38e5943c14f0c4de8942a7c95e47501 Mon Sep 17 00:00:00 2001 From: The_miro Date: Sat, 11 Jul 2026 04:28:42 +0200 Subject: [PATCH] feat(hyprlua): float xdg portal dialogs above their parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Portal-backed file/app choosers (xdg-desktop-portal-gtk) — e.g. Steam's "select library folder" picker, plus Chromium/Electron/Flatpak dialogs — run in a separate process and open as parentless top-levels with no xdg-dialog or X11-dialog hint. Hyprland can't tell they're dialogs and tiles them, unlike in-process xdg dialogs which it auto-floats. Match the portal backend's class and float + centre it so it lands above its parent. Co-Authored-By: Claude Opus 4.8 --- desktopenvs/hyprlua/hypr/usr/windowrules.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/desktopenvs/hyprlua/hypr/usr/windowrules.lua b/desktopenvs/hyprlua/hypr/usr/windowrules.lua index a08a9d7..74e8def 100644 --- a/desktopenvs/hyprlua/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprlua/hypr/usr/windowrules.lua @@ -89,6 +89,21 @@ hl.window_rule({ move = "(cursor_x-380) (cursor_y-230)", }) +-- xdg portal dialogs — float, centred on the monitor (i.e. above the parent). +-- The GTK portal backend (xdg-desktop-portal-gtk) serves native file/app/print +-- choosers for portal-driven apps: Steam ("select library folder"), Chromium/ +-- Electron, Flatpak apps, etc. It runs in its *own* process, so the dialog opens +-- as a parentless top-level with no xdg-dialog/X11-dialog hint — Hyprland has no +-- signal that it's a dialog and would otherwise tile it (unlike in-process xdg +-- dialogs, which it auto-floats). Natural size is kept, so the centre offsets use +-- the real window_w/window_h (no `size` to skew them; see the filepicker note). +hl.window_rule({ + name = "xdg-portal-dialog", + match = { class = "xdg-desktop-portal-gtk" }, + float = true, + move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", +}) + -- spotify floating hl.window_rule({ name = "spotify-float",