mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 16:25:58 +01:00
guard dragging windows in dwindle
This commit is contained in:
parent
e7467c60f9
commit
3053f99db6
1 changed files with 6 additions and 1 deletions
|
@ -482,6 +482,9 @@ void CHyprDwindleLayout::onBeginDragWindow() {
|
||||||
void CHyprDwindleLayout::onEndDragWindow() {
|
void CHyprDwindleLayout::onEndDragWindow() {
|
||||||
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;
|
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;
|
||||||
|
|
||||||
|
if (!g_pCompositor->windowValidMapped(DRAGGINGWINDOW))
|
||||||
|
return;
|
||||||
|
|
||||||
if (DRAGGINGWINDOW->m_bDraggingTiled) {
|
if (DRAGGINGWINDOW->m_bDraggingTiled) {
|
||||||
DRAGGINGWINDOW->m_bIsFloating = false;
|
DRAGGINGWINDOW->m_bIsFloating = false;
|
||||||
changeWindowFloatingMode(DRAGGINGWINDOW);
|
changeWindowFloatingMode(DRAGGINGWINDOW);
|
||||||
|
@ -494,8 +497,10 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) {
|
||||||
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;
|
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;
|
||||||
|
|
||||||
// Window invalid or drag begin size 0,0 meaning we rejected it.
|
// 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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto DELTA = Vector2D(mousePos.x - m_vBeginDragXY.x, mousePos.y - m_vBeginDragXY.y);
|
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);
|
const auto TICKDELTA = Vector2D(mousePos.x - m_vLastDragXY.x, mousePos.y - m_vLastDragXY.y);
|
||||||
|
|
Loading…
Reference in a new issue