fix: Pass ClientScrollDirection to EiScreen
This commit is contained in:
committed by
Chris Rizzitello
parent
ddadd4ad83
commit
927075688c
@ -170,7 +170,9 @@ 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), getEvents());
|
||||
return new deskflow::Screen(
|
||||
new deskflow::EiScreen(false, getEvents(), true, args().m_clientScrollDirection), getEvents()
|
||||
);
|
||||
#else
|
||||
throw XNoEiSupport();
|
||||
#endif
|
||||
|
||||
@ -38,8 +38,8 @@ struct ScrollRemainder
|
||||
|
||||
namespace deskflow {
|
||||
|
||||
EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal)
|
||||
: PlatformScreen{events},
|
||||
EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal, deskflow::ClientScrollDirection scrollDirection)
|
||||
: PlatformScreen{events, scrollDirection},
|
||||
m_isPrimary{isPrimary},
|
||||
m_events{events},
|
||||
m_w{1},
|
||||
@ -304,6 +304,8 @@ void EiScreen::fakeMouseWheel(int32_t xDelta, int32_t yDelta) const
|
||||
if (!m_eiPointer)
|
||||
return;
|
||||
|
||||
xDelta = mapClientScrollDirection(xDelta);
|
||||
yDelta = mapClientScrollDirection(yDelta);
|
||||
// libei and deskflow seem to use opposite directions, so we have
|
||||
// to send EI the opposite of the value received if we want to remain
|
||||
// compatible with other platforms (including X11).
|
||||
|
||||
@ -32,7 +32,10 @@ class PortalInputCapture;
|
||||
class EiScreen : public PlatformScreen
|
||||
{
|
||||
public:
|
||||
EiScreen(bool isPrimary, IEventQueue *events, bool usePortal);
|
||||
EiScreen(
|
||||
bool isPrimary, IEventQueue *events, bool usePortal,
|
||||
deskflow::ClientScrollDirection scrollDirection = deskflow::ClientScrollDirection::Normal
|
||||
);
|
||||
~EiScreen() override;
|
||||
|
||||
// IScreen overrides
|
||||
|
||||
Reference in New Issue
Block a user