-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Use XCB to check if an application is fullscreen #187
Conversation
Codecov Report
@@ Coverage Diff @@
## next #187 +/- ##
=========================================
- Coverage 12.6% 12.56% -0.05%
=========================================
Files 42 42
Lines 8079 8097 +18
=========================================
- Hits 1018 1017 -1
- Misses 7061 7080 +19
|
@tatokis Thanks for the patch! It is unclear what is the desired behavior when a window is fullscreen on one of the monitors. If the screen is unredirected in that case, all monitors will lost composition. Is that a motivation for your patch? If not, I am considering stop using |
If you are running an application in fullscreen, and it is in focus, then chances are you are mostly looking at, and interacting with the fullscreen application almost exclusively. The other monitors will most likely be displaying idle applications such as an IRC client, or other kinds of system stats. This is true for games, where the cursor is grabbed, and unredirecting is also a must in order to achieve lower latency and no vsync (especially if it's forced on for other applications through the compositor to remove tearing). If you switch to another application, by pressing for example alt tab, then the desktop will be redirected again until the fullscreen application is back in focus. What that basically means is that once you are done with the fullscreen application, even temporarily, the normal -and expected- behaviour will be resumed. As an example, Unity 7 with compiz handles unredirection this way, which has been my primary desktop environment for many years now, and the unredirection configuration works quite well in my opinion. If you believe this behaviour might confuse people, it could be implemented as an optional CLI argument. Either way, I think this behaviour is better than the existing implementation, especially when it comes to playing games, because as-is there is simply no way to automatically unredirect a game, without having to mess about with writing scripts. |
@tatokis I think those are really great points. But since this changes the behavior of compton, I would like to:
Is that OK with you? |
1649082
to
2013bc6
Compare
I have added the I'm fine with waiting for whenever you want. You can send a message before you want to merge this and I'll rebase it in case there are any conflicts. I had to force push because I needed to fix a typo and fix the commit message |
2013bc6
to
83d0313
Compare
Thanks a lot! |
@tatokis Hi, can you rebase on top of the latest Thanks a lot! |
This arg reverts to the old behaviour of checking for fullscreen windows.
83d0313
to
93642e5
Compare
Should be okay now |
@tatokis thanks a lot. |
On multi-monitor environments using xrandr, the
rect_is_fullscreen()
function fails to detect fullscreen applications.This happens because
root_width
androot_height
are the sum of all the monitor resolutions.For example, in my case that would be 5520x1080.
A fullscreen application only goes fullscreen on one of the monitors, with its size being the resolution of one monitor only. Thus, that check fails.
This PR works around that issue by querying the EWMH
_NET_WM_STATE
Atom [0] using XCB.If it contains the
_NET_WM_STATE_FULLSCREEN
Atom, then the application is considered fullscreen.If the current WM does not support EWMH, it should gracefully fall back to the standard behaviour so that it doesn't cause any regressions.
[0] https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317598336