Commit 75dcb278 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug: No right mouse button events during FullScreen Mac OS

Something inside setStyleMask mucks with the view responder chain, which prevents the listener from hearing the right mouse down events.  We just reset the listener after changing the style to fix this.
parent 6373d895
...@@ -792,6 +792,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display ...@@ -792,6 +792,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
NSWindow *nswindow = data->nswindow; NSWindow *nswindow = data->nswindow;
NSRect rect; NSRect rect;
/* The view responder chain gets messed with during setStyleMask */
if ([[nswindow contentView] nextResponder] == data->listener) {
[[nswindow contentView] setNextResponder:nil];
}
if (fullscreen) { if (fullscreen) {
SDL_Rect bounds; SDL_Rect bounds;
...@@ -827,6 +832,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display ...@@ -827,6 +832,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
} }
} }
/* The view responder chain gets messed with during setStyleMask */
if ([[nswindow contentView] nextResponder] != data->listener) {
[[nswindow contentView] setNextResponder:data->listener];
}
s_moveHack = 0; s_moveHack = 0;
[nswindow setFrameOrigin:rect.origin]; [nswindow setFrameOrigin:rect.origin];
[nswindow setContentSize:rect.size]; [nswindow setContentSize:rect.size];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment