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

add decoration:dim_once variable to dim only once during renderWindow (hyprwm#3617) #3633

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

slothsh
Copy link

@slothsh slothsh commented Oct 21, 2023

  • Added decoration:dim_once variable
  • When dim_once is set, renderWindow() only dims if the current window is the same as the compositor's last window

Describe your PR, what does it fix/add?

As described in #3617, the dimaround window rule's default behavior is to draw a new transparent rectangle for each open instance of the target application.

This PR adds a dim_once variable in decorations to allow the user to specify whether dimming should only be applied once instead of being compounded.

At the moment, the dim_once variable is defaulted to false - which is the current dimming behavior. I'd recommend, though, that we default it to true. Dimming windows only once feels like the natural approach, or at least that's my opinion.

Is it ready for merging, or does it need work?

Ready for merging.

…g dim to windows (hyprwm#3617)

- Added `decoration:dim_once` variable
- When `dim_once` is set, `renderWindow()` only dims if the current window is the same as the compositor's last window
@vaxerski
Copy link
Member

what if there is one dimaround window but it's not focused? It will not be dimmed.

slothsh and others added 2 commits October 23, 2023 21:38
- Added `m_bIsDimTarget` member variable to `CWindow` for targetting a single window during `renderWindow()` pass
- Added `markDimTarget()` to `CCompositor` for identifying a target window for dimming
@slothsh
Copy link
Author

slothsh commented Oct 23, 2023

@vaxerski, sharp eye you've got there, thank you for spotting that. I've amended accordingly.

However, with the latest commit, c253d79, I'm in two minds about inlining directly in renderWindow() or having markDimTarget() as a method on CCompositor.

What would you say is the best approach?

@vaxerski
Copy link
Member

I am contemplating something else.

What if there are two dimaround windows, neither being in focus?

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

Successfully merging this pull request may close these issues.

None yet

2 participants