From f040cac729490762d6cee58e88a33218f5150c1d Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 21 Jul 2026 20:49:04 +0200 Subject: [PATCH] feat(hypr): float dialog-like windows at cursor, minimum size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a `dialog-float` window rule to both hyprdrive and hyprlua: float any window whose title looks like a dialog (Rename/Save/Open/Opening/Confirm/ Delete/Move/Copy/Replace/Properties/Preferences — covers file-manager rename dialogs and Firefox "Opening " download prompts), centred on the cursor at its natural (minimum) size. Catches dialogs that carry no xdg/X11 dialog hint and would otherwise tile; Hyprland still auto-floats the ones that do. Co-Authored-By: Claude Opus 4.8 --- desktopenvs/hyprdrive/hypr/usr/windowrules.lua | 14 ++++++++++++++ desktopenvs/hyprlua/hypr/usr/windowrules.lua | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/desktopenvs/hyprdrive/hypr/usr/windowrules.lua b/desktopenvs/hyprdrive/hypr/usr/windowrules.lua index 8d81388..f63aab1 100644 --- a/desktopenvs/hyprdrive/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprdrive/hypr/usr/windowrules.lua @@ -103,6 +103,20 @@ hl.window_rule({ move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", }) +-- dialogs — float any dialog-like window at its natural (minimum) size, centred on +-- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/ +-- Properties/Preferences dialogs, and Firefox "Opening " download prompts. +-- Hyprland already auto-floats real in-process xdg/X11 dialogs; this catches the ones +-- that tile because they carry no dialog hint, matched heuristically by title. No +-- `size`, so the natural (minimum) size is kept and the cursor-centre offsets use the +-- real window_w/h (see the filepicker note above re: move/size ordering). +hl.window_rule({ + name = "dialog-float", + match = { title = "^(Rename|Save|Opening |Open |Confirm|Delete|Move|Copy|Replace|Properties|Preferences).*" }, + float = true, + move = "(cursor_x-(window_w/2)) (cursor_y-(window_h/2))", +}) + -- spotify floating hl.window_rule({ name = "spotify-float", diff --git a/desktopenvs/hyprlua/hypr/usr/windowrules.lua b/desktopenvs/hyprlua/hypr/usr/windowrules.lua index 74e8def..63c2c98 100644 --- a/desktopenvs/hyprlua/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprlua/hypr/usr/windowrules.lua @@ -104,6 +104,20 @@ hl.window_rule({ move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", }) +-- dialogs — float any dialog-like window at its natural (minimum) size, centred on +-- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/ +-- Properties/Preferences dialogs, and Firefox "Opening " download prompts. +-- Hyprland already auto-floats real in-process xdg/X11 dialogs; this catches the ones +-- that tile because they carry no dialog hint, matched heuristically by title. No +-- `size`, so the natural (minimum) size is kept and the cursor-centre offsets use the +-- real window_w/h (see the filepicker note above re: move/size ordering). +hl.window_rule({ + name = "dialog-float", + match = { title = "^(Rename|Save|Opening |Open |Confirm|Delete|Move|Copy|Replace|Properties|Preferences).*" }, + float = true, + move = "(cursor_x-(window_w/2)) (cursor_y-(window_h/2))", +}) + -- spotify floating hl.window_rule({ name = "spotify-float",