summaryrefslogtreecommitdiff
path: root/src/helpers/Workspace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Workspace.cpp')
-rw-r--r--src/helpers/Workspace.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp
index 0ac976ba..0b964fdf 100644
--- a/src/helpers/Workspace.cpp
+++ b/src/helpers/Workspace.cpp
@@ -119,4 +119,11 @@ void CWorkspace::moveToMonitor(const int& id) {
wlr_ext_workspace_handle_v1_set_urgent(m_pWlrHandle, false);
wlr_ext_workspace_handle_v1_set_name(m_pWlrHandle, m_szName.c_str());
-} \ No newline at end of file
+}
+
+CWindow* CWorkspace::getLastFocusedWindow() {
+ if (!g_pCompositor->windowValidMapped(m_pLastFocusedWindow) || m_pLastFocusedWindow->m_iWorkspaceID != m_iID)
+ return nullptr;
+
+ return m_pLastFocusedWindow;
+}