From 3c857a3375ec6b736825f42b326335dc1165cd13 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Wed, 5 Jun 2024 17:12:24 +0200 Subject: [PATCH] scripting: Do not crash when calling workspace.clientArea() without an output Just set a default one, one way less a script can crash kwin. Signed-off-by: Victoria Fischer --- src/scripting/workspace_wrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scripting/workspace_wrapper.cpp b/src/scripting/workspace_wrapper.cpp index f179bc74c7..c43b1ca1cb 100644 --- a/src/scripting/workspace_wrapper.cpp +++ b/src/scripting/workspace_wrapper.cpp @@ -250,6 +250,9 @@ QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, KWin::Window *c) co QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, Output *output, VirtualDesktop *desktop) const { + if (!output) { + return QRect(); + } return workspace()->clientArea(static_cast(option), output, desktop); }