-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
window: sync up command line option and code behavior. #604
base: master
Are you sure you want to change the base?
Conversation
This is confusing to me. Your description talks about the description for Also, that block seems to want to address bugs with legacy apps that force window size to the same as the monitor without structs, but your comment is regarding modern apps with CSD. Finally, your code just removes the case of windows being decorated: So, is there a specific bug that we can reproduce? What app, called in what way, with what workspace configuration, can we use to reproduce this issue? |
I know, all this stuff is a bit complex and took me a while to understand as well.
Essentially I am fixing the non-disabled version, i.e., default case. Yes, I'm talking about the The documentation explicitly states:
This directly contradicts the code: it will force fullscreen mode if
I'm referring to the comment directly above this code, which reads: /* Workaround braindead legacy apps that don't know how to
* fullscreen themselves properly - don't get fooled by
* fullscreen themselves properly - don't get fooled by
* windows which are client decorated; that's not the same
* windows which are client decorated; that's not the same
* as fullscreen, even if there are no struts making the
* as fullscreen, even if there are no struts making the
* workarea smaller than the monitor.
* workarea smaller than the monitor.
*/
It would be, and that would be wrong, if it was written like that, but take a closer look at it again. :)
Reproducing it is pretty easy: It makes sense for marco to detect situations in which applications explicitly disable the window decorations, change the extents to the screen resolution and have the WM automatically fullscreen the window, but in that case, it definitely shouldn't happen. Some other piece of information I have slightly omitted: Quoting from 13741f5:
So, unless my interpretation is way off, the original intention was to exempt CSD windows (which trivially are undecorated), but also catch any other undecorated window. Looking at the code, however, the original intention wasn't carried out correctly. CSD windows were (correctly) exempted, as described, but caught decorated non-CSD windows instead. This came from 1b63865, which already did try to exempt CSD by checking if the window is decorated and actually introduced this bug. The previously mentioned commit tried to fix it up, and did that, but only really fixed it for CSD windows, leaving the breakage for non-CSD windows in place. I hope that this clears up a few things. |
Oh, one more thing...
"Legacy apps" in that (comment) context doesn't refer to "legacy, as in non-CSD" vs. "modern, as in CSD" windows, but even "more legacy", broken applications, like Adobe Reader, which seems to have behaved in very weird ways. Thankfully, Adobe Reader has been dead for quite some time now, but there are probably still some applications around that behave badly. Java-based stuff for instance has a reputation for very... creative X11 behavior, to say the least. A modern video player, like mpv, can certainly not be regarded as such a legacy, braindead application, which was what I alluded to. :) |
c070bfa
to
13fbad6
Compare
The description for --no-force-fullscreen explicitly states that it disabled forcing fullscreen mode on windows that have *no* decorations and are screen-sized. Up until now, the code directly contradicted that by running the part only if either the decorations where *enabled* or no CSD being used. That causes multiple problems. For once, modern video players, which can certainly not be regarded as "legacy applications", that try to show the video window as big as possible and hence set the extents to exactly the screen size, including using static gravity (so that borders are NOT removed from the window size automatically) but still request a border are wrongly forced into fullscreen mode by this hack. Changing the gravity would work around that problem because the window size is effectively lowered, but we can't expect applications to work around bugs in marco. Secondly, the check for window decorations (or not) gets completely cancelled out by the OR'd check for no CSD. According to the original commit message, this hasn't been the intention, but rather to NOT force fullscreen mode on windows that have no decorations and are CSD. It was meant well, but the logic behind the change failed to do what it was supposed to do. Hence, fix that by checking if an application explicitly disabled window decorations *AND* is not CSD. This syncs up the help description and code behavior and fixes the CSD part, but note that, naturally, it also changes the general behavior. Specifically, this might break cases in which applications were supposed to be forced into fullscreen mode even though they didn't explicitly disable window decorations. I'd argue that such behavior would rather be a bug and not a feature, though.
13fbad6
to
04da9d5
Compare
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.
I don't think I have ANY of the apps in question installed, but the code change is extremely simple (one conditional becomes and instead of or and we use the negation on both of the first two checks. Builds and runs fine, but I have no idea how to really test it with no java apps, no Adobe reader etc. MPV's behavior on a 4K video matching a 4K screem was totally unchanged.
The description for
--no-force-fullscreen
explicitly states that itdisables forcing fullscreen mode on windows that have no decorations
and are screen-sized.
Up until now, the code directly contradicted that by running the part
only if either the decorations where enabled or no CSD being used.
That causes multiple problems.
First, modern video players, which can certainly not be regarded as
"legacy applications", that try to show the video window as big as
possible and hence set the extents to exactly the screen size, including
using static gravity (so that borders are NOT removed from the window
size automatically) but still request window decorations are wrongly forced into
fullscreen mode by this hack. Changing the gravity would work around
that problem because the window size is effectively lowered, but we
can't expect applications to work around bugs in marco.
Secondly, the check for window decorations (or not) gets completely
cancelled out by the OR'd check for no CSD. According to the original
commit message, this hasn't been the intention, but rather to NOT force
fullscreen mode on windows that have no decorations and are CSD. It was
meant well, but the logic behind the change failed to do what it was
supposed to do.
Hence, fix that by checking if an application explicitly disabled window
decorations AND is not CSD.
This syncs up the help description and code behavior and fixes the CSD
part, but note that, naturally, it also changes the general behavior.
Specifically, this might break cases in which applications were supposed
to be forced into fullscreen mode even though they didn't explicitly
disable window decorations. I'd argue that such behavior would rather be
a bug and not a feature, though.