summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-20 13:37:07 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-20 13:37:07 +0100
commit332fa8a802dd89f16848765cab8a1483e09e73aa (patch)
tree27a4a8dc9ce7d32b56b7b16b613e40d9197a0671 /src/layout
parent5d0919fcff3ee3e321b1a0b2f1e4a7c6db97f9a8 (diff)
XWayland floating
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/DwindleLayout.cpp8
-rw-r--r--src/layout/DwindleLayout.hpp1
-rw-r--r--src/layout/IHyprLayout.hpp1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 129c2142..9f97cece 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -303,4 +303,12 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) {
if (PMONITOR)
DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID;
+}
+
+void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) {
+ const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow);
+ const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
+
+ pWindow->m_vRealSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height);
+ pWindow->m_vRealPosition = Vector2D(PMONITOR->vecPosition.x + (PMONITOR->vecSize.x - pWindow->m_vRealSize.x) / 2.f, PMONITOR->vecPosition.y + (PMONITOR->vecSize.y - pWindow->m_vRealSize.y) / 2.f);
} \ No newline at end of file
diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp
index b9136727..5c2cbde8 100644
--- a/src/layout/DwindleLayout.hpp
+++ b/src/layout/DwindleLayout.hpp
@@ -35,6 +35,7 @@ public:
virtual void changeWindowFloatingMode(CWindow*);
virtual void onBeginDragWindow();
virtual void onMouseMove(const Vector2D&);
+ virtual void onWindowCreatedFloating(CWindow*);
private:
diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp
index bf0d135b..c3fbd667 100644
--- a/src/layout/IHyprLayout.hpp
+++ b/src/layout/IHyprLayout.hpp
@@ -14,5 +14,6 @@ public:
virtual void changeWindowFloatingMode(CWindow*) = 0;
virtual void onBeginDragWindow() = 0;
virtual void onMouseMove(const Vector2D&) = 0;
+ virtual void onWindowCreatedFloating(CWindow*) = 0;
}; \ No newline at end of file