core:Window: Ensure window cursor respects config. Closes #3441

This commit is contained in:
akshayaurora 2015-06-29 02:43:58 +05:30
parent 47e4ff8c44
commit 616be48357
3 changed files with 7 additions and 0 deletions

View File

@ -92,6 +92,9 @@ cdef class _WindowSDL2Storage:
SDL_GetWindowSize(self.win, &w, &h)
return w, h
def show_cursor(self, value):
SDL_ShowCursor(value)
def _get_gl_size(self):
cdef int w, h
SDL_GL_GetDrawableSize(self.win, &w, &h)

View File

@ -210,6 +210,9 @@ class WindowSDL(WindowBase):
self._win.set_fullscreen_mode(self.fullscreen)
super(WindowSDL, self).create_window()
# set mouse visibility
self._win.show_cursor(
Config.getboolean('graphics', 'show_cursor'))
if self.initialized:
return

View File

@ -525,6 +525,7 @@ cdef extern from "SDL.h":
cdef void SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h)
cdef void SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered)
cdef void SDL_ShowWindow(SDL_Window * window)
cdef int SDL_ShowCursor(int toggle)
cdef void SDL_HideWindow(SDL_Window * window)
cdef void SDL_RaiseWindow(SDL_Window * window)
cdef void SDL_MaximizeWindow(SDL_Window * window)