@@ -194,7 +194,7 @@ static bool X11_KeyRepeat(Display *display, XEvent *event)
194
194
return d .found ;
195
195
}
196
196
197
- static bool X11_IsWheelEvent (Display * display , int button , int * xticks , int * yticks )
197
+ bool X11_IsWheelEvent (int button , int * xticks , int * yticks )
198
198
{
199
199
/* according to the xlib docs, no specific mouse wheel events exist.
200
200
However, the defacto standard is that the vertical wheel is X buttons
@@ -1016,8 +1016,6 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
1016
1016
void X11_HandleButtonPress (SDL_VideoDevice * _this , SDL_WindowData * windowdata , SDL_MouseID mouseID , int button , float x , float y , unsigned long time )
1017
1017
{
1018
1018
SDL_Window * window = windowdata -> window ;
1019
- const SDL_VideoData * videodata = _this -> internal ;
1020
- Display * display = videodata -> display ;
1021
1019
int xticks = 0 , yticks = 0 ;
1022
1020
Uint64 timestamp = X11_GetEventTimestamp (time );
1023
1021
@@ -1031,7 +1029,7 @@ void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, S
1031
1029
SDL_SendMouseMotion (timestamp , window , mouseID , false, x , y );
1032
1030
}
1033
1031
1034
- if (X11_IsWheelEvent (display , button , & xticks , & yticks )) {
1032
+ if (X11_IsWheelEvent (button , & xticks , & yticks )) {
1035
1033
SDL_SendMouseWheel (timestamp , window , mouseID , (float )- xticks , (float )yticks , SDL_MOUSEWHEEL_NORMAL );
1036
1034
} else {
1037
1035
bool ignore_click = false;
@@ -1063,16 +1061,14 @@ void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, S
1063
1061
void X11_HandleButtonRelease (SDL_VideoDevice * _this , SDL_WindowData * windowdata , SDL_MouseID mouseID , int button , unsigned long time )
1064
1062
{
1065
1063
SDL_Window * window = windowdata -> window ;
1066
- const SDL_VideoData * videodata = _this -> internal ;
1067
- Display * display = videodata -> display ;
1068
1064
// The X server sends a Release event for each Press for wheels. Ignore them.
1069
1065
int xticks = 0 , yticks = 0 ;
1070
1066
Uint64 timestamp = X11_GetEventTimestamp (time );
1071
1067
1072
1068
#ifdef DEBUG_XEVENTS
1073
1069
SDL_Log ("window 0x%lx: ButtonRelease (X11 button = %d)" , windowdata -> xwindow , button );
1074
1070
#endif
1075
- if (!X11_IsWheelEvent (display , button , & xticks , & yticks )) {
1071
+ if (!X11_IsWheelEvent (button , & xticks , & yticks )) {
1076
1072
if (button > 7 ) {
1077
1073
// see explanation at case ButtonPress
1078
1074
button -= (8 - SDL_BUTTON_X1 );
0 commit comments