]> git.sesse.net Git - vlc/commitdiff
macosx: fix video-wallpaper mode by ignoring core events
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 14 Mar 2015 14:59:26 +0000 (15:59 +0100)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 14 Mar 2015 15:02:46 +0000 (16:02 +0100)
wallpaper mode is more complicated than setting fullscreen and
level values. Thus, it is implemented in the macosx UI, and we
need to ignore some core events for proper functioning.

close #14151

modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/intf.m

index 9cf3a15587554a3d9403cbbb749f531477046776..53ed3fe775562ec10fe7e34ae03596aaf5e85dfc 100644 (file)
     BOOL b_have_splitter = psz_splitter != NULL && *psz_splitter != '\0';
     free(psz_splitter);
 
-    if (!b_have_splitter && (var_InheritBool(VLCIntf, "fullscreen") || var_GetBool(pl_Get(VLCIntf), "fullscreen"))) {
+    if (!b_video_wallpaper && !b_have_splitter && (var_InheritBool(VLCIntf, "fullscreen") || var_GetBool(pl_Get(VLCIntf), "fullscreen"))) {
 
         // this is not set when we start in fullscreen because of
         // fullscreen settings in video prefs the second time
index 851f2298484b1ff3c7ed0abd5d6b920e92b5f90f..8682361827a708f71fd5997b0e49ac6698db38a7 100644 (file)
@@ -185,6 +185,12 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
         {
             unsigned i_state = va_arg(args, unsigned);
 
+            if (i_state & VOUT_WINDOW_STATE_BELOW)
+            {
+                msg_Dbg(p_wnd, "Ignore change to VOUT_WINDOW_STATE_BELOW");
+                goto out;
+            }
+
             NSInteger i_cooca_level = NSNormalWindowLevel;
             if (i_state & VOUT_WINDOW_STATE_ABOVE)
                 i_cooca_level = NSStatusWindowLevel;
@@ -202,7 +208,6 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
         }
         case VOUT_WINDOW_SET_SIZE:
         {
-
             unsigned int i_width  = va_arg(args, unsigned int);
             unsigned int i_height = va_arg(args, unsigned int);
 
@@ -220,6 +225,11 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
         }
         case VOUT_WINDOW_SET_FULLSCREEN:
         {
+            if (var_InheritBool(VLCIntf, "video-wallpaper")) {
+                msg_Dbg(p_wnd, "Ignore fullscreen event as video-wallpaper is on");
+                goto out;
+            }
+
             int i_full = va_arg(args, int);
             BOOL b_animation = YES;
 
@@ -244,6 +254,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
         }
     }
 
+out:
     [o_vout_provider_lock unlock];
     [o_pool release];
     return VLC_SUCCESS;