Skip to content

Commit cf19790

Browse files
authored
ogc: always let application decide on mouse visibility (#59)
Our heuristics break the "Abbaye des Morts" game, which does not need a mouse cursor and just calls `SDL_ShowCursor(SDL_DISABLE)` at startup. Yet, with the current version of SDL, if the wiimote is pointed at the screen we are still showing a cursor, overriding the application's explicit decision. And the mouse cursor is useless, since the application is not reacting to a mouse. The code we are removing was mainly added with the intent of _hiding_ the mouse cursor when the wiimote was not pointed at the screen, and we could indeed update it and keep it working just as an additional check on whether the cursor should be shown or not, but we don't really have a concrete use-case here. Let's just remove it completely for now, and bring it back (still respecting an explicit SDL_DISABLE setting, though!) if/when we see a reason to.
1 parent afa67bc commit cf19790

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/video/ogc/SDL_ogcevents.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ static const struct {
4949

5050
static void pump_ir_events(_THIS)
5151
{
52-
SDL_Mouse *mouse = SDL_GetMouse();
53-
bool wiimote_pointed_at_screen = false;
54-
5552
if (!_this->windows) return;
5653

5754
if (!SDL_WasInit(SDL_INIT_JOYSTICK)) {
@@ -66,7 +63,6 @@ static void pump_ir_events(_THIS)
6663

6764
if (!data->ir.valid) continue;
6865

69-
wiimote_pointed_at_screen = true;
7066
SDL_SendMouseMotion(_this->windows, i,
7167
0, data->ir.x, data->ir.y);
7268

@@ -81,18 +77,6 @@ static void pump_ir_events(_THIS)
8177
}
8278
}
8379
}
84-
85-
/* Unfortunately SDL in practice supports only one mouse, so we are
86-
* consolidating all the wiimotes as a single device.
87-
* Here we check if any wiimote is pointed at the screen, in which case we
88-
* show the default cursor (the Wii hand); if not, then the default cursor
89-
* is hidden. Note that this only affects applications which haven't
90-
* explicitly set a cursor: the others remain in full control of whether a
91-
* cursor should be shown or not. */
92-
if (mouse && mouse->cur_cursor == mouse->def_cursor &&
93-
mouse->cursor_shown != wiimote_pointed_at_screen) {
94-
SDL_ShowCursor(wiimote_pointed_at_screen);
95-
}
9680
}
9781
#endif
9882

0 commit comments

Comments
 (0)