Make Toplevel::window() no longer virtual and introduce ::windowId()
ClosedPublic

Authored by graesslin on May 2 2016, 3:52 PM.

Details

Summary

Toplevel::window() is the actual X11 window. This makes it difficult
to use as the generic identifier for both X11 and Wayland. The Wayland
ShellClient already had a windowId() which is now added to Toplevel as
a virtual method. On X11 (Toplevel default) it returns the window().

The method window() now returns XCB_WINDOW_NONE for classes without
the Toplevel::m_client, such as ShellClient. Thus it allows to properly
check whether we are on Wayland or X11.

The code is adjusted to use windowId where a generic id is needed and
to properly check whether the window is valid before using it where
a window() is used.

This also fixes at least one additional unknown issue in
Workspace::setActiveClient

where the windowId of a Wayland client was passed to X11.

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 3609.May 2 2016, 3:52 PM
graesslin retitled this revision from to Make Toplevel::window() no longer virtual and introduce ::windowId().
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 TranscriptMay 2 2016, 3:52 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart accepted this revision.May 17 2016, 12:03 PM
mart added a reviewer: mart.
This revision is now accepted and ready to land.May 17 2016, 12:03 PM
This revision was automatically updated to reflect the committed changes.