mirror of
https://github.com/yawut/SDL.git
synced 2026-09-08 17:16:19 -05:00
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.
This commit is contained in:
@@ -792,6 +792,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
|
||||
NSWindow *nswindow = data->nswindow;
|
||||
NSRect rect;
|
||||
|
||||
/* The view responder chain gets messed with during setStyleMask */
|
||||
if ([[nswindow contentView] nextResponder] == data->listener) {
|
||||
[[nswindow contentView] setNextResponder:nil];
|
||||
}
|
||||
|
||||
if (fullscreen) {
|
||||
SDL_Rect bounds;
|
||||
|
||||
@@ -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;
|
||||
[nswindow setFrameOrigin:rect.origin];
|
||||
[nswindow setContentSize:rect.size];
|
||||
|
||||
Reference in New Issue
Block a user