Avoid creating subwindow on internal page widget
ClosedPublic

Authored by davidedmundson on Apr 14 2020, 3:29 PM.

Details

Summary

KWallet::openWallet takes a windowId as a parameter.

QWidget->winId() is a dangerous call, it will create an underlying
platform window when called. This happens even if we're not the toplevel
widget. On X11 this passed winId must have always been broken, but not
in a way that caused a problem.

This leaves QtWayland in a very confused state with the side effect that
all scrolling widgets become broken.

BUG: 418755
BUG: 420035

Test Plan

Bisected drkonqi till we found the cause
Verified fix by running crashtest (with some mods so I could report a bug)
I can't confirm the winId is correct on X11, but the code looks safe

Diff Detail

Repository
R871 DrKonqi
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25233
Build 25251: arc lint + arc unit
davidedmundson created this revision.Apr 14 2020, 3:29 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 14 2020, 3:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Apr 14 2020, 3:29 PM
sitter accepted this revision.Apr 14 2020, 3:36 PM
sitter added a subscriber: sitter.

I am kind of thinking the cast should be asserted or if'd. But I suppose that doesn't add much over just letting it crash on the null dereference.

This revision is now accepted and ready to land.Apr 14 2020, 3:36 PM
This revision was automatically updated to reflect the committed changes.