Fixed bug #5256: X11 Segmentation fault with multiple windows and renderers
First window is created and it triggers and 'EnterNotify' event which calls SDL_SetMouseFocus() and X11_ShowCursor() while the second windows hasn't finished to be created (eg window->driverdata isn't set) Just check for a valid 'driverdata'main
parent
e2d74bcbe5
commit
8c660ccb6f
|
@ -294,16 +294,17 @@ X11_ShowCursor(SDL_Cursor * cursor)
|
||||||
SDL_VideoDevice *video = SDL_GetVideoDevice();
|
SDL_VideoDevice *video = SDL_GetVideoDevice();
|
||||||
Display *display = GetDisplay();
|
Display *display = GetDisplay();
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
SDL_WindowData *data;
|
|
||||||
|
|
||||||
for (window = video->windows; window; window = window->next) {
|
for (window = video->windows; window; window = window->next) {
|
||||||
data = (SDL_WindowData *)window->driverdata;
|
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
||||||
|
if (data) {
|
||||||
if (x11_cursor != None) {
|
if (x11_cursor != None) {
|
||||||
X11_XDefineCursor(display, data->xwindow, x11_cursor);
|
X11_XDefineCursor(display, data->xwindow, x11_cursor);
|
||||||
} else {
|
} else {
|
||||||
X11_XUndefineCursor(display, data->xwindow);
|
X11_XUndefineCursor(display, data->xwindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
X11_XFlush(display);
|
X11_XFlush(display);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue