diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-12-12 01:14:36 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-12-12 01:14:36 +0000 |
| commit | accb3d8d0b339ce83dd36704503253d874c7163b (patch) | |
| tree | 77be38114c756e6b27936ad5cee0ec0e85c843a5 /src | |
| parent | ea7569d7e0941d19f5f469a5fbb79bc0fa62b935 (diff) | |
xwayland: push invisible windows outside layout
fixes some xwl focus issues with special especially.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compositor.cpp | 2 | ||||
| -rw-r--r-- | src/helpers/Monitor.cpp | 27 | ||||
| -rw-r--r-- | src/managers/XWaylandManager.cpp | 4 |
3 files changed, 30 insertions, 3 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 2618ad39..3b022a19 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2773,4 +2773,4 @@ void CCompositor::setPreferredScaleForSurface(wlr_surface* pSurface, double scal void CCompositor::setPreferredTransformForSurface(wlr_surface* pSurface, wl_output_transform transform) { wlr_surface_set_preferred_buffer_transform(pSurface, transform); -} +}
\ No newline at end of file diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index c112d07d..0132db63 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -565,6 +565,15 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool g_pCompositor->updateFullscreenFadeOnWorkspace(pWorkspace); g_pConfigManager->ensureVRR(this); + + for (auto& w : g_pCompositor->m_vWindows) { + if (w->m_iWorkspaceID != POLDWORKSPACE->m_iID || !w->m_bMappedX11 || !w->m_bIsX11 || w->isHidden() || w->m_iMonitorID != ID) + continue; + + g_pXWaylandManager->moveXWaylandWindow(w.get(), {30000, 30000}); + } + + g_pCompositor->forceReportSizesToWindowsOnWorkspace(pWorkspace->m_iID); } void CMonitor::changeWorkspace(const int& id, bool internal) { @@ -576,7 +585,9 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) { if (!pWorkspace) { // remove special if exists - if (const auto EXISTINGSPECIAL = g_pCompositor->getWorkspaceByID(specialWorkspaceID); EXISTINGSPECIAL) { + const auto EXISTINGSPECIAL = g_pCompositor->getWorkspaceByID(specialWorkspaceID); + + if (EXISTINGSPECIAL) { EXISTINGSPECIAL->startAnim(false, false); g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + szName}); } @@ -590,6 +601,18 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) { else g_pInputManager->refocus(); + // for xwayland: yeet all the windows to narnia to avoid some focus fuckery. I hate xwayland. + // I'll avoid setting XCB_ICCCM_WM_STATE_ICONIC (aka minimized) so that the apps don't do stupid shit. + + if (EXISTINGSPECIAL) { + for (auto& w : g_pCompositor->m_vWindows) { + if (w->m_iWorkspaceID != EXISTINGSPECIAL->m_iID || !w->m_bMappedX11 || !w->m_bIsX11 || w->isHidden() || w->m_iMonitorID != ID) + continue; + + g_pXWaylandManager->moveXWaylandWindow(w.get(), {30000, 30000}); + } + } + return; } @@ -631,6 +654,8 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) { g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", pWorkspace->m_szName + "," + szName}); g_pHyprRenderer->damageMonitor(this); + + g_pCompositor->forceReportSizesToWindowsOnWorkspace(specialWorkspaceID); } void CMonitor::setSpecialWorkspace(const int& id) { diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 2883f205..dcb706e3 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -262,7 +262,9 @@ void CHyprXWaylandManager::moveXWaylandWindow(CWindow* pWindow, const Vector2D& if (!pWindow->m_bIsX11) return; - wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, pWindow->m_vRealSize.vec().x, pWindow->m_vRealSize.vec().y); + Vector2D size = pWindow->m_vRealSize.goalv() * pWindow->m_fX11SurfaceScaledBy; + + wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, size.x, size.y); } void CHyprXWaylandManager::checkBorders(CWindow* pWindow) { |
