summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorxDarksome <dev@darkso.me>2022-06-26 19:20:20 +0300
committerGitHub <noreply@github.com>2022-06-26 19:20:20 +0300
commit504f76112aec3625f2d67f9289a48a01bc90cb50 (patch)
treef3a4c5176a2d8f1954a7632b542f829e994c8529 /src/layout
parentbe460ea9547691eb136bf8b600b67b778af47e3f (diff)
parentf1a5cb4979f312f56967888c2b1b6d2aa535bb9e (diff)
Merge branch 'hyprwm:main' into main
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/DwindleLayout.cpp16
-rw-r--r--src/layout/DwindleLayout.hpp2
-rw-r--r--src/layout/IHyprLayout.hpp2
3 files changed, 14 insertions, 6 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) {
diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp
index 55c123ae..3f32ff0b 100644
--- a/src/layout/DwindleLayout.hpp
+++ b/src/layout/DwindleLayout.hpp
@@ -53,7 +53,7 @@ public:
virtual void onEndDragWindow();
virtual void onMouseMove(const Vector2D&);
virtual void onWindowCreatedFloating(CWindow*);
- virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode);
+ virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool);
virtual std::any layoutMessage(SLayoutMessageHeader, std::string);
virtual SWindowRenderLayoutHints requestRenderHints(CWindow*);
virtual void switchWindows(CWindow*, CWindow*);
diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp
index a7268301..d7102761 100644
--- a/src/layout/IHyprLayout.hpp
+++ b/src/layout/IHyprLayout.hpp
@@ -84,7 +84,7 @@ public:
The layout sets all the fullscreen flags.
It can either accept or ignore.
*/
- virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode) = 0;
+ virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool) = 0;
/*
Called when a dispatcher requests a custom message