[AppMenu Applet] Pass "ctx" as context instead of "this"
ClosedPublic

Authored by broulik on Jul 27 2017, 1:01 PM.

Details

Summary

We copy "ctx" pointer by value into our lambda but by the time our timer fires, it might be gone already.
Instead, pass "ctx" as context to QTimer::singleShot so it won't fire when it's gone.

BUG: 382386
FIXED-IN: 5.10.5

Test Plan

I don't have Visual Studio Code but it's probably related to Electron constantly updating the global menu causing us to re-create the buttons all the time.

Tested that the function is still called here and seems to have worked fine. It probably will not ungrab for the aforementioned app but I'd rather have QtQuick have a wrong mouse state than having plasma crash ;)

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jul 27 2017, 1:01 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 27 2017, 1:01 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson accepted this revision.Jul 27 2017, 1:47 PM
This revision is now accepted and ready to land.Jul 27 2017, 1:47 PM
This revision was automatically updated to reflect the committed changes.