added a layoutmanager and basic dwindle
This commit is contained in:
parent
e664b0b692
commit
61e10e2048
12 changed files with 308 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
11
src/managers/LayoutManager.cpp
Normal file
11
src/managers/LayoutManager.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include "LayoutManager.hpp"
|
||||
|
||||
IHyprLayout* CLayoutManager::getCurrentLayout() {
|
||||
switch (m_iCurrentLayoutID) {
|
||||
case DWINDLE:
|
||||
return &m_cDwindleLayout;
|
||||
}
|
||||
|
||||
// fallback
|
||||
return &m_cDwindleLayout;
|
||||
}
|
||||
20
src/managers/LayoutManager.hpp
Normal file
20
src/managers/LayoutManager.hpp
Normal file
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue