diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -399,7 +399,6 @@ activation.cpp appmenu.cpp atoms.cpp - client.cpp client_machine.cpp colorcorrection/colorcorrectdbusinterface.cpp colorcorrection/manager.cpp @@ -493,6 +492,7 @@ 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 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -802,7 +802,7 @@ 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 --- a/activation.cpp +++ b/activation.cpp @@ -26,7 +26,7 @@ */ -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "focuschain.h" #include "netinfo.h" @@ -92,7 +92,7 @@ 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 @@ 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 @@ - 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 @@ // 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 @@ * 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 @@ 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 @@ // 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 @@ ; // 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 @@ 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 @@ 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::updateUrgency() +void X11Client::updateUrgency() { if (info->urgency()) demandAttention(); @@ -869,7 +869,7 @@ 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.h b/activities.h --- a/activities.h +++ b/activities.h @@ -33,7 +33,7 @@ namespace KWin { -class Client; +class X11Client; class KWIN_EXPORT Activities : public QObject { @@ -50,7 +50,7 @@ * * 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/activities.cpp b/activities.cpp --- a/activities.cpp +++ b/activities.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #include "activities.h" // KWin -#include "client.h" +#include "x11client.h" #include "workspace.h" // KDE #include @@ -72,15 +72,15 @@ 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 KConfigGroup cg(KSharedConfig::openConfig(), QByteArray("SubSession: ").append(activity.toUtf8()).constData()); 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 @@ 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 @@ 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/appmenu.cpp b/appmenu.cpp --- a/appmenu.cpp +++ b/appmenu.cpp @@ -20,7 +20,7 @@ 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 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -249,9 +249,9 @@ ../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 @@ ../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 --- 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 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -20,7 +20,7 @@ #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 @@ 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 @@ 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 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -22,7 +22,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -20,7 +20,7 @@ #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 --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -20,7 +20,7 @@ #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 --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/dont_crash_glxgears.cpp +++ b/autotests/integration/dont_crash_glxgears.cpp @@ -20,7 +20,7 @@ #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 @@ 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 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -20,7 +20,7 @@ *********************************************************************/ #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 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -18,7 +18,7 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -18,7 +18,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -18,7 +18,7 @@ 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 @@ 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 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -18,7 +18,7 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -22,7 +22,7 @@ #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,20 +681,20 @@ 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(); // let's move the cursor outside the window 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -20,7 +20,7 @@ #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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -20,7 +20,7 @@ #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 @@ 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 @@ 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 --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -22,7 +22,7 @@ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -20,7 +20,7 @@ #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 @@ 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 @@ 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 @@ 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,15 +229,15 @@ 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()); QVERIFY(windowClassChangedSpy.wait()); 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 --- a/autotests/integration/x11_client_test.cpp +++ b/autotests/integration/x11_client_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ // 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,20 +434,20 @@ 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()); QVERIFY(captionChangedSpy.wait()); 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 @@ 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 @@ 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,15 +527,15 @@ 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")); NETWinInfo info3(kwinApp()->x11Connection(), w2, kwinApp()->x11RootWindow(), NET::WMVisibleName | NET::WMVisibleIconName, NET::Properties2()); 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 @@ 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 @@ 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 --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 --- a/autotests/mock_workspace.h +++ b/autotests/mock_workspace.h @@ -27,7 +27,7 @@ { class AbstractClient; -class Client; +class X11Client; class X11EventFilter; class MockWorkspace; @@ -58,7 +58,7 @@ static Workspace *self(); Q_SIGNALS: - void clientRemoved(KWin::Client*); + void clientRemoved(KWin::X11Client *); private: AbstractClient *m_activeClient; diff --git a/autotests/mock_client.h b/autotests/mock_x11client.h rename from autotests/mock_client.h rename to autotests/mock_x11client.h --- a/autotests/mock_client.h +++ b/autotests/mock_x11client.h @@ -28,12 +28,12 @@ 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/mock_client.cpp b/autotests/mock_x11client.cpp rename from autotests/mock_client.cpp rename to autotests/mock_x11client.cpp --- a/autotests/mock_client.cpp +++ b/autotests/mock_x11client.cpp @@ -17,19 +17,19 @@ 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/test_screen_edges.cpp b/autotests/test_screen_edges.cpp --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -28,9 +28,9 @@ #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 @@ } // 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 @@ { 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::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 --- a/autotests/test_screens.cpp +++ b/autotests/test_screens.cpp @@ -20,7 +20,7 @@ #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 @@ 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 --- /dev/null +++ b/autotests/x11client.h @@ -0,0 +1 @@ +#include "mock_x11client.h" diff --git a/composite.h b/composite.h --- a/composite.h +++ b/composite.h @@ -30,9 +30,9 @@ namespace KWin { -class Client; class CompositorSelectionOwner; class Scene; +class X11Client; class KWIN_EXPORT Compositor : public QObject { @@ -252,7 +252,7 @@ int refreshRate() const override; - void updateClientCompositeBlocking(Client *client = nullptr); + void updateClientCompositeBlocking(X11Client *client = nullptr); static X11Compositor *self(); diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -20,7 +20,7 @@ #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 @@ 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,22 +407,22 @@ 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()) { m_scene->removeToplevel(c); } 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 @@ return m_xrrRefreshRate; } -void X11Compositor::updateClientCompositeBlocking(Client *c) +void X11Compositor::updateClientCompositeBlocking(X11Client *c) { if (c) { if (c->isBlockingCompositing()) { diff --git a/debug_console.h b/debug_console.h --- a/debug_console.h +++ b/debug_console.h @@ -39,7 +39,7 @@ namespace KWin { -class Client; +class X11Client; class InternalClient; class XdgShellClient; class Unmanaged; @@ -75,13 +75,13 @@ 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/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 @@ 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 @@ 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 @@ 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/deleted.cpp b/deleted.cpp --- a/deleted.cpp +++ b/deleted.cpp @@ -21,7 +21,7 @@ #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 @@ } 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.h b/effects.h --- a/effects.h +++ b/effects.h @@ -55,13 +55,13 @@ 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 @@ 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/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -27,7 +27,7 @@ #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 @@ } ); connect(ws, &Workspace::clientAdded, this, - [this](Client *c) { + [this](X11Client *c) { if (c->readyForPainting()) slotClientShown(c); else @@ -246,7 +246,7 @@ } // 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::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::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::slotClientModalityChanged() { - emit windowModalityChanged(static_cast(sender())->effectWindow()); + emit windowModalityChanged(static_cast(sender())->effectWindow()); } void EffectsHandlerImpl::slotCurrentTabAboutToChange(EffectWindow *from, EffectWindow *to) @@ -1073,7 +1073,7 @@ 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 @@ managed = toplevel->isClient(); waylandClient = qobject_cast(toplevel) != nullptr; - x11Client = qobject_cast(toplevel) != nullptr; + x11Client = qobject_cast(toplevel) != nullptr; } EffectWindowImpl::~EffectWindowImpl() @@ -1775,7 +1775,7 @@ 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 @@ 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 @@ QRect EffectWindowImpl::decorationInnerRect() const { - auto client = qobject_cast(toplevel); + auto client = qobject_cast(toplevel); return client ? client->transparentRect() : contentsRect(); } diff --git a/events.cpp b/events.cpp --- a/events.cpp +++ b/events.cpp @@ -25,7 +25,7 @@ */ -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "focuschain.h" #include "netinfo.h" @@ -257,16 +257,16 @@ 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 @@ 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 @@ // 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 @@ /** * 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 @@ /** * 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 @@ /** * 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::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 @@ /** * 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 @@ /** * 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 @@ // 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 @@ /** * 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::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::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 @@ #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 @@ 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 @@ * 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 @@ // 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 @@ } // 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 @@ } // 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 @@ 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 @@ 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::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 @@ // 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 @@ } // 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::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 --- a/focuschain.h +++ b/focuschain.h @@ -96,7 +96,7 @@ * 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 @@ * * @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 @@ * 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 @@ * * @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 --- a/geometry.cpp +++ b/geometry.cpp @@ -27,7 +27,7 @@ */ -#include "client.h" +#include "x11client.h" #include "composite.h" #include "cursor.h" #include "netinfo.h" @@ -914,7 +914,7 @@ */ // 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 @@ return r; } -NETExtendedStrut Client::strut() const +NETExtendedStrut X11Client::strut() const { NETExtendedStrut ext = info->extendedStrut(); NETStrut str = info->strut(); @@ -1013,7 +1013,7 @@ 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 @@ return StrutRect(); // Null rect } -StrutRects Client::strutRects() const +StrutRects X11Client::strutRects() const { StrutRects region; region += strutRect(StrutAreaTop); @@ -1063,15 +1063,15 @@ 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) return false; return true; } -bool Client::hasOffscreenXineramaStrut() const +bool X11Client::hasOffscreenXineramaStrut() const { // Get strut as a QRegion QRegion region; @@ -1330,7 +1330,7 @@ } // 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 @@ * \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 @@ /** * 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,26 +1547,26 @@ 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(); } /** * 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 @@ 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 @@ 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 @@ // 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 @@ // 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 @@ } // _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 @@ 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 @@ return true; } -bool Client::isMovableAcrossScreens() const +bool X11Client::isMovableAcrossScreens() const { if (!hasNETSupport() && !m_motif.move()) { return false; @@ -1888,7 +1888,7 @@ return true; } -bool Client::isResizable() const +bool X11Client::isResizable() const { if (!hasNETSupport() && !m_motif.resize()) { return false; @@ -1909,7 +1909,7 @@ 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 @@ /** * 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 @@ // 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 @@ 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 @@ 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 @@ } 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,15 +2402,15 @@ emit quickTileModeChanged(); } -bool Client::userCanSetFullScreen() const +bool X11Client::userCanSetFullScreen() const { if (!isFullScreenable()) { return false; } 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::updateFullscreenMonitors(NETFullscreenMonitors topology) +void X11Client::updateFullscreenMonitors(NETFullscreenMonitors topology) { int nscreens = screens()->count(); @@ -2492,7 +2492,7 @@ * 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 @@ static GeometryTip* geometryTip = nullptr; -void Client::positionGeometryTip() +void X11Client::positionGeometryTip() { Q_ASSERT(isMove() || isResize()); // Position and Size display @@ -2575,7 +2575,7 @@ return true; } -bool Client::doStartMoveResize() +bool X11Client::doStartMoveResize() { bool has_grab = false; // This reportedly improves smoothness of the moveresize operation, @@ -2651,7 +2651,7 @@ emit clientFinishUserMovedResized(this); } -void Client::leaveMoveResize() +void X11Client::leaveMoveResize() { if (needsXWindowMove) { // Do the deferred move @@ -2768,7 +2768,7 @@ } } -bool Client::isWaitingForMoveResizeSync() const +bool X11Client::isWaitingForMoveResizeSync() const { return syncRequest.isPending && isResize(); } @@ -3094,11 +3094,11 @@ } } -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 @@ 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.h b/group.h --- a/group.h +++ b/group.h @@ -28,22 +28,22 @@ namespace KWin { -class Client; class EffectWindowGroupImpl; +class X11Client; class Group { 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 @@ 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 @@ 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/group.cpp b/group.cpp --- a/group.cpp +++ b/group.cpp @@ -30,7 +30,7 @@ #include "group.h" #include #include "workspace.h" -#include "client.h" +#include "x11client.h" #include "effects.h" #include @@ -95,14 +95,14 @@ 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::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 @@ // 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 @@ 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 @@ // 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 @@ // 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 @@ #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 @@ 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 @@ - 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 @@ 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::removeFromMainClients() +void X11Client::removeFromMainClients() { if (transientFor()) transientFor()->removeTransient(this); @@ -463,7 +463,7 @@ // 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 @@ // 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 @@ /** * 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 @@ } 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 @@ 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 @@ return new_transient_for; } -void Client::addTransient(AbstractClient* cl) +void X11Client::addTransient(AbstractClient* cl) { AbstractClient::addTransient(cl); if (workspace()->mostRecentlyActivatedClient() == this && cl->isModal()) @@ -659,15 +659,15 @@ // qDebug() << "AT:" << (*it); } -void Client::removeTransient(AbstractClient* cl) +void X11Client::removeTransient(AbstractClient* cl) { // qDebug() << "REMOVETRANS:" << this << ":" << cl; // qDebug() << kBacktrace(); // cl is transient for this, but this is going away // 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 @@ } // 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,19 +687,19 @@ // 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); } 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 @@ 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 @@ 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 @@ return false; } -QList Client::mainClients() const +QList X11Client::mainClients() const { if (!isTransient()) return QList(); @@ -750,7 +750,7 @@ 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 @@ 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 @@ } } 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 @@ 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 @@ } // 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 @@ 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/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -26,7 +26,7 @@ #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 --- a/layers.cpp +++ b/layers.cpp @@ -80,7 +80,7 @@ */ #include "utils.h" -#include "client.h" +#include "x11client.h" #include "focuschain.h" #include "netinfo.h" #include "workspace.h" @@ -177,7 +177,7 @@ 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 @@ // (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::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,16 +479,16 @@ restack(c, active_client); } -void Workspace::restoreSessionStackingOrder(Client* c) +void Workspace::restoreSessionStackingOrder(X11Client *c) { if (c->sessionStackingOrder() < 0) return; StackingUpdatesBlocker blocker(this); unconstrained_stacking_order.removeAll(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 @@ 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 @@ // 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 @@ 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 @@ } if (it != begin && (*(it - 1) == other)) - other = qobject_cast(*it); + other = qobject_cast(*it); else other = nullptr; } @@ -851,17 +851,17 @@ 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 --- a/manage.cpp +++ b/manage.cpp @@ -21,7 +21,7 @@ // This file contains things relevant to handling incoming events. -#include "client.h" +#include "x11client.h" #include @@ -47,7 +47,7 @@ * 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 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ } // 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 --- a/moving_client_x11_filter.cpp +++ b/moving_client_x11_filter.cpp @@ -18,7 +18,7 @@ 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 @@ 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.h b/netinfo.h --- a/netinfo.h +++ b/netinfo.h @@ -32,17 +32,14 @@ { 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,19 +77,16 @@ */ 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; void changeState(NET::States state, NET::States mask) override; void disable(); private: - Client * m_client; + X11Client *m_client; }; } // KWin diff --git a/netinfo.cpp b/netinfo.cpp --- a/netinfo.cpp +++ b/netinfo.cpp @@ -22,7 +22,7 @@ // 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::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 @@ 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::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,30 +199,30 @@ 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); } } 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 @@ // 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/placement.cpp b/placement.cpp --- a/placement.cpp +++ b/placement.cpp @@ -24,7 +24,7 @@ #ifndef KCMRULES #include "workspace.h" -#include "client.h" +#include "x11client.h" #include "cursor.h" #include "options.h" #include "rules.h" @@ -261,7 +261,7 @@ 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 --- a/plugins/platforms/x11/standalone/sync_filter.cpp +++ b/plugins/platforms/x11/standalone/sync_filter.cpp @@ -18,7 +18,7 @@ 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 @@ { 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 --- a/plugins/platforms/x11/standalone/windowselector.cpp +++ b/plugins/platforms/x11/standalone/windowselector.cpp @@ -20,7 +20,7 @@ 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 @@ 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 --- a/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp +++ b/plugins/platforms/x11/standalone/x11_decoration_renderer.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 --- a/plugins/scenes/opengl/lanczosfilter.cpp +++ b/plugins/scenes/opengl/lanczosfilter.cpp @@ -20,7 +20,7 @@ *********************************************************************/ #include "lanczosfilter.h" -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "effects.h" #include "screens.h" @@ -394,10 +394,10 @@ 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 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -35,7 +35,7 @@ #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 --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #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 --- a/plugins/scenes/xrender/scene_xrender.cpp +++ b/plugins/scenes/xrender/scene_xrender.cpp @@ -27,7 +27,7 @@ #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 @@ 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 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -21,7 +21,7 @@ *********************************************************************/ #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.h b/rules.h --- a/rules.h +++ b/rules.h @@ -39,7 +39,6 @@ { class AbstractClient; -class Client; class Rules; #ifndef KCMRULES // only for kwin core diff --git a/rules.cpp b/rules.cpp --- a/rules.cpp +++ b/rules.cpp @@ -30,7 +30,7 @@ #include #ifndef KCMRULES -#include "client.h" +#include "x11client.h" #include "client_machine.h" #include "screens.h" #include "workspace.h" @@ -944,16 +944,16 @@ // 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)); } else setOpacity(rules()->checkOpacityInactive(qRound(opacity() * 100.0)) / 100.0); 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 @@ { m_updatesDisabled = disable; if (!disable) { - foreach (Client * c, Workspace::self()->clientList()) + foreach (X11Client *c, Workspace::self()->clientList()) c->updateWindowRules(Rules::All); } } diff --git a/scene.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -71,7 +71,7 @@ #include #include -#include "client.h" +#include "x11client.h" #include "deleted.h" #include "effects.h" #include "overlaywindow.h" @@ -278,7 +278,7 @@ 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 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -31,7 +31,7 @@ // KWin #include "gestures.h" -#include +#include #include "cursor.h" #include "main.h" #include "platform.h" diff --git a/screens.cpp b/screens.cpp --- a/screens.cpp +++ b/screens.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #include "screens.h" #include -#include +#include #include "cursor.h" #include "orientation_sensor.h" #include "utils.h" diff --git a/scripting/meta.h b/scripting/meta.h --- a/scripting/meta.h +++ b/scripting/meta.h @@ -30,11 +30,11 @@ 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 @@ 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/meta.cpp b/scripting/meta.cpp --- a/scripting/meta.cpp +++ b/scripting/meta.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #include "meta.h" -#include "client.h" +#include "x11client.h" #include @@ -96,18 +96,18 @@ } // 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 | QScriptEngine::ExcludeDeleteLater | QScriptEngine::PreferExistingWrapperObject | 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 @@ 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/scripting.h b/scripting/scripting.h --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -52,9 +52,9 @@ namespace KWin { class AbstractClient; -class Client; class ScriptUnloaderAgent; class QtScriptWorkspaceWrapper; +class X11Client; class KWIN_EXPORT AbstractScript : public QObject { diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -28,7 +28,7 @@ #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 @@ 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 @@ 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_model.cpp b/scripting/scripting_model.cpp --- a/scripting/scripting_model.cpp +++ b/scripting/scripting_model.cpp @@ -22,7 +22,7 @@ #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 @@ { 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 @@ // 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.h b/scripting/workspace_wrapper.h --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -33,7 +33,7 @@ { // forward declarations class AbstractClient; -class Client; +class X11Client; class WorkspaceWrapper : public QObject { @@ -93,15 +93,15 @@ 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 @@ * @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 @@ private Q_SLOTS: void setupAbstractClientConnections(AbstractClient *client); - void setupClientConnections(Client *client); + void setupClientConnections(X11Client *client); }; class QtScriptWorkspaceWrapper : public WorkspaceWrapper diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -20,7 +20,7 @@ *********************************************************************/ #include "workspace_wrapper.h" -#include "../client.h" +#include "../x11client.h" #include "../outline.h" #include "../screens.h" #include "../xdgshellclient.h" @@ -71,7 +71,7 @@ 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 @@ 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 @@ outline()->hide(); } -Client *WorkspaceWrapper::getClient(qulonglong windowId) +X11Client *WorkspaceWrapper::getClient(qulonglong windowId) { return Workspace::self()->findClient(Predicate::WindowMatch, windowId); } diff --git a/sm.h b/sm.h --- a/sm.h +++ b/sm.h @@ -36,7 +36,7 @@ namespace KWin { -class Client; +class X11Client; struct SessionInfo { QByteArray sessionId; diff --git a/sm.cpp b/sm.cpp --- a/sm.cpp +++ b/sm.cpp @@ -27,7 +27,7 @@ #include #include "workspace.h" -#include "client.h" +#include "x11client.h" #include #include #include @@ -132,7 +132,7 @@ 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::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 @@ 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 @@ 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 @@ * * 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 Workspace::sessionSaveDone() { session_saving = false; - foreach (Client * c, clients) { + foreach (X11Client *c, clients) { c->setSessionActivityOverride(false); } } diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -40,7 +40,6 @@ class Workspace; class AbstractClient; -class Client; class X11EventFilter; namespace TabBox { diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -34,7 +34,7 @@ #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::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/thumbnailitem.cpp b/thumbnailitem.cpp --- a/thumbnailitem.cpp +++ b/thumbnailitem.cpp @@ -20,7 +20,7 @@ #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 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -23,7 +23,7 @@ #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 @@ return Workspace::self()->compositing(); } -void Client::damageNotifyEvent() +void X11Client::damageNotifyEvent() { if (syncRequest.isPending && isResize()) { emit damaged(this, QRect()); diff --git a/useractions.h b/useractions.h --- a/useractions.h +++ b/useractions.h @@ -34,7 +34,6 @@ namespace KWin { class AbstractClient; -class Client; /** * @brief Menu shown for a Client. diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -35,7 +35,7 @@ #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 @@ return; } - Client *c = dynamic_cast(m_client.data()); + X11Client *c = dynamic_cast(m_client.data()); if (!c) { return; } @@ -1139,7 +1139,7 @@ * 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 @@ /** * 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 @@ workspace()->clientShortcutUpdated(this); } -void Client::setShortcutInternal() +void X11Client::setShortcutInternal() { updateCaption(); #if 0 diff --git a/utils.h b/utils.h --- a/utils.h +++ b/utils.h @@ -44,15 +44,15 @@ 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 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -18,7 +18,7 @@ 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 --- a/window_property_notify_x11_filter.cpp +++ b/window_property_notify_x11_filter.cpp @@ -18,7 +18,7 @@ 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.h b/workspace.h --- a/workspace.h +++ b/workspace.h @@ -52,12 +52,12 @@ } 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 @@ 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 @@ * 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 @@ * 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 @@ 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 @@ 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 @@ 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 @@ //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 @@ 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 -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 @@ 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/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -29,7 +29,7 @@ #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 @@ 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 @@ 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 @@ m_allClients.removeAll(c); desktops.removeAll(c); } - Client::cleanupX11(); + X11Client::cleanupX11(); if (waylandServer()) { const QList shellClients = waylandServer()->clients(); @@ -605,17 +605,17 @@ 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 @@ return c; } -void Workspace::addClient(Client* c) +void Workspace::addClient(X11Client *c) { Group* grp = findGroup(c->window()); @@ -688,7 +688,7 @@ /** * 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ */ 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 @@ 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 @@ 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 @@ if (AbstractClient *ret = Toplevel::findInList(m_allClients, func)) { return ret; } - if (Client *ret = Toplevel::findInList(desktops, func)) { + if (X11Client *ret = Toplevel::findInList(desktops, func)) { return ret; } if (InternalClient *ret = Toplevel::findInList(m_internalClients, func)) { @@ -1686,35 +1686,35 @@ }); } -Client *Workspace::findClient(Predicate predicate, xcb_window_t w) const +X11Client *Workspace::findClient(Predicate predicate, xcb_window_t w) const { switch (predicate) { case Predicate::WindowMatch: - return findClient([w](const Client *c) { + return findClient([w](const X11Client *c) { return c->window() == 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; }); } return nullptr; } 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 @@ 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/client.h b/x11client.h rename from client.h rename to x11client.h --- a/client.h +++ b/x11client.h @@ -19,8 +19,7 @@ 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 @@ InputIdMatch }; -class KWIN_EXPORT Client - : public AbstractClient +class KWIN_EXPORT X11Client : public AbstractClient { Q_OBJECT /** @@ -86,7 +84,7 @@ */ 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 @@ 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: // 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 @@ //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 @@ /** * 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 @@ 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 @@ 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 @@ 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 @@ 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/client.cpp b/x11client.cpp rename from client.cpp rename to x11client.cpp --- a/client.cpp +++ b/x11client.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ // own -#include "client.h" +#include "x11client.h" // kwin #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" @@ -92,15 +92,15 @@ // - 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. */ /** * 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 @@ 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 @@ /** * "Dumb" destructor. */ -Client::~Client() +X11Client::~X11Client() { if (m_killHelperPID && !::kill(m_killHelperPID, 0)) { // means the process is alive ::kill(m_killHelperPID, SIGTERM); @@ -200,15 +200,15 @@ } // Use destroyClient() or releaseWindow(), Client instances cannot be deleted directly -void Client::deleteClient(Client* c) +void X11Client::deleteClient(X11Client *c) { delete 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 @@ * 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 @@ deleteClient(this); } -void Client::updateInputWindow() +void X11Client::updateInputWindow() { if (!Xcb::Extensions::self()->isShapeInputAvailable()) return; @@ -378,7 +378,7 @@ 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 @@ 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 @@ 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 @@ emit geometryShapeChanged(this, oldgeom); } -void Client::destroyDecoration() +void X11Client::destroyDecoration() { QRect oldgeom = geometry(); if (isDecorated()) { @@ -452,7 +452,7 @@ 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 @@ 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 @@ return QRect(); } -void Client::detectNoBorder() +void X11Client::detectNoBorder() { if (shape()) { noborder = true; @@ -539,7 +539,7 @@ } } -void Client::updateFrameExtents() +void X11Client::updateFrameExtents() { NETStrut strut; strut.left = borderLeft(); @@ -549,18 +549,18 @@ 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 @@ * 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 @@ 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 @@ 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 @@ 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,24 +701,24 @@ } } -void Client::hideClient(bool hide) +void X11Client::hideClient(bool hide) { if (hidden == hide) return; hidden = hide; updateVisibility(); } -bool Client::setupCompositing() +bool X11Client::setupCompositing() { if (!Toplevel::setupCompositing()){ return false; } updateVisibility(); // for internalKeep() return true; } -void Client::finishCompositing(ReleaseReason releaseReason) +void X11Client::finishCompositing(ReleaseReason releaseReason) { Toplevel::finishCompositing(releaseReason); updateVisibility(); @@ -729,7 +729,7 @@ /** * Returns whether the window is minimizable or not */ -bool Client::isMinimizable() const +bool X11Client::isMinimizable() const { if (isSpecialWindow() && !isTransient()) return false; @@ -762,23 +762,23 @@ 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); if (geom.isValid()) return geom; 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 @@ } } -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 @@ 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 @@ 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 @@ * 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 @@ 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 @@ emit windowShown(this); } -void Client::internalHide() +void X11Client::internalHide() { if (mapping_state == Unmapped) return; @@ -1005,7 +1005,7 @@ emit windowHidden(this); } -void Client::internalKeep() +void X11Client::internalKeep() { Q_ASSERT(compositing()); if (mapping_state == Kept) @@ -1027,7 +1027,7 @@ * 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 @@ /** * 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 @@ * 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::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,15 +1114,15 @@ /** * 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()); } /** * 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 @@ /** * 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 @@ * 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 @@ 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::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::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 @@ * 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 @@ /** * 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 @@ #endif } -void Client::blockActivityUpdates(bool b) +void X11Client::blockActivityUpdates(bool b) { if (b) { ++m_activityUpdatesBlocked; @@ -1345,7 +1345,7 @@ /** * update after activities changed */ -void Client::updateActivities(bool includeTransients) +void X11Client::updateActivities(bool includeTransients) { if (m_activityUpdatesBlocked) { m_blockedActivityUpdatesRequireTransients |= includeTransients; @@ -1363,7 +1363,7 @@ * 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 @@ * 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 @@ /** * 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 @@ 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 @@ * * \sa contextHelp() */ -bool Client::providesContextHelp() const +bool X11Client::providesContextHelp() const { return info->supportsProtocol(NET::ContextHelpProtocol); } @@ -1436,7 +1436,7 @@ * * \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 @@ * 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 @@ 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 @@ // 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 @@ 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::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::getMotifHints() +void X11Client::getMotifHints() { const bool wasClosable = m_motif.close(); const bool wasNoBorder = m_motif.noBorder(); @@ -1611,7 +1611,7 @@ } } -void Client::getIcons() +void X11Client::getIcons() { // First read icons from the window itself const QString themedIconName = iconFromDesktopFile(); @@ -1657,7 +1657,7 @@ 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 @@ /** * 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 @@ 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,26 +1749,26 @@ 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()); if (usedToBlock != blocks_compositing) { emit blockingCompositingChanged(blocks_compositing ? this : nullptr); } } -void Client::updateAllowedActions(bool force) +void X11Client::updateAllowedActions(bool force) { if (!isManaged() && !force) return; @@ -1810,22 +1810,22 @@ } } -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); #else return Xcb::StringProperty(); #endif } -void Client::readActivities(Xcb::StringProperty &property) +void X11Client::readActivities(Xcb::StringProperty &property) { #ifdef KWIN_BUILD_ACTIVITIES QStringList newActivitiesList; @@ -1880,65 +1880,65 @@ #endif } -void Client::checkActivities() +void X11Client::checkActivities() { #ifdef KWIN_BUILD_ACTIVITIES Xcb::StringProperty property = fetchActivities(); readActivities(property); #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 @@ 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 @@ 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,22 +2042,22 @@ } } -void Client::updateShowOnScreenEdge() +void X11Client::updateShowOnScreenEdge() { Xcb::Property property = fetchShowOnScreenEdge(); readShowOnScreenEdge(property); } -void Client::showOnScreenEdge() +void X11Client::showOnScreenEdge() { disconnect(m_edgeRemoveConnection); hideClient(false); setKeepBelow(false); 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 @@ 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/xwl/clipboard.cpp b/xwl/clipboard.cpp --- a/xwl/clipboard.cpp +++ b/xwl/clipboard.cpp @@ -24,7 +24,7 @@ #include "transfer.h" #include "xwayland.h" -#include "client.h" +#include "x11client.h" #include "wayland_server.h" #include "workspace.h" @@ -114,7 +114,7 @@ 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 @@ 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 --- a/xwl/dnd.cpp +++ b/xwl/dnd.cpp @@ -99,7 +99,7 @@ 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 --- a/xwl/drag_wl.cpp +++ b/xwl/drag_wl.cpp @@ -24,7 +24,7 @@ #include "xwayland.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "wayland_server.h" #include "workspace.h" @@ -64,7 +64,7 @@ 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 --- a/xwl/selection.cpp +++ b/xwl/selection.cpp @@ -23,7 +23,7 @@ #include "transfer.h" #include "atoms.h" -#include "client.h" +#include "x11client.h" #include "workspace.h" #include @@ -246,7 +246,7 @@ 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);