[vlc-commits] [Git][videolan/vlc][master] qt: use wheel accumulator to handle interface scaling on ctrl+wheel
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Nov 14 11:30:55 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
520201ef by Pierre Lamot at 2025-11-14T11:17:19+00:00
qt: use wheel accumulator to handle interface scaling on ctrl+wheel
This avoids scaling changes being spammed with when using touchpad
- - - - -
2 changed files:
- modules/gui/qt/maininterface/interface_window_handler.cpp
- modules/gui/qt/maininterface/interface_window_handler.hpp
Changes:
=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -161,6 +161,14 @@ InterfaceWindowHandler::InterfaceWindowHandler(qt_intf_t *_p_intf, MainCtx* main
w->alert(0);
});
+ connect(
+ &m_wheelAccumulator, &WheelToVLCConverter::wheelUpDown,
+ this, [this] (int steps, Qt::KeyboardModifiers modifiers) {
+ if (modifiers != Qt::ControlModifier)
+ return;
+ emit incrementIntfUserScaleFactor(steps > 0);
+ });
+
m_window->installEventFilter(this);
}
@@ -267,7 +275,7 @@ bool InterfaceWindowHandler::eventFilter(QObject*, QEvent* event)
QWheelEvent* wheelEvent = static_cast<QWheelEvent*>(event);
if (wheelEvent->modifiers() == Qt::ControlModifier)
{
- emit incrementIntfUserScaleFactor(wheelEvent->angleDelta().y() > 0);
+ m_wheelAccumulator.wheelEvent(wheelEvent);
wheelEvent->accept();
return true;
}
=====================================
modules/gui/qt/maininterface/interface_window_handler.hpp
=====================================
@@ -23,6 +23,7 @@
#include <QObject>
#include <QWindow>
#include <QPointer>
+#include "util/vlchotkeyconverter.hpp"
class MainCtx;
class InterfaceWindowHandler : public QObject
@@ -86,6 +87,8 @@ protected:
QRect m_interfaceGeometry;
+ WheelToVLCConverter m_wheelAccumulator;
+
static const Qt::Key kc[10]; /* easter eggs */
int i_kc_offset = 0;
};
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/520201efb9b7ad88c197969b8e2b7ded117a5d02
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/520201efb9b7ad88c197969b8e2b7ded117a5d02
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