summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-02 18:57:09 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-02 18:57:09 +0200
commit223beb8a826773e2e3ea4c6d7e7d40fde9247d9a (patch)
tree41d89a962caaf8e63f777e50cf00a2505e7f9a3e /src/managers/XWaylandManager.cpp
parentc923b4f0756c3494d408a257c08922621d120ae2 (diff)
Multiple focus handling changes
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r--src/managers/XWaylandManager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 6fd37f94..0e419c0f 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -37,6 +37,19 @@ void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate)
wlr_xwayland_surface_activate(wlr_xwayland_surface_from_wlr_surface(pSurface), activate);
}
+void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) {
+ if (pWindow == g_pCompositor->m_pLastWindow)
+ return;
+
+ if (pWindow->m_bIsX11)
+ wlr_xwayland_surface_activate(pWindow->m_uSurface.xwayland, activate);
+ else
+ wlr_xdg_toplevel_set_activated(pWindow->m_uSurface.xdg->toplevel, activate);
+
+ g_pCompositor->m_pLastFocus = getWindowSurface(pWindow);
+ g_pCompositor->m_pLastWindow = pWindow;
+}
+
void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) {
if (pWindow->m_bIsX11) {
pbox->x = pWindow->m_uSurface.xwayland->x;