Skip to content

Port event queue - #8562

Merged
sithlord48 merged 2 commits into
masterfrom
portEventQueue
May 5, 2025
Merged

Port event queue#8562
sithlord48 merged 2 commits into
masterfrom
portEventQueue

Conversation

@sithlord48

@sithlord48 sithlord48 commented May 2, 2025

Copy link
Copy Markdown
Member

Begin: #8557

Ports the event types from input leap

  • Use name EventTypes for enum
  • Add new EventTypes::EIConnected
  • Add new EventTypes::EISessionClosed

Needs testing to ensure no regressions

@sithlord48
sithlord48 requested a review from nbolton May 2, 2025 03:20
@sithlord48
sithlord48 force-pushed the portEventQueue branch 2 times, most recently from 9eb1eb9 to 20dcc2e Compare May 2, 2025 03:45
@nbolton

nbolton commented May 2, 2025

Copy link
Copy Markdown
Member

fixes #8557

Seems that @p12tic went a bit further than changing the ints to enums. Arguably, this goes beyond scope of #8557 in its current wording, but we should also use std::function, lambdas, etc instead of TMethodEventJob. Pretty sure he also made Event struct internal to the event queue, but my memory is fuzzy.

Deskflow:

m_events->adoptHandler(
EventType::StreamInputReady, m_stream->getEventTarget(),
new TMethodEventJob<ServerProxy>(this, &ServerProxy::handleData)
);

Input Leap:

    m_events->add_handler(EventType::STREAM_INPUT_READY, m_stream->get_event_target(),
                          [this](const auto& e){ handle_data(); });

https://github.com/input-leap/input-leap/blob/3b4a6c9f494223a2b74b43a97cc80bb181e3a3d4/src/lib/client/ServerProxy.cpp#L64-L65

Edit: You're also getting an error on macOS:

/Users/runner/work/deskflow/deskflow/src/./lib/base/Event.h:13:17: note: candidate found by name lookup is 'EventType'
using deskflow::EventType;

Comment thread src/lib/base/EventTypes.h Outdated
Comment thread src/lib/base/EventTypes.h Outdated
Comment thread src/lib/base/EventTypes.h
Comment thread src/lib/base/EventTypes.h Outdated
Comment thread src/lib/base/EventTypes.h Outdated
Comment thread src/lib/base/EventTypes.h
Comment thread src/lib/base/EventTypes.h
Comment thread src/lib/base/EventTypes.h
@sithlord48
sithlord48 force-pushed the portEventQueue branch 2 times, most recently from a238c69 to eba162b Compare May 2, 2025 19:19
@sithlord48
sithlord48 marked this pull request as draft May 3, 2025 01:49
@sithlord48
sithlord48 force-pushed the portEventQueue branch 3 times, most recently from 6c94192 to 046f637 Compare May 4, 2025 23:26
@sithlord48
sithlord48 marked this pull request as ready for review May 5, 2025 00:39
@sithlord48
sithlord48 requested a review from nbolton May 5, 2025 00:44
@nbolton

nbolton commented May 5, 2025

Copy link
Copy Markdown
Member

Arguably, this goes beyond scope of #8557 in its current wording, but we should also use std::function, lambdas, etc instead of TMethodEventJob. Pretty sure he also made Event struct internal to the event queue, but my memory is fuzzy.

Deskflow:

m_events->adoptHandler(
EventType::StreamInputReady, m_stream->getEventTarget(),
new TMethodEventJob<ServerProxy>(this, &ServerProxy::handleData)
);

Input Leap:

    m_events->add_handler(EventType::STREAM_INPUT_READY, m_stream->get_event_target(),
                          [this](const auto& e){ handle_data(); });

https://github.com/input-leap/input-leap/blob/3b4a6c9f494223a2b74b43a97cc80bb181e3a3d4/src/lib/client/ServerProxy.cpp#L64-L65

Did you want to do this in this PR?

Begin: #8557

Ah, I guess you want to do it in another PR.

@sithlord48

Copy link
Copy Markdown
Member Author

yes in another pr this just ports the enums

@nbolton

nbolton commented May 5, 2025

Copy link
Copy Markdown
Member

I'll leave thse comments for you to resolve in case you need them for a reminder on #8569

@sithlord48
sithlord48 merged commit 55a7fa3 into master May 5, 2025
@sithlord48
sithlord48 deleted the portEventQueue branch May 5, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants