-
Notifications
You must be signed in to change notification settings - Fork 89
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
libscreensaver: fix detection of monitor hotplug #463
libscreensaver: fix detection of monitor hotplug #463
Conversation
libcscreensaver/cs-screen-x11.c
Outdated
@@ -416,7 +416,7 @@ is_full_change (CsScreen *screen) | |||
{ | |||
// Check to see if the union of monitor rects is the same size as the screen | |||
|
|||
GdkRectangle total_monitors; | |||
GdkRectangle total_monitors = {}; |
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.
Zeroing worksforme, but perhaps it can have issues if there's no monitor starting at (0,0)? That could be avoided by having total_monitors = screen->monitor_infos[0].rect
initially. Let me know if that's preferable, I can cook up another patch.
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.
can you initialize it to {0}
(this is the more accepted method).
This function is a sanity check for the monitor layout - the inclusive monitor rect should always match the screen rectangle. I may have been shooting myself in the foot here, mistaking where bad values were coming from.
Some of this also may not even be necessary anymore. The 'loop' described in d23d1ea ended up being a muffin issue (linuxmint/muffin@bf234250143), but I never had a chance to re-evaluate things here.
Thanks!
Can you paste what you get in debug mode after applying the patch? |
When hot-adding monitors (e.g. DisplayPort), I was seeing unobscured content behind the screensaver. Debug mode revealed: CsScreen received 'monitors-changed' signal from GdkScreen 25675900 Found 2 Xinerama screens on display :0 Monitor 0 is 0,0 1920 x 1080 Monitor 1 is 1920,0 1920 x 1200 Cinnamon Screensaver compiled without Solaris Xinerama support Scale factor of 1 applied. Monitor 0 is 0,0 1920 x 1080 Scale factor of 1 applied. Monitor 1 is 1920,0 1920 x 1200 Screen rect (0,0-3840x1200) and 2 monitor rects (0,0-503284330x1200) DO NOT add up, skipping change notification cinnamon-screensaver This could be caused by `total_monitors` rect being uninitialized; zero it. Might fix linuxmint#437. Seems like this could fix linuxmint#460, though the log therein does _not_ say "DO NOT add up". Ref: linuxmint#437 Ref: linuxmint#460 Fixes: d23d1ea "Rework behavior surrounding sleep, display changes, fractional scaling." Signed-off-by: Alex Badea <[email protected]>
0ab7c7b
to
23e7cc8
Compare
Yeah. This was started with 3 monitors, and unplugging 2 of them (i.e. the docking station):
which does show a (transient) case when they still don't add up. Then plugging the docking station (2 monitors) back in:
or in summary:
|
When hot-adding monitors (e.g. DisplayPort), I was seeing unobscured content behind the screensaver. Debug mode revealed:
This could be caused by
total_monitors
rect being uninitialized; zero it. Might fix #437. Seems like this could fix #460, though the log therein does not say "DO NOT add up".Ref: #437
Ref: #460
Fixes: d23d1ea "Rework behavior surrounding sleep, display changes, fractional scaling."