Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

[Feature Request] Event driven hooks for Window rules or change default behavior of child floating windows.

Open ctilley83 opened this issue 4 months ago • 1 comments

Description

It would be useful if a shell script could be executed when a window rule is triggered. I encountered a scenario using pcmanfm-qt, now built on Qt6. When selecting a context menu item like "file properties," the default behavior is to tile the window. After creating a window rule to float the dialog, it gets centered on the screen, which isn't ideal. I wrote a script to calculate the center of the parent window and position the dialog above it. However, there's no way to trigger the script automatically. A keybind won’t work, as it would be impractical to manually move the window after the dialog has opened.

If there are no plans to implement the above functionality, another solution to my specific issue is to force floating windows to position themselves centered to the parent window, or at least close to it while staying within the bounds of the screen. This would change the default behavior although it could be implemented as a second option.

Just something to note. Thunar's default behavior is to center the dialog above the window, so that indicates to me that developers control the positioning and whether to float the window. However it would be nice to have built in ways to override that with window rule scripts.

Edit: Thunar only centers the file properties window, not the preferences window 🤷‍♂️

ctilley83 avatar Oct 08 '24 19:10 ctilley83