mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-07 07:50:58 +00:00
invert cursor_visible to hide_cursor
This commit is contained in:
parent
d553372682
commit
441e7e488f
3 changed files with 4 additions and 4 deletions
|
@ -229,7 +229,7 @@ static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const
|
||||||
{
|
{
|
||||||
SDL_Mouse *mouse = (SDL_Mouse *)userdata;
|
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
|
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) {
|
if (mouse->ShowCursor) {
|
||||||
mouse->ShowCursor(cursor);
|
mouse->ShowCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ typedef struct
|
||||||
bool has_position;
|
bool has_position;
|
||||||
bool relative_mode;
|
bool relative_mode;
|
||||||
bool relative_mode_warp_motion;
|
bool relative_mode_warp_motion;
|
||||||
bool relative_mode_cursor_visible;
|
bool relative_mode_hide_cursor;
|
||||||
bool relative_mode_center;
|
bool relative_mode_center;
|
||||||
bool warp_emulation_hint;
|
bool warp_emulation_hint;
|
||||||
bool warp_emulation_active;
|
bool warp_emulation_active;
|
||||||
|
|
|
@ -1118,7 +1118,7 @@ void Wayland_SeatUpdateCursor(SDL_WaylandSeat *seat)
|
||||||
if (pointer_focus) {
|
if (pointer_focus) {
|
||||||
const bool has_relative_focus = Wayland_SeatHasRelativePointerFocus(seat);
|
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;
|
const SDL_HitTestResult rc = pointer_focus->hit_test_result;
|
||||||
|
|
||||||
if ((seat->display->relative_mode_enabled && has_relative_focus) ||
|
if ((seat->display->relative_mode_enabled && has_relative_focus) ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue