Show cursor always, not just in-game.

Will do a cosmetic pass later but unblock using Steam windows that use
OS cursor for now.
This commit is contained in:
Pierre-Loup A. Griffais 2020-06-29 13:46:36 -07:00
parent 4524ac3cbb
commit 76b7d58a74

View file

@ -605,7 +605,7 @@ void MouseCursor::checkSuspension()
} }
// We're hiding the cursor, force redraw if we were showing it // We're hiding the cursor, force redraw if we were showing it
if (window && gameFocused && !m_imageEmpty ) { if (window && !m_imageEmpty ) {
hasRepaint = true; hasRepaint = true;
XSendEvent(m_display, ourWindow, true, SubstructureRedirectMask, &nudgeEvent); XSendEvent(m_display, ourWindow, true, SubstructureRedirectMask, &nudgeEvent);
} }
@ -642,10 +642,6 @@ void MouseCursor::constrainPosition()
} }
} }
if (!gameFocused) {
return;
}
auto barricade = [this](int x1, int y1, int x2, int y2) { auto barricade = [this](int x1, int y1, int x2, int y2) {
return XFixesCreatePointerBarrier(m_display, DefaultRootWindow(m_display), return XFixesCreatePointerBarrier(m_display, DefaultRootWindow(m_display),
x1, y1, x2, y2, 0, 0, NULL); x1, y1, x2, y2, 0, 0, NULL);
@ -680,7 +676,7 @@ void MouseCursor::move(int x, int y)
win *window = find_win(m_display, currentFocusWindow); win *window = find_win(m_display, currentFocusWindow);
if (window && gameFocused) { if (window) {
// If mouse moved and we're on the hook for showing the cursor, repaint // If mouse moved and we're on the hook for showing the cursor, repaint
if (!m_hideForMovement && !m_imageEmpty) { if (!m_hideForMovement && !m_imageEmpty) {
hasRepaint = true; hasRepaint = true;
@ -1097,7 +1093,7 @@ paint_all(Display *dpy, MouseCursor *cursor)
} }
// Draw cursor if we need to // Draw cursor if we need to
if (w && gameFocused) { if (w) {
cursor->paint(w, &composite, &pipeline ); cursor->paint(w, &composite, &pipeline );
} }