[vlc-commits] window: separate fullscreen set/unset control helpers

Rémi Denis-Courmont git at videolan.org
Sun May 20 19:52:25 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 19 21:24:41 2018 +0300| [119bbdb097ad5b0e418988088e47ccbf6e2c57ea] | committer: Rémi Denis-Courmont

window: separate fullscreen set/unset control helpers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=119bbdb097ad5b0e418988088e47ccbf6e2c57ea
---

 include/vlc_vout_window.h                    | 18 ++++++++++++------
 modules/gui/macosx/VLCVoutWindowController.m |  3 ++-
 modules/gui/minimal_macosx/intf.m            |  3 ++-
 modules/gui/skins2/src/skin_main.cpp         |  3 ++-
 modules/video_output/wayland/shell.c         |  3 ++-
 modules/video_output/wayland/xdg-shell.c     |  3 ++-
 src/video_output/video_output.c              |  3 ++-
 7 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index accd8b5787..c870288ea1 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -274,18 +274,24 @@ static inline int vout_window_SetSize(vout_window_t *window,
 /**
  * Requests fullscreen mode.
  *
- * \param full true to request full screen, false to request window mode
- *
  * \retval VLC_SUCCESS The request has been queued to the windowing system
  * (that does <b>not</b> imply that the request is complete nor succesful).
  * \retval VLC_EGENERIC The request could not be queued, e.g. the back-end does
  * not implement toggling between fullscreen and windowed modes.
  */
-static inline int vout_window_SetFullScreen(vout_window_t *window, bool full)
+static inline int vout_window_SetFullScreen(vout_window_t *window)
+{
+    return vout_window_Control(window, VOUT_WINDOW_SET_FULLSCREEN);
+}
+
+/**
+ * Requests windowed mode.
+ *
+ * \return \see vout_window_SetFullScreen()
+ */
+static inline int vout_window_UnsetFullScreen(vout_window_t *window)
 {
-    return vout_window_Control(window,
-                               full ? VOUT_WINDOW_SET_FULLSCREEN
-                                    : VOUT_WINDOW_UNSET_FULLSCREEN);
+    return vout_window_Control(window, VOUT_WINDOW_UNSET_FULLSCREEN);
 }
 
 /**
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index ecbe3b59f4..b5b1322816 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -76,7 +76,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
         p_wnd->type = VOUT_WINDOW_TYPE_NSOBJECT;
         p_wnd->control = WindowControl;
     }
-    vout_window_SetFullScreen(p_wnd, cfg->is_fullscreen);
+    if (cfg->is_fullscreen)
+        vout_window_SetFullScreen(p_wnd);
     return VLC_SUCCESS;
 }
 
diff --git a/modules/gui/minimal_macosx/intf.m b/modules/gui/minimal_macosx/intf.m
index bbc39fbd16..6d648cd626 100644
--- a/modules/gui/minimal_macosx/intf.m
+++ b/modules/gui/minimal_macosx/intf.m
@@ -122,7 +122,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
         p_wnd->control = WindowControl;
     }
 
-    vout_window_SetFullScreen(p_wnd, cfg->is_fullscreen);
+    if (cfg->is_fullscreen)
+        vout_window_SetFullScreen(p_wnd);
     return VLC_SUCCESS;
 }
 
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index 1327ad1cea..cab637fc7f 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -400,7 +400,8 @@ static int WindowOpen( vout_window_t *pWnd, const vout_window_cfg_t *cfg )
         return VLC_EGENERIC;
     }
 
-    vout_window_SetFullScreen( pWnd, cfg->is_fullscreen );
+    if (cfg->is_fullscreen)
+        vout_window_SetFullScreen( pWnd );
     return VLC_SUCCESS;
 }
 
diff --git a/modules/video_output/wayland/shell.c b/modules/video_output/wayland/shell.c
index 5a7ffda166..76db2695a9 100644
--- a/modules/video_output/wayland/shell.c
+++ b/modules/video_output/wayland/shell.c
@@ -296,7 +296,8 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
         goto error;
 
     vout_window_ReportSize(wnd, cfg->width, cfg->height);
-    vout_window_SetFullScreen(wnd, cfg->is_fullscreen);
+    if (cfg->is_fullscreen)
+        vout_window_SetFullScreen(wnd);
     return VLC_SUCCESS;
 
 error:
diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c
index a1e400de8c..e1d2aa9f9b 100644
--- a/modules/video_output/wayland/xdg-shell.c
+++ b/modules/video_output/wayland/xdg-shell.c
@@ -378,7 +378,8 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
     wnd->display.wl = display;
     wnd->control = Control;
 
-    vout_window_SetFullScreen(wnd, cfg->is_fullscreen);
+    if (cfg->is_fullscreen)
+        vout_window_SetFullScreen(wnd);
 
     if (vlc_clone(&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
         goto error;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 01a352a331..bc59f5a8e1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1345,7 +1345,8 @@ static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
     if (window == NULL)
         return; /* splitter! */
 
-    vout_window_SetFullScreen(window, fullscreen);
+    (fullscreen ? vout_window_SetFullScreen
+                : vout_window_UnsetFullScreen)(window);
 }
 
 static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)



More information about the vlc-commits mailing list