kscreen kcm: block changed signal after save
ClosedPublic

Authored by sebas on Jul 13 2016, 11:28 PM.

Details

Summary

When changing position (and potentially other properties) of the screen
setup, we receive delayed signals way after the sync operation finishes.
This enables the apply button after the config has been applied, leading
to the apply/discard confirmation dialog when closing (or navigating
away from) the kscreen kcm.

This patch disables propagation of the changed() signal at the highest
level, meaning that config widgets internally still get updated, but the
apply button only gets enabled after 1000 milliseconds. This magic value
is what I've figured out by testing. It's long enough to re-request edid
information on two outputs, but short enough to get in the way from
further changes.

I'm not super-happy with the timer, but I don't see any other way to fix
this glitch in the user experience. We don't really have a way on X11 to
know when all changes are flushed.

BUG:365467

Test Plan

Tested systemsettings and kcmshell, with this patch, it works reliably and doesn't get in the way.

Diff Detail

Repository
R104 KScreen
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sebas updated this revision to Diff 5137.Jul 13 2016, 11:28 PM
sebas retitled this revision from to kscreen kcm: block changed signal after save.
sebas updated this object.
sebas edited the test plan for this revision. (Show Details)
sebas added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptJul 13 2016, 11:28 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas updated this revision to Diff 5139.Jul 14 2016, 12:50 AM
  • use compile-time connection
graesslin added inline comments.
kcm/src/kcm_kscreen.cpp
154

I don't really like the "magic" 1000 here. It would be nicer to have a proper way to detect it. But better than before.

Please add a comment that this is a hack and how you got the 1sec.

sebas updated this revision to Diff 5309.Jul 19 2016, 1:55 PM
  • Add comment explaining the hack
graesslin accepted this revision.Jul 19 2016, 1:56 PM
graesslin added a reviewer: graesslin.
This revision is now accepted and ready to land.Jul 19 2016, 1:56 PM
This revision was automatically updated to reflect the committed changes.