-
Notifications
You must be signed in to change notification settings - Fork 31
feat(windows): touch activates screen — switch to touched computer #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
8380520
900171f
fa14779
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,6 +29,7 @@ | |||||
| #include "deskflow/DropHelper.h" | ||||||
| #include "deskflow/FileChunk.h" | ||||||
| #include "deskflow/IPlatformScreen.h" | ||||||
| #include "deskflow/IPrimaryScreen.h" | ||||||
| #include "deskflow/PacketStreamFilter.h" | ||||||
| #include "deskflow/ProtocolUtil.h" | ||||||
| #include "deskflow/Screen.h" | ||||||
|
|
@@ -87,6 +88,10 @@ Client::Client( | |||||
| m_events->adoptHandler( | ||||||
| m_events->forIScreen().resume(), getEventTarget(), new TMethodEventJob<Client>(this, &Client::handleResume) | ||||||
| ); | ||||||
| m_events->adoptHandler( | ||||||
| m_events->forIScreen().grabScreen(), m_screen->getEventTarget(), | ||||||
| new TMethodEventJob<Client>(this, &Client::handleGrabScreen) | ||||||
| ); | ||||||
|
|
||||||
| if (m_args.m_enableDragDrop) { | ||||||
| m_events->adoptHandler( | ||||||
|
|
@@ -107,6 +112,7 @@ Client::~Client() | |||||
|
|
||||||
| m_events->removeHandler(m_events->forIScreen().suspend(), getEventTarget()); | ||||||
| m_events->removeHandler(m_events->forIScreen().resume(), getEventTarget()); | ||||||
| m_events->removeHandler(m_events->forIScreen().grabScreen(), m_screen->getEventTarget()); | ||||||
|
|
||||||
| cleanupTimer(); | ||||||
| cleanupScreen(); | ||||||
|
|
@@ -655,7 +661,8 @@ bool Client::isCompatible(int major, int minor) const | |||||
| { | ||||||
| const std::map<int, std::set<int>> compatibleTable{ | ||||||
| {6, {7, 8}}, // 1.6 is compatible with 1.7 and 1.8 | ||||||
| {7, {8}} // 1.7 is compatible with 1.8 | ||||||
| {7, {8}}, // 1.7 is compatible with 1.8 | ||||||
| {8, {9}} // 1.8 is compatible with 1.9 (touch-to-switch unavailable) | ||||||
| }; | ||||||
|
Comment on lines
662
to
666
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This table has been removed upstream, as it doesn't make sense. I wonder if it's pointless modifying it. |
||||||
|
|
||||||
| bool isCompatible = false; | ||||||
|
|
@@ -737,6 +744,16 @@ void Client::handleResume(const Event &, void *) | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| void Client::handleGrabScreen(const Event &event, void *) | ||||||
| { | ||||||
| // Forward grab screen request to server via protocol | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment doesn't explain why -- is it redundant? |
||||||
| IPrimaryScreen::MotionInfo *info = static_cast<IPrimaryScreen::MotionInfo *>(event.getData()); | ||||||
| if (m_server != NULL) { | ||||||
| LOG((CLOG_DEBUG1 "requesting screen grab at %d,%d", info->m_x, info->m_y)); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| m_server->grabScreen(info->m_x, info->m_y); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| void Client::handleFileChunkSending(const Event &event, void *) | ||||||
| { | ||||||
| sendFileChunk(event.getDataObject()); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -200,6 +200,15 @@ class IPlatformScreen : public IScreen, public IPrimaryScreen, public ISecondary | |||||||||||
| virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const = 0; | ||||||||||||
| virtual void clearStaleModifiers() = 0; | ||||||||||||
|
|
||||||||||||
| //! Activate the window at the given screen coordinates | ||||||||||||
| /*! | ||||||||||||
| Brings the window at position \c x, \c y to the foreground. | ||||||||||||
| Default implementation does nothing; platforms override as needed. | ||||||||||||
| */ | ||||||||||||
| virtual void activateWindowAt(SInt32 x, SInt32 y) | ||||||||||||
| { | ||||||||||||
| } | ||||||||||||
|
Comment on lines
+209
to
+210
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| // Drag-and-drop overrides | ||||||||||||
| virtual String &getDraggingFilename() = 0; | ||||||||||||
| virtual void clearDraggingFilename() = 0; | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why this change was needed. Maybe it should be a separate PR?