From f9a4e9aecd2f38d0f82f24ac2dd4a1f9d4d84045 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 19 Mar 2022 17:48:18 +0100 Subject: basic keybinds --- src/Compositor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index c0059836..228723ca 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -95,6 +95,9 @@ void CCompositor::startCompositor() { // Init all the managers BEFORE we start with the wayland server so that ALL of the stuff is initialized // properly and we dont get any bad mem reads. // + Debug::log(LOG, "Creating the KeybindManager!"); + g_pKeybindManager = std::make_unique(); + Debug::log(LOG, "Creating the ConfigManager!"); g_pConfigManager = std::make_unique(); @@ -196,6 +199,16 @@ CWindow* CCompositor::vectorToWindow(const Vector2D& pos) { return nullptr; } +CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) { + for (auto& w : m_lWindows) { + wlr_box box = {w.m_vPosition.x, w.m_vPosition.y, w.m_vSize.x, w.m_vSize.y}; + if (wlr_box_contains_point(&box, pos.x, pos.y)) + return &w; + } + + return nullptr; +} + void CCompositor::focusWindow(CWindow* pWindow) { if (!pWindow) { -- cgit v1.2.3