-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Cache _NET_WM_STATE
property and add rule target wm_state
#549
base: next
Are you sure you want to change the base?
Conversation
…cified When matching against custom window properties or atoms perform the matching against all available values (currently hardcoded to a max. of 10) using logical OR if no index is specified. This should help when an atom has multiple values and you only want to check against any of these — e.g. hiding windows with state `hidden`: `--opacity-rule "0:_NET_WM_STATE@32a *= '_NET_WM_STATE_HIDDEN'"` — without having to explicitly specify each index separately.
Keep track of the `_NET_WM_STATE` property for each managed window. Use the cached state to determine if window is fullscreen instead of querying the Xserver every time.
…ATE` in string New predefined target `wm_state` for rule-based matching. Matches against the cached `_NET_WM_STATE` property of a window in string representation. NOTE: `wm_state = 'fullscreen'` is not neccessarily identical to `fullscreen`, and `wm_state = 'focused'` is not identical to `focused`.
f7f27db
to
dac6785
Compare
Codecov Report
@@ Coverage Diff @@
## next #549 +/- ##
==========================================
+ Coverage 38.21% 38.50% +0.28%
==========================================
Files 46 46
Lines 9056 9123 +67
==========================================
+ Hits 3461 3513 +52
- Misses 5595 5610 +15
|
w->wm_state = wid_get_prop_wm_state(ps, w->client_win); | ||
|
||
if (w->wm_state != wmstate_old) { | ||
win_on_factor_change(ps, w); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should set the FACTOR_CHANGE flag instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, missed that one. Same would apply in win_update_wintype()
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're at it: I think win_update_opacity_target
can be replaced as well.
@tryone144 Can you separate the "matching against all indices" commit into a different PR? The other commits look fine, but I want to avoid the 10 properties hard limit if we can. |
I wasn't sure if I should split them, since the new rule makes use of that feature. EDIT: split into #550. |
@tryone144 the new rule doesn't have to use that feature, I think? |
_NET_WM_STATE
property and add rule target; extend rule-matching to any value in property array_NET_WM_STATE
property and add rule target wm_state
Cache all entries of the
_NET_WM_STATE
property for each window. This allows the addition of a new rule-targetwm_state
to match against the cached property with a string analogous towindow_type
:See #512 (comment) for more details on that.
Resolves #512.
Related: #550
TODO
[*]
#550.