mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
invert cursor_visible to hide_cursor
This commit is contained in:
@@ -229,7 +229,7 @@ static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const
|
||||
{
|
||||
SDL_Mouse *mouse = (SDL_Mouse *)userdata;
|
||||
|
||||
mouse->relative_mode_cursor_visible = SDL_GetStringBoolean(hint, false);
|
||||
mouse->relative_mode_hide_cursor = !(SDL_GetStringBoolean(hint, false));
|
||||
|
||||
SDL_SetCursor(NULL); // Update cursor visibility
|
||||
}
|
||||
@@ -1635,7 +1635,7 @@ bool SDL_SetCursor(SDL_Cursor *cursor)
|
||||
}
|
||||
}
|
||||
|
||||
if (cursor && (!mouse->focus || (mouse->cursor_visible && (!mouse->relative_mode || mouse->relative_mode_cursor_visible)))) {
|
||||
if (cursor && (!mouse->focus || (mouse->cursor_visible && (!mouse->relative_mode || !mouse->relative_mode_hide_cursor)))) {
|
||||
if (mouse->ShowCursor) {
|
||||
mouse->ShowCursor(cursor);
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ typedef struct
|
||||
bool has_position;
|
||||
bool relative_mode;
|
||||
bool relative_mode_warp_motion;
|
||||
bool relative_mode_cursor_visible;
|
||||
bool relative_mode_hide_cursor;
|
||||
bool relative_mode_center;
|
||||
bool warp_emulation_hint;
|
||||
bool warp_emulation_active;
|
||||
|
@@ -1118,7 +1118,7 @@ void Wayland_SeatUpdateCursor(SDL_WaylandSeat *seat)
|
||||
if (pointer_focus) {
|
||||
const bool has_relative_focus = Wayland_SeatHasRelativePointerFocus(seat);
|
||||
|
||||
if (!seat->display->relative_mode_enabled || !has_relative_focus || mouse->relative_mode_cursor_visible) {
|
||||
if (!seat->display->relative_mode_enabled || !has_relative_focus || !mouse->relative_mode_hide_cursor) {
|
||||
const SDL_HitTestResult rc = pointer_focus->hit_test_result;
|
||||
|
||||
if ((seat->display->relative_mode_enabled && has_relative_focus) ||
|
||||
|
Reference in New Issue
Block a user