refactor: check settigns for invertscroll in PlatformScreen

This commit is contained in:
sithlord48
2026-02-05 21:30:30 -05:00
committed by Chris Rizzitello
parent 380f65954d
commit a520e3b2e9
11 changed files with 19 additions and 28 deletions

View File

@ -104,12 +104,11 @@ const char *ClientApp::daemonName() const
deskflow::Screen *ClientApp::createScreen()
{
const bool invertScrolling = Settings::value(Settings::Client::InvertScrollDirection).toBool();
#if WINAPI_MSWINDOWS
return new deskflow::Screen(
new MSWindowsScreen(
false, Settings::value(Settings::Core::UseHooks).toBool(), getEvents(),
Settings::value(Settings::Client::LanguageSync).toBool(), invertScrolling
Settings::value(Settings::Client::LanguageSync).toBool()
),
getEvents()
);
@ -119,7 +118,7 @@ deskflow::Screen *ClientApp::createScreen()
if (deskflow::platform::isWayland()) {
#if WINAPI_LIBEI
LOG_INFO("using ei screen for wayland");
return new deskflow::Screen(new deskflow::EiScreen(false, getEvents(), true, invertScrolling), getEvents());
return new deskflow::Screen(new deskflow::EiScreen(false, getEvents(), true), getEvents());
#else
throw XNoEiSupport();
#endif
@ -129,9 +128,7 @@ deskflow::Screen *ClientApp::createScreen()
#if WINAPI_XWINDOWS
LOG_INFO("using legacy x windows screen");
return new deskflow::Screen(
new XWindowsScreen(
qPrintable(Settings::value(Settings::Core::Display).toString()), false, getEvents(), invertScrolling
),
new XWindowsScreen(qPrintable(Settings::value(Settings::Core::Display).toString()), false, getEvents()),
getEvents()
);
@ -139,8 +136,7 @@ deskflow::Screen *ClientApp::createScreen()
#if WINAPI_CARBON
return new deskflow::Screen(
new OSXScreen(getEvents(), false, Settings::value(Settings::Client::LanguageSync).toBool(), invertScrolling),
getEvents()
new OSXScreen(getEvents(), false, Settings::value(Settings::Client::LanguageSync).toBool()), getEvents()
);
#endif
}

View File

@ -10,10 +10,9 @@
#include "common/Settings.h"
#include "deskflow/App.h"
PlatformScreen::PlatformScreen(IEventQueue *events, bool invertScrolling)
: IPlatformScreen(events),
m_invertScrollDirection(invertScrolling)
PlatformScreen::PlatformScreen(IEventQueue *events) : IPlatformScreen(events)
{
m_invertScrollDirection = Settings::value(Settings::Client::InvertScrollDirection).toBool();
m_yScrollScale = std::clamp(Settings::value(Settings::Client::YScrollScale).toDouble(), 0.1, 10.0);
}

View File

@ -23,7 +23,7 @@ public:
int32_t xDelta;
int32_t yDelta;
};
explicit PlatformScreen(IEventQueue *events, bool invertScrollDirection);
explicit PlatformScreen(IEventQueue *events);
~PlatformScreen() override = default;
// IScreen overrides

View File

@ -36,8 +36,8 @@ struct ScrollRemainder
namespace deskflow {
EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal, bool invertScrolling)
: PlatformScreen{events, invertScrolling},
EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal)
: PlatformScreen{events},
m_isPrimary{isPrimary},
m_events{events},
m_clipboard{new WlClipboardCollection()},

View File

@ -34,7 +34,7 @@ using ClipboardInfo = IScreen::ClipboardInfo;
class EiScreen : public PlatformScreen
{
public:
EiScreen(bool isPrimary, IEventQueue *events, bool usePortal, bool invertScrolling = false);
EiScreen(bool isPrimary, IEventQueue *events, bool usePortal);
~EiScreen() override;
// IScreen overrides

View File

@ -79,10 +79,8 @@
HINSTANCE MSWindowsScreen::s_windowInstance = nullptr;
MSWindowsScreen *MSWindowsScreen::s_screen = nullptr;
MSWindowsScreen::MSWindowsScreen(
bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync, bool invertScrolling
)
: PlatformScreen(events, invertScrolling),
MSWindowsScreen::MSWindowsScreen(bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync)
: PlatformScreen(events),
m_isPrimary(isPrimary),
m_useHooks(useHooks),
m_isOnScreen(m_isPrimary),

View File

@ -29,9 +29,7 @@ class MSWindowsDropTarget;
class MSWindowsScreen : public PlatformScreen
{
public:
MSWindowsScreen(
bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync = false, bool invetScrolling = false
);
MSWindowsScreen(bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync = false);
~MSWindowsScreen() override;
//! @name manipulators

View File

@ -43,7 +43,7 @@ class Mutex;
class OSXScreen : public PlatformScreen
{
public:
OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync = false, bool invertScrolling = false);
OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync = false);
virtual ~OSXScreen();

View File

@ -74,8 +74,8 @@ void avoidHesitatingCursor();
bool OSXScreen::s_testedForGHOM = false;
bool OSXScreen::s_hasGHOM = false;
OSXScreen::OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync, bool invertScrolling)
: PlatformScreen(events, invertScrolling),
OSXScreen::OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync)
: PlatformScreen(events),
m_isPrimary(isPrimary),
m_isOnScreen(m_isPrimary),
m_cursorPosValid(false),

View File

@ -82,8 +82,8 @@ static int xi_opcode;
XWindowsScreen *XWindowsScreen::s_screen = nullptr;
XWindowsScreen::XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling)
: PlatformScreen(events, invertScrolling),
XWindowsScreen::XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events)
: PlatformScreen(events),
m_isPrimary(isPrimary),
m_isOnScreen(m_isPrimary),
m_events(events)

View File

@ -28,7 +28,7 @@ class XWindowsScreenSaver;
class XWindowsScreen : public PlatformScreen
{
public:
XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling = false);
XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events);
~XWindowsScreen() override;
//! @name manipulators