Skip to content

Commit

Permalink
warp_on_change_workspace: check if focused layer is a window.
Browse files Browse the repository at this point in the history
  • Loading branch information
memchr committed Jun 15, 2024
1 parent f032f17 commit ea0930a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/managers/KeybindManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,13 +1121,10 @@ void CKeybindManager::changeworkspace(std::string args) {
const static auto PWARPONWORKSPACECHANGE = CConfigValue<Hyprlang::INT>("cursor:warp_on_change_workspace");

if (*PWARPONWORKSPACECHANGE) {
Vector2D surfaceCoords;
PHLLS pFoundLayerSurface;
auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow();
auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow();
auto HLSurface = CWLSurface::fromResource(g_pSeatManager->state.pointerFocus.lock());

if (PLAST &&
!g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfaceCoords,
&pFoundLayerSurface))
if (PLAST && (!HLSurface || HLSurface->getWindow()))
PLAST->warpCursor();
}
}
Expand Down

0 comments on commit ea0930a

Please sign in to comment.