summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-01-06 09:54:04 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-25 22:30:37 +0300
commit09beba6e9ec2c59befdfb3b4df9d4683303de880 (patch)
treedd49acc610ab3a51c276484b2a1abac7989dd1c8 /libvo
parent495dde4018e071f81462052d5b4c09c973f25f16 (diff)
downloadmpv-09beba6e9ec2c59befdfb3b4df9d4683303de880.tar.bz2
mpv-09beba6e9ec2c59befdfb3b4df9d4683303de880.tar.xz
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.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/cocoa_common.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index aa8480bec5..36f5e2471f 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -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);