Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug: No right mouse button events during FullScreen Mac OS
Browse files Browse the repository at this point in the history
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 f88a009
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -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;

Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit f88a009

Please sign in to comment.