mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 10:25:58 +01:00
input: simplify fullscreen workspace input calculations
Fixes an issue with special workspaces not receiving focus above fullscreen windows, and cleans up the code
This commit is contained in:
parent
e4ddfcfa0c
commit
b662215fad
1 changed files with 7 additions and 12 deletions
|
@ -244,17 +244,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only check floating because tiled cant be over fullscreen
|
const auto PWINDOWIDEAL = g_pCompositor->vectorToWindowIdeal(mouseCoords);
|
||||||
for (auto& w : g_pCompositor->m_vWindows | std::views::reverse) {
|
|
||||||
wlr_box box = {w->m_vRealPosition.vec().x - BORDER_GRAB_AREA, w->m_vRealPosition.vec().y - BORDER_GRAB_AREA, w->m_vRealSize.vec().x + 2 * BORDER_GRAB_AREA,
|
if (PWINDOWIDEAL &&
|
||||||
w->m_vRealSize.vec().y + 2 * BORDER_GRAB_AREA};
|
((PWINDOWIDEAL->m_bIsFloating && PWINDOWIDEAL->m_bCreatedOverFullscreen) /* floating over fullscreen */
|
||||||
if (((w->m_bIsFloating && w->m_bIsMapped && (w->m_bCreatedOverFullscreen || w->m_bPinned)) ||
|
|| (PMONITOR->specialWorkspaceID == PWINDOWIDEAL->m_iWorkspaceID) /* on an open special workspace */))
|
||||||
(g_pCompositor->isWorkspaceSpecial(w->m_iWorkspaceID) && PMONITOR->specialWorkspaceID)) &&
|
pFoundWindow = PWINDOWIDEAL;
|
||||||
wlr_box_contains_point(&box, mouseCoords.x, mouseCoords.y) && g_pCompositor->isWorkspaceVisible(w->m_iWorkspaceID) && !w->isHidden()) {
|
|
||||||
pFoundWindow = w.get();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pFoundWindow->m_bIsX11) {
|
if (!pFoundWindow->m_bIsX11) {
|
||||||
foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, pFoundWindow, surfaceCoords);
|
foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, pFoundWindow, surfaceCoords);
|
||||||
|
|
Loading…
Reference in a new issue