diff --git a/server/Mac/mf_input.c b/server/Mac/mf_input.c index 974fd0d0b..4db73c3f4 100644 --- a/server/Mac/mf_input.c +++ b/server/Mac/mf_input.c @@ -104,8 +104,23 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) if (flags & PTR_FLAGS_MOVE) { + if (mfi->mouse_down_left == TRUE) + { + mouseType = kCGEventLeftMouseDragged; + } + else if (mfi->mouse_down_right == TRUE) + { + mouseType = kCGEventRightMouseDragged; + } + else if (mfi->mouse_down_other == TRUE) + { + mouseType = kCGEventOtherMouseDragged; + } + else + { + mouseType = kCGEventMouseMoved; + } - mouseType = kCGEventMouseMoved; CGEventRef move = CGEventCreateMouseEvent(NULL, mouseType, CGPointMake(x, y), @@ -121,10 +136,15 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { mouseButton = kCGMouseButtonLeft; if (flags & PTR_FLAGS_DOWN) + { mouseType = kCGEventLeftMouseDown; + mfi->mouse_down = TRUE; + } else + { mouseType = kCGEventLeftMouseUp; - + mfi->mouse_down = FALSE; + } } else if (flags & PTR_FLAGS_BUTTON2) { @@ -144,11 +164,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) mouseType = kCGEventOtherMouseUp; } - /*else - { - return; - } - */ + CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseType, diff --git a/server/Mac/mf_interface.h b/server/Mac/mf_interface.h index b6d45dafd..b81e00407 100644 --- a/server/Mac/mf_interface.h +++ b/server/Mac/mf_interface.h @@ -83,34 +83,20 @@ struct mf_info UINT32 servscreen_xoffset; UINT32 servscreen_yoffset; - //int frame_idx; int bitsPerPixel; - //HDC driverDC; int peerCount; int activePeerCount; - //void* changeBuffer; int framesPerSecond; - //LPTSTR deviceKey; - //TCHAR deviceName[32]; freerdp_peer** peers; - //BOOL mirrorDriverActive; unsigned int framesWaiting; UINT32 scale; - //HANDLE snd_mutex; - //BOOL snd_stop; - RFX_RECT invalid; pthread_mutex_t mutex; - //BOOL updatePending; - //HANDLE updateEvent; - //HANDLE updateThread; - //HANDLE updateSemaphore; - //RFX_CONTEXT* rfx_context; - //unsigned long lastUpdate; - //unsigned long nextUpdate; - //SURFACE_BITS_COMMAND cmd; + BOOL mouse_down_left; + BOOL mouse_down_right; + BOOL mouse_down_other; BOOL input_disabled; BOOL force_all_disconnect; }; diff --git a/server/Mac/mf_peer.c b/server/Mac/mf_peer.c index d5864997d..e43409610 100644 --- a/server/Mac/mf_peer.c +++ b/server/Mac/mf_peer.c @@ -289,6 +289,10 @@ BOOL mf_peer_post_connect(freerdp_peer* client) client->update->DesktopResize(client->update->context); + mfi->mouse_down_left = FALSE; + mfi->mouse_down_right = FALSE; + mfi->mouse_down_other = FALSE; + //#ifdef WITH_SERVER_CHANNELS /* Iterate all channel names requested by the client and activate those supported by the server */