From ffcbe24e2bf9e8e2b8c351e44d8419eb4cf34c29 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 24 Sep 2019 11:48:08 +0300 Subject: [PATCH] Rename Client to X11Client Summary: Currently each managed X11 client is represented with an instance of Client class, however the name of that class is very generic and the only reason why it's called that way is because historically kwin was created as an x11 window manager, so "Client" was a sensible choice. With introduction of wayland support, things had changed and therefore Client needs to be renamed to X11Client in order to better reflect what that class stands for. Renaming of Client to X11Client was agreed upon during the last KWin sprint. Test Plan: Compiles, the test suite is still green. Reviewers: #kwin, romangg Reviewed By: #kwin, romangg Subscribers: romangg, davidedmundson, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D24184 --- CMakeLists.txt | 2 +- abstract_client.cpp | 2 +- activation.cpp | 38 +-- activities.cpp | 10 +- activities.h | 4 +- appmenu.cpp | 2 +- autotests/CMakeLists.txt | 4 +- autotests/client.h | 1 - autotests/integration/activities_test.cpp | 6 +- autotests/integration/dbus_interface_test.cpp | 6 +- .../integration/desktop_window_x11_test.cpp | 6 +- .../dont_crash_aurorae_destroy_deco.cpp | 6 +- .../dont_crash_cancel_animation.cpp | 2 +- .../dont_crash_cursor_physical_size_empty.cpp | 2 +- .../integration/dont_crash_empty_deco.cpp | 6 +- autotests/integration/dont_crash_glxgears.cpp | 6 +- .../integration/dont_crash_no_border.cpp | 2 +- .../effects/slidingpopups_test.cpp | 8 +- .../integration/effects/translucency_test.cpp | 10 +- .../integration/effects/wobbly_shade_test.cpp | 4 +- .../integration/globalshortcuts_test.cpp | 6 +- .../integration/move_resize_window_test.cpp | 16 +- autotests/integration/plasmawindow_test.cpp | 6 +- autotests/integration/quick_tiling_test.cpp | 10 +- autotests/integration/scene_qpainter_test.cpp | 6 +- .../screenedge_client_show_test.cpp | 14 +- autotests/integration/shade_test.cpp | 6 +- autotests/integration/stacking_order_test.cpp | 38 +-- autotests/integration/struts_test.cpp | 22 +- autotests/integration/window_rules_test.cpp | 12 +- autotests/integration/x11_client_test.cpp | 34 +-- autotests/integration/xwayland_input_test.cpp | 6 +- autotests/mock_workspace.h | 4 +- .../{mock_client.cpp => mock_x11client.cpp} | 8 +- autotests/{mock_client.h => mock_x11client.h} | 6 +- autotests/test_screen_edges.cpp | 8 +- autotests/test_screens.cpp | 4 +- autotests/x11client.h | 1 + composite.cpp | 16 +- composite.h | 4 +- debug_console.cpp | 10 +- debug_console.h | 6 +- deleted.cpp | 4 +- effects.cpp | 26 +- effects.h | 4 +- events.cpp | 58 ++-- focuschain.h | 10 +- geometry.cpp | 82 +++--- group.cpp | 98 +++---- group.h | 18 +- input.cpp | 2 +- layers.cpp | 30 +-- manage.cpp | 16 +- moving_client_x11_filter.cpp | 4 +- netinfo.cpp | 18 +- netinfo.h | 12 +- placement.cpp | 4 +- .../platforms/x11/standalone/sync_filter.cpp | 4 +- .../x11/standalone/windowselector.cpp | 4 +- .../standalone/x11_decoration_renderer.cpp | 2 +- plugins/scenes/opengl/lanczosfilter.cpp | 6 +- plugins/scenes/opengl/scene_opengl.cpp | 2 +- plugins/scenes/qpainter/scene_qpainter.cpp | 2 +- plugins/scenes/xrender/scene_xrender.cpp | 4 +- pointer_input.cpp | 2 +- rules.cpp | 8 +- rules.h | 1 - scene.cpp | 4 +- screenedge.cpp | 2 +- screens.cpp | 2 +- scripting/meta.cpp | 12 +- scripting/meta.h | 6 +- scripting/scripting.cpp | 6 +- scripting/scripting.h | 2 +- scripting/scripting_model.cpp | 6 +- scripting/workspace_wrapper.cpp | 12 +- scripting/workspace_wrapper.h | 16 +- sm.cpp | 14 +- sm.h | 2 +- tabbox/tabbox.cpp | 4 +- tabbox/tabbox.h | 1 - thumbnailitem.cpp | 2 +- toplevel.cpp | 4 +- useractions.cpp | 10 +- useractions.h | 1 - utils.h | 6 +- wayland_server.cpp | 2 +- window_property_notify_x11_filter.cpp | 2 +- workspace.cpp | 58 ++-- workspace.h | 50 ++-- client.cpp => x11client.cpp | 254 +++++++++--------- client.h => x11client.h | 86 +++--- xwl/clipboard.cpp | 6 +- xwl/dnd.cpp | 2 +- xwl/drag_wl.cpp | 4 +- xwl/selection.cpp | 4 +- 96 files changed, 679 insertions(+), 692 deletions(-) delete mode 100644 autotests/client.h rename autotests/{mock_client.cpp => mock_x11client.cpp} (87%) rename autotests/{mock_client.h => mock_x11client.h} (91%) create mode 100644 autotests/x11client.h rename client.cpp => x11client.cpp (91%) rename client.h => x11client.h (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8f2c7d92..4c176eb08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -399,7 +399,6 @@ set(kwin_KDEINIT_SRCS activation.cpp appmenu.cpp atoms.cpp - client.cpp client_machine.cpp colorcorrection/colorcorrectdbusinterface.cpp colorcorrection/manager.cpp @@ -493,6 +492,7 @@ set(kwin_KDEINIT_SRCS wayland_server.cpp window_property_notify_x11_filter.cpp workspace.cpp + x11client.cpp x11eventfilter.cpp xcbutils.cpp xdgshellclient.cpp diff --git a/abstract_client.cpp b/abstract_client.cpp index 4b243d6ff..b89d8c944 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -802,7 +802,7 @@ void AbstractClient::setupWindowManagementInterface() w->setShaded(isShade()); w->setResizable(isResizable()); w->setMovable(isMovable()); - w->setVirtualDesktopChangeable(true); // FIXME Matches Client::actionSupported(), but both should be implemented. + w->setVirtualDesktopChangeable(true); // FIXME Matches X11Client::actionSupported(), but both should be implemented. w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); w->setGeometry(geometry()); connect(this, &AbstractClient::skipTaskbarChanged, w, diff --git a/activation.cpp b/activation.cpp index 0c9a3af72..e22775897 100644 --- a/activation.cpp +++ b/activation.cpp @@ -26,7 +26,7 @@ along with this program. If not, see . */ -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "focuschain.h" #include "netinfo.h" @@ -92,7 +92,7 @@ namespace KWin futher user actions took place after the action leading to this new mapped window. This check is done by Workspace::allowClientActivation(). There are several ways how to get the timestamp of action that caused - the new mapped window (done in Client::readUserTimeMapTimestamp()) : + the new mapped window (done in X11Client::readUserTimeMapTimestamp()) : - the window may have the _NET_WM_USER_TIME property. This way the application may either explicitly request that the window is not activated (by using 0 timestamp), or the property contains the time @@ -131,7 +131,7 @@ namespace KWin than any user action done after launching this application. - if no timestamp is found at all, the window is activated. The check whether two windows belong to the same application (same - process) is done in Client::belongToSameApplication(). Not 100% reliable, + process) is done in X11Client::belongToSameApplication(). Not 100% reliable, but hopefully 99,99% reliable. As a somewhat special case, window activation is always enabled when @@ -170,7 +170,7 @@ namespace KWin - without ASN - user timestamp needs to be reset, otherwise it would be used, and it's old; moreover this new window mustn't be detected as window belonging to already running application, or it wouldn't - be activated - see Client::sameAppWindowRoleMatch() for the (rather ugly) + be activated - see X11Client::sameAppWindowRoleMatch() for the (rather ugly) hack - konqueror preloading, i.e. window is created in advance, and kfmclient tells this Konqueror instance to show it later @@ -326,8 +326,8 @@ void Workspace::activateClient(AbstractClient* c, bool force) // of the currently active window old, and reject further activation for it. // E.g. typing URL in minicli which will show kio_uiserver dialog (with workaround), // and then kdesktop shows dialog about SSL certificate. - // This needs also avoiding user creation time in Client::readUserTimeMapTimestamp(). - if (Client *client = dynamic_cast(c)) { + // This needs also avoiding user creation time in X11Client::readUserTimeMapTimestamp(). + if (X11Client *client = dynamic_cast(c)) { // updateUserTime is X11 specific client->updateUserTime(); } @@ -695,7 +695,7 @@ void Workspace::clientAttentionChanged(AbstractClient* c, bool set) * that qualifies for user interaction (clicking on it, activate it * externally, etc.). */ -void Client::updateUserTime(xcb_timestamp_t time) +void X11Client::updateUserTime(xcb_timestamp_t time) { // copied in Group::updateUserTime if (time == XCB_TIME_CURRENT_TIME) { @@ -711,13 +711,13 @@ void Client::updateUserTime(xcb_timestamp_t time) group()->updateUserTime(m_userTime); } -xcb_timestamp_t Client::readUserCreationTime() const +xcb_timestamp_t X11Client::readUserCreationTime() const { Xcb::Property prop(false, window(), atoms->kde_net_wm_user_creation_time, XCB_ATOM_CARDINAL, 0, 1); return prop.value(-1); } -xcb_timestamp_t Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id, const KStartupInfoData *asn_data, +xcb_timestamp_t X11Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id, const KStartupInfoData *asn_data, bool session) const { xcb_timestamp_t time = info->userTime(); @@ -741,21 +741,21 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id, c // Otherwise, refuse activation of a window // from already running application if this application // is not the active one (unless focus stealing prevention is turned off). - Client* act = dynamic_cast(workspace()->mostRecentlyActivatedClient()); + X11Client *act = dynamic_cast(workspace()->mostRecentlyActivatedClient()); if (act != nullptr && !belongToSameApplication(act, this, SameApplicationCheck::RelaxedForActive)) { bool first_window = true; - auto sameApplicationActiveHackPredicate = [this](const Client *cl) { + auto sameApplicationActiveHackPredicate = [this](const X11Client *cl) { // ignore already existing splashes, toolbars, utilities and menus, // as the app may show those before the main window return !cl->isSplash() && !cl->isToolbar() && !cl->isUtility() && !cl->isMenu() - && cl != this && Client::belongToSameApplication(cl, this, SameApplicationCheck::RelaxedForActive); + && cl != this && X11Client::belongToSameApplication(cl, this, SameApplicationCheck::RelaxedForActive); }; if (isTransient()) { auto clientMainClients = [this] () -> ClientList { ClientList ret; const auto mcs = mainClients(); for (auto mc: mcs) { - if (Client *c = dynamic_cast(mc)) { + if (X11Client *c = dynamic_cast(mc)) { ret << c; } } @@ -765,7 +765,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id, c ; // is transient for currently active window, even though it's not // the same app (e.g. kcookiejar dialog) -> allow activation else if (groupTransient() && - findInList(clientMainClients(), sameApplicationActiveHackPredicate) == nullptr) + findInList(clientMainClients(), sameApplicationActiveHackPredicate) == nullptr) ; // standalone transient else first_window = false; @@ -796,7 +796,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id, c return time; } -xcb_timestamp_t Client::userTime() const +xcb_timestamp_t X11Client::userTime() const { xcb_timestamp_t time = m_userTime; if (time == 0) // doesn't want focus after showing @@ -809,13 +809,13 @@ xcb_timestamp_t Client::userTime() const return time; } -void Client::doSetActive() +void X11Client::doSetActive() { updateUrgency(); // demand attention again if it's still urgent info->setState(isActive() ? NET::Focused : NET::States(), NET::Focused); } -void Client::startupIdChanged() +void X11Client::startupIdChanged() { KStartupInfoId asn_id; KStartupInfoData asn_data; @@ -844,7 +844,7 @@ void Client::startupIdChanged() } } -void Client::updateUrgency() +void X11Client::updateUrgency() { if (info->urgency()) demandAttention(); @@ -869,7 +869,7 @@ void Group::startupIdChanged() void Group::updateUserTime(xcb_timestamp_t time) { - // copy of Client::updateUserTime + // copy of X11Client::updateUserTime if (time == XCB_CURRENT_TIME) { updateXTime(); time = xTime(); diff --git a/activities.cpp b/activities.cpp index 262cd54bb..2f264d404 100644 --- a/activities.cpp +++ b/activities.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "activities.h" // KWin -#include "client.h" +#include "x11client.h" #include "workspace.h" // KDE #include @@ -72,7 +72,7 @@ void Activities::slotCurrentChanged(const QString &newActivity) void Activities::slotRemoved(const QString &activity) { - foreach (Client * client, Workspace::self()->clientList()) { + foreach (X11Client *client, Workspace::self()->clientList()) { client->setOnActivity(activity, false); } //toss out any session data for it @@ -80,7 +80,7 @@ void Activities::slotRemoved(const QString &activity) cg.deleteGroup(); } -void Activities::toggleClientOnActivity(Client* c, const QString &activity, bool dont_activate) +void Activities::toggleClientOnActivity(X11Client *c, const QString &activity, bool dont_activate) { //int old_desktop = c->desktop(); bool was_on_activity = c->isOnActivity(activity); @@ -109,7 +109,7 @@ void Activities::toggleClientOnActivity(Client* c, const QString &activity, bool for (auto it = transients_stacking_order.constBegin(); it != transients_stacking_order.constEnd(); ++it) { - Client *c = dynamic_cast(*it); + X11Client *c = dynamic_cast(*it); if (!c) { continue; } @@ -166,7 +166,7 @@ void Activities::reallyStop(const QString &id) QSet dontCloseSessionIds; const ClientList &clients = ws->clientList(); for (ClientList::const_iterator it = clients.constBegin(); it != clients.constEnd(); ++it) { - const Client* c = (*it); + const X11Client *c = (*it); const QByteArray sessionId = c->sessionId(); if (sessionId.isEmpty()) { continue; //TODO support old wm_command apps too? diff --git a/activities.h b/activities.h index af97787bc..15ed8de37 100644 --- a/activities.h +++ b/activities.h @@ -33,7 +33,7 @@ class Controller; namespace KWin { -class Client; +class X11Client; class KWIN_EXPORT Activities : public QObject { @@ -50,7 +50,7 @@ public: * * Takes care of transients as well. */ - void toggleClientOnActivity(Client* c, const QString &activity, bool dont_activate); + void toggleClientOnActivity(X11Client *c, const QString &activity, bool dont_activate); QStringList running() const; QStringList all() const; diff --git a/appmenu.cpp b/appmenu.cpp index 04e79d88b..89bc44ffb 100644 --- a/appmenu.cpp +++ b/appmenu.cpp @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "appmenu.h" -#include "client.h" +#include "x11client.h" #include "workspace.h" #include diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 786a6f8e7..bfb0f7894 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -249,9 +249,9 @@ set(testScreens_SRCS ../screens.cpp ../x11eventfilter.cpp mock_abstract_client.cpp - mock_client.cpp mock_screens.cpp mock_workspace.cpp + mock_x11client.cpp test_screens.cpp ) kconfig_add_kcfg_files(testScreens_SRCS ../settings.kcfgc) @@ -289,9 +289,9 @@ set(testScreenEdges_SRCS ../virtualdesktops.cpp ../xcbutils.cpp # init of extensions mock_abstract_client.cpp - mock_client.cpp mock_screens.cpp mock_workspace.cpp + mock_x11client.cpp test_screen_edges.cpp ) kconfig_add_kcfg_files(testScreenEdges_SRCS ../settings.kcfgc) diff --git a/autotests/client.h b/autotests/client.h deleted file mode 100644 index b821e1ba1..000000000 --- a/autotests/client.h +++ /dev/null @@ -1 +0,0 @@ -#include "mock_client.h" diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp index df6d88179..2fa987e87 100644 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "activities.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -135,7 +135,7 @@ void ActivitiesTest::testSetOnActivitiesValidates() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -160,7 +160,7 @@ void ActivitiesTest::testSetOnActivitiesValidates() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index 079a40f11..ee09587c6 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "platform.h" #include "rules.h" @@ -275,7 +275,7 @@ void TestDbusInterface::testGetWindowInfoX11Client() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QCOMPARE(client->clientSize(), windowGeometry.size()); @@ -388,7 +388,7 @@ void TestDbusInterface::testGetWindowInfoX11Client() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp index 7ece7f5f2..fa5108e24 100644 --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -151,7 +151,7 @@ void X11DesktopWindowTest::testDesktopWindow() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); @@ -167,7 +167,7 @@ void X11DesktopWindowTest::testDesktopWindow() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp index a7941ab86..c7e13cfb1 100644 --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "screenedge.h" @@ -114,7 +114,7 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -148,7 +148,7 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows() xcb_flush(c); xcb_disconnect(c); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/dont_crash_cancel_animation.cpp b/autotests/integration/dont_crash_cancel_animation.cpp index 3b19fd528..defa6d6e2 100644 --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "abstract_client.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "deleted.h" #include "effects.h" diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp index 7661b67f9..4c7fd90a2 100644 --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "composite.h" #include "effectloader.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "effects.h" #include "platform.h" diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp index 6a55a5dca..b760c0b23 100644 --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "scene.h" @@ -98,7 +98,7 @@ void DontCrashEmptyDecorationTest::testBug361551() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -113,7 +113,7 @@ void DontCrashEmptyDecorationTest::testBug361551() xcb_flush(c); xcb_disconnect(c); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/dont_crash_glxgears.cpp b/autotests/integration/dont_crash_glxgears.cpp index 998a68ccb..417994512 100644 --- a/autotests/integration/dont_crash_glxgears.cpp +++ b/autotests/integration/dont_crash_glxgears.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "abstract_client.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "screens.h" #include "wayland_server.h" @@ -67,9 +67,9 @@ void DontCrashGlxgearsTest::testGlxgears() QVERIFY(clientAddedSpy.wait()); QCOMPARE(clientAddedSpy.count(), 1); QCOMPARE(workspace()->clientList().count(), 1); - Client *glxgearsClient = workspace()->clientList().first(); + X11Client *glxgearsClient = workspace()->clientList().first(); QVERIFY(glxgearsClient->isDecorated()); - QSignalSpy closedSpy(glxgearsClient, &Client::windowClosed); + QSignalSpy closedSpy(glxgearsClient, &X11Client::windowClosed); QVERIFY(closedSpy.isValid()); KDecoration2::Decoration *decoration = glxgearsClient->decoration(); QVERIFY(decoration); diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp index 80097d6b5..a014b4f55 100644 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "scene.h" diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index 900bfae1e..b5dcca4bd 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "deleted.h" #include "effects.h" @@ -219,7 +219,7 @@ void SlidingPopupsTest::testWithOtherEffect() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isNormalWindow()); @@ -238,7 +238,7 @@ void SlidingPopupsTest::testWithOtherEffect() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted); @@ -357,7 +357,7 @@ void SlidingPopupsTest::testWithOtherEffectWayland() shellSurface.reset(); surface.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted); diff --git a/autotests/integration/effects/translucency_test.cpp b/autotests/integration/effects/translucency_test.cpp index 222214217..db2510321 100644 --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "effects.h" #include "effectloader.h" @@ -151,7 +151,7 @@ void TranslucencyTest::testMoveAfterDesktopChange() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -179,7 +179,7 @@ void TranslucencyTest::testMoveAfterDesktopChange() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); xcb_destroy_window(c.data(), w); @@ -219,7 +219,7 @@ void TranslucencyTest::testDialogClose() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -231,7 +231,7 @@ void TranslucencyTest::testDialogClose() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted); diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp index d205e3b31..dcbcbd62f 100644 --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "effects.h" @@ -139,7 +139,7 @@ void WobblyWindowsShadeTest::testShadeMove() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index ac26305c4..5c3b9c226 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "input.h" #include "internal_client.h" @@ -262,7 +262,7 @@ void GlobalShortcutsTest::testX11ClientShortcut() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QCOMPARE(workspace()->activeClient(), client); @@ -293,7 +293,7 @@ void GlobalShortcutsTest::testX11ClientShortcut() kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); // destroy window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index 87dfc93e5..f303a132c 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "atoms.h" #include "platform.h" #include "abstract_client.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "effects.h" #include "screens.h" @@ -681,7 +681,7 @@ void MoveResizeWindowTest::testNetMove() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); const QRect origGeo = client->geometry(); @@ -690,11 +690,11 @@ void MoveResizeWindowTest::testNetMove() Cursor::setPos(screens()->geometry(0).center()); QVERIFY(!origGeo.contains(Cursor::pos())); - QSignalSpy moveStartSpy(client, &Client::clientStartUserMovedResized); + QSignalSpy moveStartSpy(client, &X11Client::clientStartUserMovedResized); QVERIFY(moveStartSpy.isValid()); - QSignalSpy moveEndSpy(client, &Client::clientFinishUserMovedResized); + QSignalSpy moveEndSpy(client, &X11Client::clientFinishUserMovedResized); QVERIFY(moveEndSpy.isValid()); - QSignalSpy moveStepSpy(client, &Client::clientStepUserMovedResized); + QSignalSpy moveStepSpy(client, &X11Client::clientStepUserMovedResized); QVERIFY(moveStepSpy.isValid()); QVERIFY(!workspace()->moveResizeClient()); @@ -725,7 +725,7 @@ void MoveResizeWindowTest::testNetMove() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } @@ -770,7 +770,7 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *panel = windowCreatedSpy.first().first().value(); + X11Client *panel = windowCreatedSpy.first().first().value(); QVERIFY(panel); QCOMPARE(panel->window(), w); QCOMPARE(panel->geometry(), panelGeometry); @@ -808,7 +808,7 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel() xcb_flush(c.data()); c.reset(); - QSignalSpy panelClosedSpy(panel, &Client::windowClosed); + QSignalSpy panelClosedSpy(panel, &X11Client::windowClosed); QVERIFY(panelClosedSpy.isValid()); QVERIFY(panelClosedSpy.wait()); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index a9bee087d..48510cb12 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "screenedge.h" #include "screens.h" @@ -137,7 +137,7 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -187,7 +187,7 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index aca43f5fe..4b862b802 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "abstract_client.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" @@ -600,7 +600,7 @@ void QuickTilingTest::testX11QuickTiling() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); @@ -629,7 +629,7 @@ void QuickTilingTest::testX11QuickTiling() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } @@ -680,7 +680,7 @@ void QuickTilingTest::testX11QuickTilingAfterVertMaximize() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); @@ -708,7 +708,7 @@ void QuickTilingTest::testX11QuickTilingAfterVertMaximize() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp index 76c0aae8c..d646307f4 100644 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "composite.h" #include "effectloader.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "effects.h" #include "platform.h" @@ -345,7 +345,7 @@ void SceneQPainterTest::testX11Window() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QCOMPARE(client->clientSize(), QSize(100, 200)); @@ -382,7 +382,7 @@ void SceneQPainterTest::testX11Window() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp index 64f2641d1..65d808ec4 100644 --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -140,7 +140,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(!client->isDecorated()); QCOMPARE(client->geometry(), windowGeometry); @@ -158,7 +158,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11() QSignalSpy effectsWindowHiddenSpy(effects, &EffectsHandler::windowHidden); QVERIFY(effectsWindowHiddenSpy.isValid()); - QSignalSpy clientHiddenSpy(client, &Client::windowHidden); + QSignalSpy clientHiddenSpy(client, &X11Client::windowHidden); QVERIFY(clientHiddenSpy.isValid()); QVERIFY(clientHiddenSpy.wait()); QVERIFY(client->isHiddenInternal()); @@ -189,7 +189,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11() QVERIFY(client->isHiddenInternal()); // destroy window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); @@ -244,7 +244,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(!client->isDecorated()); QCOMPARE(client->geometry(), windowGeometry); @@ -262,7 +262,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch() QSignalSpy effectsWindowHiddenSpy(effects, &EffectsHandler::windowHidden); QVERIFY(effectsWindowHiddenSpy.isValid()); - QSignalSpy clientHiddenSpy(client, &Client::windowHidden); + QSignalSpy clientHiddenSpy(client, &X11Client::windowHidden); QVERIFY(clientHiddenSpy.isValid()); QVERIFY(clientHiddenSpy.wait()); QVERIFY(client->isHiddenInternal()); @@ -282,7 +282,7 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch() QCOMPARE(effectsWindowShownSpy.count(), 1); // destroy window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/shade_test.cpp b/autotests/integration/shade_test.cpp index b70d886ad..7fd932cf1 100644 --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "screenedge.h" #include "screens.h" @@ -106,7 +106,7 @@ void ShadeTest::testShadeGeometry() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isDecorated()); @@ -132,7 +132,7 @@ void ShadeTest::testShadeGeometry() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } diff --git a/autotests/integration/stacking_order_test.cpp b/autotests/integration/stacking_order_test.cpp index 12a1501bf..e53be80e7 100644 --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "abstract_client.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "main.h" #include "platform.h" @@ -370,7 +370,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *leader = windowCreatedSpy.first().first().value(); + X11Client *leader = windowCreatedSpy.first().first().value(); QVERIFY(leader); QVERIFY(leader->isActive()); QCOMPARE(leader->windowId(), leaderWid); @@ -385,7 +385,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member1 = windowCreatedSpy.first().first().value(); + X11Client *member1 = windowCreatedSpy.first().first().value(); QVERIFY(member1); QVERIFY(member1->isActive()); QCOMPARE(member1->windowId(), member1Wid); @@ -401,7 +401,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member2 = windowCreatedSpy.first().first().value(); + X11Client *member2 = windowCreatedSpy.first().first().value(); QVERIFY(member2); QVERIFY(member2->isActive()); QCOMPARE(member2->windowId(), member2Wid); @@ -439,7 +439,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *transient = windowCreatedSpy.first().first().value(); + X11Client *transient = windowCreatedSpy.first().first().value(); QVERIFY(transient); QVERIFY(transient->isActive()); QCOMPARE(transient->windowId(), transientWid); @@ -484,7 +484,7 @@ void StackingOrderTest::testRaiseGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *leader = windowCreatedSpy.first().first().value(); + X11Client *leader = windowCreatedSpy.first().first().value(); QVERIFY(leader); QVERIFY(leader->isActive()); QCOMPARE(leader->windowId(), leaderWid); @@ -499,7 +499,7 @@ void StackingOrderTest::testRaiseGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member1 = windowCreatedSpy.first().first().value(); + X11Client *member1 = windowCreatedSpy.first().first().value(); QVERIFY(member1); QVERIFY(member1->isActive()); QCOMPARE(member1->windowId(), member1Wid); @@ -515,7 +515,7 @@ void StackingOrderTest::testRaiseGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member2 = windowCreatedSpy.first().first().value(); + X11Client *member2 = windowCreatedSpy.first().first().value(); QVERIFY(member2); QVERIFY(member2->isActive()); QCOMPARE(member2->windowId(), member2Wid); @@ -553,7 +553,7 @@ void StackingOrderTest::testRaiseGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *transient = windowCreatedSpy.first().first().value(); + X11Client *transient = windowCreatedSpy.first().first().value(); QVERIFY(transient); QVERIFY(transient->isActive()); QCOMPARE(transient->windowId(), transientWid); @@ -618,7 +618,7 @@ void StackingOrderTest::testDeletedGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *leader = windowCreatedSpy.first().first().value(); + X11Client *leader = windowCreatedSpy.first().first().value(); QVERIFY(leader); QVERIFY(leader->isActive()); QCOMPARE(leader->windowId(), leaderWid); @@ -633,7 +633,7 @@ void StackingOrderTest::testDeletedGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member1 = windowCreatedSpy.first().first().value(); + X11Client *member1 = windowCreatedSpy.first().first().value(); QVERIFY(member1); QVERIFY(member1->isActive()); QCOMPARE(member1->windowId(), member1Wid); @@ -649,7 +649,7 @@ void StackingOrderTest::testDeletedGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member2 = windowCreatedSpy.first().first().value(); + X11Client *member2 = windowCreatedSpy.first().first().value(); QVERIFY(member2); QVERIFY(member2->isActive()); QCOMPARE(member2->windowId(), member2Wid); @@ -687,7 +687,7 @@ void StackingOrderTest::testDeletedGroupTransient() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *transient = windowCreatedSpy.first().first().value(); + X11Client *transient = windowCreatedSpy.first().first().value(); QVERIFY(transient); QVERIFY(transient->isActive()); QCOMPARE(transient->windowId(), transientWid); @@ -699,14 +699,14 @@ void StackingOrderTest::testDeletedGroupTransient() QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient})); // Unmap the transient. - connect(transient, &Client::windowClosed, this, + connect(transient, &X11Client::windowClosed, this, [](Toplevel *toplevel, Deleted *deleted) { Q_UNUSED(toplevel) deleted->refWindow(); } ); - QSignalSpy windowClosedSpy(transient, &Client::windowClosed); + QSignalSpy windowClosedSpy(transient, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(conn.data(), transientWid); xcb_flush(conn.data()); @@ -738,7 +738,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *leader = windowCreatedSpy.first().first().value(); + X11Client *leader = windowCreatedSpy.first().first().value(); QVERIFY(leader); QVERIFY(leader->isActive()); QCOMPARE(leader->windowId(), leaderWid); @@ -753,7 +753,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member1 = windowCreatedSpy.first().first().value(); + X11Client *member1 = windowCreatedSpy.first().first().value(); QVERIFY(member1); QVERIFY(member1->isActive()); QCOMPARE(member1->windowId(), member1Wid); @@ -769,7 +769,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *member2 = windowCreatedSpy.first().first().value(); + X11Client *member2 = windowCreatedSpy.first().first().value(); QVERIFY(member2); QVERIFY(member2->isActive()); QCOMPARE(member2->windowId(), member2Wid); @@ -786,7 +786,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients() xcb_flush(conn.data()); QVERIFY(windowCreatedSpy.wait()); - Client *transient = windowCreatedSpy.first().first().value(); + X11Client *transient = windowCreatedSpy.first().first().value(); QVERIFY(transient); QVERIFY(transient->isActive()); QCOMPARE(transient->windowId(), transientWid); diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index 943f119b3..ce156cebf 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -600,7 +600,7 @@ void StrutsTest::testX11Struts() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); @@ -636,7 +636,7 @@ void StrutsTest::testX11Struts() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); @@ -713,7 +713,7 @@ void StrutsTest::test363804() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); @@ -733,7 +733,7 @@ void StrutsTest::test363804() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } @@ -793,7 +793,7 @@ void StrutsTest::testLeftScreenSmallerBottomAligned() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); @@ -824,14 +824,14 @@ void StrutsTest::testLeftScreenSmallerBottomAligned() xcb_map_window(c.data(), w2); xcb_flush(c.data()); QVERIFY(windowCreatedSpy.wait()); - Client *client2 = windowCreatedSpy.last().first().value(); + X11Client *client2 = windowCreatedSpy.last().first().value(); QVERIFY(client2); QVERIFY(client2 != client); QVERIFY(client2->isDecorated()); QCOMPARE(client2->geometry(), QRect(0, 306, 1366, 744)); QCOMPARE(client2->maximizeMode(), KWin::MaximizeFull); // destroy window again - QSignalSpy normalWindowClosedSpy(client2, &Client::windowClosed); + QSignalSpy normalWindowClosedSpy(client2, &X11Client::windowClosed); QVERIFY(normalWindowClosedSpy.isValid()); xcb_unmap_window(c.data(), w2); xcb_destroy_window(c.data(), w2); @@ -844,7 +844,7 @@ void StrutsTest::testLeftScreenSmallerBottomAligned() xcb_flush(c.data()); c.reset(); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); } @@ -905,7 +905,7 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); @@ -938,7 +938,7 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens() xcb_map_window(c.data(), w2); xcb_flush(c.data()); QVERIFY(windowCreatedSpy.wait()); - Client *client2 = windowCreatedSpy.last().first().value(); + X11Client *client2 = windowCreatedSpy.last().first().value(); QVERIFY(client2); QVERIFY(client2 != client); QVERIFY(client2->isDecorated()); diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp index 59fde8ef5..6302b9740 100644 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -142,7 +142,7 @@ void WindowRuleTest::testApplyInitialMaximizeVert() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(client->isDecorated()); QVERIFY(!client->hasStrut()); @@ -158,7 +158,7 @@ void WindowRuleTest::testApplyInitialMaximizeVert() QCOMPARE(client->maximizeMode(), MaximizeVertical); // destroy window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); @@ -213,7 +213,7 @@ void WindowRuleTest::testWindowClassChange() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(client->isDecorated()); QVERIFY(!client->hasStrut()); @@ -229,7 +229,7 @@ void WindowRuleTest::testWindowClassChange() QCOMPARE(client->keepAbove(), false); // now change class - QSignalSpy windowClassChangedSpy{client, &Client::windowClassChanged}; + QSignalSpy windowClassChangedSpy{client, &X11Client::windowClassChanged}; QVERIFY(windowClassChangedSpy.isValid()); xcb_icccm_set_wm_class(c.data(), w, 23, "org.kde.foo\0org.kde.foo"); xcb_flush(c.data()); @@ -237,7 +237,7 @@ void WindowRuleTest::testWindowClassChange() QCOMPARE(client->keepAbove(), true); // destroy window - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); diff --git a/autotests/integration/x11_client_test.cpp b/autotests/integration/x11_client_test.cpp index ae5ebe52a..3d4792ec8 100644 --- a/autotests/integration/x11_client_test.cpp +++ b/autotests/integration/x11_client_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "effects.h" #include "effectloader.h" @@ -138,7 +138,7 @@ void X11ClientTest::testTrimCaption() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QFETCH(QByteArray, expectedTitle); @@ -148,7 +148,7 @@ void X11ClientTest::testTrimCaption() xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); xcb_destroy_window(c.data(), w); @@ -184,7 +184,7 @@ void X11ClientTest::testFullscreenLayerWithActiveWaylandWindow() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(!client->isFullScreen()); @@ -302,7 +302,7 @@ void X11ClientTest::testFocusInWithWaylandLastActiveWindow() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); QVERIFY(client->isActive()); @@ -359,7 +359,7 @@ void X11ClientTest::testX11WindowId() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->windowId(), w); QVERIFY(client->isActive()); @@ -369,7 +369,7 @@ void X11ClientTest::testX11WindowId() QUuid deletedUuid; QCOMPARE(deletedUuid.isNull(), true); - connect(client, &Client::windowClosed, this, [&deletedUuid] (Toplevel *, Deleted *d) { deletedUuid = d->internalId(); }); + connect(client, &X11Client::windowClosed, this, [&deletedUuid] (Toplevel *, Deleted *d) { deletedUuid = d->internalId(); }); NETRootInfo rootInfo(c.data(), NET::WMAllProperties); @@ -398,7 +398,7 @@ void X11ClientTest::testX11WindowId() // and destroy the window again xcb_unmap_window(c.data(), w); xcb_flush(c.data()); - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); QVERIFY(windowClosedSpy.wait()); @@ -434,12 +434,12 @@ void X11ClientTest::testCaptionChanges() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->windowId(), w); QCOMPARE(client->caption(), QStringLiteral("foo")); - QSignalSpy captionChangedSpy(client, &Client::captionChanged); + QSignalSpy captionChangedSpy(client, &X11Client::captionChanged); QVERIFY(captionChangedSpy.isValid()); info.setName("bar"); xcb_flush(c.data()); @@ -447,7 +447,7 @@ void X11ClientTest::testCaptionChanges() QCOMPARE(client->caption(), QStringLiteral("bar")); // and destroy the window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_flush(c.data()); @@ -471,7 +471,7 @@ void X11ClientTest::testCaptionWmName() QVERIFY(clientAddedSpy.wait()); QCOMPARE(clientAddedSpy.count(), 1); QCOMPARE(workspace()->clientList().count(), 1); - Client *glxgearsClient = workspace()->clientList().first(); + X11Client *glxgearsClient = workspace()->clientList().first(); QCOMPARE(glxgearsClient->caption(), QStringLiteral("glxgears")); glxgears.terminate(); @@ -505,7 +505,7 @@ void X11ClientTest::testCaptionMultipleWindows() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->windowId(), w); QCOMPARE(client->caption(), QStringLiteral("foo")); @@ -527,7 +527,7 @@ void X11ClientTest::testCaptionMultipleWindows() windowCreatedSpy.clear(); QVERIFY(windowCreatedSpy.wait()); - Client *client2 = windowCreatedSpy.first().first().value(); + X11Client *client2 = windowCreatedSpy.first().first().value(); QVERIFY(client2); QCOMPARE(client2->windowId(), w2); QCOMPARE(client2->caption(), QStringLiteral("foo <2>\u200E")); @@ -535,7 +535,7 @@ void X11ClientTest::testCaptionMultipleWindows() QCOMPARE(QByteArray(info3.visibleName()), QByteArrayLiteral("foo <2>\u200E")); QCOMPARE(QByteArray(info3.visibleIconName()), QByteArrayLiteral("foo <2>\u200E")); - QSignalSpy captionChangedSpy(client2, &Client::captionChanged); + QSignalSpy captionChangedSpy(client2, &X11Client::captionChanged); QVERIFY(captionChangedSpy.isValid()); NETWinInfo info4(c.data(), w2, kwinApp()->x11RootWindow(), NET::Properties(), NET::Properties2()); @@ -580,7 +580,7 @@ void X11ClientTest::testFullscreenWindowGroups() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.first().first().value(); + X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->windowId(), w); QCOMPARE(client->isActive(), true); @@ -610,7 +610,7 @@ void X11ClientTest::testFullscreenWindowGroups() xcb_flush(c.data()); QVERIFY(windowCreatedSpy.wait()); - Client *client2 = windowCreatedSpy.first().first().value(); + X11Client *client2 = windowCreatedSpy.first().first().value(); QVERIFY(client2); QVERIFY(client != client2); QCOMPARE(client2->windowId(), w2); diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp index dcb2e9756..92e3bc9ac 100644 --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -171,7 +171,7 @@ void XWaylandInputTest::testPointerEnterLeave() QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); QVERIFY(windowCreatedSpy.isValid()); QVERIFY(windowCreatedSpy.wait()); - Client *client = windowCreatedSpy.last().first().value(); + X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(client->isDecorated()); QVERIFY(!client->hasStrut()); @@ -198,7 +198,7 @@ void XWaylandInputTest::testPointerEnterLeave() QVERIFY(leftSpy.wait()); // destroy window again - QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); QVERIFY(windowClosedSpy.isValid()); xcb_unmap_window(c.data(), w); xcb_destroy_window(c.data(), w); diff --git a/autotests/mock_workspace.h b/autotests/mock_workspace.h index f55a51c0c..2f958a903 100644 --- a/autotests/mock_workspace.h +++ b/autotests/mock_workspace.h @@ -27,7 +27,7 @@ namespace KWin { class AbstractClient; -class Client; +class X11Client; class X11EventFilter; class MockWorkspace; @@ -58,7 +58,7 @@ public: static Workspace *self(); Q_SIGNALS: - void clientRemoved(KWin::Client*); + void clientRemoved(KWin::X11Client *); private: AbstractClient *m_activeClient; diff --git a/autotests/mock_client.cpp b/autotests/mock_x11client.cpp similarity index 87% rename from autotests/mock_client.cpp rename to autotests/mock_x11client.cpp index 88b5fa669..a1718e6fc 100644 --- a/autotests/mock_client.cpp +++ b/autotests/mock_x11client.cpp @@ -17,19 +17,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ -#include "mock_client.h" +#include "mock_x11client.h" namespace KWin { -Client::Client(QObject *parent) +X11Client::X11Client(QObject *parent) : AbstractClient(parent) { } -Client::~Client() = default; +X11Client::~X11Client() = default; -void Client::showOnScreenEdge() +void X11Client::showOnScreenEdge() { setKeepBelow(false); setHiddenInternal(false); diff --git a/autotests/mock_client.h b/autotests/mock_x11client.h similarity index 91% rename from autotests/mock_client.h rename to autotests/mock_x11client.h index 7900f80dc..6338fd25d 100644 --- a/autotests/mock_client.h +++ b/autotests/mock_x11client.h @@ -28,12 +28,12 @@ along with this program. If not, see . namespace KWin { -class Client : public AbstractClient +class X11Client : public AbstractClient { Q_OBJECT public: - explicit Client(QObject *parent); - ~Client() override; + explicit X11Client(QObject *parent); + ~X11Client() override; void showOnScreenEdge() override; }; diff --git a/autotests/test_screen_edges.cpp b/autotests/test_screen_edges.cpp index f349f515e..044d93443 100644 --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -28,9 +28,9 @@ along with this program. If not, see . #include "../utils.h" #include "../virtualdesktops.h" #include "../xcbutils.h" -#include "mock_client.h" #include "mock_screens.h" #include "mock_workspace.h" +#include "mock_x11client.h" #include "testutils.h" // Frameworks #include @@ -395,7 +395,7 @@ void TestScreenEdges::testCreatingInitialEdges() } // let's start a move of window. - Client client(workspace()); + X11Client client(workspace()); workspace()->setMoveResizeClient(&client); for (int i = 0; i < 8; ++i) { auto e = edges.at(i); @@ -667,7 +667,7 @@ void TestScreenEdges::testFullScreenBlocking() { using namespace KWin; MockWorkspace ws; - Client client(&ws); + X11Client client(&ws); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); config->group("Windows").writeEntry("ElectricBorderPushbackPixels", 1); config->sync(); @@ -781,7 +781,7 @@ void TestScreenEdges::testFullScreenBlocking() void TestScreenEdges::testClientEdge() { using namespace KWin; - Client client(workspace()); + X11Client client(workspace()); client.setGeometry(QRect(10, 50, 10, 50)); auto s = ScreenEdges::self(); s->init(); diff --git a/autotests/test_screens.cpp b/autotests/test_screens.cpp index fcb8e0ee3..4d42658ef 100644 --- a/autotests/test_screens.cpp +++ b/autotests/test_screens.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "mock_workspace.h" #include "../cursor.h" #include "mock_screens.h" -#include "mock_client.h" +#include "mock_x11client.h" // frameworks #include // Qt @@ -265,7 +265,7 @@ void TestScreens::testCurrentClient() QVERIFY(currentChangedSpy.isValid()); // create a mock client - Client *client = new Client(&ws); + X11Client *client = new X11Client(&ws); client->setScreen(1); // it's not the active client, so changing won't work diff --git a/autotests/x11client.h b/autotests/x11client.h new file mode 100644 index 000000000..0e5bef1db --- /dev/null +++ b/autotests/x11client.h @@ -0,0 +1 @@ +#include "mock_x11client.h" diff --git a/composite.cpp b/composite.cpp index 319fb5ce2..683b5a564 100644 --- a/composite.cpp +++ b/composite.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "composite.h" #include "dbusinterface.h" -#include "client.h" +#include "x11client.h" #include "decorations/decoratedclient.h" #include "deleted.h" #include "effects.h" @@ -348,11 +348,11 @@ void Compositor::startupWithWorkspace() connect(Workspace::self(), &Workspace::deletedRemoved, m_scene, &Scene::removeToplevel); connect(effects, &EffectsHandler::screenGeometryChanged, this, &Compositor::addRepaintFull); - for (Client *c : Workspace::self()->clientList()) { + for (X11Client *c : Workspace::self()->clientList()) { c->setupCompositing(); c->getShadow(); } - for (Client *c : Workspace::self()->desktopList()) { + for (X11Client *c : Workspace::self()->desktopList()) { c->setupCompositing(); } for (Unmanaged *c : Workspace::self()->unmanagedList()) { @@ -407,10 +407,10 @@ void Compositor::stop() effects = nullptr; if (Workspace::self()) { - for (Client *c : Workspace::self()->clientList()) { + for (X11Client *c : Workspace::self()->clientList()) { m_scene->removeToplevel(c); } - for (Client *c : Workspace::self()->desktopList()) { + for (X11Client *c : Workspace::self()->desktopList()) { m_scene->removeToplevel(c); } for (Unmanaged *c : Workspace::self()->unmanagedList()) { @@ -419,10 +419,10 @@ void Compositor::stop() for (InternalClient *client : workspace()->internalClients()) { m_scene->removeToplevel(client); } - for (Client *c : Workspace::self()->clientList()) { + for (X11Client *c : Workspace::self()->clientList()) { c->finishCompositing(); } - for (Client *c : Workspace::self()->desktopList()) { + for (X11Client *c : Workspace::self()->desktopList()) { c->finishCompositing(); } for (Unmanaged *c : Workspace::self()->unmanagedList()) { @@ -1009,7 +1009,7 @@ int X11Compositor::refreshRate() const return m_xrrRefreshRate; } -void X11Compositor::updateClientCompositeBlocking(Client *c) +void X11Compositor::updateClientCompositeBlocking(X11Client *c) { if (c) { if (c->isBlockingCompositing()) { diff --git a/composite.h b/composite.h index 0dc0d8d0d..62825ea19 100644 --- a/composite.h +++ b/composite.h @@ -30,9 +30,9 @@ along with this program. If not, see . namespace KWin { -class Client; class CompositorSelectionOwner; class Scene; +class X11Client; class KWIN_EXPORT Compositor : public QObject { @@ -252,7 +252,7 @@ public: int refreshRate() const override; - void updateClientCompositeBlocking(Client *client = nullptr); + void updateClientCompositeBlocking(X11Client *client = nullptr); static X11Compositor *self(); diff --git a/debug_console.cpp b/debug_console.cpp index ad3211c51..1c4c5fe9d 100644 --- a/debug_console.cpp +++ b/debug_console.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "debug_console.h" #include "composite.h" -#include "client.h" +#include "x11client.h" #include "input_event.h" #include "internal_client.h" #include "main.h" @@ -817,13 +817,13 @@ DebugConsoleModel::DebugConsoleModel(QObject *parent) m_x11Clients.append(c); } connect(workspace(), &Workspace::clientAdded, this, - [this] (Client *c) { + [this] (X11Client *c) { add(s_x11ClientId -1, m_x11Clients, c); } ); connect(workspace(), &Workspace::clientRemoved, this, [this] (AbstractClient *ac) { - Client *c = qobject_cast(ac); + X11Client *c = qobject_cast(ac); if (!c) { return; } @@ -1117,7 +1117,7 @@ QVariant DebugConsoleModel::data(const QModelIndex &index, int role) const return propertyData(c, index, role); } else if (InternalClient *c = internalClient(index)) { return propertyData(c, index, role); - } else if (Client *c = x11Client(index)) { + } else if (X11Client *c = x11Client(index)) { return propertyData(c, index, role); } else if (Unmanaged *u = unmanaged(index)) { return propertyData(u, index, role); @@ -1171,7 +1171,7 @@ InternalClient *DebugConsoleModel::internalClient(const QModelIndex &index) cons return clientForIndex(index, m_internalClients, s_workspaceInternalId); } -Client *DebugConsoleModel::x11Client(const QModelIndex &index) const +X11Client *DebugConsoleModel::x11Client(const QModelIndex &index) const { return clientForIndex(index, m_x11Clients, s_x11ClientId); } diff --git a/debug_console.h b/debug_console.h index 9ecb78c58..c71da6a3d 100644 --- a/debug_console.h +++ b/debug_console.h @@ -39,7 +39,7 @@ class DebugConsole; namespace KWin { -class Client; +class X11Client; class InternalClient; class XdgShellClient; class Unmanaged; @@ -75,13 +75,13 @@ private: void remove(int parentRow, QVector &clients, T *client); XdgShellClient *shellClient(const QModelIndex &index) const; InternalClient *internalClient(const QModelIndex &index) const; - Client *x11Client(const QModelIndex &index) const; + X11Client *x11Client(const QModelIndex &index) const; Unmanaged *unmanaged(const QModelIndex &index) const; int topLevelRowCount() const; QVector m_shellClients; QVector m_internalClients; - QVector m_x11Clients; + QVector m_x11Clients; QVector m_unmanageds; }; diff --git a/deleted.cpp b/deleted.cpp index 80d9aa3d9..6ab998d71 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -21,7 +21,7 @@ along with this program. If not, see . #include "deleted.h" #include "workspace.h" -#include "client.h" +#include "x11client.h" #include "group.h" #include "netinfo.h" #include "shadow.h" @@ -147,7 +147,7 @@ void Deleted::copyToDeleted(Toplevel* c) } m_wasWaylandClient = qobject_cast(c) != nullptr; - m_wasX11Client = qobject_cast(c) != nullptr; + m_wasX11Client = qobject_cast(c) != nullptr; m_wasPopupWindow = c->isPopupWindow(); m_wasOutline = c->isOutline(); } diff --git a/effects.cpp b/effects.cpp index e1df727f4..7290f1dfb 100644 --- a/effects.cpp +++ b/effects.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "activities.h" #endif #include "deleted.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "group.h" #include "internal_client.h" @@ -166,7 +166,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) } ); connect(ws, &Workspace::clientAdded, this, - [this](Client *c) { + [this](X11Client *c) { if (c->readyForPainting()) slotClientShown(c); else @@ -246,7 +246,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) } // connect all clients - for (Client *c : ws->clientList()) { + for (X11Client *c : ws->clientList()) { setupClientConnections(c); } for (Unmanaged *u : ws->unmanagedList()) { @@ -367,10 +367,10 @@ void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c) ); } -void EffectsHandlerImpl::setupClientConnections(Client* c) +void EffectsHandlerImpl::setupClientConnections(X11Client *c) { setupAbstractClientConnections(c); - connect(c, &Client::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged); + connect(c, &X11Client::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged); } void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u) @@ -567,8 +567,8 @@ void EffectsHandlerImpl::slotOpacityChanged(Toplevel *t, qreal oldOpacity) void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t) { - Q_ASSERT(qobject_cast(t)); - Client *c = static_cast(t); + Q_ASSERT(qobject_cast(t)); + X11Client *c = static_cast(t); disconnect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown); setupClientConnections(c); emit windowAdded(c->effectWindow()); @@ -599,7 +599,7 @@ void EffectsHandlerImpl::slotWindowClosed(KWin::Toplevel *c, KWin::Deleted *d) void EffectsHandlerImpl::slotClientModalityChanged() { - emit windowModalityChanged(static_cast(sender())->effectWindow()); + emit windowModalityChanged(static_cast(sender())->effectWindow()); } void EffectsHandlerImpl::slotCurrentTabAboutToChange(EffectWindow *from, EffectWindow *to) @@ -1073,7 +1073,7 @@ WindowQuadType EffectsHandlerImpl::newWindowQuadType() EffectWindow* EffectsHandlerImpl::findWindow(WId id) const { - if (Client* w = Workspace::self()->findClient(Predicate::WindowMatch, id)) + if (X11Client *w = Workspace::self()->findClient(Predicate::WindowMatch, id)) return w->effectWindow(); if (Unmanaged* w = Workspace::self()->findUnmanaged(id)) return w->effectWindow(); @@ -1721,7 +1721,7 @@ EffectWindowImpl::EffectWindowImpl(Toplevel *toplevel) managed = toplevel->isClient(); waylandClient = qobject_cast(toplevel) != nullptr; - x11Client = qobject_cast(toplevel) != nullptr; + x11Client = qobject_cast(toplevel) != nullptr; } EffectWindowImpl::~EffectWindowImpl() @@ -1775,7 +1775,7 @@ void EffectWindowImpl::addLayerRepaint(int x, int y, int w, int h) const EffectWindowGroup* EffectWindowImpl::group() const { - if (auto c = qobject_cast(toplevel)) { + if (auto c = qobject_cast(toplevel)) { return c->group()->effectGroup(); } return nullptr; // TODO @@ -1914,7 +1914,7 @@ CLIENT_HELPER(bool, isUnresponsive, unresponsive, false) QSize EffectWindowImpl::basicUnit() const { - if (auto client = qobject_cast(toplevel)){ + if (auto client = qobject_cast(toplevel)){ return client->basicUnit(); } return QSize(1,1); @@ -1938,7 +1938,7 @@ QRegion EffectWindowImpl::shape() const QRect EffectWindowImpl::decorationInnerRect() const { - auto client = qobject_cast(toplevel); + auto client = qobject_cast(toplevel); return client ? client->transparentRect() : contentsRect(); } diff --git a/effects.h b/effects.h index de12c3fde..6984c1ce6 100644 --- a/effects.h +++ b/effects.h @@ -55,13 +55,13 @@ class DesktopThumbnailItem; class WindowThumbnailItem; class AbstractClient; -class Client; class Compositor; class Deleted; class EffectLoader; class Toplevel; class Unmanaged; class WindowPropertyNotifyX11Filter; +class X11Client; class KWIN_EXPORT EffectsHandlerImpl : public EffectsHandler { @@ -306,7 +306,7 @@ protected: void disconnectNotify(const QMetaMethod &signal) override; void effectsChanged(); void setupAbstractClientConnections(KWin::AbstractClient *c); - void setupClientConnections(KWin::Client *c); + void setupClientConnections(KWin::X11Client *c); void setupUnmanagedConnections(KWin::Unmanaged *u); /** diff --git a/events.cpp b/events.cpp index b49e6008c..e1a9fe28f 100644 --- a/events.cpp +++ b/events.cpp @@ -25,7 +25,7 @@ along with this program. If not, see . */ -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "focuschain.h" #include "netinfo.h" @@ -257,16 +257,16 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) const xcb_window_t eventWindow = findEventWindow(e); if (eventWindow != XCB_WINDOW_NONE) { - if (Client* c = findClient(Predicate::WindowMatch, eventWindow)) { + if (X11Client *c = findClient(Predicate::WindowMatch, eventWindow)) { if (c->windowEvent(e)) return true; - } else if (Client* c = findClient(Predicate::WrapperIdMatch, eventWindow)) { + } else if (X11Client *c = findClient(Predicate::WrapperIdMatch, eventWindow)) { if (c->windowEvent(e)) return true; - } else if (Client* c = findClient(Predicate::FrameIdMatch, eventWindow)) { + } else if (X11Client *c = findClient(Predicate::FrameIdMatch, eventWindow)) { if (c->windowEvent(e)) return true; - } else if (Client *c = findClient(Predicate::InputIdMatch, eventWindow)) { + } else if (X11Client *c = findClient(Predicate::InputIdMatch, eventWindow)) { if (c->windowEvent(e)) return true; } else if (Unmanaged* c = findUnmanaged(eventWindow)) { @@ -301,7 +301,7 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) updateXTime(); const auto *event = reinterpret_cast(e); - if (Client* c = findClient(Predicate::WindowMatch, event->window)) { + if (X11Client *c = findClient(Predicate::WindowMatch, event->window)) { // e->xmaprequest.window is different from e->xany.window // TODO this shouldn't be necessary now c->windowEvent(e); @@ -312,7 +312,7 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) // a chance to reparent it back to root // since KWin can get MapRequest only for root window children and // children of WindowWrapper (=clients), the check is AFAIK useless anyway - // NOTICE: The save-set support in Client::mapRequestEvent() actually requires that + // NOTICE: The save-set support in X11Client::mapRequestEvent() actually requires that // this code doesn't check the parent to be root. if (!createClient(event->window, false)) { xcb_map_window(connection(), event->window); @@ -411,7 +411,7 @@ bool Workspace::workspaceEvent(QEvent* e) /** * General handler for XEvents concerning the client window */ -bool Client::windowEvent(xcb_generic_event_t *e) +bool X11Client::windowEvent(xcb_generic_event_t *e) { if (findEventWindow(e) == window()) { // avoid doing stuff on frame or wrapper NET::Properties dirtyProperties; @@ -579,7 +579,7 @@ bool Client::windowEvent(xcb_generic_event_t *e) /** * Handles map requests of the client window */ -bool Client::mapRequestEvent(xcb_map_request_event_t *e) +bool X11Client::mapRequestEvent(xcb_map_request_event_t *e) { if (e->window != window()) { // Special support for the save-set feature, which is a bit broken. @@ -615,7 +615,7 @@ bool Client::mapRequestEvent(xcb_map_request_event_t *e) /** * Handles unmap notify events of the client window */ -void Client::unmapNotifyEvent(xcb_unmap_notify_event_t *e) +void X11Client::unmapNotifyEvent(xcb_unmap_notify_event_t *e) { if (e->window != window()) return; @@ -640,7 +640,7 @@ void Client::unmapNotifyEvent(xcb_unmap_notify_event_t *e) } } -void Client::destroyNotifyEvent(xcb_destroy_notify_event_t *e) +void X11Client::destroyNotifyEvent(xcb_destroy_notify_event_t *e) { if (e->window != window()) return; @@ -651,7 +651,7 @@ void Client::destroyNotifyEvent(xcb_destroy_notify_event_t *e) /** * Handles client messages for the client window */ -void Client::clientMessageEvent(xcb_client_message_event_t *e) +void X11Client::clientMessageEvent(xcb_client_message_event_t *e) { Toplevel::clientMessageEvent(e); if (e->window != window()) @@ -668,7 +668,7 @@ void Client::clientMessageEvent(xcb_client_message_event_t *e) /** * Handles configure requests of the client window */ -void Client::configureRequestEvent(xcb_configure_request_event_t *e) +void X11Client::configureRequestEvent(xcb_configure_request_event_t *e) { if (e->window != window()) return; // ignore frame/wrapper @@ -700,7 +700,7 @@ void Client::configureRequestEvent(xcb_configure_request_event_t *e) // the ICCCM doesn't require this - it can be though of as 'the WM decided to move // the window later'. The client should not cause that many configure request, // so this should not have any significant impact. With user moving/resizing - // the it should be optimized though (see also Client::setGeometry()/plainResize()/move()). + // the it should be optimized though (see also X11Client::setGeometry()/plainResize()/move()). sendSyntheticConfigureNotify(); // SELI TODO accept configure requests for isDesktop windows (because kdesktop @@ -711,7 +711,7 @@ void Client::configureRequestEvent(xcb_configure_request_event_t *e) /** * Handles property changes of the client window */ -void Client::propertyNotifyEvent(xcb_property_notify_event_t *e) +void X11Client::propertyNotifyEvent(xcb_property_notify_event_t *e) { Toplevel::propertyNotifyEvent(e); if (e->window != window()) @@ -756,7 +756,7 @@ void Client::propertyNotifyEvent(xcb_property_notify_event_t *e) } -void Client::enterNotifyEvent(xcb_enter_notify_event_t *e) +void X11Client::enterNotifyEvent(xcb_enter_notify_event_t *e) { if (e->event != frameId()) return; // care only about entering the whole frame @@ -781,7 +781,7 @@ void Client::enterNotifyEvent(xcb_enter_notify_event_t *e) } } -void Client::leaveNotifyEvent(xcb_leave_notify_event_t *e) +void X11Client::leaveNotifyEvent(xcb_leave_notify_event_t *e) { if (e->event != frameId()) return; // care only about leaving the whole frame @@ -830,7 +830,7 @@ void Client::leaveNotifyEvent(xcb_leave_notify_event_t *e) #define XCapL KKeyServer::modXLock() #define XNumL KKeyServer::modXNumLock() #define XScrL KKeyServer::modXScrollLock() -void Client::grabButton(int modifier) +void X11Client::grabButton(int modifier) { unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, @@ -843,7 +843,7 @@ void Client::grabButton(int modifier) m_wrapper.grabButton(XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, modifier | mods[ i ]); } -void Client::ungrabButton(int modifier) +void X11Client::ungrabButton(int modifier) { unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, @@ -865,7 +865,7 @@ void Client::ungrabButton(int modifier) * missinterpret LeaveNotify events in grab mode to work properly * (Motif, AWT, Tk, ...) */ -void Client::updateMouseGrab() +void X11Client::updateMouseGrab() { if (workspace()->globalShortcutsDisabled()) { m_wrapper.ungrabButton(); @@ -905,7 +905,7 @@ static bool modKeyDown(int state) { // return value matters only when filtering events before decoration gets them -bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root, xcb_timestamp_t time) +bool X11Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root, xcb_timestamp_t time) { if (isMoveResizePointerButtonDown()) { if (w == wrapperId()) @@ -1018,7 +1018,7 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int } // return value matters only when filtering events before decoration gets them -bool Client::buttonReleaseEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root) +bool X11Client::buttonReleaseEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root) { if (w == frameId() && isDecorated()) { // wheel handled on buttonPress @@ -1064,7 +1064,7 @@ bool Client::buttonReleaseEvent(xcb_window_t w, int button, int state, int x, in } // return value matters only when filtering events before decoration gets them -bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root) +bool X11Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root) { if (w == frameId() && isDecorated() && !isMinimized()) { // TODO Mouse move event dependent on state @@ -1099,7 +1099,7 @@ bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_ro return true; } -void Client::focusInEvent(xcb_focus_in_event_t *e) +void X11Client::focusInEvent(xcb_focus_in_event_t *e) { if (e->event != window()) return; // only window gets focus @@ -1109,7 +1109,7 @@ void Client::focusInEvent(xcb_focus_in_event_t *e) return; // we don't care if (!isShown(false) || !isOnCurrentDesktop()) // we unmapped it, but it got focus meanwhile -> return; // activateNextClient() already transferred focus elsewhere - workspace()->forEachClient([](Client *client) { + workspace()->forEachClient([](X11Client *client) { client->cancelFocusOutTimer(); }); // check if this client is in should_get_focus list or if activation is allowed @@ -1123,7 +1123,7 @@ void Client::focusInEvent(xcb_focus_in_event_t *e) } } -void Client::focusOutEvent(xcb_focus_out_event_t *e) +void X11Client::focusOutEvent(xcb_focus_out_event_t *e) { if (e->event != window()) return; // only window gets focus @@ -1147,7 +1147,7 @@ void Client::focusOutEvent(xcb_focus_out_event_t *e) // flicker sometimes, e.g. when a fullscreen is shown, and focus is transferred // from it to its transient, the fullscreen would be kept in the Active layer // at the beginning and at the end, but not in the middle, when the active - // client would be temporarily none (see Client::belongToLayer() ). + // client would be temporarily none (see X11Client::belongToLayer() ). // Therefore the setActive(false) call is moved to the end of the current // event queue. If there is a matching FocusIn event in the current queue // this will be processed before the setActive(false) call and the activation @@ -1165,7 +1165,7 @@ void Client::focusOutEvent(xcb_focus_out_event_t *e) } // performs _NET_WM_MOVERESIZE -void Client::NETMoveResize(int x_root, int y_root, NET::Direction direction) +void X11Client::NETMoveResize(int x_root, int y_root, NET::Direction direction) { if (direction == NET::Move) { // move cursor to the provided position to prevent the window jumping there on first movement @@ -1211,7 +1211,7 @@ void Client::NETMoveResize(int x_root, int y_root, NET::Direction direction) } } -void Client::keyPressEvent(uint key_code, xcb_timestamp_t time) +void X11Client::keyPressEvent(uint key_code, xcb_timestamp_t time) { updateUserTime(time); AbstractClient::keyPressEvent(key_code); diff --git a/focuschain.h b/focuschain.h index 258634192..3dbd75438 100644 --- a/focuschain.h +++ b/focuschain.h @@ -96,7 +96,7 @@ public: * If no Client for activation is found @c null is returned. * * @param desktop The virtual desktop to look for a Client for activation - * @return :Client* The Client which could be activated or @c null if there is none. + * @return :X11Client *The Client which could be activated or @c null if there is none. */ AbstractClient *getForActivation(uint desktop) const; /** @@ -109,7 +109,7 @@ public: * * @param desktop The virtual desktop to look for a Client for activation * @param screen The screen to constrain the search on with separate screen focus - * @return :Client* The Client which could be activated or @c null if there is none. + * @return :X11Client *The Client which could be activated or @c null if there is none. */ AbstractClient *getForActivation(uint desktop, int screen) const; @@ -142,7 +142,7 @@ public: * chain is returned. * * @param reference The start point in the focus chain to search - * @return :Client* The relatively next Client in the most recently used chain. + * @return :X11Client *The relatively next Client in the most recently used chain. */ AbstractClient *nextMostRecentlyUsed(AbstractClient *reference) const; /** @@ -154,14 +154,14 @@ public: * * @param reference The reference Client which should not be returned * @param desktop The virtual desktop whose focus chain should be used - * @return :Client* The next usable Client or @c null if none can be found. + * @return :X11Client *The next usable Client or @c null if none can be found. */ AbstractClient *nextForDesktop(AbstractClient *reference, uint desktop) const; /** * @brief Returns the first Client in the most recently used focus chain. First Client in this * case means really the first Client in the chain and not the most recently used Client. * - * @return :Client* The first Client in the most recently used chain. + * @return :X11Client *The first Client in the most recently used chain. */ AbstractClient *firstMostRecentlyUsed() const; diff --git a/geometry.cpp b/geometry.cpp index 2f11697a1..57c283156 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . */ -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "netinfo.h" @@ -914,7 +914,7 @@ void Workspace::fixPositionAfterCrash(xcb_window_t w, const xcb_get_geometry_rep */ // TODO move to Workspace? -QRect Client::adjustedClientArea(const QRect &desktopArea, const QRect& area) const +QRect X11Client::adjustedClientArea(const QRect &desktopArea, const QRect& area) const { QRect r = area; NETExtendedStrut str = strut(); @@ -981,7 +981,7 @@ QRect Client::adjustedClientArea(const QRect &desktopArea, const QRect& area) co return r; } -NETExtendedStrut Client::strut() const +NETExtendedStrut X11Client::strut() const { NETExtendedStrut ext = info->extendedStrut(); NETStrut str = info->strut(); @@ -1013,7 +1013,7 @@ NETExtendedStrut Client::strut() const return ext; } -StrutRect Client::strutRect(StrutArea area) const +StrutRect X11Client::strutRect(StrutArea area) const { Q_ASSERT(area != StrutAreaAll); // Not valid const QSize displaySize = screens()->displaySize(); @@ -1053,7 +1053,7 @@ StrutRect Client::strutRect(StrutArea area) const return StrutRect(); // Null rect } -StrutRects Client::strutRects() const +StrutRects X11Client::strutRects() const { StrutRects region; region += strutRect(StrutAreaTop); @@ -1063,7 +1063,7 @@ StrutRects Client::strutRects() const return region; } -bool Client::hasStrut() const +bool X11Client::hasStrut() const { NETExtendedStrut ext = strut(); if (ext.left_width == 0 && ext.right_width == 0 && ext.top_width == 0 && ext.bottom_width == 0) @@ -1071,7 +1071,7 @@ bool Client::hasStrut() const return true; } -bool Client::hasOffscreenXineramaStrut() const +bool X11Client::hasOffscreenXineramaStrut() const { // Get strut as a QRegion QRegion region; @@ -1330,7 +1330,7 @@ QSize AbstractClient::adjustedSize(const QSize& frame, Sizemode mode) const } // this helper returns proper size even if the window is shaded -// see also the comment in Client::setGeometry() +// see also the comment in X11Client::setGeometry() QSize AbstractClient::adjustedSize() const { return sizeForClientSize(clientSize()); @@ -1343,7 +1343,7 @@ QSize AbstractClient::adjustedSize() const * \a wsize is adapted according to the window's size hints (minimum, * maximum and incremental size changes). */ -QSize Client::sizeForClientSize(const QSize& wsize, Sizemode mode, bool noframe) const +QSize X11Client::sizeForClientSize(const QSize& wsize, Sizemode mode, bool noframe) const { int w = wsize.width(); int h = wsize.height(); @@ -1515,7 +1515,7 @@ QSize Client::sizeForClientSize(const QSize& wsize, Sizemode mode, bool noframe) /** * Gets the client's normal WM hints and reconfigures itself respectively. */ -void Client::getWmNormalHints() +void X11Client::getWmNormalHints() { const bool hadFixedAspect = m_geometryHints.hasAspect(); // roundtrip to X server @@ -1547,17 +1547,17 @@ void Client::getWmNormalHints() updateAllowedActions(); // affects isResizeable() } -QSize Client::minSize() const +QSize X11Client::minSize() const { return rules()->checkMinSize(m_geometryHints.minSize()); } -QSize Client::maxSize() const +QSize X11Client::maxSize() const { return rules()->checkMaxSize(m_geometryHints.maxSize()); } -QSize Client::basicUnit() const +QSize X11Client::basicUnit() const { return m_geometryHints.resizeIncrements(); } @@ -1566,7 +1566,7 @@ QSize Client::basicUnit() const * Auxiliary function to inform the client about the current window * configuration. */ -void Client::sendSyntheticConfigureNotify() +void X11Client::sendSyntheticConfigureNotify() { xcb_configure_notify_event_t c; memset(&c, 0, sizeof(c)); @@ -1584,7 +1584,7 @@ void Client::sendSyntheticConfigureNotify() xcb_flush(connection()); } -const QPoint Client::calculateGravitation(bool invert, int gravity) const +const QPoint X11Client::calculateGravitation(bool invert, int gravity) const { int dx, dy; dx = dy = 0; @@ -1649,7 +1649,7 @@ const QPoint Client::calculateGravitation(bool invert, int gravity) const return QPoint(x() - dx, y() - dy); } -void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool) +void X11Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool) { const int configurePositionMask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; const int configureSizeMask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; @@ -1743,7 +1743,7 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in // this is part of the kicker-xinerama-hack... it should be // safe to remove when kicker gets proper ExtendedStrut support; // see Workspace::updateClientArea() and - // Client::adjustedClientArea() + // X11Client::adjustedClientArea() if (hasStrut()) workspace() -> updateClientArea(); } @@ -1781,7 +1781,7 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in // Handling of the real ConfigureRequest event forces sending it, as there it's necessary. } -void Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force) +void X11Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force) { Q_ASSERT(!shade_geometry_change); if (isShade()) { @@ -1843,7 +1843,7 @@ void Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry } // _NET_MOVERESIZE_WINDOW -void Client::NETMoveResizeWindow(int flags, int x, int y, int width, int height) +void X11Client::NETMoveResizeWindow(int flags, int x, int y, int width, int height) { int gravity = flags & 0xff; int value_mask = 0; @@ -1862,7 +1862,7 @@ void Client::NETMoveResizeWindow(int flags, int x, int y, int width, int height) configureRequest(value_mask, x, y, width, height, gravity, true); } -bool Client::isMovable() const +bool X11Client::isMovable() const { if (!hasNETSupport() && !m_motif.move()) { return false; @@ -1876,7 +1876,7 @@ bool Client::isMovable() const return true; } -bool Client::isMovableAcrossScreens() const +bool X11Client::isMovableAcrossScreens() const { if (!hasNETSupport() && !m_motif.move()) { return false; @@ -1888,7 +1888,7 @@ bool Client::isMovableAcrossScreens() const return true; } -bool Client::isResizable() const +bool X11Client::isResizable() const { if (!hasNETSupport() && !m_motif.resize()) { return false; @@ -1909,7 +1909,7 @@ bool Client::isResizable() const return min.width() < max.width() || min.height() < max.height(); } -bool Client::isMaximizable() const +bool X11Client::isMaximizable() const { if (!isResizable() || isToolbar()) // SELI isToolbar() ? return false; @@ -1922,9 +1922,9 @@ bool Client::isMaximizable() const /** * Reimplemented to inform the client about the new window position. */ -void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) +void X11Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) { - // this code is also duplicated in Client::plainResize() + // this code is also duplicated in X11Client::plainResize() // Ok, the shading geometry stuff. Generally, code doesn't care about shaded geometry, // simply because there are too many places dealing with geometry. Those places // ignore shaded state and use normal geometry, which they usually should get @@ -1934,7 +1934,7 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) // This gets more complicated in the case the code does only something like // setGeometry( geometry()) - geometry() will return the shaded frame geometry. // Such code is wrong and should be changed to handle the case when the window is shaded, - // for example using Client::clientSize() + // for example using X11Client::clientSize() if (shade_geometry_change) ; // nothing @@ -2013,9 +2013,9 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) emit geometryChanged(); } -void Client::plainResize(int w, int h, ForceGeometry_t force) +void X11Client::plainResize(int w, int h, ForceGeometry_t force) { - // this code is also duplicated in Client::setGeometry(), and it's also commented there + // this code is also duplicated in X11Client::setGeometry(), and it's also commented there if (shade_geometry_change) ; // nothing else if (isShade()) { @@ -2103,7 +2103,7 @@ void AbstractClient::move(int x, int y, ForceGeometry_t force) emit geometryChanged(); } -void Client::doMove(int x, int y) +void X11Client::doMove(int x, int y) { m_frame.move(x, y); sendSyntheticConfigureNotify(); @@ -2150,7 +2150,7 @@ void AbstractClient::setMaximize(bool vertically, bool horizontally) } static bool changeMaximizeRecursion = false; -void Client::changeMaximize(bool horizontal, bool vertical, bool adjust) +void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust) { if (changeMaximizeRecursion) return; @@ -2402,7 +2402,7 @@ void Client::changeMaximize(bool horizontal, bool vertical, bool adjust) emit quickTileModeChanged(); } -bool Client::userCanSetFullScreen() const +bool X11Client::userCanSetFullScreen() const { if (!isFullScreenable()) { return false; @@ -2410,7 +2410,7 @@ bool Client::userCanSetFullScreen() const return isNormalWindow() || isDialog(); } -void Client::setFullScreen(bool set, bool user) +void X11Client::setFullScreen(bool set, bool user) { set = rules()->checkFullScreen(set); @@ -2467,7 +2467,7 @@ void Client::setFullScreen(bool set, bool user) } -void Client::updateFullscreenMonitors(NETFullscreenMonitors topology) +void X11Client::updateFullscreenMonitors(NETFullscreenMonitors topology) { int nscreens = screens()->count(); @@ -2492,7 +2492,7 @@ void Client::updateFullscreenMonitors(NETFullscreenMonitors topology) * Calculates the bounding rectangle defined by the 4 monitor indices indicating the * top, bottom, left, and right edges of the window when the fullscreen state is enabled. */ -QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) const +QRect X11Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) const { QRect top, bottom, left, right, total; @@ -2510,7 +2510,7 @@ QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) co static GeometryTip* geometryTip = nullptr; -void Client::positionGeometryTip() +void X11Client::positionGeometryTip() { Q_ASSERT(isMove() || isResize()); // Position and Size display @@ -2575,7 +2575,7 @@ bool AbstractClient::startMoveResize() return true; } -bool Client::doStartMoveResize() +bool X11Client::doStartMoveResize() { bool has_grab = false; // This reportedly improves smoothness of the moveresize operation, @@ -2651,7 +2651,7 @@ void AbstractClient::finishMoveResize(bool cancel) emit clientFinishUserMovedResized(this); } -void Client::leaveMoveResize() +void X11Client::leaveMoveResize() { if (needsXWindowMove) { // Do the deferred move @@ -2768,7 +2768,7 @@ void AbstractClient::handleMoveResize(const QPoint &local, const QPoint &global) } } -bool Client::isWaitingForMoveResizeSync() const +bool X11Client::isWaitingForMoveResizeSync() const { return syncRequest.isPending && isResize(); } @@ -3094,11 +3094,11 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root) } } -void Client::doResizeSync() +void X11Client::doResizeSync() { if (!syncRequest.timeout) { syncRequest.timeout = new QTimer(this); - connect(syncRequest.timeout, &QTimer::timeout, this, &Client::performMoveResize); + connect(syncRequest.timeout, &QTimer::timeout, this, &X11Client::performMoveResize); syncRequest.timeout->setSingleShot(true); } if (syncRequest.counter != XCB_NONE) { @@ -3125,7 +3125,7 @@ void AbstractClient::performMoveResize() emit clientStepUserMovedResized(this, moveResizeGeom); } -void Client::doPerformMoveResize() +void X11Client::doPerformMoveResize() { if (syncRequest.counter == XCB_NONE) // client w/o XSYNC support. allow the next resize event syncRequest.isPending = false; // NEVER do this for clients with a valid counter diff --git a/group.cpp b/group.cpp index 8df0a5188..806f9a77d 100644 --- a/group.cpp +++ b/group.cpp @@ -30,7 +30,7 @@ along with this program. If not, see . #include "group.h" #include #include "workspace.h" -#include "client.h" +#include "x11client.h" #include "effects.h" #include @@ -95,14 +95,14 @@ QIcon Group::icon() const return QIcon(); } -void Group::addMember(Client* member_P) +void Group::addMember(X11Client *member_P) { _members.append(member_P); // qDebug() << "GROUPADD:" << this << ":" << member_P; // qDebug() << kBacktrace(); } -void Group::removeMember(Client* member_P) +void Group::removeMember(X11Client *member_P) { // qDebug() << "GROUPREMOVE:" << this << ":" << member_P; // qDebug() << kBacktrace(); @@ -131,7 +131,7 @@ void Group::deref() } } -void Group::gotLeader(Client* leader_P) +void Group::gotLeader(X11Client *leader_P) { Q_ASSERT(leader_P->window() == leader_wid); leader_client = leader_P; @@ -164,7 +164,7 @@ Group* Workspace::findGroup(xcb_window_t leader) const // Client is group transient, but has no group set. Try to find // group with windows with the same client leader. -Group* Workspace::findClientLeaderGroup(const Client* c) const +Group* Workspace::findClientLeaderGroup(const X11Client *c) const { Group* ret = nullptr; for (ClientList::ConstIterator it = clients.constBegin(); @@ -185,7 +185,7 @@ Group* Workspace::findClientLeaderGroup(const Client* c) const for (int pos = 0; pos < old_group.count(); ++pos) { - Client* tmp = old_group[ pos ]; + X11Client *tmp = old_group[ pos ]; if (tmp != c) tmp->changeClientLeaderGroup(ret); } @@ -271,7 +271,7 @@ bool Toplevel::resourceMatch(const Toplevel* c1, const Toplevel* c2) // Client //**************************************** -bool Client::belongToSameApplication(const Client* c1, const Client* c2, SameApplicationChecks checks) +bool X11Client::belongToSameApplication(const X11Client *c1, const X11Client *c2, SameApplicationChecks checks) { bool same_app = false; @@ -322,10 +322,10 @@ bool Client::belongToSameApplication(const Client* c1, const Client* c2, SameApp // considered belonging to the same application. This is for // the cases when opening new mainwindow directly from the application, // e.g. 'Open New Window' in konqy ( active_hack == true ). -bool Client::sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool active_hack) +bool X11Client::sameAppWindowRoleMatch(const X11Client *c1, const X11Client *c2, bool active_hack) { if (c1->isTransient()) { - while (const Client *t = dynamic_cast(c1->transientFor())) + while (const X11Client *t = dynamic_cast(c1->transientFor())) c1 = t; if (c1->groupTransient()) return c1->group() == c2->group(); @@ -337,7 +337,7 @@ bool Client::sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool act #endif } if (c2->isTransient()) { - while (const Client *t = dynamic_cast(c2->transientFor())) + while (const X11Client *t = dynamic_cast(c2->transientFor())) c2 = t; if (c2->groupTransient()) return c1->group() == c2->group(); @@ -368,21 +368,21 @@ bool Client::sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool act of this property in some cases (window pointing to itself or creating a loop, keeping NET::Splash windows above other windows from the same app, etc.). - Client::transient_for_id is the value of the WM_TRANSIENT_FOR property, after - possibly being adjusted by KWin. Client::transient_for points to the Client - this Client is transient for, or is NULL. If Client::transient_for_id is + X11Client::transient_for_id is the value of the WM_TRANSIENT_FOR property, after + possibly being adjusted by KWin. X11Client::transient_for points to the Client + this Client is transient for, or is NULL. If X11Client::transient_for_id is poiting to the root window, the window is considered to be transient for the whole window group, as suggested in NETWM 7.3. - In the case of group transient window, Client::transient_for is NULL, - and Client::groupTransient() returns true. Such window is treated as + In the case of group transient window, X11Client::transient_for is NULL, + and X11Client::groupTransient() returns true. Such window is treated as if it were transient for every window in its window group that has been mapped _before_ it (or, to be exact, was added to the same group before it). Otherwise two group transients can create loops, which can lead very very nasty things (bug #67914 and all its dupes). - Client::original_transient_for_id is the value of the property, which - may be different if Client::transient_for_id if e.g. forcing NET::Splash + X11Client::original_transient_for_id is the value of the property, which + may be different if X11Client::transient_for_id if e.g. forcing NET::Splash to be kept on top of its window group, or when the mainwindow is not mapped yet, in which case the window is temporarily made group transient, and when the mainwindow is mapped, transiency is re-evaluated. @@ -404,12 +404,12 @@ bool Client::sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool act - every window in the group : group()->members() */ -Xcb::TransientFor Client::fetchTransient() const +Xcb::TransientFor X11Client::fetchTransient() const { return Xcb::TransientFor(window()); } -void Client::readTransientProperty(Xcb::TransientFor &transientFor) +void X11Client::readTransientProperty(Xcb::TransientFor &transientFor) { xcb_window_t new_transient_for_id = XCB_WINDOW_NONE; if (transientFor.getTransientFor(&new_transient_for_id)) { @@ -422,17 +422,17 @@ void Client::readTransientProperty(Xcb::TransientFor &transientFor) setTransient(new_transient_for_id); } -void Client::readTransient() +void X11Client::readTransient() { Xcb::TransientFor transientFor = fetchTransient(); readTransientProperty(transientFor); } -void Client::setTransient(xcb_window_t new_transient_for_id) +void X11Client::setTransient(xcb_window_t new_transient_for_id) { if (new_transient_for_id != m_transientForId) { removeFromMainClients(); - Client *transient_for = nullptr; + X11Client *transient_for = nullptr; m_transientForId = new_transient_for_id; if (m_transientForId != XCB_WINDOW_NONE && !groupTransient()) { transient_for = workspace()->findClient(Predicate::WindowMatch, m_transientForId); @@ -447,7 +447,7 @@ void Client::setTransient(xcb_window_t new_transient_for_id) } } -void Client::removeFromMainClients() +void X11Client::removeFromMainClients() { if (transientFor()) transientFor()->removeTransient(this); @@ -463,7 +463,7 @@ void Client::removeFromMainClients() // This one is called when destroying/releasing a window. // It makes sure this client is removed from all grouping // related lists. -void Client::cleanGrouping() +void X11Client::cleanGrouping() { // qDebug() << "CLEANGROUPING:" << this; // for ( ClientList::ConstIterator it = group()->members().begin(); @@ -530,7 +530,7 @@ void Client::cleanGrouping() // for a window that is (directly or indirectly) transient for it // (including another group transients). // Non-group transients not causing loops are checked in verifyTransientFor(). -void Client::checkGroupTransients() +void X11Client::checkGroupTransients() { for (ClientList::ConstIterator it1 = group()->members().constBegin(); it1 != group()->members().constEnd(); @@ -582,7 +582,7 @@ void Client::checkGroupTransients() /** * Check that the window is not transient for itself, and similar nonsense. */ -xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, bool set) +xcb_window_t X11Client::verifyTransientFor(xcb_window_t new_transient_for, bool set) { xcb_window_t new_property_value = new_transient_for; // make sure splashscreens are shown above all their app's windows, even though @@ -613,7 +613,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, bool set } new_transient_for = tree->parent; } - if (Client* new_transient_for_client = workspace()->findClient(Predicate::WindowMatch, new_transient_for)) { + if (X11Client *new_transient_for_client = workspace()->findClient(Predicate::WindowMatch, new_transient_for)) { if (new_transient_for != before_search) { qCDebug(KWIN_CORE) << "Client " << this << " has WM_TRANSIENT_FOR poiting to non-toplevel window " << before_search << ", child of " << new_transient_for_client << ", adjusting."; @@ -627,7 +627,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, bool set int count = 20; xcb_window_t loop_pos = new_transient_for; while (loop_pos != XCB_WINDOW_NONE && loop_pos != rootWindow()) { - Client* pos = workspace()->findClient(Predicate::WindowMatch, loop_pos); + X11Client *pos = workspace()->findClient(Predicate::WindowMatch, loop_pos); if (pos == nullptr) break; loop_pos = pos->m_transientForId; @@ -646,7 +646,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, bool set return new_transient_for; } -void Client::addTransient(AbstractClient* cl) +void X11Client::addTransient(AbstractClient* cl) { AbstractClient::addTransient(cl); if (workspace()->mostRecentlyActivatedClient() == this && cl->isModal()) @@ -659,7 +659,7 @@ void Client::addTransient(AbstractClient* cl) // qDebug() << "AT:" << (*it); } -void Client::removeTransient(AbstractClient* cl) +void X11Client::removeTransient(AbstractClient* cl) { // qDebug() << "REMOVETRANS:" << this << ":" << cl; // qDebug() << kBacktrace(); @@ -667,7 +667,7 @@ void Client::removeTransient(AbstractClient* cl) // make cl group transient AbstractClient::removeTransient(cl); if (cl->transientFor() == this) { - if (Client *c = dynamic_cast(cl)) { + if (X11Client *c = dynamic_cast(cl)) { c->m_transientForId = XCB_WINDOW_NONE; c->setTransientFor(nullptr); // SELI // SELI cl->setTransient( rootWindow()); @@ -677,7 +677,7 @@ void Client::removeTransient(AbstractClient* cl) } // A new window has been mapped. Check if it's not a mainwindow for this already existing window. -void Client::checkTransient(xcb_window_t w) +void X11Client::checkTransient(xcb_window_t w) { if (m_originalTransientForId != w) return; @@ -687,9 +687,9 @@ void Client::checkTransient(xcb_window_t w) // returns true if cl is the transient_for window for this client, // or recursively the transient_for window -bool Client::hasTransient(const AbstractClient* cl, bool indirect) const +bool X11Client::hasTransient(const AbstractClient* cl, bool indirect) const { - if (const Client *c = dynamic_cast(cl)) { + if (const X11Client *c = dynamic_cast(cl)) { // checkGroupTransients() uses this to break loops, so hasTransient() must detect them ConstClientList set; return hasTransientInternal(c, indirect, set); @@ -697,9 +697,9 @@ bool Client::hasTransient(const AbstractClient* cl, bool indirect) const return false; } -bool Client::hasTransientInternal(const Client* cl, bool indirect, ConstClientList& set) const +bool X11Client::hasTransientInternal(const X11Client *cl, bool indirect, ConstClientList& set) const { - if (const Client *t = dynamic_cast(cl->transientFor())) { + if (const X11Client *t = dynamic_cast(cl->transientFor())) { if (t == this) return true; if (!indirect) @@ -714,7 +714,7 @@ bool Client::hasTransientInternal(const Client* cl, bool indirect, ConstClientLi if (group() != cl->group()) return false; // cl is group transient, search from top - if (transients().contains(const_cast< Client* >(cl))) + if (transients().contains(const_cast< X11Client *>(cl))) return true; if (!indirect) return false; @@ -724,7 +724,7 @@ bool Client::hasTransientInternal(const Client* cl, bool indirect, ConstClientLi for (auto it = transients().constBegin(); it != transients().constEnd(); ++it) { - const Client *c = qobject_cast(*it); + const X11Client *c = qobject_cast(*it); if (!c) { continue; } @@ -734,7 +734,7 @@ bool Client::hasTransientInternal(const Client* cl, bool indirect, ConstClientLi return false; } -QList Client::mainClients() const +QList X11Client::mainClients() const { if (!isTransient()) return QList(); @@ -750,7 +750,7 @@ QList Client::mainClients() const return result; } -AbstractClient* Client::findModal(bool allow_itself) +AbstractClient* X11Client::findModal(bool allow_itself) { for (auto it = transients().constBegin(); it != transients().constEnd(); @@ -762,10 +762,10 @@ AbstractClient* Client::findModal(bool allow_itself) return nullptr; } -// Client::window_group only holds the contents of the hint, +// X11Client::window_group only holds the contents of the hint, // but it should be used only to find the group, not for anything else // Argument is only when some specific group needs to be set. -void Client::checkGroup(Group* set_group, bool force) +void X11Client::checkGroup(Group* set_group, bool force) { Group* old_group = in_group; if (old_group != nullptr) @@ -779,7 +779,7 @@ void Client::checkGroup(Group* set_group, bool force) } } else if (info->groupLeader() != XCB_WINDOW_NONE) { Group* new_group = workspace()->findGroup(info->groupLeader()); - Client *t = qobject_cast(transientFor()); + X11Client *t = qobject_cast(transientFor()); if (t != nullptr && t->group() != new_group) { // move the window to the right group (e.g. a dialog provided // by different app, but transient for this one, so make it part of that group) @@ -794,7 +794,7 @@ void Client::checkGroup(Group* set_group, bool force) in_group->addMember(this); } } else { - if (Client *t = qobject_cast(transientFor())) { + if (X11Client *t = qobject_cast(transientFor())) { // doesn't have window group set, but is transient for something // so make it part of that group Group* new_group = t->group(); @@ -884,7 +884,7 @@ void Client::checkGroup(Group* set_group, bool force) } // used by Workspace::findClientLeaderGroup() -void Client::changeClientLeaderGroup(Group* gr) +void X11Client::changeClientLeaderGroup(Group* gr) { // transientFor() != NULL are in the group of their mainwindow, so keep them there if (transientFor() != nullptr) @@ -895,16 +895,16 @@ void Client::changeClientLeaderGroup(Group* gr) checkGroup(gr); // change group } -bool Client::check_active_modal = false; +bool X11Client::check_active_modal = false; -void Client::checkActiveModal() +void X11Client::checkActiveModal() { // if the active window got new modal transient, activate it. // cannot be done in AddTransient(), because there may temporarily // exist loops, breaking findModal - Client* check_modal = dynamic_cast(workspace()->mostRecentlyActivatedClient()); + X11Client *check_modal = dynamic_cast(workspace()->mostRecentlyActivatedClient()); if (check_modal != nullptr && check_modal->check_active_modal) { - Client* new_modal = dynamic_cast(check_modal->findModal()); + X11Client *new_modal = dynamic_cast(check_modal->findModal()); if (new_modal != nullptr && new_modal != check_modal) { if (!new_modal->isManaged()) return; // postpone check until end of manage() diff --git a/group.h b/group.h index 3333e4dac..ad55741fb 100644 --- a/group.h +++ b/group.h @@ -28,8 +28,8 @@ along with this program. If not, see . namespace KWin { -class Client; class EffectWindowGroupImpl; +class X11Client; class Group { @@ -37,13 +37,13 @@ public: Group(xcb_window_t leader); ~Group(); xcb_window_t leader() const; - const Client* leaderClient() const; - Client* leaderClient(); + const X11Client *leaderClient() const; + X11Client *leaderClient(); const ClientList& members() const; QIcon icon() const; - void addMember(Client* member); - void removeMember(Client* member); - void gotLeader(Client* leader); + void addMember(X11Client *member); + void removeMember(X11Client *member); + void gotLeader(X11Client *leader); void lostLeader(); void updateUserTime(xcb_timestamp_t time); xcb_timestamp_t userTime() const; @@ -53,7 +53,7 @@ public: private: void startupIdChanged(); ClientList _members; - Client* leader_client; + X11Client *leader_client; xcb_window_t leader_wid; NETWinInfo* leader_info; xcb_timestamp_t user_time; @@ -66,12 +66,12 @@ inline xcb_window_t Group::leader() const return leader_wid; } -inline const Client* Group::leaderClient() const +inline const X11Client *Group::leaderClient() const { return leader_client; } -inline Client* Group::leaderClient() +inline X11Client *Group::leaderClient() { return leader_client; } diff --git a/input.cpp b/input.cpp index 2f79ea626..903e7e941 100644 --- a/input.cpp +++ b/input.cpp @@ -26,7 +26,7 @@ along with this program. If not, see . #include "pointer_input.h" #include "touch_input.h" #include "touch_hide_cursor_spy.h" -#include "client.h" +#include "x11client.h" #include "effects.h" #include "gestures.h" #include "globalshortcuts.h" diff --git a/layers.cpp b/layers.cpp index 5037098ec..2d41f6e32 100644 --- a/layers.cpp +++ b/layers.cpp @@ -80,7 +80,7 @@ along with this program. If not, see . */ #include "utils.h" -#include "client.h" +#include "x11client.h" #include "focuschain.h" #include "netinfo.h" #include "workspace.h" @@ -177,7 +177,7 @@ void Workspace::propagateClients(bool propagate_new_clients) newWindowStack.reserve(newWindowStack.size() + 2*stacking_order.size()); // *2 for inputWindow for (int i = stacking_order.size() - 1; i >= 0; --i) { - Client *client = qobject_cast(stacking_order.at(i)); + X11Client *client = qobject_cast(stacking_order.at(i)); if (!client || client->hiddenPreview()) { continue; } @@ -193,7 +193,7 @@ void Workspace::propagateClients(bool propagate_new_clients) // (as far as pure X stacking order is concerned), in order to avoid having // these windows that should be unmapped to interfere with other windows for (int i = stacking_order.size() - 1; i >= 0; --i) { - Client *client = qobject_cast(stacking_order.at(i)); + X11Client *client = qobject_cast(stacking_order.at(i)); if (!client || !client->hiddenPreview()) continue; newWindowStack << client->frameId(); @@ -430,7 +430,7 @@ void Workspace::raiseClientRequest(KWin::AbstractClient *c, NET::RequestSource s } } -void Workspace::lowerClientRequest(KWin::Client *c, NET::RequestSource src, xcb_timestamp_t /*timestamp*/) +void Workspace::lowerClientRequest(KWin::X11Client *c, NET::RequestSource src, xcb_timestamp_t /*timestamp*/) { // If the client has support for all this focus stealing prevention stuff, // do only lowering within the application, as that's the more logical @@ -479,7 +479,7 @@ void Workspace::restackClientUnderActive(AbstractClient* c) restack(c, active_client); } -void Workspace::restoreSessionStackingOrder(Client* c) +void Workspace::restoreSessionStackingOrder(X11Client *c) { if (c->sessionStackingOrder() < 0) return; @@ -488,7 +488,7 @@ void Workspace::restoreSessionStackingOrder(Client* c) for (ToplevelList::Iterator it = unconstrained_stacking_order.begin(); // from bottom it != unconstrained_stacking_order.end(); ++it) { - Client *current = qobject_cast(*it); + X11Client *current = qobject_cast(*it); if (!current) { continue; } @@ -514,7 +514,7 @@ ToplevelList Workspace::constrainedStackingOrder() Layer l = (*it)->layer(); const int screen = (*it)->screen(); - Client *c = qobject_cast(*it); + X11Client *c = qobject_cast(*it); QMap< Group*, Layer >::iterator mLayer = minimum_layer[screen].find(c ? c->group() : nullptr); if (mLayer != minimum_layer[screen].end()) { // If a window is raised above some other window in the same window group @@ -776,9 +776,9 @@ void Workspace::updateXStackingOrder() // Client //******************************* -void Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource src, xcb_timestamp_t timestamp, bool send_event) +void X11Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource src, xcb_timestamp_t timestamp, bool send_event) { - Client *other = nullptr; + X11Client *other = nullptr; if (detail == XCB_STACK_MODE_OPPOSITE) { other = workspace()->findClient(Predicate::WindowMatch, above); if (!other) { @@ -824,7 +824,7 @@ void Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource sr src = NET::FromTool; // force break; } - Client *c = qobject_cast(*it); + X11Client *c = qobject_cast(*it); if (!c || !( (*it)->isNormalWindow() && c->isShown(true) && (*it)->isOnCurrentDesktop() && (*it)->isOnCurrentActivity() && (*it)->isOnScreen(screen()) )) @@ -835,7 +835,7 @@ void Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource sr } if (it != begin && (*(it - 1) == other)) - other = qobject_cast(*it); + other = qobject_cast(*it); else other = nullptr; } @@ -851,17 +851,17 @@ void Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource sr sendSyntheticConfigureNotify(); } -void Client::doSetKeepAbove() +void X11Client::doSetKeepAbove() { } -void Client::doSetKeepBelow() +void X11Client::doSetKeepBelow() { } -bool Client::belongsToDesktop() const +bool X11Client::belongsToDesktop() const { - foreach (const Client *c, group()->members()) { + foreach (const X11Client *c, group()->members()) { if (c->isDesktop()) return true; } diff --git a/manage.cpp b/manage.cpp index beb8a52a0..84a0770a6 100644 --- a/manage.cpp +++ b/manage.cpp @@ -21,7 +21,7 @@ along with this program. If not, see . // This file contains things relevant to handling incoming events. -#include "client.h" +#include "x11client.h" #include @@ -47,7 +47,7 @@ namespace KWin * reparenting, initial geometry, initial state, placement, etc. * Returns false if KWin is not going to manage this window. */ -bool Client::manage(xcb_window_t w, bool isMapped) +bool X11Client::manage(xcb_window_t w, bool isMapped) { StackingUpdatesBlocker stacking_blocker(workspace()); @@ -133,7 +133,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) setupWindowRules(false); setCaption(cap_normal, true); - connect(this, &Client::windowClassChanged, this, &Client::evaluateWindowRules); + connect(this, &X11Client::windowClassChanged, this, &X11Client::evaluateWindowRules); if (Xcb::Extensions::self()->isShapeAvailable()) xcb_shape_select_input(connection(), window(), true); @@ -151,7 +151,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) readTransientProperty(transientCookie); setDesktopFileName(rules()->checkDesktopFile(QByteArray(info->desktopFileName()), true).toUtf8()); getIcons(); - connect(this, &Client::desktopFileNameChanged, this, &Client::getIcons); + connect(this, &X11Client::desktopFileNameChanged, this, &X11Client::getIcons); m_geometryHints.read(); getMotifHints(); @@ -447,7 +447,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) if (!init_minimize && isTransient() && mainClients().count() > 0 && !workspace()->sessionSaving()) { bool visible_parent = false; // Use allMainClients(), to include also main clients of group transients - // that have been optimized out in Client::checkGroupTransients() + // that have been optimized out in X11Client::checkGroupTransients() auto mainclients = allMainClients(); for (auto it = mainclients.constBegin(); it != mainclients.constEnd(); @@ -518,7 +518,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) // Set initial user time directly m_userTime = readUserTimeMapTimestamp(asn_valid ? &asn_id : nullptr, asn_valid ? &asn_data : nullptr, session); - group()->updateUserTime(m_userTime); // And do what Client::updateUserTime() does + group()->updateUserTime(m_userTime); // And do what X11Client::updateUserTime() does // This should avoid flicker, because real restacking is done // only after manage() finishes because of blocking, but the window is shown sooner @@ -553,7 +553,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) if( !isMapped && !session && workspace()->sessionSaving() && !isOnCurrentActivity()) { setSessionActivityOverride( true ); foreach( AbstractClient* c, mainClients()) { - if (Client *mc = dynamic_cast(c)) { + if (X11Client *mc = dynamic_cast(c)) { mc->setSessionActivityOverride(true); } } @@ -619,7 +619,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) } // Called only from manage() -void Client::embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth) +void X11Client::embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth) { Q_ASSERT(m_client == XCB_WINDOW_NONE); Q_ASSERT(frameId() == XCB_WINDOW_NONE); diff --git a/moving_client_x11_filter.cpp b/moving_client_x11_filter.cpp index a52c740eb..2c9d4ecd7 100644 --- a/moving_client_x11_filter.cpp +++ b/moving_client_x11_filter.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "moving_client_x11_filter.h" -#include "client.h" +#include "x11client.h" #include "workspace.h" #include #include @@ -33,7 +33,7 @@ MovingClientX11Filter::MovingClientX11Filter() bool MovingClientX11Filter::event(xcb_generic_event_t *event) { - auto client = dynamic_cast(workspace()->moveResizeClient()); + auto client = dynamic_cast(workspace()->moveResizeClient()); if (!client) { return false; } diff --git a/netinfo.cpp b/netinfo.cpp index 1f09c1818..4fa340a5f 100644 --- a/netinfo.cpp +++ b/netinfo.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . // own #include "netinfo.h" // kwin -#include "client.h" +#include "x11client.h" #include "rootinfo_filter.h" #include "virtualdesktops.h" #include "workspace.h" @@ -161,7 +161,7 @@ void RootInfo::changeCurrentDesktop(int d) void RootInfo::changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_timestamp_t timestamp, xcb_window_t active_window) { Workspace *workspace = Workspace::self(); - if (Client* c = workspace->findClient(Predicate::WindowMatch, w)) { + if (X11Client *c = workspace->findClient(Predicate::WindowMatch, w)) { if (timestamp == XCB_CURRENT_TIME) timestamp = c->userTime(); if (src != NET::FromApplication && src != FromTool) @@ -171,7 +171,7 @@ void RootInfo::changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_ti else if (c == workspace->mostRecentlyActivatedClient()) { return; // WORKAROUND? With > 1 plasma activities, we cause this ourselves. bug #240673 } else { // NET::FromApplication - Client* c2; + X11Client *c2; if (workspace->allowClientActivation(c, timestamp, false, true)) workspace->activateClient(c); // if activation of the requestor's window would be allowed, allow activation too @@ -188,7 +188,7 @@ void RootInfo::changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_ti void RootInfo::restackWindow(xcb_window_t w, RequestSource src, xcb_window_t above, int detail, xcb_timestamp_t timestamp) { - if (Client* c = Workspace::self()->findClient(Predicate::WindowMatch, w)) { + if (X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) { if (timestamp == XCB_CURRENT_TIME) timestamp = c->userTime(); if (src != NET::FromApplication && src != FromTool) @@ -199,14 +199,14 @@ void RootInfo::restackWindow(xcb_window_t w, RequestSource src, xcb_window_t abo void RootInfo::closeWindow(xcb_window_t w) { - Client* c = Workspace::self()->findClient(Predicate::WindowMatch, w); + X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w); if (c) c->closeWindow(); } void RootInfo::moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction) { - Client* c = Workspace::self()->findClient(Predicate::WindowMatch, w); + X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w); if (c) { updateXTime(); // otherwise grabbing may have old timestamp - this message should include timestamp c->NETMoveResize(x_root, y_root, (Direction)direction); @@ -215,14 +215,14 @@ void RootInfo::moveResize(xcb_window_t w, int x_root, int y_root, unsigned long void RootInfo::moveResizeWindow(xcb_window_t w, int flags, int x, int y, int width, int height) { - Client* c = Workspace::self()->findClient(Predicate::WindowMatch, w); + X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w); if (c) c->NETMoveResizeWindow(flags, x, y, width, height); } void RootInfo::gotPing(xcb_window_t w, xcb_timestamp_t timestamp) { - if (Client* c = Workspace::self()->findClient(Predicate::WindowMatch, w)) + if (X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) c->gotPing(timestamp); } @@ -245,7 +245,7 @@ void RootInfo::setActiveClient(AbstractClient *client) // WinInfo // **************************************** -WinInfo::WinInfo(Client * c, xcb_window_t window, +WinInfo::WinInfo(X11Client *c, xcb_window_t window, xcb_window_t rwin, NET::Properties properties, NET::Properties2 properties2) : NETWinInfo(connection(), window, rwin, properties, properties2, NET::WindowManager), m_client(c) { diff --git a/netinfo.h b/netinfo.h index a6ee95083..445cf3085 100644 --- a/netinfo.h +++ b/netinfo.h @@ -32,17 +32,14 @@ namespace KWin { class AbstractClient; -class Client; class RootInfoFilter; +class X11Client; /** * NET WM Protocol handler class */ class RootInfo : public NETRootInfo { -private: - typedef KWin::Client Client; // Because of NET::Client - public: static RootInfo *create(); static void destroy(); @@ -80,11 +77,8 @@ inline RootInfo *rootInfo() */ class WinInfo : public NETWinInfo { -private: - typedef KWin::Client Client; // Because of NET::Client - public: - WinInfo(Client* c, xcb_window_t window, + WinInfo(X11Client *c, xcb_window_t window, xcb_window_t rwin, NET::Properties properties, NET::Properties2 properties2); void changeDesktop(int desktop) override; void changeFullscreenMonitors(NETFullscreenMonitors topology) override; @@ -92,7 +86,7 @@ public: void disable(); private: - Client * m_client; + X11Client *m_client; }; } // KWin diff --git a/placement.cpp b/placement.cpp index d61704613..9d9c0dfde 100644 --- a/placement.cpp +++ b/placement.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . #ifndef KCMRULES #include "workspace.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "options.h" #include "rules.h" @@ -261,7 +261,7 @@ void Placement::placeSmart(AbstractClient* c, const QRect& area, Policy /*next*/ if (client->keepAbove()) overlap += 16 * (xr - xl) * (yb - yt); else if (client->keepBelow() && !client->isDock()) // ignore KeepBelow windows - overlap += 0; // for placement (see Client::belongsToLayer() for Dock) + overlap += 0; // for placement (see X11Client::belongsToLayer() for Dock) else overlap += (xr - xl) * (yb - yt); } diff --git a/plugins/platforms/x11/standalone/sync_filter.cpp b/plugins/platforms/x11/standalone/sync_filter.cpp index 7f2506cc8..10e531e09 100644 --- a/plugins/platforms/x11/standalone/sync_filter.cpp +++ b/plugins/platforms/x11/standalone/sync_filter.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "sync_filter.h" -#include "client.h" +#include "x11client.h" #include "workspace.h" #include "xcbutils.h" @@ -34,7 +34,7 @@ bool SyncFilter::event(xcb_generic_event_t *event) { auto e = reinterpret_cast< xcb_sync_alarm_notify_event_t* >(event); auto client = workspace()->findClient( - [e] (const Client *c) { + [e] (const X11Client *c) { const auto syncRequest = c->getSyncRequest(); return e->alarm == syncRequest.alarm && e->counter_value.hi == syncRequest.value.hi && e->counter_value.lo == syncRequest.value.lo; } diff --git a/plugins/platforms/x11/standalone/windowselector.cpp b/plugins/platforms/x11/standalone/windowselector.cpp index aa4412e97..f2a9c361d 100644 --- a/plugins/platforms/x11/standalone/windowselector.cpp +++ b/plugins/platforms/x11/standalone/windowselector.cpp @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "windowselector.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "unmanaged.h" #include "workspace.h" @@ -241,7 +241,7 @@ void WindowSelector::selectWindowId(xcb_window_t window_to_select) return; } xcb_window_t window = window_to_select; - Client* client = nullptr; + X11Client *client = nullptr; while (true) { client = Workspace::self()->findClient(Predicate::FrameIdMatch, window); if (client) { diff --git a/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp b/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp index af0d7802f..54bd763ae 100644 --- a/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp +++ b/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "x11_decoration_renderer.h" #include "decorations/decoratedclient.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include diff --git a/plugins/scenes/opengl/lanczosfilter.cpp b/plugins/scenes/opengl/lanczosfilter.cpp index 6b4cae100..a83917c2e 100644 --- a/plugins/scenes/opengl/lanczosfilter.cpp +++ b/plugins/scenes/opengl/lanczosfilter.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . *********************************************************************/ #include "lanczosfilter.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "effects.h" #include "screens.h" @@ -394,10 +394,10 @@ void LanczosFilter::timerEvent(QTimerEvent *event) delete m_offscreenTex; m_offscreenTarget = nullptr; m_offscreenTex = nullptr; - foreach (Client *c, Workspace::self()->clientList()) { + foreach (X11Client *c, Workspace::self()->clientList()) { discardCacheTexture(c->effectWindow()); } - foreach (Client *c, Workspace::self()->desktopList()) { + foreach (X11Client *c, Workspace::self()->desktopList()) { discardCacheTexture(c->effectWindow()); } foreach (Unmanaged *u, Workspace::self()->unmanagedList()) { diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index 5d57f07a4..325a590fe 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -35,7 +35,7 @@ along with this program. If not, see . #include #include "utils.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "deleted.h" #include "effects.h" diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp index 79672f89e..0fe2a8657 100644 --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "scene_qpainter.h" // KWin -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "deleted.h" diff --git a/plugins/scenes/xrender/scene_xrender.cpp b/plugins/scenes/xrender/scene_xrender.cpp index 633cc0b1e..0050be1af 100644 --- a/plugins/scenes/xrender/scene_xrender.cpp +++ b/plugins/scenes/xrender/scene_xrender.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "logging.h" #include "toplevel.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "deleted.h" #include "effects.h" @@ -451,7 +451,7 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat qreal yscale = 1; bool scaled = false; - Client *client = dynamic_cast(toplevel); + X11Client *client = dynamic_cast(toplevel); Deleted *deleted = dynamic_cast(toplevel); const QRect decorationRect = toplevel->decorationRect(); if (((client && !client->noBorder()) || (deleted && !deleted->noBorder())) && diff --git a/pointer_input.cpp b/pointer_input.cpp index 49c9704f2..36b6c1a27 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -21,7 +21,7 @@ along with this program. If not, see . *********************************************************************/ #include "pointer_input.h" #include "platform.h" -#include "client.h" +#include "x11client.h" #include "effects.h" #include "input_event.h" #include "input_event_spy.h" diff --git a/rules.cpp b/rules.cpp index c98834273..193d8c49d 100644 --- a/rules.cpp +++ b/rules.cpp @@ -30,7 +30,7 @@ along with this program. If not, see . #include #ifndef KCMRULES -#include "client.h" +#include "x11client.h" #include "client_machine.h" #include "screens.h" #include "workspace.h" @@ -944,7 +944,7 @@ void AbstractClient::applyWindowRules() // AutogroupById : Only checked on window manage // StrictGeometry setShortcut(rules()->checkShortcut(shortcut().toString())); - // see also Client::setActive() + // see also X11Client::setActive() if (isActive()) { setOpacity(rules()->checkOpacityActive(qRound(opacity() * 100.0)) / 100.0); workspace()->disableGlobalShortcutsForClient(rules()->checkDisableGlobalShortcuts(false)); @@ -953,7 +953,7 @@ void AbstractClient::applyWindowRules() setDesktopFileName(rules()->checkDesktopFile(desktopFileName()).toUtf8()); } -void Client::updateWindowRules(Rules::Types selection) +void X11Client::updateWindowRules(Rules::Types selection) { if (!isManaged()) // not fully setup yet return; @@ -1170,7 +1170,7 @@ void RuleBook::setUpdatesDisabled(bool disable) { m_updatesDisabled = disable; if (!disable) { - foreach (Client * c, Workspace::self()->clientList()) + foreach (X11Client *c, Workspace::self()->clientList()) c->updateWindowRules(Rules::All); } } diff --git a/rules.h b/rules.h index 7d2b4afdb..035efeadd 100644 --- a/rules.h +++ b/rules.h @@ -39,7 +39,6 @@ namespace KWin { class AbstractClient; -class Client; class Rules; #ifndef KCMRULES // only for kwin core diff --git a/scene.cpp b/scene.cpp index debdba4a1..8ae934731 100644 --- a/scene.cpp +++ b/scene.cpp @@ -71,7 +71,7 @@ along with this program. If not, see . #include #include -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "effects.h" #include "overlaywindow.h" @@ -278,7 +278,7 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region) if (c) { opaqueFullscreen = c->isFullScreen(); } - Client *cc = dynamic_cast(c); + X11Client *cc = dynamic_cast(c); // the window is fully opaque if (cc && cc->decorationHasAlpha()) { // decoration uses alpha channel, so we may not exclude it in clipping diff --git a/screenedge.cpp b/screenedge.cpp index 4dd6adf50..41f634323 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -31,7 +31,7 @@ along with this program. If not, see . // KWin #include "gestures.h" -#include +#include #include "cursor.h" #include "main.h" #include "platform.h" diff --git a/screens.cpp b/screens.cpp index 7b4e40415..02cddc6ee 100644 --- a/screens.cpp +++ b/screens.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "screens.h" #include -#include +#include #include "cursor.h" #include "orientation_sensor.h" #include "utils.h" diff --git a/scripting/meta.cpp b/scripting/meta.cpp index 14064e5ba..9d475250c 100644 --- a/scripting/meta.cpp +++ b/scripting/meta.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "meta.h" -#include "client.h" +#include "x11client.h" #include @@ -96,7 +96,7 @@ void Rect::fromScriptValue(const QScriptValue& obj, QRect &rect) } // End of meta for QRect object -QScriptValue Client::toScriptValue(QScriptEngine *eng, const KClientRef &client) +QScriptValue X11Client::toScriptValue(QScriptEngine *eng, const KClientRef &client) { return eng->newQObject(client, QScriptEngine::QtOwnership, QScriptEngine::ExcludeChildObjects | @@ -105,9 +105,9 @@ QScriptValue Client::toScriptValue(QScriptEngine *eng, const KClientRef &client) QScriptEngine::AutoCreateDynamicProperties); } -void Client::fromScriptValue(const QScriptValue &value, KWin::Client* &client) +void X11Client::fromScriptValue(const QScriptValue &value, KWin::X11Client *&client) { - client = qobject_cast(value.toQObject()); + client = qobject_cast(value.toQObject()); } QScriptValue Toplevel::toScriptValue(QScriptEngine *eng, const KToplevelRef &client) @@ -130,12 +130,12 @@ void KWin::MetaScripting::registration(QScriptEngine* eng) qScriptRegisterMetaType(eng, Point::toScriptValue, Point::fromScriptValue); qScriptRegisterMetaType(eng, Size::toScriptValue, Size::fromScriptValue); qScriptRegisterMetaType(eng, Rect::toScriptValue, Rect::fromScriptValue); - qScriptRegisterMetaType(eng, Client::toScriptValue, Client::fromScriptValue); + qScriptRegisterMetaType(eng, X11Client::toScriptValue, X11Client::fromScriptValue); qScriptRegisterMetaType(eng, Toplevel::toScriptValue, Toplevel::fromScriptValue); qScriptRegisterSequenceMetaType(eng); qScriptRegisterSequenceMetaType< QList >(eng); - qScriptRegisterSequenceMetaType< QList >(eng); + qScriptRegisterSequenceMetaType< QList >(eng); } QScriptValue KWin::MetaScripting::configExists(QScriptContext* ctx, QScriptEngine* eng) diff --git a/scripting/meta.h b/scripting/meta.h index 2626f3a4d..8f8144f9e 100644 --- a/scripting/meta.h +++ b/scripting/meta.h @@ -30,11 +30,11 @@ class QScriptContext; class QSize; namespace KWin { -class Client; class Toplevel; +class X11Client; } -typedef KWin::Client* KClientRef; +typedef KWin::X11Client *KClientRef; typedef KWin::Toplevel* KToplevelRef; namespace KWin @@ -75,7 +75,7 @@ QScriptValue toScriptValue(QScriptEngine*, const QRect&); void fromScriptValue(const QScriptValue&, QRect&); } -namespace Client +namespace X11Client { QScriptValue toScriptValue(QScriptEngine *eng, const KClientRef &client); void fromScriptValue(const QScriptValue &value, KClientRef& client); diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index ba18792fd..8ecddb385 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -28,7 +28,7 @@ along with this program. If not, see . #include "screenedgeitem.h" #include "scripting_model.h" #include "scripting_logging.h" -#include "../client.h" +#include "../x11client.h" #include "../thumbnailitem.h" #include "../options.h" #include "../workspace.h" @@ -65,7 +65,7 @@ QScriptValue kwinScriptPrint(QScriptContext *context, QScriptEngine *engine) stream << " "; } QScriptValue argument = context->argument(i); - if (KWin::Client *client = qscriptvalue_cast(argument)) { + if (KWin::X11Client *client = qscriptvalue_cast(argument)) { client->print(stream); } else { stream << argument.toString(); @@ -711,7 +711,7 @@ void KWin::Scripting::init() qmlRegisterType("org.kde.kwin", 2, 0, "ClientModelByScreenAndDesktop"); qmlRegisterType("org.kde.kwin", 2, 0, "ClientFilterModel"); qmlRegisterType(); - qmlRegisterType(); + qmlRegisterType(); qmlRegisterType(); m_qmlEngine->rootContext()->setContextProperty(QStringLiteral("workspace"), m_workspaceWrapper); diff --git a/scripting/scripting.h b/scripting/scripting.h index d8bfed400..cea7d43af 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -52,9 +52,9 @@ typedef QList< QPair > > LoadScriptList; namespace KWin { class AbstractClient; -class Client; class ScriptUnloaderAgent; class QtScriptWorkspaceWrapper; +class X11Client; class KWIN_EXPORT AbstractScript : public QObject { diff --git a/scripting/scripting_model.cpp b/scripting/scripting_model.cpp index a8774feff..d8f8674b8 100644 --- a/scripting/scripting_model.cpp +++ b/scripting/scripting_model.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" #endif -#include "client.h" +#include "x11client.h" #include "screens.h" #include "workspace.h" #include "xdgshellclient.h" @@ -204,7 +204,7 @@ void ClientLevel::init() { const ClientList &clients = Workspace::self()->clientList(); for (ClientList::const_iterator it = clients.begin(); it != clients.end(); ++it) { - Client *client = *it; + X11Client *client = *it; setupClientConnections(client); if (!exclude(client) && shouldAdd(client)) { m_clients.insert(nextId(), client); @@ -896,7 +896,7 @@ bool ClientFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourc // we do not filter out screen, desktop and activity return true; } - Client *client = qvariant_cast(data); + X11Client *client = qvariant_cast(data); if (!client) { return false; } diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 6c5b1588e..9a40a0ec5 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . *********************************************************************/ #include "workspace_wrapper.h" -#include "../client.h" +#include "../x11client.h" #include "../outline.h" #include "../screens.h" #include "../xdgshellclient.h" @@ -71,7 +71,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent) connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::clientAdded); connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::setupAbstractClientConnections); } - foreach (KWin::Client *client, ws->clientList()) { + foreach (KWin::X11Client *client, ws->clientList()) { setupClientConnections(client); } } @@ -274,12 +274,12 @@ void WorkspaceWrapper::setupAbstractClientConnections(AbstractClient *client) this, &WorkspaceWrapper::clientMaximizeSet); } -void WorkspaceWrapper::setupClientConnections(Client *client) +void WorkspaceWrapper::setupClientConnections(X11Client *client) { setupAbstractClientConnections(client); - connect(client, &Client::clientManaging, this, &WorkspaceWrapper::clientManaging); - connect(client, &Client::clientFullScreenSet, this, &WorkspaceWrapper::clientFullScreenSet); + connect(client, &X11Client::clientManaging, this, &WorkspaceWrapper::clientManaging); + connect(client, &X11Client::clientFullScreenSet, this, &WorkspaceWrapper::clientFullScreenSet); } void WorkspaceWrapper::showOutline(const QRect &geometry) @@ -297,7 +297,7 @@ void WorkspaceWrapper::hideOutline() outline()->hide(); } -Client *WorkspaceWrapper::getClient(qulonglong windowId) +X11Client *WorkspaceWrapper::getClient(qulonglong windowId) { return Workspace::self()->findClient(Predicate::WindowMatch, windowId); } diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index 901d56234..c4024c215 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -33,7 +33,7 @@ namespace KWin { // forward declarations class AbstractClient; -class Client; +class X11Client; class WorkspaceWrapper : public QObject { @@ -93,15 +93,15 @@ Q_SIGNALS: void currentDesktopChanged(int desktop, KWin::AbstractClient *client); void clientAdded(KWin::AbstractClient *client); void clientRemoved(KWin::AbstractClient *client); - void clientManaging(KWin::Client *client); + void clientManaging(KWin::X11Client *client); void clientMinimized(KWin::AbstractClient *client); void clientUnminimized(KWin::AbstractClient *client); - void clientRestored(KWin::Client *client); + void clientRestored(KWin::X11Client *client); void clientMaximizeSet(KWin::AbstractClient *client, bool h, bool v); - void killWindowCalled(KWin::Client *client); + void killWindowCalled(KWin::X11Client *client); void clientActivated(KWin::AbstractClient *client); - void clientFullScreenSet(KWin::Client *client, bool fullScreen, bool user); - void clientSetKeepAbove(KWin::Client *client, bool keepAbove); + void clientFullScreenSet(KWin::X11Client *client, bool fullScreen, bool user); + void clientSetKeepAbove(KWin::X11Client *client, bool keepAbove); /** * Signal emitted whenever the number of desktops changed. * To get the current number of desktops use the property desktops. @@ -264,7 +264,7 @@ void setter( rettype val ); * @param windowId The window Id of the Client * @return The found Client or @c null */ - Q_SCRIPTABLE KWin::Client *getClient(qulonglong windowId); + Q_SCRIPTABLE KWin::X11Client *getClient(qulonglong windowId); public Q_SLOTS: // all the available key bindings @@ -347,7 +347,7 @@ public Q_SLOTS: private Q_SLOTS: void setupAbstractClientConnections(AbstractClient *client); - void setupClientConnections(Client *client); + void setupClientConnections(X11Client *client); }; class QtScriptWorkspaceWrapper : public WorkspaceWrapper diff --git a/sm.cpp b/sm.cpp index 3cd48060d..285973524 100644 --- a/sm.cpp +++ b/sm.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include #include "workspace.h" -#include "client.h" +#include "x11client.h" #include #include #include @@ -132,7 +132,7 @@ void Workspace::storeSession(KConfig* config, SMSavePhase phase) int active_client = -1; for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) { - Client* c = (*it); + X11Client *c = (*it); if (c->windowType() > NET::Splash) { //window types outside this are not tooltips/menus/OSDs //typically these will be unmanaged and not in this list anyway, but that is not enforced @@ -168,7 +168,7 @@ void Workspace::storeSession(KConfig* config, SMSavePhase phase) } } -void Workspace::storeClient(KConfigGroup &cg, int num, Client *c) +void Workspace::storeClient(KConfigGroup &cg, int num, X11Client *c) { c->setSessionActivityOverride(false); //make sure we get the real values QString n = QString::number(num); @@ -211,7 +211,7 @@ void Workspace::storeSubSession(const QString &name, QSet sessionIds int count = 0; int active_client = -1; for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) { - Client* c = (*it); + X11Client *c = (*it); if (c->windowType() > NET::Splash) { continue; } @@ -294,7 +294,7 @@ void Workspace::loadSubSessionInfo(const QString &name) addSessionInfo(cg); } -static bool sessionInfoWindowTypeMatch(Client* c, SessionInfo* info) +static bool sessionInfoWindowTypeMatch(X11Client *c, SessionInfo* info) { if (info->windowType == -2) { // undefined (not really part of NET::WindowType) @@ -312,7 +312,7 @@ static bool sessionInfoWindowTypeMatch(Client* c, SessionInfo* info) * * May return 0 if there's no session info for the client. */ -SessionInfo* Workspace::takeSessionInfo(Client* c) +SessionInfo* Workspace::takeSessionInfo(X11Client *c) { SessionInfo *realInfo = nullptr; QByteArray sessionId = c->sessionId(); @@ -510,7 +510,7 @@ void SessionSaveDoneHelper::processData() void Workspace::sessionSaveDone() { session_saving = false; - foreach (Client * c, clients) { + foreach (X11Client *c, clients) { c->setSessionActivityOverride(false); } } diff --git a/sm.h b/sm.h index 9fdcb547a..4cbef4bb7 100644 --- a/sm.h +++ b/sm.h @@ -36,7 +36,7 @@ class QSocketNotifier; namespace KWin { -class Client; +class X11Client; struct SessionInfo { QByteArray sessionId; diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index fa3e1b355..1a7a89fcb 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -34,7 +34,7 @@ along with this program. If not, see . #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" #endif -#include "client.h" +#include "x11client.h" #include "effects.h" #include "input.h" #include "keyboard_input.h" @@ -318,7 +318,7 @@ void TabBoxHandlerImpl::elevateClient(TabBoxClient *c, QWindow *tabbox, bool b) void TabBoxHandlerImpl::shadeClient(TabBoxClient *c, bool b) const { - Client *cl = dynamic_cast(static_cast(c)->client()); + X11Client *cl = dynamic_cast(static_cast(c)->client()); if (!cl) { // shading is X11 specific return; diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h index 7a0bd13e9..ef3ad5e44 100644 --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -40,7 +40,6 @@ namespace KWin class Workspace; class AbstractClient; -class Client; class X11EventFilter; namespace TabBox { diff --git a/thumbnailitem.cpp b/thumbnailitem.cpp index b968f125f..b5c0e81d6 100644 --- a/thumbnailitem.cpp +++ b/thumbnailitem.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "thumbnailitem.h" // KWin -#include "client.h" +#include "x11client.h" #include "composite.h" #include "effects.h" #include "workspace.h" diff --git a/toplevel.cpp b/toplevel.cpp index cc6c7e4d0..135fc13c1 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . #include "activities.h" #endif #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "client_machine.h" #include "composite.h" #include "effects.h" @@ -326,7 +326,7 @@ bool Toplevel::compositing() const return Workspace::self()->compositing(); } -void Client::damageNotifyEvent() +void X11Client::damageNotifyEvent() { if (syncRequest.isPending && isResize()) { emit damaged(this, QRect()); diff --git a/useractions.cpp b/useractions.cpp index b69020aa1..dd2a98018 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -35,7 +35,7 @@ along with this program. If not, see . #include "useractions.h" #include "cursor.h" -#include "client.h" +#include "x11client.h" #include "colorcorrection/manager.h" #include "composite.h" #include "input.h" @@ -803,7 +803,7 @@ void UserActionsMenu::slotToggleOnActivity(QAction *action) return; } - Client *c = dynamic_cast(m_client.data()); + X11Client *c = dynamic_cast(m_client.data()); if (!c) { return; } @@ -1139,7 +1139,7 @@ void Workspace::performWindowOperation(AbstractClient* c, Options::WindowOperati * Called by the decoration in the new API to determine what buttons the user has configured for * window tab dragging and the operations menu. */ -Options::WindowOperation Client::mouseButtonToWindowOperation(Qt::MouseButtons button) +Options::WindowOperation X11Client::mouseButtonToWindowOperation(Qt::MouseButtons button) { Options::MouseCommand com = Options::MouseNothing; bool active = isActive(); @@ -1161,7 +1161,7 @@ Options::WindowOperation Client::mouseButtonToWindowOperation(Qt::MouseButtons b /** * Performs a mouse command on this client (see options.h) */ -bool Client::performMouseCommand(Options::MouseCommand command, const QPoint &globalPos) +bool X11Client::performMouseCommand(Options::MouseCommand command, const QPoint &globalPos) { bool replay = false; switch(command) { @@ -1717,7 +1717,7 @@ void AbstractClient::setShortcutInternal() workspace()->clientShortcutUpdated(this); } -void Client::setShortcutInternal() +void X11Client::setShortcutInternal() { updateCaption(); #if 0 diff --git a/useractions.h b/useractions.h index 2de180482..29bc9b926 100644 --- a/useractions.h +++ b/useractions.h @@ -34,7 +34,6 @@ class QRect; namespace KWin { class AbstractClient; -class Client; /** * @brief Menu shown for a Client. diff --git a/utils.h b/utils.h index 98e420a00..85a0c5c81 100644 --- a/utils.h +++ b/utils.h @@ -44,15 +44,15 @@ namespace KWin const QPoint invalidPoint(INT_MIN, INT_MIN); class Toplevel; -class Client; +class X11Client; class Unmanaged; class Deleted; class Group; class Options; typedef QList< Toplevel* > ToplevelList; -typedef QList< Client* > ClientList; -typedef QList< const Client* > ConstClientList; +typedef QList< X11Client *> ClientList; +typedef QList< const X11Client *> ConstClientList; typedef QList< Unmanaged* > UnmanagedList; typedef QList< Deleted* > DeletedList; diff --git a/wayland_server.cpp b/wayland_server.cpp index d5adf4aa1..16220f42c 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "wayland_server.h" -#include "client.h" +#include "x11client.h" #include "platform.h" #include "composite.h" #include "idle_inhibition.h" diff --git a/window_property_notify_x11_filter.cpp b/window_property_notify_x11_filter.cpp index 69f6d42d7..bb5c696b9 100644 --- a/window_property_notify_x11_filter.cpp +++ b/window_property_notify_x11_filter.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "window_property_notify_x11_filter.h" -#include "client.h" +#include "x11client.h" #include "effects.h" #include "unmanaged.h" #include "workspace.h" diff --git a/workspace.cpp b/workspace.cpp index d63b666e1..e3827290e 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -29,7 +29,7 @@ along with this program. If not, see . #endif #include "appmenu.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "dbusinterface.h" @@ -90,7 +90,7 @@ ColorMapper::~ColorMapper() void ColorMapper::update() { xcb_colormap_t cmap = m_default; - if (Client *c = dynamic_cast(Workspace::self()->activeClient())) { + if (X11Client *c = dynamic_cast(Workspace::self()->activeClient())) { if (c->colormap() != XCB_COLORMAP_NONE) { cmap = c->colormap(); } @@ -544,7 +544,7 @@ Workspace::~Workspace() stacking_order.clear(); for (ToplevelList::const_iterator it = stack.constBegin(), end = stack.constEnd(); it != end; ++it) { - Client *c = qobject_cast(const_cast(*it)); + X11Client *c = qobject_cast(const_cast(*it)); if (!c) { continue; } @@ -557,7 +557,7 @@ Workspace::~Workspace() m_allClients.removeAll(c); desktops.removeAll(c); } - Client::cleanupX11(); + X11Client::cleanupX11(); if (waylandServer()) { const QList shellClients = waylandServer()->clients(); @@ -605,17 +605,17 @@ void Workspace::setupClientConnections(AbstractClient *c) connect(c, &AbstractClient::minimizedChanged, this, std::bind(&Workspace::clientMinimizedChanged, this, c)); } -Client* Workspace::createClient(xcb_window_t w, bool is_mapped) +X11Client *Workspace::createClient(xcb_window_t w, bool is_mapped) { StackingUpdatesBlocker blocker(this); - Client* c = new Client(); + X11Client *c = new X11Client(); setupClientConnections(c); if (X11Compositor *compositor = X11Compositor::self()) { - connect(c, &Client::blockingCompositingChanged, compositor, &X11Compositor::updateClientCompositeBlocking); + connect(c, &X11Client::blockingCompositingChanged, compositor, &X11Compositor::updateClientCompositeBlocking); } - connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking())); + connect(c, SIGNAL(clientFullScreenSet(KWin::X11Client *,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking())); if (!c->manage(w, is_mapped)) { - Client::deleteClient(c); + X11Client::deleteClient(c); return nullptr; } addClient(c); @@ -640,7 +640,7 @@ Unmanaged* Workspace::createUnmanaged(xcb_window_t w) return c; } -void Workspace::addClient(Client* c) +void Workspace::addClient(X11Client *c) { Group* grp = findGroup(c->window()); @@ -688,7 +688,7 @@ void Workspace::addUnmanaged(Unmanaged* c) /** * Destroys the client \a c */ -void Workspace::removeClient(Client* c) +void Workspace::removeClient(X11Client *c) { if (c == active_popup_client) closeActivePopup(); @@ -938,7 +938,7 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint newDesktop) for (ToplevelList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) { - Client *c = qobject_cast(*it); + X11Client *c = qobject_cast(*it); if (!c) { continue; } @@ -956,7 +956,7 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint newDesktop) } for (int i = stacking_order.size() - 1; i >= 0 ; --i) { - Client *c = qobject_cast(stacking_order.at(i)); + X11Client *c = qobject_cast(stacking_order.at(i)); if (!c) { continue; } @@ -1005,7 +1005,7 @@ AbstractClient *Workspace::findClientToActivateOnDesktop(uint desktop) if (options->isNextFocusPrefersMouse()) { ToplevelList::const_iterator it = stackingOrder().constEnd(); while (it != stackingOrder().constBegin()) { - Client *client = qobject_cast(*(--it)); + X11Client *client = qobject_cast(*(--it)); if (!client) { continue; } @@ -1049,7 +1049,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) for (ToplevelList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) { - Client *c = qobject_cast(*it); + X11Client *c = qobject_cast(*it); if (!c) { continue; } @@ -1068,7 +1068,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) */ for (int i = stacking_order.size() - 1; i >= 0 ; --i) { - Client *c = qobject_cast(stacking_order.at(i)); + X11Client *c = qobject_cast(stacking_order.at(i)); if (!c) { continue; } @@ -1299,7 +1299,7 @@ void Workspace::setShowingDesktop(bool showing) if (!topDesk) topDesk = c; if (auto group = c->group()) { - foreach (Client *cm, group->members()) { + foreach (X11Client *cm, group->members()) { cm->updateLayer(); } } @@ -1649,12 +1649,12 @@ QString Workspace::supportInformation() const return support; } -Client *Workspace::findClient(std::function func) const +X11Client *Workspace::findClient(std::function func) const { - if (Client *ret = Toplevel::findInList(clients, func)) { + if (X11Client *ret = Toplevel::findInList(clients, func)) { return ret; } - if (Client *ret = Toplevel::findInList(desktops, func)) { + if (X11Client *ret = Toplevel::findInList(desktops, func)) { return ret; } return nullptr; @@ -1665,7 +1665,7 @@ AbstractClient *Workspace::findAbstractClient(std::functionwindow() == w; }); case Predicate::WrapperIdMatch: - return findClient([w](const Client *c) { + return findClient([w](const X11Client *c) { return c->wrapperId() == w; }); case Predicate::FrameIdMatch: - return findClient([w](const Client *c) { + return findClient([w](const X11Client *c) { return c->frameId() == w; }); case Predicate::InputIdMatch: - return findClient([w](const Client *c) { + return findClient([w](const X11Client *c) { return c->inputId() == w; }); } @@ -1711,10 +1711,10 @@ Client *Workspace::findClient(Predicate predicate, xcb_window_t w) const Toplevel *Workspace::findToplevel(std::function func) const { - if (Client *ret = Toplevel::findInList(clients, func)) { + if (X11Client *ret = Toplevel::findInList(clients, func)) { return ret; } - if (Client *ret = Toplevel::findInList(desktops, func)) { + if (X11Client *ret = Toplevel::findInList(desktops, func)) { return ret; } if (Unmanaged *ret = Toplevel::findInList(unmanaged, func)) { @@ -1728,7 +1728,7 @@ Toplevel *Workspace::findToplevel(std::function func) co bool Workspace::hasClient(const AbstractClient *c) { - if (auto cc = dynamic_cast(c)) { + if (auto cc = dynamic_cast(c)) { return hasClient(cc); } else { return findAbstractClient([c](const AbstractClient *test) { diff --git a/workspace.h b/workspace.h index 70a17bcf5..d785f6898 100644 --- a/workspace.h +++ b/workspace.h @@ -52,12 +52,12 @@ class Window; } class AbstractClient; -class Client; class Compositor; class InternalClient; class KillWindow; class ShortcutDialog; class UserActionsMenu; +class X11Client; class X11EventFilter; enum class Predicate; @@ -75,7 +75,7 @@ public: bool workspaceEvent(xcb_generic_event_t*); bool workspaceEvent(QEvent*); - bool hasClient(const Client*); + bool hasClient(const X11Client *); bool hasClient(const AbstractClient*); /** @@ -85,7 +85,7 @@ public: * needs to be implemented. An example usage for finding a Client with a matching windowId * @code * xcb_window_t w; // our test window - * Client *client = findClient([w](const Client *c) -> bool { + * X11Client *client = findClient([w](const X11Client *c) -> bool { * return c->window() == w; * }); * @endcode @@ -95,29 +95,29 @@ public: * can be simplified to: * @code * xcb_window_t w; // our test window - * Client *client = findClient(Predicate::WindowMatch, w); + * X11Client *client = findClient(Predicate::WindowMatch, w); * @endcode * - * @param func Unary function that accepts a Client* as argument and + * @param func Unary function that accepts a X11Client *as argument and * returns a value convertible to bool. The value returned indicates whether the - * Client* is considered a match in the context of this function. + * X11Client *is considered a match in the context of this function. * The function shall not modify its argument. * This can either be a function pointer or a function object. - * @return KWin::Client* The found Client or @c null + * @return KWin::X11Client *The found Client or @c null * @see findClient(Predicate, xcb_window_t) */ - Client *findClient(std::function func) const; + X11Client *findClient(std::function func) const; AbstractClient *findAbstractClient(std::function func) const; /** * @brief Finds the Client matching the given match @p predicate for the given window. * * @param predicate Which window should be compared * @param w The window id to test against - * @return KWin::Client* The found Client or @c null - * @see findClient(std::function) + * @return KWin::X11Client *The found Client or @c null + * @see findClient(std::function) */ - Client *findClient(Predicate predicate, xcb_window_t w) const; - void forEachClient(std::function func); + X11Client *findClient(Predicate predicate, xcb_window_t w) const; + void forEachClient(std::function func); void forEachAbstractClient(std::function func); Unmanaged *findUnmanaged(std::function func) const; /** @@ -190,14 +190,14 @@ public: void raiseClient(AbstractClient* c, bool nogroup = false); void lowerClient(AbstractClient* c, bool nogroup = false); void raiseClientRequest(AbstractClient* c, NET::RequestSource src = NET::FromApplication, xcb_timestamp_t timestamp = 0); - void lowerClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp); + void lowerClientRequest(X11Client *c, NET::RequestSource src, xcb_timestamp_t timestamp); void lowerClientRequest(AbstractClient* c); void restackClientUnderActive(AbstractClient*); void restack(AbstractClient *c, AbstractClient *under, bool force = false); void updateClientLayer(AbstractClient* c); void raiseOrLowerClient(AbstractClient*); void resetUpdateToolWindowsTimer(); - void restoreSessionStackingOrder(Client* c); + void restoreSessionStackingOrder(X11Client *c); void updateStackingOrder(bool propagate_new_clients = false); void forceRestacking(); @@ -303,11 +303,11 @@ public: void checkTransients(xcb_window_t w); void storeSession(KConfig* config, SMSavePhase phase); - void storeClient(KConfigGroup &cg, int num, Client *c); + void storeClient(KConfigGroup &cg, int num, X11Client *c); void storeSubSession(const QString &name, QSet sessionIds); void loadSubSessionInfo(const QString &name); - SessionInfo* takeSessionInfo(Client*); + SessionInfo* takeSessionInfo(X11Client *); // D-Bus interface QString supportInformation() const; @@ -317,14 +317,14 @@ public: void setShowingDesktop(bool showing); bool showingDesktop() const; - void sendPingToWindow(xcb_window_t w, xcb_timestamp_t timestamp); // Called from Client::pingWindow() + void sendPingToWindow(xcb_window_t w, xcb_timestamp_t timestamp); // Called from X11Client::pingWindow() - void removeClient(Client*); // Only called from Client::destroyClient() or Client::releaseWindow() + void removeClient(X11Client *); // Only called from X11Client::destroyClient() or X11Client::releaseWindow() void setActiveClient(AbstractClient*); Group* findGroup(xcb_window_t leader) const; void addGroup(Group* group); void removeGroup(Group* group); - Group* findClientLeaderGroup(const Client* c) const; + Group* findClientLeaderGroup(const X11Client *c) const; void removeUnmanaged(Unmanaged*); // Only called from Unmanaged::release() void removeDeleted(Deleted*); @@ -504,7 +504,7 @@ Q_SIGNALS: //Signals required for the scripting interface void desktopPresenceChanged(KWin::AbstractClient*, int); void currentDesktopChanged(int, KWin::AbstractClient*); - void clientAdded(KWin::Client*); + void clientAdded(KWin::X11Client *); void clientRemoved(KWin::AbstractClient*); void clientActivated(KWin::AbstractClient*); void clientDemandsAttentionChanged(KWin::AbstractClient*, bool); @@ -556,9 +556,9 @@ private: void saveOldScreenSizes(); /// This is the right way to create a new client - Client* createClient(xcb_window_t w, bool is_mapped); + X11Client *createClient(xcb_window_t w, bool is_mapped); void setupClientConnections(AbstractClient *client); - void addClient(Client* c); + void addClient(X11Client *c); Unmanaged* createUnmanaged(xcb_window_t w); void addUnmanaged(Unmanaged* c); @@ -779,7 +779,7 @@ inline QPoint Workspace::focusMousePosition() const } inline -void Workspace::forEachClient(std::function< void (Client*) > func) +void Workspace::forEachClient(std::function< void (X11Client *) > func) { std::for_each(clients.constBegin(), clients.constEnd(), func); std::for_each(desktops.constBegin(), desktops.constEnd(), func); @@ -791,9 +791,9 @@ void Workspace::forEachUnmanaged(std::function< void (Unmanaged*) > func) std::for_each(unmanaged.constBegin(), unmanaged.constEnd(), func); } -inline bool Workspace::hasClient(const Client* c) +inline bool Workspace::hasClient(const X11Client *c) { - return findClient([c](const Client *test) { + return findClient([c](const X11Client *test) { return test == c; }); } diff --git a/client.cpp b/x11client.cpp similarity index 91% rename from client.cpp rename to x11client.cpp index 4fe24e6f6..825d9da80 100644 --- a/client.cpp +++ b/x11client.cpp @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ // own -#include "client.h" +#include "x11client.h" // kwin #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" @@ -92,7 +92,7 @@ const NET::WindowTypes SUPPORTED_MANAGED_WINDOW_TYPES_MASK = NET::NormalMask | N // - releaseWindow() - the window is kept, only the client itself is destroyed /** - * \class Client client.h + * \class Client x11client.h * \brief The Client class encapsulates a window decoration frame. */ @@ -100,7 +100,7 @@ const NET::WindowTypes SUPPORTED_MANAGED_WINDOW_TYPES_MASK = NET::NormalMask | N * This ctor is "dumb" - it only initializes data. All the real initialization * is done in manage(). */ -Client::Client() +X11Client::X11Client() : AbstractClient() , m_client() , m_wrapper() @@ -160,10 +160,10 @@ Client::Client() geom = QRect(0, 0, 100, 100); // So that decorations don't start with size being (0,0) client_size = QSize(100, 100); - connect(clientMachine(), &ClientMachine::localhostChanged, this, &Client::updateCaption); - connect(options, &Options::condensedTitleChanged, this, &Client::updateCaption); + connect(clientMachine(), &ClientMachine::localhostChanged, this, &X11Client::updateCaption); + connect(options, &Options::condensedTitleChanged, this, &X11Client::updateCaption); - connect(this, &Client::moveResizeCursorChanged, this, [this] (CursorShape cursor) { + connect(this, &X11Client::moveResizeCursorChanged, this, [this] (CursorShape cursor) { xcb_cursor_t nativeCursor = Cursor::x11Cursor(cursor); m_frame.defineCursor(nativeCursor); if (m_decoInputExtent.isValid()) @@ -181,7 +181,7 @@ Client::Client() /** * "Dumb" destructor. */ -Client::~Client() +X11Client::~X11Client() { if (m_killHelperPID && !::kill(m_killHelperPID, 0)) { // means the process is alive ::kill(m_killHelperPID, SIGTERM); @@ -200,7 +200,7 @@ Client::~Client() } // Use destroyClient() or releaseWindow(), Client instances cannot be deleted directly -void Client::deleteClient(Client* c) +void X11Client::deleteClient(X11Client *c) { delete c; } @@ -208,7 +208,7 @@ void Client::deleteClient(Client* c) /** * Releases the window. The client has done its job and the window is still existing. */ -void Client::releaseWindow(bool on_shutdown) +void X11Client::releaseWindow(bool on_shutdown) { Q_ASSERT(!deleting); deleting = true; @@ -282,7 +282,7 @@ void Client::releaseWindow(bool on_shutdown) * Like releaseWindow(), but this one is called when the window has been already destroyed * (E.g. The application closed it) */ -void Client::destroyClient() +void X11Client::destroyClient() { Q_ASSERT(!deleting); deleting = true; @@ -321,7 +321,7 @@ void Client::destroyClient() deleteClient(this); } -void Client::updateInputWindow() +void X11Client::updateInputWindow() { if (!Xcb::Extensions::self()->isShapeInputAvailable()) return; @@ -378,7 +378,7 @@ void Client::updateInputWindow() m_decoInputExtent, 0, 0, rects.count(), rects.constData()); } -void Client::updateDecoration(bool check_workspace_pos, bool force) +void X11Client::updateDecoration(bool check_workspace_pos, bool force) { if (!force && ((!isDecorated() && noBorder()) || (isDecorated() && !noBorder()))) @@ -400,13 +400,13 @@ void Client::updateDecoration(bool check_workspace_pos, bool force) updateFrameExtents(); } -void Client::createDecoration(const QRect& oldgeom) +void X11Client::createDecoration(const QRect& oldgeom) { KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::getShadow); - connect(decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &Client::updateInputWindow); + connect(decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &X11Client::updateInputWindow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { updateFrameExtents(); @@ -422,8 +422,8 @@ void Client::createDecoration(const QRect& oldgeom) emit geometryShapeChanged(this, oldgeom); } ); - connect(decoratedClient()->decoratedClient(), &KDecoration2::DecoratedClient::widthChanged, this, &Client::updateInputWindow); - connect(decoratedClient()->decoratedClient(), &KDecoration2::DecoratedClient::heightChanged, this, &Client::updateInputWindow); + connect(decoratedClient()->decoratedClient(), &KDecoration2::DecoratedClient::widthChanged, this, &X11Client::updateInputWindow); + connect(decoratedClient()->decoratedClient(), &KDecoration2::DecoratedClient::heightChanged, this, &X11Client::updateInputWindow); } setDecoration(decoration); @@ -435,7 +435,7 @@ void Client::createDecoration(const QRect& oldgeom) emit geometryShapeChanged(this, oldgeom); } -void Client::destroyDecoration() +void X11Client::destroyDecoration() { QRect oldgeom = geometry(); if (isDecorated()) { @@ -452,7 +452,7 @@ void Client::destroyDecoration() m_decoInputExtent.reset(); } -void Client::layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const +void X11Client::layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const { if (!isDecorated()) { return; @@ -481,7 +481,7 @@ void Client::layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect borderRight() + strut.right, r.height() - top.height() - bottom.height()); } -QRect Client::transparentRect() const +QRect X11Client::transparentRect() const { if (isShade()) return QRect(); @@ -501,7 +501,7 @@ QRect Client::transparentRect() const return QRect(); } -void Client::detectNoBorder() +void X11Client::detectNoBorder() { if (shape()) { noborder = true; @@ -539,7 +539,7 @@ void Client::detectNoBorder() } } -void Client::updateFrameExtents() +void X11Client::updateFrameExtents() { NETStrut strut; strut.left = borderLeft(); @@ -549,18 +549,18 @@ void Client::updateFrameExtents() info->setFrameExtents(strut); } -Xcb::Property Client::fetchGtkFrameExtents() const +Xcb::Property X11Client::fetchGtkFrameExtents() const { return Xcb::Property(false, m_client, atoms->gtk_frame_extents, XCB_ATOM_CARDINAL, 0, 4); } -void Client::readGtkFrameExtents(Xcb::Property &prop) +void X11Client::readGtkFrameExtents(Xcb::Property &prop) { m_clientSideDecorated = !prop.isNull() && prop->type != 0; emit clientSideDecoratedChanged(); } -void Client::detectGtkFrameExtents() +void X11Client::detectGtkFrameExtents() { Xcb::Property prop = fetchGtkFrameExtents(); readGtkFrameExtents(prop); @@ -573,18 +573,18 @@ void Client::detectGtkFrameExtents() * the decoration may alter some borders, but the actual size * of the decoration stays the same). */ -void Client::resizeDecoration() +void X11Client::resizeDecoration() { triggerDecorationRepaint(); updateInputWindow(); } -bool Client::userNoBorder() const +bool X11Client::userNoBorder() const { return noborder; } -bool Client::isFullScreenable() const +bool X11Client::isFullScreenable() const { if (!rules()->checkFullScreen(true)) { return false; @@ -600,17 +600,17 @@ bool Client::isFullScreenable() const return !isSpecialWindow(); // also better disallow only weird types to go fullscreen } -bool Client::noBorder() const +bool X11Client::noBorder() const { return userNoBorder() || isFullScreen(); } -bool Client::userCanSetNoBorder() const +bool X11Client::userCanSetNoBorder() const { return !isFullScreen() && !isShade(); } -void Client::setNoBorder(bool set) +void X11Client::setNoBorder(bool set) { if (!userCanSetNoBorder()) return; @@ -622,17 +622,17 @@ void Client::setNoBorder(bool set) updateWindowRules(Rules::NoBorder); } -void Client::checkNoBorder() +void X11Client::checkNoBorder() { setNoBorder(app_noborder); } -bool Client::wantsShadowToBeRendered() const +bool X11Client::wantsShadowToBeRendered() const { return !isFullScreen() && maximizeMode() != MaximizeFull; } -void Client::updateShape() +void X11Client::updateShape() { if (shape()) { // Workaround for #19644 - Shaped windows shouldn't have decoration @@ -666,12 +666,12 @@ void Client::updateShape() static Xcb::Window shape_helper_window(XCB_WINDOW_NONE); -void Client::cleanupX11() +void X11Client::cleanupX11() { shape_helper_window.reset(); } -void Client::updateInputShape() +void X11Client::updateInputShape() { if (hiddenPreview()) // Sets it to none, don't change return; @@ -701,7 +701,7 @@ void Client::updateInputShape() } } -void Client::hideClient(bool hide) +void X11Client::hideClient(bool hide) { if (hidden == hide) return; @@ -709,7 +709,7 @@ void Client::hideClient(bool hide) updateVisibility(); } -bool Client::setupCompositing() +bool X11Client::setupCompositing() { if (!Toplevel::setupCompositing()){ return false; @@ -718,7 +718,7 @@ bool Client::setupCompositing() return true; } -void Client::finishCompositing(ReleaseReason releaseReason) +void X11Client::finishCompositing(ReleaseReason releaseReason) { Toplevel::finishCompositing(releaseReason); updateVisibility(); @@ -729,7 +729,7 @@ void Client::finishCompositing(ReleaseReason releaseReason) /** * Returns whether the window is minimizable or not */ -bool Client::isMinimizable() const +bool X11Client::isMinimizable() const { if (isSpecialWindow() && !isTransient()) return false; @@ -762,14 +762,14 @@ bool Client::isMinimizable() const return true; } -void Client::doMinimize() +void X11Client::doMinimize() { updateVisibility(); updateAllowedActions(); workspace()->updateMinimizedOfTransients(this); } -QRect Client::iconGeometry() const +QRect X11Client::iconGeometry() const { NETRect r = info->iconGeometry(); QRect geom(r.pos.x, r.pos.y, r.size.width, r.size.height); @@ -778,7 +778,7 @@ QRect Client::iconGeometry() const else { // Check all mainwindows of this window (recursively) foreach (AbstractClient * amainwin, mainClients()) { - Client *mainwin = dynamic_cast(amainwin); + X11Client *mainwin = dynamic_cast(amainwin); if (!mainwin) { continue; } @@ -791,12 +791,12 @@ QRect Client::iconGeometry() const } } -bool Client::isShadeable() const +bool X11Client::isShadeable() const { return !isSpecialWindow() && !noBorder() && (rules()->checkShade(ShadeNormal) != rules()->checkShade(ShadeNone)); } -void Client::setShade(ShadeMode mode) +void X11Client::setShade(ShadeMode mode) { if (mode == ShadeHover && isMove()) return; // causes geometry breaks and is probably nasty @@ -864,7 +864,7 @@ void Client::setShade(ShadeMode mode) shade_below = nullptr; // this is likely related to the index parameter?! for (int idx = order.indexOf(this) + 1; idx < order.count(); ++idx) { - shade_below = qobject_cast(order.at(idx)); + shade_below = qobject_cast(order.at(idx)); if (shade_below) { break; } @@ -890,31 +890,31 @@ void Client::setShade(ShadeMode mode) emit shadeChanged(); } -void Client::shadeHover() +void X11Client::shadeHover() { setShade(ShadeHover); cancelShadeHoverTimer(); } -void Client::shadeUnhover() +void X11Client::shadeUnhover() { setShade(ShadeNormal); cancelShadeHoverTimer(); } -void Client::cancelShadeHoverTimer() +void X11Client::cancelShadeHoverTimer() { delete shadeHoverTimer; shadeHoverTimer = nullptr; } -void Client::toggleShade() +void X11Client::toggleShade() { // If the mode is ShadeHover or ShadeActive, cancel shade too setShade(shade_mode == ShadeNone ? ShadeNormal : ShadeNone); } -void Client::updateVisibility() +void X11Client::updateVisibility() { if (deleting) return; @@ -959,7 +959,7 @@ void Client::updateVisibility() * Sets the client window's mapping state. Possible values are * WithdrawnState, IconicState, NormalState. */ -void Client::exportMappingState(int s) +void X11Client::exportMappingState(int s) { Q_ASSERT(m_client != XCB_WINDOW_NONE); Q_ASSERT(!deleting || s == XCB_ICCCM_WM_STATE_WITHDRAWN); @@ -975,7 +975,7 @@ void Client::exportMappingState(int s) m_client.changeProperty(atoms->wm_state, atoms->wm_state, 32, 2, data); } -void Client::internalShow() +void X11Client::internalShow() { if (mapping_state == Mapped) return; @@ -990,7 +990,7 @@ void Client::internalShow() emit windowShown(this); } -void Client::internalHide() +void X11Client::internalHide() { if (mapping_state == Unmapped) return; @@ -1005,7 +1005,7 @@ void Client::internalHide() emit windowHidden(this); } -void Client::internalKeep() +void X11Client::internalKeep() { Q_ASSERT(compositing()); if (mapping_state == Kept) @@ -1027,7 +1027,7 @@ void Client::internalKeep() * not necessarily the client window itself (i.e. a shaded window is here * considered mapped, even though it is in IconicState). */ -void Client::map() +void X11Client::map() { // XComposite invalidates backing pixmaps on unmap (minimize, different // virtual desktop, etc.). We kept the last known good pixmap around @@ -1048,7 +1048,7 @@ void Client::map() /** * Unmaps the client. Again, this is about the frame. */ -void Client::unmap() +void X11Client::unmap() { // Here it may look like a race condition, as some other client might try to unmap // the window between these two XSelectInput() calls. However, they're supposed to @@ -1076,7 +1076,7 @@ void Client::unmap() * Using normal shape would be better, but that'd affect other things, e.g. painting * of the actual preview. */ -void Client::updateHiddenPreview() +void X11Client::updateHiddenPreview() { if (hiddenPreview()) { workspace()->forceRestacking(); @@ -1090,7 +1090,7 @@ void Client::updateHiddenPreview() } } -void Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, uint32_t data1, uint32_t data2, uint32_t data3, xcb_timestamp_t timestamp) +void X11Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, uint32_t data1, uint32_t data2, uint32_t data3, xcb_timestamp_t timestamp) { xcb_client_message_event_t ev; memset(&ev, 0, sizeof(ev)); @@ -1114,7 +1114,7 @@ void Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol /** * Returns whether the window may be closed (have a close button) */ -bool Client::isCloseable() const +bool X11Client::isCloseable() const { return rules()->checkCloseable(m_motif.close() && !isSpecialWindow()); } @@ -1122,7 +1122,7 @@ bool Client::isCloseable() const /** * Closes the window by either sending a delete_window message or using XKill. */ -void Client::closeWindow() +void X11Client::closeWindow() { if (!isCloseable()) return; @@ -1142,9 +1142,9 @@ void Client::closeWindow() /** * Kills the window via XKill */ -void Client::killWindow() +void X11Client::killWindow() { - qCDebug(KWIN_CORE) << "Client::killWindow():" << caption(); + qCDebug(KWIN_CORE) << "X11Client::killWindow():" << caption(); killProcess(false); m_client.kill(); // Always kill this client at the server destroyClient(); @@ -1154,7 +1154,7 @@ void Client::killWindow() * Send a ping to the window using _NET_WM_PING if possible if it * doesn't respond within a reasonable time, it will be killed. */ -void Client::pingWindow() +void X11Client::pingWindow() { if (!info->supportsProtocol(NET::PingProtocol)) return; // Can't ping :( @@ -1187,7 +1187,7 @@ void Client::pingWindow() workspace()->sendPingToWindow(window(), m_pingTimestamp); } -void Client::gotPing(xcb_timestamp_t timestamp) +void X11Client::gotPing(xcb_timestamp_t timestamp) { // Just plain compare is not good enough because of 64bit and truncating and whatnot if (NET::timestampCompare(timestamp, m_pingTimestamp) != 0) @@ -1203,7 +1203,7 @@ void Client::gotPing(xcb_timestamp_t timestamp) } } -void Client::killProcess(bool ask, xcb_timestamp_t timestamp) +void X11Client::killProcess(bool ask, xcb_timestamp_t timestamp) { if (m_killHelperPID && !::kill(m_killHelperPID, 0)) // means the process is alive return; @@ -1233,22 +1233,22 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp) } } -void Client::doSetSkipTaskbar() +void X11Client::doSetSkipTaskbar() { info->setState(skipTaskbar() ? NET::SkipTaskbar : NET::States(), NET::SkipTaskbar); } -void Client::doSetSkipPager() +void X11Client::doSetSkipPager() { info->setState(skipPager() ? NET::SkipPager : NET::States(), NET::SkipPager); } -void Client::doSetSkipSwitcher() +void X11Client::doSetSkipSwitcher() { info->setState(skipSwitcher() ? NET::SkipSwitcher : NET::States(), NET::SkipSwitcher); } -void Client::doSetDesktop(int desktop, int was_desk) +void X11Client::doSetDesktop(int desktop, int was_desk) { Q_UNUSED(desktop) Q_UNUSED(was_desk) @@ -1262,7 +1262,7 @@ void Client::doSetDesktop(int desktop, int was_desk) * Note: If it was on all activities and you try to remove it from one, nothing will happen; * I don't think that's an important enough use case to handle here. */ -void Client::setOnActivity(const QString &activity, bool enable) +void X11Client::setOnActivity(const QString &activity, bool enable) { #ifdef KWIN_BUILD_ACTIVITIES if (! Activities::self()) { @@ -1288,7 +1288,7 @@ void Client::setOnActivity(const QString &activity, bool enable) /** * set exactly which activities this client is on */ -void Client::setOnActivities(QStringList newActivitiesList) +void X11Client::setOnActivities(QStringList newActivitiesList) { #ifdef KWIN_BUILD_ACTIVITIES if (!Activities::self()) { @@ -1330,7 +1330,7 @@ void Client::setOnActivities(QStringList newActivitiesList) #endif } -void Client::blockActivityUpdates(bool b) +void X11Client::blockActivityUpdates(bool b) { if (b) { ++m_activityUpdatesBlocked; @@ -1345,7 +1345,7 @@ void Client::blockActivityUpdates(bool b) /** * update after activities changed */ -void Client::updateActivities(bool includeTransients) +void X11Client::updateActivities(bool includeTransients) { if (m_activityUpdatesBlocked) { m_blockedActivityUpdatesRequireTransients |= includeTransients; @@ -1363,7 +1363,7 @@ void Client::updateActivities(bool includeTransients) * if it's on all activities, the list will be empty. * Don't use this, use isOnActivity() and friends (from class Toplevel) */ -QStringList Client::activities() const +QStringList X11Client::activities() const { if (sessionActivityOverride) { return QStringList(); @@ -1375,7 +1375,7 @@ QStringList Client::activities() const * if @p on is true, sets on all activities. * if it's false, sets it to only be on the current activity */ -void Client::setOnAllActivities(bool on) +void X11Client::setOnAllActivities(bool on) { #ifdef KWIN_BUILD_ACTIVITIES if (on == isOnAllActivities()) @@ -1394,7 +1394,7 @@ void Client::setOnAllActivities(bool on) /** * Performs the actual focusing of the window using XSetInputFocus and WM_TAKE_FOCUS */ -void Client::takeFocus() +void X11Client::takeFocus() { if (rules()->checkAcceptFocus(info->input())) m_client.focus(); @@ -1407,7 +1407,7 @@ void Client::takeFocus() bool breakShowingDesktop = !keepAbove(); if (breakShowingDesktop) { - foreach (const Client *c, group()->members()) { + foreach (const X11Client *c, group()->members()) { if (c->isDesktop()) { breakShowingDesktop = false; break; @@ -1425,7 +1425,7 @@ void Client::takeFocus() * * \sa contextHelp() */ -bool Client::providesContextHelp() const +bool X11Client::providesContextHelp() const { return info->supportsProtocol(NET::ContextHelpProtocol); } @@ -1436,7 +1436,7 @@ bool Client::providesContextHelp() const * * \sa providesContextHelp() */ -void Client::showContextHelp() +void X11Client::showContextHelp() { if (info->supportsProtocol(NET::ContextHelpProtocol)) { sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help); @@ -1447,7 +1447,7 @@ void Client::showContextHelp() * Fetches the window's caption (WM_NAME property). It will be * stored in the client's caption(). */ -void Client::fetchName() +void X11Client::fetchName() { setCaption(readName()); } @@ -1469,7 +1469,7 @@ static inline QString readNameProperty(xcb_window_t w, xcb_atom_t atom) return QString(); } -QString Client::readName() const +QString X11Client::readName() const { if (info->name() && info->name()[0] != '\0') return QString::fromUtf8(info->name()).simplified(); @@ -1481,7 +1481,7 @@ QString Client::readName() const // The list is taken from https://www.unicode.org/reports/tr9/ (#154840) static const QChar LRM(0x200E); -void Client::setCaption(const QString& _s, bool force) +void X11Client::setCaption(const QString& _s, bool force) { QString s(_s); for (int i = 0; i < s.length(); ) { @@ -1540,12 +1540,12 @@ void Client::setCaption(const QString& _s, bool force) emit captionChanged(); } -void Client::updateCaption() +void X11Client::updateCaption() { setCaption(cap_normal, true); } -void Client::fetchIconicName() +void X11Client::fetchIconicName() { QString s; if (info->iconName() && info->iconName()[0] != '\0') @@ -1564,7 +1564,7 @@ void Client::fetchIconicName() } } -void Client::setClientShown(bool shown) +void X11Client::setClientShown(bool shown) { if (deleting) return; // Don't change shown status if this client is being deleted @@ -1584,7 +1584,7 @@ void Client::setClientShown(bool shown) } } -void Client::getMotifHints() +void X11Client::getMotifHints() { const bool wasClosable = m_motif.close(); const bool wasNoBorder = m_motif.noBorder(); @@ -1611,7 +1611,7 @@ void Client::getMotifHints() } } -void Client::getIcons() +void X11Client::getIcons() { // First read icons from the window itself const QString themedIconName = iconFromDesktopFile(); @@ -1657,7 +1657,7 @@ void Client::getIcons() setIcon(icon); } -void Client::getSyncCounter() +void X11Client::getSyncCounter() { // TODO: make sync working on XWayland static const bool isX11 = kwinApp()->operationMode() == Application::OperationModeX11; @@ -1701,7 +1701,7 @@ void Client::getSyncCounter() /** * Send the client a _NET_SYNC_REQUEST */ -void Client::sendSyncRequest() +void X11Client::sendSyncRequest() { if (syncRequest.counter == XCB_NONE || syncRequest.isPending) return; // do NOT, NEVER send a sync request when there's one on the stack. the clients will just stop respoding. FOREVER! ... @@ -1728,7 +1728,7 @@ void Client::sendSyncRequest() syncRequest.failsafeTimeout->setSingleShot(true); } // if there's no response within 10 seconds, sth. went wrong and we remove XSYNC support from this client. - // see events.cpp Client::syncEvent() + // see events.cpp X11Client::syncEvent() syncRequest.failsafeTimeout->start(ready_for_painting ? 10000 : 1000); // We increment before the notify so that after the notify @@ -1749,17 +1749,17 @@ void Client::sendSyncRequest() syncRequest.lastTimestamp = xTime(); } -bool Client::wantsInput() const +bool X11Client::wantsInput() const { return rules()->checkAcceptFocus(acceptsFocus() || info->supportsProtocol(NET::TakeFocusProtocol)); } -bool Client::acceptsFocus() const +bool X11Client::acceptsFocus() const { return info->input(); } -void Client::setBlockingCompositing(bool block) +void X11Client::setBlockingCompositing(bool block) { const bool usedToBlock = blocks_compositing; blocks_compositing = rules()->checkBlockCompositing(block && options->windowsBlockCompositing()); @@ -1768,7 +1768,7 @@ void Client::setBlockingCompositing(bool block) } } -void Client::updateAllowedActions(bool force) +void X11Client::updateAllowedActions(bool force) { if (!isManaged() && !force) return; @@ -1810,13 +1810,13 @@ void Client::updateAllowedActions(bool force) } } -void Client::debug(QDebug& stream) const +void X11Client::debug(QDebug& stream) const { stream.nospace(); print(stream); } -Xcb::StringProperty Client::fetchActivities() const +Xcb::StringProperty X11Client::fetchActivities() const { #ifdef KWIN_BUILD_ACTIVITIES return Xcb::StringProperty(window(), atoms->activities); @@ -1825,7 +1825,7 @@ Xcb::StringProperty Client::fetchActivities() const #endif } -void Client::readActivities(Xcb::StringProperty &property) +void X11Client::readActivities(Xcb::StringProperty &property) { #ifdef KWIN_BUILD_ACTIVITIES QStringList newActivitiesList; @@ -1880,7 +1880,7 @@ void Client::readActivities(Xcb::StringProperty &property) #endif } -void Client::checkActivities() +void X11Client::checkActivities() { #ifdef KWIN_BUILD_ACTIVITIES Xcb::StringProperty property = fetchActivities(); @@ -1888,57 +1888,57 @@ void Client::checkActivities() #endif } -void Client::setSessionActivityOverride(bool needed) +void X11Client::setSessionActivityOverride(bool needed) { sessionActivityOverride = needed; updateActivities(false); } -QRect Client::decorationRect() const +QRect X11Client::decorationRect() const { return QRect(0, 0, width(), height()); } -Xcb::Property Client::fetchFirstInTabBox() const +Xcb::Property X11Client::fetchFirstInTabBox() const { return Xcb::Property(false, m_client, atoms->kde_first_in_window_list, atoms->kde_first_in_window_list, 0, 1); } -void Client::readFirstInTabBox(Xcb::Property &property) +void X11Client::readFirstInTabBox(Xcb::Property &property) { setFirstInTabBox(property.toBool(32, atoms->kde_first_in_window_list)); } -void Client::updateFirstInTabBox() +void X11Client::updateFirstInTabBox() { // TODO: move into KWindowInfo Xcb::Property property = fetchFirstInTabBox(); readFirstInTabBox(property); } -Xcb::StringProperty Client::fetchColorScheme() const +Xcb::StringProperty X11Client::fetchColorScheme() const { return Xcb::StringProperty(m_client, atoms->kde_color_sheme); } -void Client::readColorScheme(Xcb::StringProperty &property) +void X11Client::readColorScheme(Xcb::StringProperty &property) { AbstractClient::updateColorScheme(rules()->checkDecoColor(QString::fromUtf8(property))); } -void Client::updateColorScheme() +void X11Client::updateColorScheme() { Xcb::StringProperty property = fetchColorScheme(); readColorScheme(property); } -bool Client::isClient() const +bool X11Client::isClient() const { return true; } -NET::WindowType Client::windowType(bool direct, int supportedTypes) const +NET::WindowType X11Client::windowType(bool direct, int supportedTypes) const { // TODO: does it make sense to cache the returned window type for SUPPORTED_MANAGED_WINDOW_TYPES_MASK? if (supportedTypes == 0) { @@ -1959,24 +1959,24 @@ NET::WindowType Client::windowType(bool direct, int supportedTypes) const return wt; } -void Client::cancelFocusOutTimer() +void X11Client::cancelFocusOutTimer() { if (m_focusOutTimer) { m_focusOutTimer->stop(); } } -xcb_window_t Client::frameId() const +xcb_window_t X11Client::frameId() const { return m_frame; } -Xcb::Property Client::fetchShowOnScreenEdge() const +Xcb::Property X11Client::fetchShowOnScreenEdge() const { return Xcb::Property(false, window(), atoms->kde_screen_edge_show, XCB_ATOM_CARDINAL, 0, 1); } -void Client::readShowOnScreenEdge(Xcb::Property &property) +void X11Client::readShowOnScreenEdge(Xcb::Property &property) { //value comes in two parts, edge in the lower byte //then the type in the upper byte @@ -2017,7 +2017,7 @@ void Client::readShowOnScreenEdge(Xcb::Property &property) hideClient(true); successfullyHidden = isHiddenInternal(); - m_edgeGeometryTrackingConnection = connect(this, &Client::geometryChanged, this, [this, border](){ + m_edgeGeometryTrackingConnection = connect(this, &X11Client::geometryChanged, this, [this, border](){ hideClient(true); ScreenEdges::self()->reserve(this, border); }); @@ -2042,13 +2042,13 @@ void Client::readShowOnScreenEdge(Xcb::Property &property) } } -void Client::updateShowOnScreenEdge() +void X11Client::updateShowOnScreenEdge() { Xcb::Property property = fetchShowOnScreenEdge(); readShowOnScreenEdge(property); } -void Client::showOnScreenEdge() +void X11Client::showOnScreenEdge() { disconnect(m_edgeRemoveConnection); @@ -2057,7 +2057,7 @@ void Client::showOnScreenEdge() xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show); } -void Client::addDamage(const QRegion &damage) +void X11Client::addDamage(const QRegion &damage) { if (!ready_for_painting) { // avoid "setReadyForPainting()" function calling overhead if (syncRequest.counter == XCB_NONE) { // cannot detect complete redraw, consider done now @@ -2069,53 +2069,53 @@ void Client::addDamage(const QRegion &damage) Toplevel::addDamage(damage); } -bool Client::belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const +bool X11Client::belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const { - const Client *c2 = dynamic_cast(other); + const X11Client *c2 = dynamic_cast(other); if (!c2) { return false; } - return Client::belongToSameApplication(this, c2, checks); + return X11Client::belongToSameApplication(this, c2, checks); } -QSize Client::resizeIncrements() const +QSize X11Client::resizeIncrements() const { return m_geometryHints.resizeIncrements(); } -Xcb::StringProperty Client::fetchApplicationMenuServiceName() const +Xcb::StringProperty X11Client::fetchApplicationMenuServiceName() const { return Xcb::StringProperty(m_client, atoms->kde_net_wm_appmenu_service_name); } -void Client::readApplicationMenuServiceName(Xcb::StringProperty &property) +void X11Client::readApplicationMenuServiceName(Xcb::StringProperty &property) { updateApplicationMenuServiceName(QString::fromUtf8(property)); } -void Client::checkApplicationMenuServiceName() +void X11Client::checkApplicationMenuServiceName() { Xcb::StringProperty property = fetchApplicationMenuServiceName(); readApplicationMenuServiceName(property); } -Xcb::StringProperty Client::fetchApplicationMenuObjectPath() const +Xcb::StringProperty X11Client::fetchApplicationMenuObjectPath() const { return Xcb::StringProperty(m_client, atoms->kde_net_wm_appmenu_object_path); } -void Client::readApplicationMenuObjectPath(Xcb::StringProperty &property) +void X11Client::readApplicationMenuObjectPath(Xcb::StringProperty &property) { updateApplicationMenuObjectPath(QString::fromUtf8(property)); } -void Client::checkApplicationMenuObjectPath() +void X11Client::checkApplicationMenuObjectPath() { Xcb::StringProperty property = fetchApplicationMenuObjectPath(); readApplicationMenuObjectPath(property); } -void Client::handleSync() +void X11Client::handleSync() { setReadyForPainting(); setupWindowManagementInterface(); diff --git a/client.h b/x11client.h similarity index 90% rename from client.h rename to x11client.h index 2b4b46474..1dfec104b 100644 --- a/client.h +++ b/x11client.h @@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ -#ifndef KWIN_CLIENT_H -#define KWIN_CLIENT_H +#pragma once // kwin #include "options.h" @@ -58,8 +57,7 @@ enum class Predicate { InputIdMatch }; -class KWIN_EXPORT Client - : public AbstractClient +class KWIN_EXPORT X11Client : public AbstractClient { Q_OBJECT /** @@ -86,7 +84,7 @@ class KWIN_EXPORT Client */ Q_PROPERTY(bool clientSideDecorated READ isClientSideDecorated NOTIFY clientSideDecoratedChanged) public: - explicit Client(); + explicit X11Client(); xcb_window_t wrapperId() const; xcb_window_t inputId() const { return m_decoInputExtent; } xcb_window_t frameId() const override; @@ -233,10 +231,10 @@ public: bool hasUserTimeSupport() const; /// Does 'delete c;' - static void deleteClient(Client* c); + static void deleteClient(X11Client *c); - static bool belongToSameApplication(const Client* c1, const Client* c2, SameApplicationChecks checks = SameApplicationChecks()); - static bool sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool active_hack); + static bool belongToSameApplication(const X11Client *c1, const X11Client *c2, SameApplicationChecks checks = SameApplicationChecks()); + static bool sameAppWindowRoleMatch(const X11Client *c1, const X11Client *c2, bool active_hack); void killWindow() override; void toggleShade(); @@ -326,7 +324,7 @@ private Q_SLOTS: private: // Use Workspace::createClient() - ~Client() override; ///< Use destroyClient() or releaseWindow() + ~X11Client() override; ///< Use destroyClient() or releaseWindow() // Handlers for X11 events bool mapRequestEvent(xcb_map_request_event_t *e); @@ -372,8 +370,8 @@ protected: //in between objects as compared to simple function //calls Q_SIGNALS: - void clientManaging(KWin::Client*); - void clientFullScreenSet(KWin::Client*, bool, bool); + void clientManaging(KWin::X11Client *); + void clientFullScreenSet(KWin::X11Client *, bool, bool); /** * Emitted whenever the Client want to show it menu @@ -395,7 +393,7 @@ Q_SIGNALS: /** * Emitted whenever the Client's block compositing state changes. */ - void blockingCompositingChanged(KWin::Client *client); + void blockingCompositingChanged(KWin::X11Client *client); void clientSideDecoratedChanged(); private: @@ -411,7 +409,7 @@ private: void fetchIconicName(); QString readName() const; void setCaption(const QString& s, bool force = false); - bool hasTransientInternal(const Client* c, bool indirect, ConstClientList& set) const; + bool hasTransientInternal(const X11Client *c, bool indirect, ConstClientList& set) const; void setShortcutInternal() override; void configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool); @@ -498,7 +496,7 @@ private: xcb_window_t m_transientForId; xcb_window_t m_originalTransientForId; ShadeMode shade_mode; - Client *shade_below; + X11Client *shade_below; uint deleting : 1; ///< True when doing cleanup and destroying the client Xcb::MotifHints m_motif; uint hidden : 1; ///< Forcibly hidden by calling hide() @@ -527,7 +525,7 @@ private: QSize client_size; bool shade_geometry_change; SyncRequest syncRequest; - static bool check_active_modal; ///< \see Client::checkActiveModal() + static bool check_active_modal; ///< \see X11Client::checkActiveModal() int sm_stacking_order; friend struct ResetupRulesProcedure; @@ -553,142 +551,140 @@ private: QMetaObject::Connection m_edgeGeometryTrackingConnection; }; -inline xcb_window_t Client::wrapperId() const +inline xcb_window_t X11Client::wrapperId() const { return m_wrapper; } -inline bool Client::isClientSideDecorated() const +inline bool X11Client::isClientSideDecorated() const { return m_clientSideDecorated; } -inline bool Client::groupTransient() const +inline bool X11Client::groupTransient() const { return m_transientForId == rootWindow(); } // Needed because verifyTransientFor() may set transient_for_id to root window, // if the original value has a problem (window doesn't exist, etc.) -inline bool Client::wasOriginallyGroupTransient() const +inline bool X11Client::wasOriginallyGroupTransient() const { return m_originalTransientForId == rootWindow(); } -inline bool Client::isTransient() const +inline bool X11Client::isTransient() const { return m_transientForId != XCB_WINDOW_NONE; } -inline const Group* Client::group() const +inline const Group* X11Client::group() const { return in_group; } -inline Group* Client::group() +inline Group* X11Client::group() { return in_group; } -inline bool Client::isShown(bool shaded_is_shown) const +inline bool X11Client::isShown(bool shaded_is_shown) const { return !isMinimized() && (!isShade() || shaded_is_shown) && !hidden; } -inline bool Client::isHiddenInternal() const +inline bool X11Client::isHiddenInternal() const { return hidden; } -inline ShadeMode Client::shadeMode() const +inline ShadeMode X11Client::shadeMode() const { return shade_mode; } -inline QRect Client::geometryRestore() const +inline QRect X11Client::geometryRestore() const { return geom_restore; } -inline void Client::setGeometryRestore(const QRect &geo) +inline void X11Client::setGeometryRestore(const QRect &geo) { geom_restore = geo; } -inline MaximizeMode Client::maximizeMode() const +inline MaximizeMode X11Client::maximizeMode() const { return max_mode; } -inline bool Client::isFullScreen() const +inline bool X11Client::isFullScreen() const { return m_fullscreenMode != FullScreenNone; } -inline bool Client::hasNETSupport() const +inline bool X11Client::hasNETSupport() const { return info->hasNETSupport(); } -inline xcb_colormap_t Client::colormap() const +inline xcb_colormap_t X11Client::colormap() const { return m_colormap; } -inline int Client::sessionStackingOrder() const +inline int X11Client::sessionStackingOrder() const { return sm_stacking_order; } -inline bool Client::isManaged() const +inline bool X11Client::isManaged() const { return m_managed; } -inline QSize Client::clientSize() const +inline QSize X11Client::clientSize() const { return client_size; } -inline void Client::plainResize(const QSize& s, ForceGeometry_t force) +inline void X11Client::plainResize(const QSize& s, ForceGeometry_t force) { plainResize(s.width(), s.height(), force); } -inline void Client::resizeWithChecks(int w, int h, AbstractClient::ForceGeometry_t force) +inline void X11Client::resizeWithChecks(int w, int h, AbstractClient::ForceGeometry_t force) { resizeWithChecks(w, h, XCB_GRAVITY_BIT_FORGET, force); } -inline void Client::resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force) +inline void X11Client::resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force) { resizeWithChecks(s.width(), s.height(), gravity, force); } -inline bool Client::hasUserTimeSupport() const +inline bool X11Client::hasUserTimeSupport() const { return info->userTime() != -1U; } -inline xcb_window_t Client::moveResizeGrabWindow() const +inline xcb_window_t X11Client::moveResizeGrabWindow() const { return m_moveResizeGrabWindow; } -inline bool Client::hiddenPreview() const +inline bool X11Client::hiddenPreview() const { return mapping_state == Kept; } template -inline void Client::print(T &stream) const +inline void X11Client::print(T &stream) const { stream << "\'Client:" << window() << ";WMCLASS:" << resourceClass() << ":" << resourceName() << ";Caption:" << caption() << "\'"; } } // namespace -Q_DECLARE_METATYPE(KWin::Client*) -Q_DECLARE_METATYPE(QList) - -#endif +Q_DECLARE_METATYPE(KWin::X11Client *) +Q_DECLARE_METATYPE(QList) diff --git a/xwl/clipboard.cpp b/xwl/clipboard.cpp index cbfb9cf90..5148ca38b 100644 --- a/xwl/clipboard.cpp +++ b/xwl/clipboard.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . #include "transfer.h" #include "xwayland.h" -#include "client.h" +#include "x11client.h" #include "wayland_server.h" #include "workspace.h" @@ -114,7 +114,7 @@ void Clipboard::checkWlSource() removeSource(); return; } - if (!workspace()->activeClient() || !workspace()->activeClient()->inherits("KWin::Client")) { + if (!workspace()->activeClient() || !workspace()->activeClient()->inherits("KWin::X11Client")) { // no active client or active client is Wayland native removeSource(); return; @@ -140,7 +140,7 @@ void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) createX11Source(nullptr); const AbstractClient *client = workspace()->activeClient(); - if (!qobject_cast(client)) { + if (!qobject_cast(client)) { // clipboard is only allowed to be acquired when Xwayland has focus // TODO: can we make this stronger (window id comparision)? return; diff --git a/xwl/dnd.cpp b/xwl/dnd.cpp index 34bc7b33e..5613d425a 100644 --- a/xwl/dnd.cpp +++ b/xwl/dnd.cpp @@ -99,7 +99,7 @@ Dnd::Dnd(xcb_atom_t atom, QObject *parent) m_surfaceIface = si; connect(workspace(), &Workspace::clientActivated, this, [this](AbstractClient *ac) { - if (!ac || !ac->inherits("KWin::Client")) { + if (!ac || !ac->inherits("KWin::X11Client")) { return; } auto *surface = ac->surface(); diff --git a/xwl/drag_wl.cpp b/xwl/drag_wl.cpp index c1c1836a9..1052ebc83 100644 --- a/xwl/drag_wl.cpp +++ b/xwl/drag_wl.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . #include "xwayland.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "wayland_server.h" #include "workspace.h" @@ -64,7 +64,7 @@ DragEventReply WlToXDrag::moveFilter(Toplevel *target, const QPoint &pos) delete m_visit; m_visit = nullptr; } - if (!qobject_cast(ac)) { + if (!qobject_cast(ac)) { // no target or wayland native target, // handled by input code directly return DragEventReply::Wayland; diff --git a/xwl/selection.cpp b/xwl/selection.cpp index dcfad8912..cbcceed50 100644 --- a/xwl/selection.cpp +++ b/xwl/selection.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . #include "transfer.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "workspace.h" #include @@ -246,7 +246,7 @@ bool Selection::handleSelectionRequest(xcb_selection_request_event_t *event) return false; } - if (qobject_cast(workspace()->activeClient()) == nullptr) { + if (qobject_cast(workspace()->activeClient()) == nullptr) { // Receiving Wayland selection not allowed when no Xwayland surface active // filter the event, but don't act upon it sendSelectionNotify(event, false);