[PanelView] Check whether we're X11 before calling QX11Info::connection()
ClosedPublic

Authored by broulik on May 30 2016, 2:36 PM.

Details

Summary

QX11Info::connection() looks up the connection in the QPA. The Wayland QPA happens to have a property with the same name, so it happily reinterpret_casts a wl_connection_t* to xcb_connection_t* and disaster ensues.

Test Plan

Auto hiding panels still works on X11, haven't tested Wayland.

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 updated this revision to Diff 4075.May 30 2016, 2:36 PM
broulik retitled this revision from to [PanelView] Check whether we're X11 before calling QX11Info::connection().
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, graesslin.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 30 2016, 2:36 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin requested changes to this revision.May 30 2016, 2:38 PM
graesslin edited edge metadata.
graesslin added inline comments.
shell/panelview.cpp
593

I suggest to move the complete X11 block into the if. So that we can in future add an
else if (isWayland())

This revision now requires changes to proceed.May 30 2016, 2:38 PM
broulik updated this revision to Diff 4076.May 30 2016, 2:40 PM
broulik edited edge metadata.

Wrap everything inside if (QX11Info::isPlatformX11()) {

graesslin accepted this revision.May 30 2016, 2:42 PM
graesslin edited edge metadata.
This revision is now accepted and ready to land.May 30 2016, 2:42 PM
This revision was automatically updated to reflect the committed changes.