From aac546b7710e14397f6986c55ad628fedac2de14 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 16 Jul 2022 16:27:17 +0200 Subject: added center windowrule --- src/events/Windows.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index afedcf34..36f0b2db 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -224,6 +224,8 @@ void Events::listener_mapWindow(void* owner, void* data) { } catch (...) { Debug::log(LOG, "Rule move failed, rule: %s -> %s", r.szRule.c_str(), r.szValue.c_str()); } + } else if (r.szRule == "center") { + PWINDOW->m_vRealPosition = PMONITOR->vecPosition + PMONITOR->vecSize / 2.f - PWINDOW->m_vRealSize.goalv() / 2.f; } } -- cgit v1.2.3 From 90d07d7b520d3ea8d01dd248d16dcd96937f431c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:39:57 +0200 Subject: fix shadows on unmanaged and noborder --- src/events/Windows.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 36f0b2db..694b9a9c 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -49,6 +49,8 @@ void Events::listener_mapWindow(void* owner, void* data) { if (PWINDOW->m_iX11Type == 2) g_pCompositor->moveUnmanagedX11ToWindows(PWINDOW); + g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW); + // Set all windows tiled regardless of anything g_pXWaylandManager->setWindowStyleTiled(PWINDOW, WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM); -- cgit v1.2.3 From 755245e752016441da2a091f72eb87aa99414e33 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:21:35 +0200 Subject: adjust workspace on geom change x11 --- src/events/Windows.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 694b9a9c..9520d17b 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -505,6 +505,8 @@ void Events::listener_configureX11(void* owner, void* data) { wlr_xwayland_surface_configure(PWINDOW->m_uSurface.xwayland, E->x, E->y, E->width, E->height); + PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromVector(PWINDOW->m_vRealPosition.vec() + PWINDOW->m_vRealSize.vec() / 2.f)->activeWorkspace; + g_pCompositor->moveWindowToTop(PWINDOW); PWINDOW->m_bCreatedOverFullscreen = true; @@ -529,7 +531,9 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { if (abs(floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) PWINDOW->m_vRealSize.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->width, PWINDOW->m_uSurface.xwayland->height)); - + + PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromVector(PWINDOW->m_vRealPosition.vec() + PWINDOW->m_vRealSize.vec() / 2.f)->activeWorkspace; + g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.vec()); g_pCompositor->moveWindowToTop(PWINDOW); PWINDOW->updateWindowDecos(); -- cgit v1.2.3 From d4690a5c5e545877a6704f4376cb4974ad525275 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:38:27 +0200 Subject: minor change to unmanaged X11 geom requests --- src/events/Windows.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 9520d17b..8d30ffc0 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -526,6 +526,8 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { const auto SIZ = PWINDOW->m_vRealSize.goalv(); if (abs(floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 || abs(floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) { + Debug::log(LOG, "Unmanaged window %x requests geometry update to %i %i %i %i", (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y, (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height); + g_pHyprRenderer->damageWindow(PWINDOW); PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y)); @@ -534,7 +536,6 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromVector(PWINDOW->m_vRealPosition.vec() + PWINDOW->m_vRealSize.vec() / 2.f)->activeWorkspace; - g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.vec()); g_pCompositor->moveWindowToTop(PWINDOW); PWINDOW->updateWindowDecos(); g_pHyprRenderer->damageWindow(PWINDOW); -- cgit v1.2.3 From ce8d655fadae18cbb8d58679edd7601f76177811 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:39:15 +0200 Subject: fix oopsie in log --- src/events/Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 8d30ffc0..327c06fa 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -526,7 +526,7 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { const auto SIZ = PWINDOW->m_vRealSize.goalv(); if (abs(floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 || abs(floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) { - Debug::log(LOG, "Unmanaged window %x requests geometry update to %i %i %i %i", (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y, (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height); + Debug::log(LOG, "Unmanaged window %x requests geometry update to %i %i %i %i", PWINDOW, (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y, (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height); g_pHyprRenderer->damageWindow(PWINDOW); PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y)); -- cgit v1.2.3 From 641aaff998d6297831b9b139e5ff8767ab5c0c79 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:39:08 +0200 Subject: minor code adjustments --- src/events/Windows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 327c06fa..3cd111ba 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -438,7 +438,7 @@ void Events::listener_setTitleWindow(void* owner, void* data) { PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW); if (PWINDOW == g_pCompositor->m_pLastWindow) // if it's the active, let's post an event to update others - g_pEventManager->postEvent(SHyprIPCEvent("activewindow", g_pXWaylandManager->getAppIDClass(PWINDOW) + "," + PWINDOW->m_szTitle)); + g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", g_pXWaylandManager->getAppIDClass(PWINDOW) + "," + PWINDOW->m_szTitle}); if (PWINDOW->m_phForeignToplevel) wlr_foreign_toplevel_handle_v1_set_title(PWINDOW->m_phForeignToplevel, PWINDOW->m_szTitle.c_str()); @@ -525,13 +525,13 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { const auto POS = PWINDOW->m_vRealPosition.goalv(); const auto SIZ = PWINDOW->m_vRealSize.goalv(); - if (abs(floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 || abs(floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) { + if (abs(std::floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(std::floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 || abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) { Debug::log(LOG, "Unmanaged window %x requests geometry update to %i %i %i %i", PWINDOW, (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y, (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height); g_pHyprRenderer->damageWindow(PWINDOW); PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y)); - if (abs(floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) + if (abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) PWINDOW->m_vRealSize.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->width, PWINDOW->m_uSurface.xwayland->height)); PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromVector(PWINDOW->m_vRealPosition.vec() + PWINDOW->m_vRealSize.vec() / 2.f)->activeWorkspace; -- cgit v1.2.3