mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 00:29:02 +00:00
cocoa_common: accept window drag event from the whole window surface
Change the window to accept mouse drag events not only on the title bar, but also on the rest of the window surface; this includes the video area. It looks like the changing of the window mask resets the behaviour specified in the delegate method, probably due to some strange interaction with NSBorderlessWindow. For this reason call -setPresentationOptions in the -fullscreen method to remind cocoa the behaviour we want.
This commit is contained in:
parent
495dde4018
commit
09beba6e9e
@ -368,6 +368,7 @@ void create_menu()
|
||||
[self setLevel:s->fullscreen_window_level];
|
||||
vo_fs = VO_TRUE;
|
||||
vo_cocoa_display_cursor(0);
|
||||
[self setMovableByWindowBackground: NO];
|
||||
} else {
|
||||
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
|
||||
[self setHasShadow:YES];
|
||||
@ -382,6 +383,7 @@ void create_menu()
|
||||
[self setLevel:s->windowed_window_level];
|
||||
vo_fs = VO_FALSE;
|
||||
vo_cocoa_display_cursor(1);
|
||||
[self setMovableByWindowBackground: YES];
|
||||
}
|
||||
}
|
||||
|
||||
@ -399,6 +401,12 @@ void create_menu()
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) isMovableByWindowBackground
|
||||
{
|
||||
// this is only valid as a starting value. it will be rewritten in the -fullscreen method.
|
||||
return !vo_fs;
|
||||
}
|
||||
|
||||
- (void) handleQuitEvent:(NSAppleEventDescriptor*)e withReplyEvent:(NSAppleEventDescriptor*)r
|
||||
{
|
||||
mplayer_put_key(l_vo->key_fifo, KEY_CLOSE_WIN);
|
||||
|
Loading…
Reference in New Issue
Block a user