ShellClient's m_shellSurface might be null
ClosedPublic

Authored by graesslin on Apr 18 2016, 11:35 AM.

Details

Summary

In preparation to support xdg-shell we need to make sure that ShellClient
does not assume m_shellSurface to not be null.

Everything that can be done through the surface() is resolved through
surface(). All accesses to m_shellSurface are nullptr checked.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 3400.Apr 18 2016, 11:35 AM
graesslin retitled this revision from to ShellClient's m_shellSurface might be null.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 18 2016, 11:35 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a subscriber: mart.Apr 18 2016, 12:25 PM
mart added inline comments.
shell_client.cpp
295–297

is surface() guaranteed to not be null or needs to be checked as well?

sebas added a subscriber: sebas.Apr 18 2016, 7:55 PM

What Marco asks. Otherwise, it's fine.

graesslin added inline comments.Apr 19 2016, 7:10 AM
shell_client.cpp
295–297

Yes surface() is guaranteed to not be null. A shellsurface is created for a surface. If the surface is destroyed, the shellsurface also gets destroyed.

mart accepted this revision.Apr 19 2016, 7:53 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Apr 19 2016, 7:53 AM
This revision was automatically updated to reflect the committed changes.