@@ -571,23 +571,7 @@ wxThread::ExitCode VNCConn::Entry()
571571
572572bool VNCConn::thread_send_pointer_event (pointerEvent &event)
573573{
574- int buttonmask = 0 ;
575-
576- if (event.LeftIsDown ())
577- buttonmask |= rfbButton1Mask;
578-
579- if (event.MiddleIsDown ())
580- buttonmask |= rfbButton2Mask;
581-
582- if (event.RightIsDown ())
583- buttonmask |= rfbButton3Mask;
584-
585- if (event.GetWheelRotation () > 0 )
586- buttonmask |= rfbWheelUpMask;
587-
588- if (event.GetWheelRotation () < 0 )
589- buttonmask |= rfbWheelDownMask;
590-
574+ // first, handle cuttext sending, if any
591575 if (event.Entering () && ! cuttext.IsEmpty ())
592576 {
593577 wxCriticalSectionLocker lock (mutex_cuttext); // since cuttext can be set from the main thread
@@ -610,6 +594,25 @@ bool VNCConn::thread_send_pointer_event(pointerEvent &event)
610594 }
611595 }
612596
597+
598+ int buttonmask = 0 ;
599+
600+ if (event.LeftIsDown ())
601+ buttonmask |= rfbButton1Mask;
602+
603+ if (event.MiddleIsDown ())
604+ buttonmask |= rfbButton2Mask;
605+
606+ if (event.RightIsDown ())
607+ buttonmask |= rfbButton3Mask;
608+
609+ if (event.GetWheelRotation () > 0 )
610+ buttonmask |= rfbWheelUpMask;
611+
612+ if (event.GetWheelRotation () < 0 )
613+ buttonmask |= rfbWheelDownMask;
614+
615+
613616 // record here
614617 {
615618 wxCriticalSectionLocker lock (mutex_recordreplay);
0 commit comments