[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: remove unused variables from mainctx

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Oct 29 07:48:27 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7c42847d by Prince Gupta at 2023-10-29T07:18:31+00:00
qt: remove unused variables from mainctx

- - - - -
186c3dd5 by Prince Gupta at 2023-10-29T07:18:31+00:00
qt: move functions to cpp

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -925,3 +925,69 @@ double MainCtx::dp(const double px) const
 {
     return dp(px, m_intfScaleFactor);
 }
+
+bool WindowStateHolder::holdFullscreen(QWindow *window, Source source, bool hold)
+{
+    QVariant prop = window->property("__windowFullScreen");
+    bool ok = false;
+    unsigned fullscreenCounter = prop.toUInt(&ok);
+    if (!ok)
+        fullscreenCounter = 0;
+
+    if (hold)
+        fullscreenCounter |= source;
+    else
+        fullscreenCounter &= ~source;
+
+    Qt::WindowStates oldflags = window->windowStates();
+    Qt::WindowStates newflags;
+
+    if( fullscreenCounter != 0 )
+        newflags = oldflags | Qt::WindowFullScreen;
+    else
+        newflags = oldflags & ~Qt::WindowFullScreen;
+
+    if( newflags != oldflags )
+    {
+        window->setWindowStates( newflags );
+    }
+
+    window->setProperty("__windowFullScreen", QVariant::fromValue(fullscreenCounter));
+
+    return fullscreenCounter != 0;
+}
+
+bool WindowStateHolder::holdOnTop(QWindow *window, Source source, bool hold)
+{
+    QVariant prop = window->property("__windowOnTop");
+    bool ok = false;
+    unsigned onTopCounter = prop.toUInt(&ok);
+    if (!ok)
+        onTopCounter = 0;
+
+    if (hold)
+        onTopCounter |= source;
+    else
+        onTopCounter &= ~source;
+
+    Qt::WindowStates oldStates = window->windowStates();
+    Qt::WindowFlags oldflags = window->flags();
+    Qt::WindowFlags newflags;
+
+    if( onTopCounter != 0 )
+        newflags = oldflags | Qt::WindowStaysOnTopHint;
+    else
+        newflags = oldflags & ~Qt::WindowStaysOnTopHint;
+    if( newflags != oldflags )
+    {
+
+        window->setFlags( newflags );
+        window->show(); /* necessary to apply window flags */
+        //workaround: removing onTop state might drop fullscreen state
+        window->setWindowStates(oldStates);
+    }
+
+    window->setProperty("__windowOnTop", QVariant::fromValue(onTopCounter));
+
+    return onTopCounter != 0;
+}


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -76,72 +76,10 @@ public:
         VIDEO = 2,
     };
 
-    static bool holdFullscreen( QWindow* window, Source source, bool hold )
-    {
-        QVariant prop = window->property("__windowFullScreen");
-        bool ok = false;
-        unsigned fullscreenCounter = prop.toUInt(&ok);
-        if (!ok)
-            fullscreenCounter = 0;
-
-        if (hold)
-            fullscreenCounter |= source;
-        else
-            fullscreenCounter &= ~source;
-
-        Qt::WindowStates oldflags = window->windowStates();
-        Qt::WindowStates newflags;
-
-        if( fullscreenCounter != 0 )
-            newflags = oldflags | Qt::WindowFullScreen;
-        else
-            newflags = oldflags & ~Qt::WindowFullScreen;
-
-        if( newflags != oldflags )
-        {
-            window->setWindowStates( newflags );
-        }
-
-        window->setProperty("__windowFullScreen", QVariant::fromValue(fullscreenCounter));
+    static bool holdFullscreen( QWindow* window, Source source, bool hold );
 
-        return fullscreenCounter != 0;
-    }
 
-
-    static bool holdOnTop( QWindow* window, Source source, bool hold )
-    {
-        QVariant prop = window->property("__windowOnTop");
-        bool ok = false;
-        unsigned onTopCounter = prop.toUInt(&ok);
-        if (!ok)
-            onTopCounter = 0;
-
-        if (hold)
-            onTopCounter |= source;
-        else
-            onTopCounter &= ~source;
-
-        Qt::WindowStates oldStates = window->windowStates();
-        Qt::WindowFlags oldflags = window->flags();
-        Qt::WindowFlags newflags;
-
-        if( onTopCounter != 0 )
-            newflags = oldflags | Qt::WindowStaysOnTopHint;
-        else
-            newflags = oldflags & ~Qt::WindowStaysOnTopHint;
-        if( newflags != oldflags )
-        {
-
-            window->setFlags( newflags );
-            window->show(); /* necessary to apply window flags */
-            //workaround: removing onTop state might drop fullscreen state
-            window->setWindowStates(oldStates);
-        }
-
-        window->setProperty("__windowOnTop", QVariant::fromValue(onTopCounter));
-
-        return onTopCounter != 0;
-    }
+    static bool holdOnTop( QWindow* window, Source source, bool hold );
 
 };
 
@@ -336,17 +274,6 @@ protected:
     QSystemTrayIcon     *sysTray = nullptr;
     std::unique_ptr<QMenu> systrayMenu;
 
-    QString              input_name;
-
-    /* Status and flags */
-    QPoint              lastWinPosition;
-    QSize               lastWinSize;  /// To restore the same window size when leaving fullscreen
-    QScreen             *lastWinScreen = nullptr;
-
-    QSize               pendingResize; // to be applied when fullscreen is disabled
-
-    QMap<QWidget *, QSize> stackWidgetsSizes;
-
     /* Flags */
     double               m_intfUserScaleFactor = 1.;
     double               m_intfScaleFactor = 1.;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/08950258ef982204319ea48af93603ffef19bd5c...186c3dd591ae96c8bd34cb80729d596af32fcb55

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/08950258ef982204319ea48af93603ffef19bd5c...186c3dd591ae96c8bd34cb80729d596af32fcb55
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