Fix crash in setMainWindow on wayland
ClosedPublic

Authored by fvogt on Jan 1 2018, 4:42 PM.

Details

Summary

It's copy of KWindowSystem::setMainWindow, but it was missing
e7249deae417cdf9fb2983b06aa118c4ae4e22df:

Verify that QWindow::fromWinId returned a QWindow before using it

Foreign window support is not available on all platforms. E.g. on
Wayland this returns a nullptr. Thus we cannot use it.

Test Plan

Crashed kwalletd5 when clicking on "Change Password" for
a GPG wallet.

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fvogt created this revision.Jan 1 2018, 4:42 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 1 2018, 4:42 PM
fvogt requested review of this revision.Jan 1 2018, 4:42 PM
fvogt added a comment.Jan 3 2018, 6:02 PM

Ping? This should probably go into 5.42.

dfaure accepted this revision.Jan 4 2018, 8:29 AM
This revision is now accepted and ready to land.Jan 4 2018, 8:29 AM
This revision was automatically updated to reflect the committed changes.