summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-19 15:59:53 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-19 15:59:53 +0100
commit61e10e20484e8867656d39cbaa6d75c3aab7eba6 (patch)
treec57b575aff261990764929ad855176228791aa26 /src/managers
parente664b0b6920571b864776319dd32153e104e748d (diff)
added a layoutmanager and basic dwindle
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/InputManager.cpp2
-rw-r--r--src/managers/LayoutManager.cpp11
-rw-r--r--src/managers/LayoutManager.hpp20
-rw-r--r--src/managers/XWaylandManager.cpp4
4 files changed, 34 insertions, 3 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index 725ce672..492251fd 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -45,7 +45,7 @@ void CInputManager::mouseMoveUnified(uint32_t time) {
g_pCompositor->focusWindow(PWINDOW);
- Vector2D surfaceLocal = m_vWLRMouseCoords - PWINDOW->m_vPosition;
+ Vector2D surfaceLocal = m_vWLRMouseCoords - PWINDOW->m_vEffectivePosition;
wlr_seat_pointer_notify_enter(g_pCompositor->m_sWLRSeat, g_pXWaylandManager->getWindowSurface(PWINDOW), surfaceLocal.x, surfaceLocal.y);
wlr_seat_pointer_notify_motion(g_pCompositor->m_sWLRSeat, time, surfaceLocal.x, surfaceLocal.y);
diff --git a/src/managers/LayoutManager.cpp b/src/managers/LayoutManager.cpp
new file mode 100644
index 00000000..ec723350
--- /dev/null
+++ b/src/managers/LayoutManager.cpp
@@ -0,0 +1,11 @@
+#include "LayoutManager.hpp"
+
+IHyprLayout* CLayoutManager::getCurrentLayout() {
+ switch (m_iCurrentLayoutID) {
+ case DWINDLE:
+ return &m_cDwindleLayout;
+ }
+
+ // fallback
+ return &m_cDwindleLayout;
+} \ No newline at end of file
diff --git a/src/managers/LayoutManager.hpp b/src/managers/LayoutManager.hpp
new file mode 100644
index 00000000..20f1f7f9
--- /dev/null
+++ b/src/managers/LayoutManager.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "../layout/DwindleLayout.hpp"
+
+class CLayoutManager {
+public:
+
+ IHyprLayout* getCurrentLayout();
+
+private:
+ enum HYPRLAYOUTS {
+ DWINDLE = 0,
+ };
+
+ HYPRLAYOUTS m_iCurrentLayoutID = DWINDLE;
+
+ CHyprDwindleLayout m_cDwindleLayout;
+};
+
+inline std::unique_ptr<CLayoutManager> g_pLayoutManager; \ No newline at end of file
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 1c28ec35..dfe6cb19 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -64,8 +64,8 @@ void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) {
}
void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size) {
- if (pWindow->m_bIsX11)
- wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vPosition.x, pWindow->m_vPosition.y, size.x, size.y);
+ if (pWindow->m_bIsX11)
+ wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vEffectivePosition.x, pWindow->m_vEffectivePosition.y, size.x, size.y);
else
wlr_xdg_toplevel_set_size(pWindow->m_uSurface.xdg->toplevel, size.x, size.y);