François Cartegnie pushed to branch 3.0.x at VideoLAN / VLC


Commits:
04d8fcb9 by Rémi Denis-Courmont at 2026-01-13T21:54:03+01:00
qt: remove dysfunctional Wayland window

This has never worked properly in Qt5 / VLC 3.0.x.

- - - - -


7 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/components/controller.cpp
- modules/gui/qt/components/controller.hpp
- modules/gui/qt/components/interface_widgets.cpp
- modules/gui/qt/main_interface.cpp
- modules/gui/qt/main_interface.hpp
- modules/gui/qt/qt.cpp


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -29,12 +29,6 @@ endif
 if HAVE_XCB
 libqt_plugin_la_CXXFLAGS += -DQT5_HAS_XCB
 endif
-if HAVE_WAYLAND
-libqt_plugin_la_CPPFLAGS += -DQT5_HAS_WAYLAND \
-       -DQPNI_HEADER=\<$(QT_VERSION)/QtGui/qpa/qplatformnativeinterface.h\>
-libqt_plugin_la_CXXFLAGS += $(WAYLAND_CLIENT_CFLAGS)
-libqt_plugin_la_LIBADD += $(WAYLAND_CLIENT_LIBS)
-endif
 if HAVE_WIN32
 libqt_plugin_la_LIBADD += $(LIBCOM) -lcomctl32 -luuid
 endif


