Skip to content
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

The 'maximized is true' criteria is not working. #2043

Closed
xiaohuirong opened this issue Dec 1, 2023 · 10 comments
Closed

The 'maximized is true' criteria is not working. #2043

xiaohuirong opened this issue Dec 1, 2023 · 10 comments

Comments

@xiaohuirong
Copy link

xiaohuirong commented Dec 1, 2023

Describe the bug
I set ignore_views = app_id is "xfce4-terminal" | maximized is true for decoration plugin, but the maximized is true criteria is not working and it will render the app_id is "xfce4-terminal" ineffective.

To Reproduce
Steps to reproduce the behavior:

  1. enable ssd and decoration plugin.
  2. set ignore_views = app_id is "xfce4-terminal" | maximized is true for decoration plugin.
  3. The xfce4-terminal's ssd still exists, and it won't be hidden when the window is maximized.

Expected behavior
The SSD can be hidden when the window is maximized.

Wayfire version
wayfire 0.8.0.r52.g8f7787e1-1 built from latest 8f7787e and wayfire 0.7.5

@xiaohuirong xiaohuirong added the bug label Dec 1, 2023
@ammen99
Copy link
Member

ammen99 commented Dec 1, 2023

The criteria here will be applied only once, when the window is mapped. The intention has never been to allow this to hide the decoration when the window is maximized and restore decorations when it is not ...

@ammen99 ammen99 removed the bug label Dec 1, 2023
@xiaohuirong
Copy link
Author

xiaohuirong commented Dec 1, 2023

Is it possible to support this feature? It seems that apart from automatically hiding decorations, there doesn't seem to be any other place where the maximized is true criteria can be used. I tried adding this criteria to the blur plugin, but it seems to be ineffective as well.

@ammen99
Copy link
Member

ammen99 commented Dec 1, 2023

The maximized criteria was originally intended for window-rules, but I agree it is not particularly interesting. The decoration plugin could, of course, handle this, but I am not sure what the best way to expose the functionality is - (ab)using the existing option seems less than ideal.

Maybe we want configurable decoration size for different states, so that you can set the size to 0 for maximized windows?

PS. For blur it won't work either, they all have a one-off effect: only when the view is mapped. The maximized criteria was meant for window-rules primarily.

@xiaohuirong
Copy link
Author

Dynamic setting of window height also requires the decoration to change along with the window's state. Therefore, the key to solving this issue is to ensure that these one-off effects can refresh along with the window state changes. This design should be more reasonable; otherwise, the usability of criteria that change with window state is very limited.

@ammen99
Copy link
Member

ammen99 commented Dec 1, 2023

In all honesty I believe that the best solution is custom IPC scripts, you can then embed any logic you want, provided that:

  • You have the possibility of receiving events from Wayfire - ipc-rules does that
  • The decoration plugin exposes methods for toggling decoration and/or changing the size at runtime - still TBD

@timgott
Copy link
Contributor

timgott commented Dec 11, 2023

Also affects winshadows. "floating is true" does not work either. This used to work, so I consider this a bug. Probably the view_matcher is broken, but I did not investigate yet.

See timgott/wayfire-shadows#19

Edit: I checked quickly, indeed the decoration plugin does not connect to the tiled signal so probably it cannot work for that reason. The shadows plugin does though.

Edit2: I was wrong, the view matcher does work (test: disable and enable title bar in firefox to trigger decoration state update). The tiled signal in the shadows plugin does not work anymore probably.

tldr: In the decoration plugin this could be easily fixed by updating state on view_tiled.

@timgott
Copy link
Contributor

timgott commented Dec 11, 2023

The criteria parser does not even accept "maximized is true" for me:

[src/core/matcher.cpp:27] Failed to parse condition maximized is true from option ignore_views
[src/core/matcher.cpp:28] Reason for the failure: Condition parser error. Unexpected symbol.

"tiled-top is true" does not work either:

[src/core/matcher.cpp:27] Failed to parse condition tiled-top is true from option ignore_views
[src/core/matcher.cpp:28] Reason for the failure: Symbol parser error. Identifier contains invalid character. text:tiled-top

"floating is true" does work.

@ammen99
Copy link
Member

ammen99 commented Dec 20, 2023

@timgott See WayfireWM/wf-utils#8

@erikvanhamme
Copy link
Contributor

I have checked and merged the pull request.

@ammen99
Copy link
Member

ammen99 commented Dec 20, 2023

I have checked and merged the pull request.

Cool, thanks :)

With #2062 this issue should be resolved.

@ammen99 ammen99 closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants