Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy 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 targetwm_state#549

Open
tryone144 wants to merge3 commits intoyshui:next
base:next
Choose a base branch
Loading
fromtryone144:wm_state-target

Conversation

tryone144
Copy link
Collaborator

@tryone144tryone144 commentedNov 29, 2020
edited
Loading

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:

opacity-rule = [ "0:wm_state = 'hidden'" ];

See#512 (comment) for more details on that.

Resolves#512.
Related:#550

TODO

…cifiedWhen matching against custom window properties or atoms perform thematching 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 tocheck 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. Usethe cached state to determine if window is fullscreen instead ofquerying the Xserver every time.
…ATE` in stringNew predefined target `wm_state` for rule-based matching. Matchesagainst the cached `_NET_WM_STATE` property of a window in stringrepresentation.NOTE: `wm_state = 'fullscreen'` is not neccessarily identical to`fullscreen`, and `wm_state = 'focused'` is not identical to `focused`.
@codecov
Copy link

codecovbot commentedNov 29, 2020

Codecov Report

Merging#549 (dac6785) intonext (fb38bf0) willincrease coverage by0.28%.
The diff coverage is50.00%.

Impacted file tree graph

@@            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
Impacted FilesCoverage Δ
src/atom.h100.00% <ø> (ø)
src/common.h66.66% <ø> (ø)
src/win.h50.00% <ø> (ø)
src/c2.c36.70% <34.16%> (+1.37%)⬆️
src/win.c69.51% <95.45%> (+0.39%)⬆️
src/event.c69.97% <100.00%> (+0.33%)⬆️
src/picom.c68.79% <100.00%> (+0.39%)⬆️

w->wm_state = wid_get_prop_wm_state(ps, w->client_win);

if (w->wm_state != wmstate_old) {
win_on_factor_change(ps, w);
Copy link
Owner

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.

Copy link
CollaboratorAuthor

@tryone144tryone144Nov 29, 2020
edited
Loading

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 inwin_update_wintype() above.

Copy link
CollaboratorAuthor

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 thinkwin_update_opacity_target can be replaced as well.

@yshui
Copy link
Owner

@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.

@tryone144
Copy link
CollaboratorAuthor

tryone144 commentedNov 29, 2020
edited
Loading

@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.
We can discuss the hardcoded limit in that PR.

EDIT: split into#550.

yshui reacted with heart emoji

@yshui
Copy link
Owner

@tryone144 the new rule doesn't have to use that feature, I think?

@tryone144tryone144 changed the titleCache_NET_WM_STATE property and add rule target; extend rule-matching to any value in property arrayCache_NET_WM_STATE property and add rule targetwm_stateNov 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@yshuiyshuiyshui left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Feature request: add predefined targets for sticky and hidden
2 participants
@tryone144@yshui

[8]ページ先頭

©2009-2025 Movatter.jp