comparison src/video/quartz/SDL_QuartzWM.m @ 4066:58a5055da431 SDL-1.2

More improvements for bug #373 Show the SDL cursor in the window and the arrow cursor outside the window. This is also supposed to show the SDL cursor when activated, but that code isn't working yet...
author Sam Lantinga <slouken@libsdl.org>
date Sat, 14 Jul 2007 08:27:06 +0000
parents 0c76e6d1c3d6
children b8f2db95145e
comparison
equal deleted inserted replaced
4065:0c76e6d1c3d6 4066:58a5055da431
88 if (cursor != NULL) SDL_free(cursor); 88 if (cursor != NULL) SDL_free(cursor);
89 SDL_OutOfMemory(); 89 SDL_OutOfMemory();
90 return(NULL); 90 return(NULL);
91 } 91 }
92 92
93 void QZ_ShowMouse (_THIS) { 93 void QZ_ShowMouse (_THIS, NSCursor *cursor) {
94 if (!cursor_visible) { 94 if (!cursor_visible) {
95 [ NSCursor unhide ]; 95 [ NSCursor unhide ];
96 cursor_visible = YES; 96 cursor_visible = YES;
97 } 97 }
98 [ cursor set ];
98 } 99 }
99 100
100 void QZ_HideMouse (_THIS) { 101 void QZ_HideMouse (_THIS) {
101 if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) { 102 if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
102 [ NSCursor hide ]; 103 [ NSCursor hide ];
114 } 115 }
115 116
116 int QZ_ShowWMCursor (_THIS, WMcursor *cursor) { 117 int QZ_ShowWMCursor (_THIS, WMcursor *cursor) {
117 118
118 if ( cursor == NULL) { 119 if ( cursor == NULL) {
120 QZ_HideMouse (this);
119 if ( cursor_should_be_visible ) { 121 if ( cursor_should_be_visible ) {
120 QZ_HideMouse (this);
121 cursor_should_be_visible = NO; 122 cursor_should_be_visible = NO;
122 QZ_ChangeGrabState (this, QZ_HIDECURSOR); 123 QZ_ChangeGrabState (this, QZ_HIDECURSOR);
123 } 124 }
124 } 125 }
125 else { 126 else {
126 [ cursor->nscursor set ]; 127 QZ_ShowMouse (this, cursor->nscursor);
127 if ( ! cursor_should_be_visible ) { 128 if ( ! cursor_should_be_visible ) {
128 QZ_ShowMouse (this);
129 cursor_should_be_visible = YES; 129 cursor_should_be_visible = YES;
130 QZ_ChangeGrabState (this, QZ_SHOWCURSOR); 130 QZ_ChangeGrabState (this, QZ_SHOWCURSOR);
131 } 131 }
132 } 132 }
133 133