]> git.sesse.net Git - vlc/commitdiff
macosx: fspanel: give up focus to the right fullscreen window
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 20 Oct 2012 09:46:25 +0000 (11:46 +0200)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 20 Oct 2012 13:33:10 +0000 (15:33 +0200)
modules/gui/macosx/MainWindow.m
modules/gui/macosx/Windows.m
modules/gui/macosx/fspanel.h
modules/gui/macosx/fspanel.m

index 976faa3552cdec176558833624fcbdf22cb750a6..736f965e7c3a2c9f24424a96eccc45bc84a9c2f9 100644 (file)
@@ -958,7 +958,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     // But this creates some problems when leaving fs over remote intfs, so activate app here.
     [NSApp activateIgnoringOtherApps:YES];
 
-    [o_fspanel setVoutWasUpdated: (int)[[self screen] displayID]];
+    [o_fspanel setVoutWasUpdated: self];
     [o_fspanel setActive: nil];
 }
 
index fd064674670989e526ec2b566e3f439b772cd247..e849c0ecb3e008ed63e2aadf0b49c2881b635ca4 100644 (file)
     [o_fullscreen_window setAcceptsMouseMovedEvents: YES];
 
     /* tell the fspanel to move itself to front next time it's triggered */
-    [[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
+    [[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: o_fullscreen_window];
     [[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
 
     if ([self isVisible])
index 62c1bcc949947010a82acd505beb0d3d2f2ce7be..d51198b1bc3c226bede1fc54231b6dd0c4e4faac 100644 (file)
@@ -22,6 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+@class VLCWindow;
 
 @interface VLCFSPanel : NSWindow
 {
@@ -36,6 +37,8 @@
     BOOL b_displayed;
     BOOL b_voutWasUpdated;
     int i_device;
+
+    VLCWindow *o_vout_window;
 }
 - (id)initWithContentRect: (NSRect)contentRect
                 styleMask: (NSUInteger)aStyle
@@ -70,7 +73,7 @@
 - (void)mouseDown: (NSEvent *)theEvent;
 - (void)mouseDragged: (NSEvent *)theEvent;
 
-- (void)setVoutWasUpdated: (int)i_screen;
+- (void)setVoutWasUpdated: (VLCWindow *)o_window;
 @end
 
 @interface VLCFSPanelView : NSView
index 057212045d8bbd04706099f2c12dc466297ab940..78c6c2388f3e87ed1cd72b4eb3b0d2ae31af7172 100644 (file)
         [hideAgainTimer invalidate];
         [hideAgainTimer release];
     }
+
+    if (o_vout_window)
+        [o_vout_window release];
+
     [self setFadeTimer:nil];
     [super dealloc];
 }
 - (void)mouseExited:(NSEvent *)theEvent
 {
     /* give up our focus, so the vout may show us again without letting the user clicking it */
-    vout_thread_t *p_vout = getVout();
-    if (p_vout) {
-        if (var_GetBool(p_vout, "fullscreen"))
-            [[[[VLCMainWindow sharedInstance] videoView] window] makeKeyWindow];
-        vlc_object_release(p_vout);
-    }
+    if (o_vout_window && var_GetBool(pl_Get(VLCIntf), "fullscreen"))
+        [o_vout_window makeKeyWindow];
 }
 
 - (void)hideMouse
     [self setFrameOrigin:point];
 }
 
-- (void)setVoutWasUpdated: (int)i_newdevice;
+- (void)setVoutWasUpdated: (VLCWindow *)o_window
 {
     b_voutWasUpdated = YES;
+    if (o_vout_window)
+        [o_vout_window release];
+    o_vout_window = [o_window retain];
+    int i_newdevice = (int)[[o_vout_window screen] displayID];
     if(i_newdevice != i_device) {
         i_device = i_newdevice;
         [self center];