[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt, windows: fix CSD button handling with interface scaling

François Cartegnie (@fcartegnie) gitlab at videolan.org
Tue Aug 8 03:41:34 UTC 2023



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
434e14e4 by Prince Gupta at 2023-08-08T03:03:36+00:00
qt, windows: fix CSD button handling with interface scaling

- - - - -
f39f107f by Prince Gupta at 2023-08-08T03:03:36+00:00
qt: remove unused variable

- - - - -


1 changed file:

- modules/gui/qt/maininterface/mainctx_win32.cpp


Changes:

=====================================
modules/gui/qt/maininterface/mainctx_win32.cpp
=====================================
@@ -217,7 +217,6 @@ class CSDWin32EventHandler : public QObject, public QAbstractNativeEventFilter
 public:
     CSDWin32EventHandler(MainCtx* mainctx, QWindow *window, QObject *parent)
         : QObject {parent}
-        , m_mainctx(mainctx)
         , m_useClientSideDecoration {mainctx->useClientSideDecoration()}
         , m_window {window}
         , m_buttonmodel {mainctx->csdButtonModel()}
@@ -332,8 +331,8 @@ public:
                     || point.x > (m_window->width() * m_window->devicePixelRatio() - resizeBorderWidth(m_window))))
                 return false;
 
-            //getIntfScaleFactor uses logicalDotsPerInch, here we want the actual window DPR
-            double scaleFactor = m_mainctx->getIntfUserScaleFactor() * m_window->devicePixelRatio();
+            const double scaleFactor = m_window->devicePixelRatio();
+
             //divide by scale factor as buttons coordinates will be in dpr
             const QPoint qtPoint {static_cast<int>(point.x / scaleFactor), static_cast<int>(point.y / scaleFactor)};
             auto button = overlappingButton(qtPoint);
@@ -525,7 +524,6 @@ private:
         }
     }
 
-    MainCtx* m_mainctx = nullptr;
     bool m_useClientSideDecoration;
     QWindow *m_window;
     CSDButtonModel *m_buttonmodel;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/da5f1ad0cd42084e81ad7206de90cadd2f20b86b...f39f107f75d2fbdb142bada7660a16c8fc29eb3b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/da5f1ad0cd42084e81ad7206de90cadd2f20b86b...f39f107f75d2fbdb142bada7660a16c8fc29eb3b
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