From 616be4835768aeed5cb7cc72ce51c19dac09d1a0 Mon Sep 17 00:00:00 2001 From: akshayaurora Date: Mon, 29 Jun 2015 02:43:58 +0530 Subject: [PATCH] core:Window: Ensure window cursor respects config. Closes #3441 --- kivy/core/window/_window_sdl2.pyx | 3 +++ kivy/core/window/window_sdl2.py | 3 +++ kivy/lib/sdl2.pxi | 1 + 3 files changed, 7 insertions(+) diff --git a/kivy/core/window/_window_sdl2.pyx b/kivy/core/window/_window_sdl2.pyx index 8f43487c4..3587dc8d5 100644 --- a/kivy/core/window/_window_sdl2.pyx +++ b/kivy/core/window/_window_sdl2.pyx @@ -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) diff --git a/kivy/core/window/window_sdl2.py b/kivy/core/window/window_sdl2.py index 8b6f69244..219375248 100644 --- a/kivy/core/window/window_sdl2.py +++ b/kivy/core/window/window_sdl2.py @@ -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 diff --git a/kivy/lib/sdl2.pxi b/kivy/lib/sdl2.pxi index ab6a8d741..5f39a98fc 100644 --- a/kivy/lib/sdl2.pxi +++ b/kivy/lib/sdl2.pxi @@ -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)