-
-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to override floating rules #4782
Conversation
Some float rules (e.g. fixed size/aspect ratio) can be too broad and users may want exceptions to these rules. It is possible to do this with hooks but they can become unwieldy with multiple exceptions. This PR adds an `override_rules` argument to the floating layout. Where a window matches one of these rules then window will not be floated.
d708288
to
37a871c
Compare
I think it's "intentional", i.e. when we add a window underneath a floating window, the floating window remains focused. But,
this whole patch seems to be because our Match rules can't express this |
Good idea. Let me rework this. |
Thinking about it some more, do we need exceptions for other uses of |
The alternative would be to allow a Match object to take a list of Match objects to treat as exceptions to the parent. |
IMO having exceptions for float rules is also weird, but I don't use floating at all, so maybe I don't know. What specifically are the exceptions that people are interested in? Is it because the default rules are too broad? |
The float rules are deliberately broad eg they capture all windows requesting a fixed aspect ratio but you may want to carve out some specific apps. You could do this with a user defined function but then you're asking users to use non documented methods to retrieve properties of windows. This was just an idea to make it a bit easier for users. |
A "fun" way to do it would be to use bitwise operators e.g. |
Honestly, I like it. A DSL for window matching. I guess you mean I think this would be great :) |
Yes - missed the OK - I might have a play at implementing this. |
I've actually managed to get this working. I still need to write some tests and fix the mypy stuff so will upload later this week. |
Some float rules (e.g. fixed size/aspect ratio) can be too broad and users may want exceptions to these rules. It is possible to do this with hooks but they can become unwieldy with multiple exceptions.
This PR adds an
override_rules
argument to the floating layout. Where a window matches one of these rules then window will not be floated.Question for @tych0 - any idea where the test fails if the windows are added in the other order? i.e. if I open the
nofloat
window second, the focus remains on the first one somanager.c.window
points to the wrong window.