[vlc-devel] [PATCH 3/4] kva: assume VOUT_DISPLAY_CHANGE_WINDOW_STATE is only called to set video on top

Steve Lhomme robux4 at ycbcr.xyz
Wed Sep 2 12:08:51 CEST 2020


It's supposed to be handled in the window, not in the display module.
---
 include/vlc_vout_display.h | 2 +-
 modules/video_output/kva.c | 8 ++------
 src/video_output/display.c | 3 +--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 96f582a609c..8709604897c 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -165,7 +165,7 @@ enum vout_display_query {
     VOUT_DISPLAY_CHANGE_FULLSCREEN VLC_DEPRECATED_ENUM,     /* bool fs */
     /* Ask the module to acknowledge/refuse the window management state change
      * after being requested externally or by VOUT_DISPLAY_WINDOW_STATE */
-    VOUT_DISPLAY_CHANGE_WINDOW_STATE VLC_DEPRECATED_ENUM,   /* unsigned state */
+    VOUT_DISPLAY_CHANGE_WINDOW_STATE VLC_DEPRECATED_ENUM,
 #endif
     /**
      * Notifies a change in display size.
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 185e8269600..7a2b0bc5112 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -407,13 +407,9 @@ static int Control( vout_display_t *vd, int query, va_list args )
 
     case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
     {
-        const unsigned state = va_arg( args, unsigned );
-        const bool is_on_top = (state & VOUT_WINDOW_STATE_ABOVE) != 0;
+        WinSetWindowPos( sys->frame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER );
 
-        if( is_on_top )
-            WinSetWindowPos( sys->frame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER );
-
-        sys->is_on_top = is_on_top;
+        sys->is_on_top = true;
 
         return VLC_SUCCESS;
     }
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 2d05d8e9325..a435460b099 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -759,8 +759,7 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
         osys->cfg.is_fullscreen = true;
 
     if (var_InheritBool(parent, "video-on-top"))
-        vout_display_Control(vd, VOUT_DISPLAY_CHANGE_WINDOW_STATE,
-                             (unsigned)VOUT_WINDOW_STATE_ABOVE);
+        vout_display_Control(vd, VOUT_DISPLAY_CHANGE_WINDOW_STATE);
 #endif
 
     if (VoutDisplayCreateRender(vd)) {
-- 
2.26.2



More information about the vlc-devel mailing list