Skip to content

Commit 3a389a5

Browse files
committed
Release mouse grab on fullscreen exit
A user who entered fullscreen with the cursor grabbed used to regain it on the way out. The behavior went with the custom-fullscreen IBAction; restore it under the AppKit transition by adding a windowDidExitFullScreen: hook on DisplayOpenGLView (the window's existing delegate). The entry side is intentionally not symmetric. Auto-grabbing on fullscreen entry would hide the cursor and block the menu-bar-on- hover reveal that exposes Open, Preferences, and the rest of the menu in fullscreen.
1 parent 3941d79 commit 3a389a5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

fusepb/views/DisplayOpenGLView.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,16 @@ - (void)windowDidResignKey:(NSNotification *)notification
360360
[proxy_emulator keyboardReleaseAll];
361361
}
362362

363+
- (void)windowDidExitFullScreen:(NSNotification *)notification
364+
{
365+
/* Release the emulator's mouse grab on fullscreen exit so a user who
366+
entered fullscreen with the cursor grabbed regains it. The entry side
367+
is deliberately not symmetric: auto-grabbing would hide the cursor
368+
and block the menu-bar-on-hover reveal that exposes Open, Preferences,
369+
and the rest of the menu in fullscreen. */
370+
if( ui_mouse_grabbed ) ui_mouse_grabbed = ui_mouse_release( 0 );
371+
}
372+
363373
-(void) loadPicture: (NSString *) name
364374
greenTex:(Texture*) greenTexture
365375
redTex:(Texture*) redTexture

0 commit comments

Comments
 (0)