summaryrefslogtreecommitdiff
path: root/src/layout/DwindleLayout.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-24 18:37:04 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-24 18:37:04 +0200
commit3053f99db65fcbf00b1d2ffed0f7c522d01b616e (patch)
tree02d28a9206661bd6cbe09f6c5432983b438751c8 /src/layout/DwindleLayout.cpp
parente7467c60f9fe9e66c74dd8dc7c752a73ed4bc4db (diff)
guard dragging windows in dwindle
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
-rw-r--r--src/layout/DwindleLayout.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index fb966153..aeaf8c6b 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);