Rename XwaylandClient to XwaylandWindow

remotes/origin/work/zzag/workspace-client-to-window
Vlad Zahorodnii 4 years ago
parent 4b91c6163f
commit 3de377e461
  1. 2
      src/CMakeLists.txt
  2. 4
      src/workspace.cpp
  3. 14
      src/xwaylandwindow.cpp
  4. 6
      src/xwaylandwindow.h

@ -158,7 +158,7 @@ target_sources(kwin PRIVATE
xdgshellintegration.cpp xdgshellintegration.cpp
xdgshellwindow.cpp xdgshellwindow.cpp
xkb.cpp xkb.cpp
xwaylandclient.cpp xwaylandwindow.cpp
xwayland/xwayland_interface.cpp xwayland/xwayland_interface.cpp
) )

@ -52,7 +52,7 @@
#include "virtualdesktops.h" #include "virtualdesktops.h"
#include "was_user_interaction_x11_filter.h" #include "was_user_interaction_x11_filter.h"
#include "wayland_server.h" #include "wayland_server.h"
#include "xwaylandclient.h" #include "xwaylandwindow.h"
// KDE // KDE
#include <KConfig> #include <KConfig>
#include <KConfigGroup> #include <KConfigGroup>
@ -652,7 +652,7 @@ X11Window *Workspace::createClient(xcb_window_t w, bool is_mapped)
if (kwinApp()->operationMode() == Application::OperationModeX11) { if (kwinApp()->operationMode() == Application::OperationModeX11) {
c = new X11Window(); c = new X11Window();
} else { } else {
c = new XwaylandClient(); c = new XwaylandWindow();
} }
setupClientConnections(c); setupClientConnections(c);
if (X11Compositor *compositor = X11Compositor::self()) { if (X11Compositor *compositor = X11Compositor::self()) {

@ -7,7 +7,7 @@
SPDX-License-Identifier: GPL-2.0-or-later SPDX-License-Identifier: GPL-2.0-or-later
*/ */
#include "xwaylandclient.h" #include "xwaylandwindow.h"
#include "wayland/surface_interface.h" #include "wayland/surface_interface.h"
using namespace KWaylandServer; using namespace KWaylandServer;
@ -15,24 +15,24 @@ using namespace KWaylandServer;
namespace KWin namespace KWin
{ {
XwaylandClient::XwaylandClient() XwaylandWindow::XwaylandWindow()
{ {
// The wayland surface is associated with the Xwayland window asynchronously. // The wayland surface is associated with the Xwayland window asynchronously.
connect(this, &Window::surfaceChanged, this, &XwaylandClient::associate); connect(this, &Window::surfaceChanged, this, &XwaylandWindow::associate);
} }
void XwaylandClient::associate() void XwaylandWindow::associate()
{ {
if (surface()->isMapped()) { if (surface()->isMapped()) {
initialize(); initialize();
} else { } else {
// Queued connection because we want to mark the window ready for painting after // Queued connection because we want to mark the window ready for painting after
// the associated surface item has processed the new surface state. // the associated surface item has processed the new surface state.
connect(surface(), &SurfaceInterface::mapped, this, &XwaylandClient::initialize, Qt::QueuedConnection); connect(surface(), &SurfaceInterface::mapped, this, &XwaylandWindow::initialize, Qt::QueuedConnection);
} }
} }
void XwaylandClient::initialize() void XwaylandWindow::initialize()
{ {
if (!readyForPainting()) { // avoid "setReadyForPainting()" function calling overhead if (!readyForPainting()) { // avoid "setReadyForPainting()" function calling overhead
if (syncRequest().counter == XCB_NONE) { // cannot detect complete redraw, consider done now if (syncRequest().counter == XCB_NONE) { // cannot detect complete redraw, consider done now
@ -42,7 +42,7 @@ void XwaylandClient::initialize()
} }
} }
bool XwaylandClient::wantsSyncCounter() const bool XwaylandWindow::wantsSyncCounter() const
{ {
// When the frame window is resized, the attached buffer will be destroyed by // When the frame window is resized, the attached buffer will be destroyed by
// Xwayland, causing unexpected invalid previous and current window pixmaps. // Xwayland, causing unexpected invalid previous and current window pixmaps.

@ -15,14 +15,14 @@ namespace KWin
{ {
/** /**
* The XwaylandClient class represents a managed Xwayland client. * The XwaylandWindow class represents a managed Xwayland window.
*/ */
class XwaylandClient : public X11Window class XwaylandWindow : public X11Window
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit XwaylandClient(); explicit XwaylandWindow();
bool wantsSyncCounter() const override; bool wantsSyncCounter() const override;
Loading…
Cancel
Save