diff options
| author | xDarksome <dev@darkso.me> | 2022-06-26 19:20:20 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-26 19:20:20 +0300 |
| commit | 504f76112aec3625f2d67f9289a48a01bc90cb50 (patch) | |
| tree | f3a4c5176a2d8f1954a7632b542f829e994c8529 /src/layout/DwindleLayout.cpp | |
| parent | be460ea9547691eb136bf8b600b67b778af47e3f (diff) | |
| parent | f1a5cb4979f312f56967888c2b1b6d2aa535bb9e (diff) | |
Merge branch 'hyprwm:main' into main
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index fb966153..c72dbb99 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -482,6 +482,9 @@ void CHyprDwindleLayout::onBeginDragWindow() { void CHyprDwindleLayout::onEndDragWindow() { const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow; + if (!g_pCompositor->windowValidMapped(DRAGGINGWINDOW)) + return; + if (DRAGGINGWINDOW->m_bDraggingTiled) { DRAGGINGWINDOW->m_bIsFloating = false; changeWindowFloatingMode(DRAGGINGWINDOW); @@ -494,8 +497,10 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow; // Window invalid or drag begin size 0,0 meaning we rejected it. - if (!g_pCompositor->windowValidMapped(DRAGGINGWINDOW) || m_vBeginDragSizeXY == Vector2D()) + if (!g_pCompositor->windowValidMapped(DRAGGINGWINDOW) || m_vBeginDragSizeXY == Vector2D()) { + g_pInputManager->currentlyDraggedWindow = nullptr; return; + } const auto DELTA = Vector2D(mousePos.x - m_vBeginDragXY.x, mousePos.y - m_vBeginDragXY.y); const auto TICKDELTA = Vector2D(mousePos.x - m_vLastDragXY.x, mousePos.y - m_vLastDragXY.y); @@ -671,21 +676,24 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { g_pCompositor->moveWindowToTop(pWindow); } -void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode) { +void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode, bool on) { if (!g_pCompositor->windowValidMapped(pWindow)) return; + if (on == pWindow->m_bIsFullscreen) + return; // ignore + const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); - if (PWORKSPACE->m_bHasFullscreenWindow && !pWindow->m_bIsFullscreen) { + if (PWORKSPACE->m_bHasFullscreenWindow && on) { // if the window wants to be fullscreen but there already is one, // ignore the request. return; } // otherwise, accept it. - pWindow->m_bIsFullscreen = !pWindow->m_bIsFullscreen; + pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; if (!pWindow->m_bIsFullscreen) { |
