Runner/Windows make the window finding more reliable
ClosedPublic

Authored by meven on Jan 7 2020, 2:16 PM.

Details

Summary

QTimer::singleShot could dispatch gatherInfo after the next WindowsRunner::match was called in a not-ready state preventing to return match.

prepareForMatchSession will lock the lock, allowing only gatherInfo to run, which will unlock the lock, allowing match() to run.

BUG: 414804
FIXED-IN: 5.18

Diff Detail

Repository
R120 Plasma Workspace
Branch
arcpatch-D26494
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21517
Build 21535: arc lint + arc unit
meven created this revision.Jan 7 2020, 2:16 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 7 2020, 2:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Jan 7 2020, 2:16 PM
meven edited the summary of this revision. (Show Details)Jan 7 2020, 4:42 PM
meven added a comment.EditedJan 8 2020, 11:53 AM

Instead we might want to keep a cache of windows and desktopNames and use KWindowSystem::desktopNamesChanged / numberOfDesktopsChanged and windowAdded / windowRemoved signals.

Sorry, I don't know how any of that prepare and teardown stuff works, so I can't really judge.

meven removed a reviewer: broulik.Jan 22 2020, 9:05 AM
meven added a reviewer: mart.

I assume it was done like this, because after you've done prepareForMatchSession on every runner we can start all the threads and run match.
If we block the main thread now, it doesn't matter as at least every runner is busy doing something and the main thread would just be idling about waiting anyway.

After this patch we'll block every runner from starting whilst we do this.

It sounds like we just want to just block in match till we're loaded. Something with QWaitCondition for m_ready would be an option.

or manually lock in prepareForMatchSession manually unlock in gatherInfo

then you don't need m_ready

meven updated this revision to Diff 74152.Jan 22 2020, 5:54 PM

prepareForMatchSession will lock the lock, allowing only gatherInfo to run

meven edited the summary of this revision. (Show Details)Jan 22 2020, 5:56 PM
meven updated this revision to Diff 74154.Jan 22 2020, 5:57 PM

Remove variable m_ready

davidedmundson accepted this revision.Jan 22 2020, 5:58 PM
This revision is now accepted and ready to land.Jan 22 2020, 5:58 PM
This revision was automatically updated to reflect the committed changes.