reset m_bEmptyFocusCursorSet on workspace switch

This commit is contained in:
Vaxry 2022-11-25 11:34:29 +00:00
parent 141456dd89
commit 0e6e8461eb
3 changed files with 7 additions and 1 deletions

View file

@ -707,6 +707,8 @@ void CKeybindManager::changeworkspace(std::string args) {
// remove constraints
g_pInputManager->unconstrainMouse();
g_pInputManager->m_bEmptyFocusCursorSet = false;
// if it's not internal, we will unfocus to prevent stuck focus
if (!internal)
g_pCompositor->focusWindow(nullptr);

View file

@ -218,7 +218,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor);
else
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor);
m_bEmptyFocusCursorSet = true;
}

View file

@ -25,6 +25,8 @@ struct STouchData {
Vector2D touchSurfaceOrigin;
};
class CKeybindManager;
class CInputManager {
public:
@ -161,6 +163,8 @@ private:
// swipe
void beginWorkspaceSwipe();
friend class CKeybindManager;
};
inline std::unique_ptr<CInputManager> g_pInputManager;