Skip to content

Commit

Permalink
core:Window: Ensure window cursor respects config. Closes kivy#3441
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayaurora committed Jun 28, 2015
1 parent 47e4ff8 commit 616be48
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kivy/core/window/_window_sdl2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions kivy/core/window/window_sdl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def create_window(self, *largs):
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
Expand Down
1 change: 1 addition & 0 deletions kivy/lib/sdl2.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 616be48

Please sign in to comment.