Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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.
  • Loading branch information
slouken committed Mar 21, 2011
1 parent 026c7ed commit f88a009d60c69a0e15b60b1188829018dec84d27
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/video/cocoa/SDL_cocoawindow.m
@@ -792,6 +792,11 @@ - (void)rightMouseDown:(NSEvent *)theEvent
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 @@ - (void)rightMouseDown:(NSEvent *)theEvent
}
}

/* 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];

0 comments on commit f88a009

Please sign in to comment.