summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-26 13:44:59 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-26 13:44:59 +0200
commit0887e2ee6ec9c7ef106b71c906c6531730c8fdd4 (patch)
tree8bbedcc55584a3445670342f2b1dbe85e4064bc6 /src/Window.cpp
parent62e3953f5b2274fdb6c41bee079513c5c622234c (diff)
window: reveal current from group on toplevel activate
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 1392650b..01d337e8 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -197,7 +197,16 @@ void CWindow::createToplevelHandle() {
// handle events
hyprListener_toplevelActivate.initCallback(
- &m_phForeignToplevel->events.request_activate, [&](void* owner, void* data) { g_pCompositor->focusWindow(this); }, this, "Toplevel");
+ &m_phForeignToplevel->events.request_activate,
+ [&](void* owner, void* data) {
+ if (isHidden() && m_sGroupData.pNextWindow) {
+ // grouped, change the current to us
+ setGroupCurrent(this);
+ }
+
+ g_pCompositor->focusWindow(this);
+ },
+ this, "Toplevel");
hyprListener_toplevelFullscreen.initCallback(
&m_phForeignToplevel->events.request_fullscreen,
@@ -677,8 +686,7 @@ bool CWindow::opaque() {
return true;
const auto EXTENTS = pixman_region32_extents(&m_uSurface.xdg->surface->opaque_region);
- if (EXTENTS->x2 - EXTENTS->x1 >= m_uSurface.xdg->surface->current.buffer_width
- && EXTENTS->y2 - EXTENTS->y1 >= m_uSurface.xdg->surface->current.buffer_height)
+ if (EXTENTS->x2 - EXTENTS->x1 >= m_uSurface.xdg->surface->current.buffer_width && EXTENTS->y2 - EXTENTS->y1 >= m_uSurface.xdg->surface->current.buffer_height)
return true;
return false;