=====================================
modules/gui/qt/components/controller.cpp
=====================================
@@ -813,10 +813,6 @@ FullscreenControllerWidget::FullscreenControllerWidget( 
intf_thread_t *_p_i, QWi
     b_fullscreen        = false;
     i_hide_timeout      = 1;
     i_screennumber      = -1;
-#ifdef QT5_HAS_WAYLAND
-    b_hasWayland = QGuiApplication::platformName()
-           .startsWith(QLatin1String("wayland"), Qt::CaseInsensitive);
-#endif
 
     vout.clear();
 
@@ -900,12 +896,7 @@ void FullscreenControllerWidget::restoreFSC()
         QWindow *wh = windowHandle();
         if ( wh != Q_NULLPTR )
         {
-#ifdef QT5_HAS_WAYLAND
-            if ( !b_hasWayland )
-                wh->setScreen(QGuiApplication::screens()[targetScreen()]);
-#else
             wh->setScreen(QGuiApplication::screens()[targetScreen()]);
-#endif
         }
 
         if( currentRes == screenRes &&


=====================================
modules/gui/qt/components/controller.hpp
=====================================
@@ -325,10 +325,6 @@ private:
 
     bool isWideFSC;
     int i_sensitivity;
-
-#ifdef QT5_HAS_WAYLAND
-    bool b_hasWayland;
-#endif
 };
 
 #endif


=====================================
modules/gui/qt/components/interface_widgets.cpp
=====================================
@@ -59,10 +59,6 @@ static inline int qrand() {
 #  include <xcb/xproto.h>
 # endif
 #endif
-#ifdef QT5_HAS_WAYLAND
-# include QPNI_HEADER
-# include <QWindow>
-#endif
 
 #if defined(_WIN32)
 #include <QWindow>
@@ -164,27 +160,6 @@ bool VideoWidget::request( struct vout_window_t *p_wnd )
         case VOUT_WINDOW_TYPE_NSOBJECT:
             p_wnd->handle.nsobject = (void *)stable->winId();
             break;
-#ifdef QT5_HAS_WAYLAND
-        case VOUT_WINDOW_TYPE_WAYLAND:
-        {
-            /* Ensure only the video widget is native (needed for Wayland) */
-            stable->setAttribute( Qt::WA_DontCreateNativeAncestors, true);
-
-            QWindow *window = stable->windowHandle();
-            assert(window != NULL);
-            window->create();
-
-            QPlatformNativeInterface *qni = qApp->platformNativeInterface();
-            assert(qni != NULL);
-
-            p_wnd->handle.wl = static_cast<wl_surface*>(
-                qni->nativeResourceForWindow(QByteArrayLiteral("surface"),
-                                             window));
-            p_wnd->display.wl = static_cast<wl_display*>(
-                
qni->nativeResourceForIntegration(QByteArrayLiteral("wl_display")));
-            break;
-        }
-#endif
         default:
             vlc_assert_unreachable();
     }


=====================================
modules/gui/qt/main_interface.cpp
=====================================
@@ -152,11 +152,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : 
QVLCMW( _p_intf )
     /* Should the UI stays on top of other windows */
     b_interfaceOnTop = var_InheritBool( p_intf, "video-on-top" );
 
-#ifdef QT5_HAS_WAYLAND
-    b_hasWayland = QGuiApplication::platformName()
-        .startsWith(QLatin1String("wayland"), Qt::CaseInsensitive);
-#endif
-
     /**************************
      *  UI and Widgets design
      **************************/
@@ -892,12 +887,7 @@ void MainInterface::setVideoFullScreen( bool fs )
 
             QRect screenres = QGuiApplication::screens()[ numscreen 
]->geometry();
             lastWinScreen = windowHandle()->screen();
-#ifdef QT5_HAS_WAYLAND
-            if( !b_hasWayland )
-                
windowHandle()->setScreen(QGuiApplication::screens()[numscreen]);
-#else
             windowHandle()->setScreen(QGuiApplication::screens()[numscreen]);
-#endif
 
             /* To be sure window is on proper-screen in xinerama */
             if( !screenres.contains( pos() ) )
@@ -923,13 +913,8 @@ void MainInterface::setVideoFullScreen( bool fs )
     {
         setMinimalView( b_minimalView );
         setInterfaceFullScreen( b_interfaceFullScreen );
-#ifdef QT5_HAS_WAYLAND
-        if( lastWinScreen != NULL && !b_hasWayland )
-            windowHandle()->setScreen(lastWinScreen);
-#else
         if( lastWinScreen != NULL )
             windowHandle()->setScreen(lastWinScreen);
-#endif
         if( lastWinPosition.isNull() == false )
         {
             move( lastWinPosition );


=====================================
modules/gui/qt/main_interface.hpp
=====================================
@@ -184,9 +184,6 @@ protected:
     bool                 b_pauseOnMinimize;
     bool                 b_maximizedView;
     bool                 b_isWindowTiled;
-#ifdef QT5_HAS_WAYLAND
-    bool                 b_hasWayland;
-#endif
     /* States */
     bool                 playlistVisible;       ///< Is the playlist visible ?
 //    bool                 videoIsActive;       ///< Having a video now / 
THEMIM->hasV


=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -389,26 +389,6 @@ static bool HasX11( vlc_object_t *obj )
 }
 #endif
 
-#ifdef QT5_HAS_WAYLAND
-# include <wayland-client.h>
-
-static void *ThreadWayland( void *data )
-{
-    char platform_name[] = "wayland";
-    return ThreadPlatform( data, platform_name );
-}
-
-static bool HasWayland( void )
-{
-    struct wl_display *dpy = wl_display_connect( NULL );
-    if( dpy == NULL )
-        return false;
-
-    wl_display_disconnect( dpy );
-    return true;
-}
-#endif
-
 bool isDarkPaletteEnabled(intf_thread_t *p_intf) {
     static const bool darkPalette = var_InheritBool( p_intf, "qt-dark-palette" 
);
     return darkPalette;
@@ -477,13 +457,6 @@ static int Open( vlc_object_t *p_this, bool 
isDialogProvider )
     if( HasX11( p_this ) )
         thread = ThreadXCB;
     else
-#endif
-#ifdef QT5_HAS_WAYLAND
-    if( HasWayland() )
-        thread = ThreadWayland;
-    else
-#endif
-#if defined (QT5_HAS_X11) || defined (QT5_HAS_WAYLAND)
         return VLC_EGENERIC;
 #endif
 



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

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


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to