From 93c1a610bccf3e8cfc463d66cd26aa80a9b482b6 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 7 Feb 2023 19:02:13 +0200 Subject: [PATCH] scripting: Remove X11 specific signals --- src/scripting/workspace_wrapper.cpp | 8 -------- src/scripting/workspace_wrapper.h | 2 -- src/scripts/videowall/contents/code/main.js | 15 +++++++++------ src/x11window.cpp | 5 ----- src/x11window.h | 3 --- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/scripting/workspace_wrapper.cpp b/src/scripting/workspace_wrapper.cpp index f1009cc61c..5ad3926a64 100644 --- a/src/scripting/workspace_wrapper.cpp +++ b/src/scripting/workspace_wrapper.cpp @@ -286,14 +286,6 @@ void WorkspaceWrapper::setupClientConnections(Window *client) connect(client, &Window::clientUnminimized, this, &WorkspaceWrapper::clientUnminimized); connect(client, qOverload(&Window::clientMaximizedStateChanged), this, &WorkspaceWrapper::clientMaximizeSet); - - X11Window *x11Client = qobject_cast(client); // TODO: Drop X11-specific signals. - if (!x11Client) { - return; - } - - connect(x11Client, &X11Window::clientManaging, this, &WorkspaceWrapper::clientManaging); - connect(x11Client, &X11Window::clientFullScreenSet, this, &WorkspaceWrapper::clientFullScreenSet); } void WorkspaceWrapper::showOutline(const QRect &geometry) diff --git a/src/scripting/workspace_wrapper.h b/src/scripting/workspace_wrapper.h index d9b68516ff..612cdd12d7 100644 --- a/src/scripting/workspace_wrapper.h +++ b/src/scripting/workspace_wrapper.h @@ -67,14 +67,12 @@ Q_SIGNALS: void desktopPresenceChanged(KWin::Window *client, int desktop); void clientAdded(KWin::Window *client); void clientRemoved(KWin::Window *client); - void clientManaging(KWin::X11Window *client); void clientMinimized(KWin::Window *client); void clientUnminimized(KWin::Window *client); void clientRestored(KWin::X11Window *client); void clientMaximizeSet(KWin::Window *client, bool h, bool v); void killWindowCalled(KWin::X11Window *client); void clientActivated(KWin::Window *client); - void clientFullScreenSet(KWin::X11Window *client, bool fullScreen, bool user); void clientSetKeepAbove(KWin::X11Window *client, bool keepAbove); /** * This signal is emitted when a virtual desktop is added or removed. diff --git a/src/scripts/videowall/contents/code/main.js b/src/scripts/videowall/contents/code/main.js index 3e21d0fd41..55b892ccd4 100644 --- a/src/scripts/videowall/contents/code/main.js +++ b/src/scripts/videowall/contents/code/main.js @@ -26,10 +26,13 @@ function isVideoPlayer(client) { return true; } -var videowall = function(client, set) { - if (set && isVideoPlayer(client)) { - client.frameGeometry = workspace.clientArea(KWin.FullArea, 0, 1); - } -}; +function setup(window) { + window.fullScreenChanged.connect(() => { + if (window.fullScreen && isVideoPlayer(window)) { + window.frameGeometry = workspace.clientArea(KWin.FullArea, window); + } + }); +} -workspace.clientFullScreenSet.connect(videowall); +workspace.clientAdded.connect(setup); +workspace.clientList().forEach(setup); diff --git a/src/x11window.cpp b/src/x11window.cpp index 918fa6a398..970272b88c 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -1027,10 +1027,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped) info.setOpacityF(opacity()); }); - // TODO: there's a small problem here - isManaged() depends on the mapping state, - // but this client is not yet in Workspace's client list at this point, will - // be only done in addClient() - Q_EMIT clientManaging(this); return true; } @@ -4617,7 +4613,6 @@ void X11Window::setFullScreen(bool set, bool user) updateWindowRules(Rules::Fullscreen | Rules::Position | Rules::Size); updateAllowedActions(false); - Q_EMIT clientFullScreenSet(this, set, user); Q_EMIT fullScreenChanged(); } diff --git a/src/x11window.h b/src/x11window.h index 635abb163c..17a10fc8b2 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -364,9 +364,6 @@ protected: // in between objects as compared to simple function // calls Q_SIGNALS: - void clientManaging(KWin::X11Window *); - void clientFullScreenSet(KWin::X11Window *, bool, bool); - /** * Emitted whenever the Client want to show it menu */