basic keybinds

This commit is contained in:
vaxerski
2022-03-19 17:48:18 +01:00
parent dba7bbdcf3
commit f9a4e9aecd
7 changed files with 139 additions and 3 deletions

View File

@@ -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<CKeybindManager>();
Debug::log(LOG, "Creating the ConfigManager!");
g_pConfigManager = std::make_unique<CConfigManager>();
@@ -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) {