From b92a43c8eafa7745b52bc7c4dbb680ae4591ac4e Mon Sep 17 00:00:00 2001 From: The_miro Date: Wed, 29 Jul 2026 08:40:20 +0200 Subject: [PATCH] fix(hyprlua,hyprdrive): float/center the xdg-desktop-portal-hyprland share picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Discord's screen-share source picker wasn't matching the modal-dialog windowrules and tiled instead of floating. It's the Qt "hyprland-share-picker" binary, which sets its app_id/class via QCoreApplication::setApplicationName("org.hyprland.xdg-desktop-portal-hyprland") — neither the GTK portal-dialog rule (different class) nor the title-based dialog-float rule (title doesn't match) catches it. Added a dedicated rule matching that class with the same float+center-on-monitor treatment. Co-Authored-By: Claude Sonnet 5 --- desktopenvs/hyprdrive/hypr/usr/windowrules.lua | 13 +++++++++++++ desktopenvs/hyprlua/hypr/usr/windowrules.lua | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/desktopenvs/hyprdrive/hypr/usr/windowrules.lua b/desktopenvs/hyprdrive/hypr/usr/windowrules.lua index 400c6ae..bf62f29 100644 --- a/desktopenvs/hyprdrive/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprdrive/hypr/usr/windowrules.lua @@ -103,6 +103,19 @@ hl.window_rule({ move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", }) +-- screen-share source picker (xdg-desktop-portal-hyprland) — same treatment as +-- the GTK portal dialog above. This is the Qt "hyprland-share-picker" binary +-- that pops up asking which output/window to share (e.g. from Discord); it +-- calls QCoreApplication::setApplicationName("org.hyprland.xdg-desktop-portal-hyprland"), +-- which becomes its Wayland app_id/class. It's a parentless top-level like the +-- GTK portal dialog, so it needs the same explicit float+center rule. +hl.window_rule({ + name = "hyprland-share-picker", + match = { class = "org.hyprland.xdg-desktop-portal-hyprland" }, + float = true, + 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. diff --git a/desktopenvs/hyprlua/hypr/usr/windowrules.lua b/desktopenvs/hyprlua/hypr/usr/windowrules.lua index 63c2c98..26b932a 100644 --- a/desktopenvs/hyprlua/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprlua/hypr/usr/windowrules.lua @@ -104,6 +104,19 @@ hl.window_rule({ move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", }) +-- screen-share source picker (xdg-desktop-portal-hyprland) — same treatment as +-- the GTK portal dialog above. This is the Qt "hyprland-share-picker" binary +-- that pops up asking which output/window to share (e.g. from Discord); it +-- calls QCoreApplication::setApplicationName("org.hyprland.xdg-desktop-portal-hyprland"), +-- which becomes its Wayland app_id/class. It's a parentless top-level like the +-- GTK portal dialog, so it needs the same explicit float+center rule. +hl.window_rule({ + name = "hyprland-share-picker", + match = { class = "org.hyprland.xdg-desktop-portal-hyprland" }, + float = true, + 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.