fix(hyprlua,hyprdrive): float/center the xdg-desktop-portal-hyprland share picker

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 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-07-29 08:40:20 +02:00
parent 9cd8eb2065
commit b92a43c8ea
2 changed files with 26 additions and 0 deletions

View File

@ -103,6 +103,19 @@ hl.window_rule({
move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", 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 -- 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/ -- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/
-- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts. -- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts.

View File

@ -104,6 +104,19 @@ hl.window_rule({
move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)", 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 -- 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/ -- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/
-- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts. -- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts.