comparison src/video/quartz/SDL_QuartzVideo.h @ 615:7ec821f3cbd0

Date: Thu, 17 Apr 2003 23:27:34 -0400 From: Darrell Walisser Subject: Yet another OS X cursor bug The synopsis: 1. Call SDL_ShowCursor(0); 2. Call SDL_SetVideoMode(); 3. Call SDL_GetEvent(); 3. Call SDL_ShowCursor(1); The result: Sometimes the cursor doesn't come back! Ack! Oddly enough, it does come back when mousing over the dock or clicking in the menu bar. But that's besides the point. The reason why this is happening is a flaw in the handling of activation/deactivation events. The short explanation is that the HideCursor() and ShowCursor() calls must be balanced, but if the cursor was initially hidden, HideCursor() was called again on the activate event - so now the next ShowCursor() fails (as does the next, and the next, for some reason). So, here's the patch. All it does is keep track of the HideCursor()/ShowCursor() calls so that they will always be balanced.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 20 Apr 2003 05:41:16 +0000
parents 2c6510c0a304
children 864e2d2a9a55
comparison
equal deleted inserted replaced
614:0b4c3f5ff63d 615:7ec821f3cbd0
136 Uint32 last_virtual_button;/* last virtual mouse button pressed */ 136 Uint32 last_virtual_button;/* last virtual mouse button pressed */
137 io_connect_t power_connection; /* used with IOKit to detect wake from sleep */ 137 io_connect_t power_connection; /* used with IOKit to detect wake from sleep */
138 Uint8 expect_mouse_up; /* used to determine when to send mouse up events */ 138 Uint8 expect_mouse_up; /* used to determine when to send mouse up events */
139 Uint8 grab_state; /* used to manage grab behavior */ 139 Uint8 grab_state; /* used to manage grab behavior */
140 NSPoint cursor_loc; /* saved cursor coords, for activate/deactivate when grabbed */ 140 NSPoint cursor_loc; /* saved cursor coords, for activate/deactivate when grabbed */
141 BOOL cursor_visible; /* tells if cursor was hidden or not */ 141 BOOL cursor_visible; /* tells if cursor was instructed to be hidden or not (SDL_ShowCursor) */
142 BOOL cursor_hidden; /* tells if cursor is *actually* hidden or not */
142 Uint8* sw_buffers[2]; /* pointers to the two software buffers for double-buffer emulation */ 143 Uint8* sw_buffers[2]; /* pointers to the two software buffers for double-buffer emulation */
143 SDL_Thread *thread; /* thread for async updates to the screen */ 144 SDL_Thread *thread; /* thread for async updates to the screen */
144 SDL_sem *sem1, *sem2; /* synchronization for async screen updates */ 145 SDL_sem *sem1, *sem2; /* synchronization for async screen updates */
145 Uint8 *current_buffer; /* the buffer being copied to the screen */ 146 Uint8 *current_buffer; /* the buffer being copied to the screen */
146 BOOL quit_thread; /* used to quit the async blitting thread */ 147 BOOL quit_thread; /* used to quit the async blitting thread */
181 #define power_connection (this->hidden->power_connection) 182 #define power_connection (this->hidden->power_connection)
182 #define expect_mouse_up (this->hidden->expect_mouse_up) 183 #define expect_mouse_up (this->hidden->expect_mouse_up)
183 #define grab_state (this->hidden->grab_state) 184 #define grab_state (this->hidden->grab_state)
184 #define cursor_loc (this->hidden->cursor_loc) 185 #define cursor_loc (this->hidden->cursor_loc)
185 #define cursor_visible (this->hidden->cursor_visible) 186 #define cursor_visible (this->hidden->cursor_visible)
187 #define cursor_hidden (this->hidden->cursor_hidden)
186 #define sw_buffers (this->hidden->sw_buffers) 188 #define sw_buffers (this->hidden->sw_buffers)
187 #define thread (this->hidden->thread) 189 #define thread (this->hidden->thread)
188 #define sem1 (this->hidden->sem1) 190 #define sem1 (this->hidden->sem1)
189 #define sem2 (this->hidden->sem2) 191 #define sem2 (this->hidden->sem2)
190 #define current_buffer (this->hidden->current_buffer) 192 #define current_buffer (this->hidden->current_buffer)