summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-21 19:18:33 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-21 19:18:33 +0100
commit295a0c4a6904b639ae406df2f106eb35d71899ae (patch)
tree55ba41ed80f20b798e3f7719323dfb673787a44b /src/managers/InputManager.cpp
parent1b50377a5aaa8d5e2585d72dc5393ac6ad6fe248 (diff)
Added fullscreen
Diffstat (limited to 'src/managers/InputManager.cpp')
-rw-r--r--src/managers/InputManager.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index 530e1fd9..af1a3856 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -20,15 +20,30 @@ void CInputManager::onMouseWarp(wlr_event_pointer_motion_absolute* e) {
void CInputManager::mouseMoveUnified(uint32_t time) {
- // first top layers
wlr_surface* foundSurface = nullptr;
Vector2D mouseCoords = getMouseCoordsInternal();
const auto PMONITOR = g_pCompositor->getMonitorFromCursor();
Vector2D surfacePos;
- foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &surfacePos);
+ // first, we check if the workspace doesnt have a fullscreen window
+ const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
+ if (PWORKSPACE->hasFullscreenWindow) {
+ const auto PFULLSCREENWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->ID);
+
+ // should never ever happen but who knows
+ if (PFULLSCREENWINDOW) {
+ foundSurface = g_pXWaylandManager->getWindowSurface(PFULLSCREENWINDOW);
+ if (foundSurface)
+ surfacePos = PFULLSCREENWINDOW->m_vRealPosition;
+ }
+ }
+
+ // then surfaces on top
+ if (!foundSurface)
+ foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &surfacePos);
+
if (!foundSurface)
- foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfacePos);
+ foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfacePos);
// then windows
if (!foundSurface && g_pCompositor->vectorToWindowIdeal(mouseCoords)) {
@@ -79,6 +94,8 @@ void CInputManager::onMouseButton(wlr_event_pointer_button* e) {
dragButton = e->button;
g_pLayoutManager->getCurrentLayout()->onBeginDragWindow();
+
+ return;
}
break;
case WLR_BUTTON_RELEASED:
@@ -87,8 +104,6 @@ void CInputManager::onMouseButton(wlr_event_pointer_button* e) {
break;
}
- g_pCompositor->focusWindow(g_pCompositor->vectorToWindowIdeal(Vector2D(g_pCompositor->m_sWLRCursor->x, g_pCompositor->m_sWLRCursor->y)));
-
// notify app if we didnt handle it
wlr_seat_pointer_notify_button(g_pCompositor->m_sWLRSeat, e->time_msec, e->button, e->state);
}