[vlc-commits] [Git][videolan/vlc][master] qt: remove obsolete `qt_intf_t::voutWindowType`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jul 20 11:02:57 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e23f2dbd by Fatih Uzunoglu at 2024-07-20T10:38:15+00:00
qt: remove obsolete `qt_intf_t::voutWindowType`

... and only consider `video-wallpaper` if
platform is windows.

We can not set an appropriate voutWindowType
during initialization, because it depends on
`qt-compositor` which is evaluated later on.

For example, platform `windows` might use
both `dcomp` and `hwnd` window types. In fact
none of the compositor integrations care about
`qt_intf_t::voutWindowType` but rather set the
valid type themselves.

Fo example, `compositor_dcomp` already uses
`VLC_WINDOW_TYPE_DCOMP` and `compositor_platform`
already uses `VLC_WINDOW_TYPE_HWND`, effectively
making `qt_intf_t::voutWindowType` obsolete.

- - - - -


2 changed files:

- modules/gui/qt/qt.cpp
- modules/gui/qt/qt.hpp


Changes:

=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -989,18 +989,13 @@ static void *Thread( void *obj )
         bool known_type = true;
 
         const QString& platform = app.platformName();
-        if( platform == QLatin1String("xcb") )
-            p_intf->voutWindowType = VLC_WINDOW_TYPE_XID;
+        if( platform == QLatin1String("xcb") ) { }
         else if( platform.startsWith( QLatin1String("wayland") ) ) {
-            p_intf->voutWindowType = VLC_WINDOW_TYPE_WAYLAND;
-
             // Workaround for popup widgets not closing on mouse press on wayland:
             app.installEventFilter(new DismissPopupEventFilter(&app));
         }
-        else if( platform == QLatin1String("windows") || platform == QLatin1String("direct2d") )
-            p_intf->voutWindowType = VLC_WINDOW_TYPE_HWND;
-        else if( platform == QLatin1String("cocoa") )
-            p_intf->voutWindowType = VLC_WINDOW_TYPE_NSOBJECT;
+        else if( platform == QLatin1String("windows") || platform == QLatin1String("direct2d") ) { }
+        else if( platform == QLatin1String("cocoa") ) { }
         else
         {
             msg_Err( p_intf, "unknown Qt platform: %s", qtu(platform) );
@@ -1173,13 +1168,13 @@ static int WindowOpen( vlc_window_t *p_wnd )
         if (p_intf->isShuttingDown)
             return VLC_EGENERIC;
 
-        switch( p_intf->voutWindowType )
         {
-            case VLC_WINDOW_TYPE_XID:
-            case VLC_WINDOW_TYPE_HWND:
+            const QString& platform = qApp->platformName();
+            if (platform == QLatin1String("windows") || platform == QLatin1String("direct2d"))
+            {
                 if( var_InheritBool( p_wnd, "video-wallpaper" ) )
                     return VLC_EGENERIC;
-                break;
+            }
         }
 
         bool ret = p_intf->p_compositor->setupVoutWindow( p_wnd, &WindowCloseCb );


=====================================
modules/gui/qt/qt.hpp
=====================================
@@ -95,7 +95,6 @@ struct qt_intf_t
     class MainCtx *p_mi;     /* Main Interface, NULL if DialogProvider Mode */
     class QSettings *mainSettings; /* Qt State settings not messing main VLC ones */
 
-    unsigned voutWindowType; /* Type of vlc_window_t provided */
     bool b_isDialogProvider; /* Qt mode or Skins mode */
 
     vlc_playlist_t *p_playlist;  /* playlist */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e23f2dbdee195a87b267c25ba917c1622260c7d7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e23f2dbdee195a87b267c25ba917c1622260c7d7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list