2
2
* barrier -- mouse and keyboard sharing utility
3
3
* Copyright (C) 2012-2016 Symless Ltd.
4
4
* Copyright (C) 2002 Chris Schoeneman
5
- *
5
+ *
6
6
* This package is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU General Public License
8
8
* found in the file LICENSE that should have accompanied this file.
9
- *
9
+ *
10
10
* This package is distributed in the hope that it will be useful,
11
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -134,11 +134,11 @@ Client::connect()
134
134
// being shuttled between various networks). patch by Brent
135
135
// Priddy.
136
136
m_serverAddress.resolve ();
137
-
137
+
138
138
// m_serverAddress will be null if the hostname address is not reolved
139
139
if (m_serverAddress.getAddress () != NULL ) {
140
140
// to help users troubleshoot, show server host name (issue: 60)
141
- LOG ((CLOG_NOTE " connecting to '%s': %s:%i" ,
141
+ LOG ((CLOG_NOTE " connecting to '%s': %s:%i" ,
142
142
m_serverAddress.getHostname ().c_str (),
143
143
ARCH->addrToString (m_serverAddress.getAddress ()).c_str (),
144
144
m_serverAddress.getPort ()));
@@ -255,7 +255,7 @@ Client::leave()
255
255
m_active = false ;
256
256
257
257
m_screen->leave ();
258
-
258
+
259
259
if (m_enableClipboard) {
260
260
// send clipboards that we own and that have changed
261
261
for (ClipboardID id = 0 ; id < kClipboardEnd ; ++id) {
@@ -271,7 +271,7 @@ Client::leave()
271
271
void
272
272
Client::setClipboard (ClipboardID id, const IClipboard* clipboard)
273
273
{
274
- m_screen->setClipboard (id, clipboard);
274
+ m_screen->setClipboard (id, clipboard);
275
275
m_ownClipboard[id] = false ;
276
276
m_sentClipboard[id] = false ;
277
277
}
@@ -508,6 +508,10 @@ Client::setupScreen()
508
508
getEventTarget (),
509
509
new TMethodEventJob<Client>(this ,
510
510
&Client::handleClipboardGrabbed));
511
+ m_events->adoptHandler (m_events->forIScreen ().localInput (),
512
+ getEventTarget (),
513
+ new TMethodEventJob<Client>(this ,
514
+ &Client::handleLocalInputEvent));
511
515
}
512
516
513
517
void
@@ -564,6 +568,8 @@ Client::cleanupScreen()
564
568
getEventTarget ());
565
569
m_events->removeHandler (m_events->forClipboard ().clipboardGrabbed (),
566
570
getEventTarget ());
571
+ m_events->removeHandler (m_events->forIScreen ().localInput (),
572
+ getEventTarget ());
567
573
delete m_server;
568
574
m_server = NULL ;
569
575
}
@@ -767,6 +773,14 @@ Client::handleStopRetry(const Event&, void*)
767
773
m_args.m_restartable = false ;
768
774
}
769
775
776
+ void
777
+ Client::handleLocalInputEvent (const Event& event, void *)
778
+ {
779
+ IPlatformScreen::MotionInfo* info = static_cast <IPlatformScreen::MotionInfo*>(event.getData ());
780
+ LOG ((CLOG_DEBUG " Trigger screen switching caused by local input, screen coordinates (%d, %d)" , info->m_x , info->m_y ));
781
+ m_server->onLocalInput (info->m_x , info->m_y );
782
+ }
783
+
770
784
void
771
785
Client::writeToDropDirThread (void *)
772
786
{
@@ -775,7 +789,7 @@ Client::writeToDropDirThread(void*)
775
789
while (m_screen->isFakeDraggingStarted ()) {
776
790
ARCH->sleep (.1f );
777
791
}
778
-
792
+
779
793
DropHelper::writeToDir (m_screen->getDropTarget (), m_dragFileList,
780
794
m_receivedFileData);
781
795
}
@@ -790,7 +804,7 @@ Client::dragInfoReceived(UInt32 fileNum, std::string data)
790
804
}
791
805
792
806
DragInformation::parseDragInfo (m_dragFileList, fileNum, data);
793
-
807
+
794
808
m_screen->startDraggingFiles (m_dragFileList);
795
809
}
796
810
@@ -806,7 +820,7 @@ Client::sendFileToServer(const char* filename)
806
820
if (m_sendFileThread != NULL ) {
807
821
StreamChunker::interruptFile ();
808
822
}
809
-
823
+
810
824
m_sendFileThread = new Thread (
811
825
new TMethodJob<Client>(
812
826
this , &Client::sendFileThread,
0 commit comments