Add querys to "if" action for detecting if a window covers a location#20
Add querys to "if" action for detecting if a window covers a location#20brainwater wants to merge 2 commits intodanakj:masterfrom
Conversation
…windows front to back (if true) or back to front (if false) or do the original behavior if not present.
|
I realized that this has unexpected behavior when multiple windows are at the specified point, since the client_list is not in front to back order. To fix this, I added a stacking_order tag that allows the user to specify the foreach either go in front to back (if true) or back to front (if false) order. I'm not completely satisfied with using this 3-state boolean (true, false, not present) for this purpose and am open to suggestions. It would not be completely obvious to a user that having stacking_order false and having stacking_order not be there would cause 2 different results, so at a minimum it would have to be clearly documented. An example configuration for this which would take the topmost window in the upper lefthand corner of the screen and raise and focus it is: <keybind key="W-C-q">
<action name="ForEach">
<stacking_order>true</stacking_order>
<query>
<containsxpoint>1/8</containsxpoint>
<containsypoint>1/6</containsypoint>
</query>
<then>
<action name="Focus"/>
<action name="Raise"/>
<action name="Stop"/>
</then>
</action>
</keybind> |
|
What if we just walked for each in stacking order always? The order we do it now is kinda arbitrary. |
|
I have created a new branch ifpoint-revised that contains the fixes for the issues raised in this pr. New pull request is #22 |
This is best used with the ForEach action, which calls If on each window. If you consider a 3 row and 4 column grid on the screen, then the following keybind will raise and focus the window in upper left square of that grid (more specifically, the window that would be raised and focused if you were to click on the center of the upper left most square).
From my rc.xml file.