From e853f5fe073ade3a7be685d2a68eb4e54d3645d5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 16 Sep 2022 09:57:07 +0000 Subject: [PATCH] Don't check for workspace->initializing() the existence of Window is bound to the one of workspace so it will always be there. We also need to check the window sizes before workspace is done initializing, otherwise when KWin restarts and there are maximized windows, they won't be resized to take panels into account and will always span the full screen. --- src/window.cpp | 9 --------- src/workspace.cpp | 6 ------ src/workspace.h | 7 ------- 3 files changed, 22 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 79791d3a2b..29612c8883 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3990,15 +3990,6 @@ void Window::checkWorkspacePosition(QRectF oldGeometry, const VirtualDesktop *ol oldGeometry = newGeom; } - // this can be true only if this window was mapped before KWin - // was started - in such case, don't adjust position to workarea, - // because the window already had its position, and if a window - // with a strut altering the workarea would be managed in initialization - // after this one, this window would be moved - if (!workspace() || workspace()->initializing()) { - return; - } - VirtualDesktop *desktop = !isOnCurrentDesktop() ? desktops().constLast() : VirtualDesktopManager::self()->currentDesktop(); if (!oldDesktop) { oldDesktop = desktop; diff --git a/src/workspace.cpp b/src/workspace.cpp index 863cd93694..16f6e25d8f 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -124,7 +124,6 @@ Workspace::Workspace() , was_user_interaction(false) , block_focus(0) , m_userActionsMenu(new UserActionsMenu(this)) - , workspaceInit(true) , m_sessionManager(new SessionManager(this)) , m_focusChain(std::make_unique()) , m_applicationMenu(std::make_unique()) @@ -270,11 +269,6 @@ void Workspace::init() connect(server, &WaylandServer::windowRemoved, this, &Workspace::removeWaylandWindow); } - // SELI TODO: This won't work with unreasonable focus policies, - // and maybe in rare cases also if the selected window doesn't - // want focus - workspaceInit = false; - // broadcast that Workspace is ready, but first process all events. QMetaObject::invokeMethod(this, "workspaceInitialized", Qt::QueuedConnection); diff --git a/src/workspace.h b/src/workspace.h index e0df82bbdd..7d58b6f427 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -720,8 +720,6 @@ private: static Workspace *_self; - bool workspaceInit; - std::unique_ptr m_startup; std::unique_ptr m_colorMapper; @@ -812,11 +810,6 @@ inline QList Workspace::outputs() const return m_outputs; } -inline bool Workspace::initializing() const -{ - return workspaceInit; -} - inline Window *Workspace::activeWindow() const { return m_activeWindow;