ignore spurious resize events to empty sizes
ClosedPublic

Authored by mart on Aug 4 2017, 11:40 AM.

Details

Summary

on multiscreen systems, the notification dialog gets resized to 0x0
right after componentcomplete by someone else (either kwin, notification
applet or Qt code) causing 382340, resizing a window to a null size is not correct anyways
and should never happen.
with this, all other resize events are correct and notifications are ok on multiscreen
systems

BUG:382340

Test Plan

system with primary monitor and panel in the external monitor
at the right of a panel, notifications are fine

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
mart created this revision.Aug 4 2017, 11:40 AM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptAug 4 2017, 11:40 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
broulik added inline comments.
src/plasmaquick/dialog.cpp
1045

So it will never update its size? Shouldn't it be size == oldSize?

mart updated this revision to Diff 17712.Aug 4 2017, 1:50 PM
  • fix check
mart marked an inline comment as done.Aug 4 2017, 1:50 PM
mart added inline comments.
src/plasmaquick/dialog.cpp
1045

ouch, sure, sorry :)

davidedmundson requested changes to this revision.Aug 4 2017, 9:27 PM
davidedmundson added a subscriber: davidedmundson.

on multiscreen systems, the notification dialog gets resized to 0x0
by someone else (either kwin, notification applet or Qt code)

So which is it?

This revision now requires changes to proceed.Aug 4 2017, 9:27 PM
mart marked an inline comment as done.Aug 7 2017, 10:36 AM

not sure how to proceed in debugging this, as all i have is a resize event handler being called, which a backtrace there is useless to figure out who is resizing it

mart added a comment.Aug 7 2017, 1:39 PM

finally figured out where this event is generated:
it's a spontaneous event generated in qguiapplication.cpp QGuiApplicationPrivate::processWindowScreenChangedEvent
around line 2209 QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect());

this happens even before the first show event, right after the window has been created, the window is still 0x0, but the resize event gets delivered with 0x0 again and executed with all the bad side effects
this seems to happen for every window when there are multiple screens, so something we have probably to watch out for in the future

davidedmundson accepted this revision.Aug 7 2017, 1:54 PM

thanks!
add some code comments.

This revision is now accepted and ready to land.Aug 7 2017, 1:54 PM
mart updated this revision to Diff 17832.Aug 7 2017, 2:03 PM

more comments

This revision was automatically updated to reflect the committed changes.
cfeck added a subscriber: cfeck.EditedAug 11 2017, 2:58 PM

The commit still says "size != oldSize". Is this correct?

EDIT: Ah, there was a follow-up commit...