Skip to content
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

SDL used by Dosbox(and Dosbox-X variant), as well as current SDL2 build from libsdl.org Windows 10 Remote Desktop problems moving mouse. #2331

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 1 comment

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.8
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2016-12-14 08:52:41 +0000, wrote:

When I move the mouse and mount/unmount the mouse with SDL&SDL2, strange things happen:

On my own app(UniPCemu using the latest SDL2 source code from libsdl.org), moving the mouse from the normal(SDL_SetRelativeMouseMode(SDL_FALSE) has been called), it uses the following code to log information about mouse movement used in the logs:

[code] case SDL_MOUSEMOTION: //Mouse moved?
if (hasmousefocus) //Do we have mouse focus?
{
lock(LOCK_INPUT);
if (Direct_Input) //Direct input? Move the mouse in the emulator itself!
{
dolog("SDL","xmove,ymove=%i,%i",event->motion.xrel,event->motion.yrel); //Log our movement!
mouse_xmove += event->motion.xrel; //Move the mouse horizontally!
mouse_ymove += event->motion.yrel; //Move the mouse vertically!
}

  	//Always update mouse coordinates for our own GUI handling!
  	mouse_x = event->motion.x; //X coordinate on the window!
  	mouse_y = event->motion.y; //Y coordinate on the window!
  	unlock(LOCK_INPUT);
  }
  break;

[/code]

It results in the following log on normal direct input when the mouse is moved on the PC itself(without Remote Desktop used):
[code]00:00:04:01.08710: xmove,ymove=0,2
00:00:04:02.06524: xmove,ymove=0,1
00:00:04:03.04491: xmove,ymove=0,1
00:00:04:05.00506: xmove,ymove=0,1
00:00:04:05.08505: xmove,ymove=0,1
00:00:04:06.06498: xmove,ymove=0,1
00:00:04:08.02591: xmove,ymove=0,1
00:00:04:09.00512: xmove,ymove=0,1
00:00:04:10.06535: xmove,ymove=0,1
00:00:04:11.04573: xmove,ymove=0,1
00:00:04:13.00514: xmove,ymove=0,1
00:00:04:13.08548: xmove,ymove=0,2
00:00:04:14.06513: xmove,ymove=0,1
00:00:04:15.04512: xmove,ymove=0,1
00:00:04:17.01148: xmove,ymove=0,1
00:00:04:17.08559: xmove,ymove=0,1
00:00:04:18.06528: xmove,ymove=0,1
00:00:05:12.05049: xmove,ymove=0,2
00:00:05:12.05055: xmove,ymove=0,1
00:00:05:12.05069: xmove,ymove=0,1
00:00:05:12.05072: xmove,ymove=0,1
00:00:05:12.05075: xmove,ymove=0,1
00:00:05:12.05079: xmove,ymove=0,2
00:00:05:12.05082: xmove,ymove=0,1
00:00:05:12.05085: xmove,ymove=0,2
00:00:05:12.05088: xmove,ymove=0,1
00:00:05:12.05092: xmove,ymove=0,1
00:00:05:12.05095: xmove,ymove=0,2
00:00:05:12.05098: xmove,ymove=0,2
00:00:05:12.05101: xmove,ymove=0,1
00:00:05:12.05104: xmove,ymove=0,1
00:00:05:12.05128: xmove,ymove=0,2
00:00:05:12.05146: xmove,ymove=0,1
00:00:05:12.05149: xmove,ymove=0,1
00:00:05:12.05152: xmove,ymove=0,2
00:00:05:12.05156: xmove,ymove=0,1
00:00:05:12.05159: xmove,ymove=0,1
00:00:05:12.05162: xmove,ymove=0,1
00:00:05:12.05166: xmove,ymove=0,2
00:00:05:12.05169: xmove,ymove=0,1
00:00:05:12.05172: xmove,ymove=0,2
00:00:05:12.05175: xmove,ymove=0,1
00:00:05:12.05178: xmove,ymove=0,1
00:00:05:12.05181: xmove,ymove=0,2
00:00:05:12.05185: xmove,ymove=0,1
00:00:05:12.05188: xmove,ymove=0,1
00:00:05:12.05191: xmove,ymove=0,1
00:00:05:12.05194: xmove,ymove=0,1
00:00:05:12.05198: xmove,ymove=0,2
00:00:05:12.05201: xmove,ymove=0,1
00:00:05:12.05204: xmove,ymove=0,1
00:00:05:12.05207: xmove,ymove=0,1
00:00:05:12.05210: xmove,ymove=0,1
00:00:05:12.05213: xmove,ymove=0,1
00:00:05:12.05217: xmove,ymove=0,2
00:00:05:12.05220: xmove,ymove=0,1
00:00:05:12.05223: xmove,ymove=0,1
00:00:05:12.05226: xmove,ymove=0,1
00:00:05:12.05229: xmove,ymove=0,1
00:00:05:12.05232: xmove,ymove=0,1
00:00:05:12.05236: xmove,ymove=0,1
00:00:05:12.05240: xmove,ymove=0,2
00:00:05:12.05243: xmove,ymove=0,1
00:00:05:12.05246: xmove,ymove=0,1
00:00:05:12.05249: xmove,ymove=0,1
00:00:05:12.05252: xmove,ymove=0,1
00:00:05:12.05255: xmove,ymove=0,2
00:00:05:12.05258: xmove,ymove=0,1
00:00:05:12.05262: xmove,ymove=0,1
00:00:05:45.01052: xmove,ymove=1,0
00:00:05:45.09312: xmove,ymove=1,0
00:00:05:46.07501: xmove,ymove=3,0
00:00:05:47.05391: xmove,ymove=2,0
00:00:05:48.02578: xmove,ymove=4,-1
00:00:05:49.00820: xmove,ymove=3,0
00:00:05:49.09025: xmove,ymove=4,-1
00:00:05:50.06574: xmove,ymove=3,0
00:00:05:51.04815: xmove,ymove=3,0
00:00:05:52.03049: xmove,ymove=3,0
00:00:05:53.01357: xmove,ymove=3,0
00:00:05:53.09295: xmove,ymove=3,0
00:00:05:54.06547: xmove,ymove=2,0
00:00:05:55.04756: xmove,ymove=2,0
00:00:05:56.02941: xmove,ymove=2,0
00:00:05:57.02880: xmove,ymove=1,0
00:00:05:57.09037: xmove,ymove=2,0
00:00:05:58.07206: xmove,ymove=1,0
00:00:05:59.05331: xmove,ymove=2,0
00:00:05:61.01337: xmove,ymove=1,0
00:00:05:61.08647: xmove,ymove=1,0
00:00:05:63.04930: xmove,ymove=1,0
00:00:05:64.02759: xmove,ymove=1,0
00:00:05:65.00964: xmove,ymove=1,0
00:00:05:65.09164: xmove,ymove=1,0
00:00:05:66.07379: xmove,ymove=1,0
00:00:05:67.05127: xmove,ymove=1,0
00:00:05:68.03312: xmove,ymove=2,0
00:00:05:69.01456: xmove,ymove=1,0
00:00:05:69.08667: xmove,ymove=1,0
00:00:05:70.06659: xmove,ymove=2,0
00:00:05:71.04868: xmove,ymove=1,0
00:00:05:72.03183: xmove,ymove=2,0
00:00:05:73.01420: xmove,ymove=2,0
00:00:05:73.09150: xmove,ymove=4,0
00:00:05:74.07332: xmove,ymove=3,0
00:00:05:75.05439: xmove,ymove=3,0
00:00:05:76.02606: xmove,ymove=4,0
00:00:05:77.02525: xmove,ymove=3,0
00:00:05:77.08714: xmove,ymove=3,0
00:00:05:78.06866: xmove,ymove=3,0
00:00:05:79.05070: xmove,ymove=2,0
00:00:05:80.05910: xmove,ymove=2,0
00:00:05:81.01042: xmove,ymove=3,0
00:00:05:81.09267: xmove,ymove=1,0
00:00:05:82.06497: xmove,ymove=2,0
00:00:05:83.04684: xmove,ymove=1,0
00:00:05:84.02543: xmove,ymove=1,0
00:00:05:85.00811: xmove,ymove=1,0
00:00:05:85.09045: xmove,ymove=1,0
00:00:05:86.07216: xmove,ymove=1,0
00:00:05:87.04873: xmove,ymove=1,0
00:00:05:88.03088: xmove,ymove=1,0
00:00:05:90.07041: xmove,ymove=1,0
00:00:05:91.05449: xmove,ymove=1,0
00:00:05:92.02626: xmove,ymove=2,0
00:00:05:93.00819: xmove,ymove=2,0
00:00:05:93.09978: xmove,ymove=2,0
00:00:05:94.07097: xmove,ymove=1,0
00:00:05:95.05301: xmove,ymove=2,0
00:00:05:96.02505: xmove,ymove=2,0
00:00:05:97.02534: xmove,ymove=1,0
00:00:05:97.08669: xmove,ymove=1,0
00:00:05:98.06867: xmove,ymove=2,0
00:00:05:99.05069: xmove,ymove=1,0
00:00:06:00.06153: xmove,ymove=1,0
00:00:06:01.01247: xmove,ymove=1,0
00:00:06:01.09457: xmove,ymove=1,0
00:00:06:03.04702: xmove,ymove=1,0
00:00:06:64.03450: xmove,ymove=0,-2
00:00:06:65.00667: xmove,ymove=0,-1
00:00:06:65.08899: xmove,ymove=0,-1
00:00:06:66.07107: xmove,ymove=0,-1
00:00:06:67.05038: xmove,ymove=-1,-2
00:00:06:68.03136: xmove,ymove=0,-1
00:00:06:69.01213: xmove,ymove=0,-1
00:00:06:69.09323: xmove,ymove=-1,-2
00:00:06:70.07061: xmove,ymove=0,-1
00:00:06:71.05167: xmove,ymove=0,-1
00:00:06:72.03295: xmove,ymove=0,-1
00:00:06:73.01462: xmove,ymove=0,-1
00:00:06:73.09517: xmove,ymove=-1,-1
00:00:06:74.06624: xmove,ymove=0,-1
00:00:06:75.04823: xmove,ymove=0,-2
00:00:06:76.02970: xmove,ymove=0,-1
00:00:06:77.03629: xmove,ymove=0,-1
00:00:06:77.08710: xmove,ymove=0,-1
00:00:06:78.06813: xmove,ymove=-1,-2
00:00:06:79.05038: xmove,ymove=0,-1
00:00:06:80.05903: xmove,ymove=0,-1
00:00:06:81.00974: xmove,ymove=0,-2
00:00:06:81.09246: xmove,ymove=0,-1
00:00:06:82.07359: xmove,ymove=0,-3
00:00:06:83.05462: xmove,ymove=0,-1
00:00:06:84.03059: xmove,ymove=0,-2
00:00:06:85.01161: xmove,ymove=0,-1
00:00:06:85.09272: xmove,ymove=0,-3
00:00:06:86.07364: xmove,ymove=0,-1
00:00:06:87.04955: xmove,ymove=0,-2
00:00:06:88.03045: xmove,ymove=0,-1
00:00:06:89.01148: xmove,ymove=0,-2
00:00:06:89.09225: xmove,ymove=0,-2
00:00:06:90.06862: xmove,ymove=0,-1
00:00:06:91.04983: xmove,ymove=0,-2
00:00:06:92.03108: xmove,ymove=0,-2
00:00:06:93.01215: xmove,ymove=0,-2
00:00:06:93.08788: xmove,ymove=0,-1
00:00:06:94.06903: xmove,ymove=0,-1
00:00:06:95.05003: xmove,ymove=0,-2
00:00:06:96.02728: xmove,ymove=0,-2
00:00:06:97.03476: xmove,ymove=0,-1
00:00:06:98.01621: xmove,ymove=-1,-2
00:00:06:98.06920: xmove,ymove=0,-2
00:00:06:99.07642: xmove,ymove=0,-1
00:00:07:00.02775: xmove,ymove=0,-1
00:00:07:01.00757: xmove,ymove=0,-1
00:00:07:01.08906: xmove,ymove=0,-1
00:00:07:02.07093: xmove,ymove=0,-1
00:00:07:03.05479: xmove,ymove=0,-1
00:00:07:04.03275: xmove,ymove=0,-2
00:00:07:05.08523: xmove,ymove=0,-1
00:00:07:06.06641: xmove,ymove=0,-1
00:00:07:07.05446: xmove,ymove=0,-1
00:00:07:08.02525: xmove,ymove=0,-2
00:00:07:09.00586: xmove,ymove=0,-1
00:00:07:09.08679: xmove,ymove=0,-1
00:00:07:10.07479: xmove,ymove=0,-1
00:00:07:11.04585: xmove,ymove=0,-1
00:00:07:12.02695: xmove,ymove=0,-1
00:00:07:13.00846: xmove,ymove=0,-1
00:00:07:13.09880: xmove,ymove=0,-1
00:00:07:14.06963: xmove,ymove=0,-1
00:00:07:15.05161: xmove,ymove=0,-1
00:00:07:16.03280: xmove,ymove=0,-1
00:00:07:17.03370: xmove,ymove=0,-1
00:00:07:18.06572: xmove,ymove=0,-1
00:00:07:19.04714: xmove,ymove=0,-1
00:00:07:20.05721: xmove,ymove=0,-1
00:00:07:21.00783: xmove,ymove=0,-1
00:00:07:22.07034: xmove,ymove=0,-1
00:00:07:23.05428: xmove,ymove=0,-1
00:00:07:24.02548: xmove,ymove=0,-1
00:00:07:25.09779: xmove,ymove=0,-1
00:00:07:26.06920: xmove,ymove=1,0
00:00:07:27.04639: xmove,ymove=0,-1
00:00:07:83.04539: xmove,ymove=-1,0
00:00:07:84.03240: xmove,ymove=-1,0
00:00:07:85.01431: xmove,ymove=-1,0
00:00:07:85.08538: xmove,ymove=-1,1
00:00:07:87.04710: xmove,ymove=-2,0
00:00:07:88.02844: xmove,ymove=-1,0
00:00:07:89.00967: xmove,ymove=-1,1
00:00:07:89.09103: xmove,ymove=-1,0
00:00:07:91.05235: xmove,ymove=-2,0
00:00:07:92.03391: xmove,ymove=-1,0
00:00:07:93.00612: xmove,ymove=-1,0
00:00:07:93.09430: xmove,ymove=-1,1
00:00:07:94.06601: xmove,ymove=-2,0
00:00:07:95.04730: xmove,ymove=-2,0
00:00:07:96.02837: xmove,ymove=-2,0
00:00:07:97.03214: xmove,ymove=-2,1
00:00:07:97.09389: xmove,ymove=-2,0
00:00:07:98.06538: xmove,ymove=-3,0
00:00:07:99.04742: xmove,ymove=-2,1
00:00:08:00.05728: xmove,ymove=-3,0
00:00:08:01.00848: xmove,ymove=-2,1
00:00:08:01.08953: xmove,ymove=-2,0
00:00:08:02.07167: xmove,ymove=-2,0
00:00:08:03.05397: xmove,ymove=-2,1
00:00:08:04.02564: xmove,ymove=-2,0
00:00:08:05.00807: xmove,ymove=-2,0
00:00:08:05.09036: xmove,ymove=-2,1
00:00:08:06.07207: xmove,ymove=-2,0
00:00:08:07.05143: xmove,ymove=-3,0
00:00:08:08.03274: xmove,ymove=-2,0
00:00:08:09.01444: xmove,ymove=-2,1
00:00:08:09.08593: xmove,ymove=-2,0
00:00:08:10.06547: xmove,ymove=-1,0
00:00:08:11.04744: xmove,ymove=-3,0
00:00:08:12.02881: xmove,ymove=-2,0
00:00:08:13.01073: xmove,ymove=-2,0
00:00:08:14.00019: xmove,ymove=-1,0
00:00:08:14.07115: xmove,ymove=-3,0
00:00:08:15.05243: xmove,ymove=-1,0
00:00:08:16.03452: xmove,ymove=-2,0
00:00:08:17.02424: xmove,ymove=-1,0
00:00:08:17.08557: xmove,ymove=-1,0
00:00:08:18.06755: xmove,ymove=-2,0
00:00:08:19.04913: xmove,ymove=-1,0
00:00:08:20.05907: xmove,ymove=-1,0
00:00:08:21.00977: xmove,ymove=-1,1
00:00:08:21.09137: xmove,ymove=-1,0
00:00:08:22.07306: xmove,ymove=-1,0
00:00:08:23.04492: xmove,ymove=-1,0
00:00:08:24.02973: xmove,ymove=-2,0
00:00:08:25.01153: xmove,ymove=-1,1
00:00:08:25.09383: xmove,ymove=-1,0
00:00:08:26.06559: xmove,ymove=-2,0
00:00:08:27.05382: xmove,ymove=-1,0
00:00:08:28.02546: xmove,ymove=-2,0
00:00:08:29.00679: xmove,ymove=-1,1
00:00:08:29.08874: xmove,ymove=-3,0
00:00:08:30.06830: xmove,ymove=-1,1
00:00:08:31.05013: xmove,ymove=-2,0
00:00:08:32.03171: xmove,ymove=-1,0
00:00:08:33.01311: xmove,ymove=-2,0
00:00:08:35.05484: xmove,ymove=-1,0
00:00:08:41.01042: xmove,ymove=0,1
00:00:08:44.03384: xmove,ymove=-1,0[/code]

Simply moving the mouse, drawing a 1x1cm square using the mouse motion(left-top to left-bottom to right-bottom to right-top and back to left-top). This is the correct input.

When remote desktop is used, however, different input happens(toggling Windows 10 mouse speed settings in the control panel of Windows 10, as well as enabling/disabling mouse acceleration has no effect on the results using Remote Desktop):

Mounting/unmounting the mouse Direct Input mode(by toggling SDL_SetRelativeMouseMode(SDL_TRUE or SDL_FALSE))
[code]00:00:14:14.03737: xmove,ymove=0,-729
00:00:14:76.05838: xmove,ymove=0,729
00:00:15:01.01196: xmove,ymove=0,-729
00:00:15:55.03644: xmove,ymove=0,729
00:00:15:76.03283: xmove,ymove=0,-729
00:00:17:38.06822: xmove,ymove=0,729
00:00:17:50.07626: xmove,ymove=0,-729
00:00:17:87.05090: xmove,ymove=0,729
00:00:17:97.01876: xmove,ymove=0,-729
00:00:18:32.01196: xmove,ymove=0,729
00:00:18:40.02550: xmove,ymove=0,-729[/code]

When moving the mouse when Direct Input mode is enabled and moved, then disabled at the end:
[code]00:00:08:45.01213: xmove,ymove=34,0
00:00:08:47.07358: xmove,ymove=68,61
00:00:08:48.03480: xmove,ymove=0,61
00:00:08:53.01350: xmove,ymove=0,60
00:00:08:53.09512: xmove,ymove=34,0
00:00:08:63.04922: xmove,ymove=0,61
00:00:08:65.01771: xmove,ymove=35,122
00:00:08:67.07850: xmove,ymove=0,182
00:00:08:69.09338: xmove,ymove=0,60
00:00:08:72.02827: xmove,ymove=0,61
00:00:08:73.09153: xmove,ymove=0,61
00:00:08:75.05418: xmove,ymove=0,60
00:00:08:77.00946: xmove,ymove=0,61
00:00:08:78.07442: xmove,ymove=0,61
00:00:08:79.05646: xmove,ymove=0,60
00:00:08:81.09191: xmove,ymove=0,122
00:00:08:82.07329: xmove,ymove=0,60
00:00:08:85.01768: xmove,ymove=0,122
00:00:08:86.07121: xmove,ymove=0,121
00:00:08:88.03701: xmove,ymove=0,121
00:00:08:91.00507: xmove,ymove=0,122
00:00:08:91.05611: xmove,ymove=0,61
00:00:08:93.00959: xmove,ymove=0,182
00:00:08:94.07325: xmove,ymove=0,121
00:00:08:96.03597: xmove,ymove=0,182
00:00:08:97.09400: xmove,ymove=0,121
00:00:08:99.04753: xmove,ymove=0,122
00:00:09:01.01006: xmove,ymove=-35,182
00:00:09:02.07330: xmove,ymove=-34,182
00:00:09:04.03677: xmove,ymove=0,60
00:00:09:06.07159: xmove,ymove=0,183
00:00:09:08.03270: xmove,ymove=0,60
00:00:09:09.01450: xmove,ymove=0,61
00:00:09:11.00837: xmove,ymove=0,121
00:00:09:12.03197: xmove,ymove=0,61
00:00:09:13.09524: xmove,ymove=0,121
00:00:09:15.05933: xmove,ymove=0,61
00:00:09:17.02493: xmove,ymove=0,61
00:00:09:18.00116: xmove,ymove=0,60
00:00:09:19.05609: xmove,ymove=-34,122
00:00:09:21.02234: xmove,ymove=0,121
00:00:09:22.07565: xmove,ymove=0,61
00:00:09:25.01641: xmove,ymove=-34,121
00:00:09:25.08802: xmove,ymove=0,121
00:00:09:27.07204: xmove,ymove=0,122
00:00:09:30.06826: xmove,ymove=0,121
00:00:09:35.04876: xmove,ymove=0,61
00:00:09:78.04477: xmove,ymove=34,0
00:00:09:82.00208: xmove,ymove=34,61
00:00:09:82.07405: xmove,ymove=69,0
00:00:09:83.05584: xmove,ymove=34,0
00:00:09:85.01141: xmove,ymove=34,0
00:00:09:87.08503: xmove,ymove=34,0
00:00:09:89.00793: xmove,ymove=34,0
00:00:09:91.00401: xmove,ymove=34,0
00:00:09:91.05547: xmove,ymove=0,60
00:00:09:93.00857: xmove,ymove=69,0
00:00:09:95.05306: xmove,ymove=68,0
00:00:09:96.03417: xmove,ymove=34,0
00:00:09:98.06879: xmove,ymove=34,0
00:00:10:00.03201: xmove,ymove=34,0
00:00:10:02.06802: xmove,ymove=34,0
00:00:10:04.04508: xmove,ymove=69,0
00:00:10:05.09764: xmove,ymove=68,0
00:00:10:07.07132: xmove,ymove=34,61
00:00:10:09.01381: xmove,ymove=68,0
00:00:10:10.06753: xmove,ymove=69,61
00:00:10:13.01130: xmove,ymove=68,0
00:00:10:13.09322: xmove,ymove=68,0
00:00:10:16.03015: xmove,ymove=34,0
00:00:10:17.01218: xmove,ymove=34,0
00:00:10:19.05678: xmove,ymove=34,0
00:00:10:22.06825: xmove,ymove=69,0
00:00:10:25.00725: xmove,ymove=68,0
00:00:10:26.07019: xmove,ymove=34,0
00:00:10:27.07854: xmove,ymove=68,0
00:00:10:29.01132: xmove,ymove=35,0
00:00:10:31.00611: xmove,ymove=68,0
00:00:10:32.02903: xmove,ymove=34,0
00:00:10:34.07383: xmove,ymove=68,0
00:00:10:35.04598: xmove,ymove=34,0
00:00:10:37.01012: xmove,ymove=34,0
00:00:10:38.07294: xmove,ymove=35,0
00:00:10:40.02651: xmove,ymove=68,0
00:00:10:42.06978: xmove,ymove=34,0
00:00:10:45.01393: xmove,ymove=34,0
00:00:10:46.09823: xmove,ymove=34,0
00:00:10:49.01530: xmove,ymove=69,0
00:00:10:50.06851: xmove,ymove=34,0
00:00:10:54.04018: xmove,ymove=68,0
00:00:10:55.05216: xmove,ymove=34,0
00:00:10:57.01484: xmove,ymove=102,0
00:00:10:58.06724: xmove,ymove=69,0
00:00:10:61.09277: xmove,ymove=68,0
00:00:10:64.04901: xmove,ymove=34,0
00:00:10:65.01139: xmove,ymove=34,0
00:00:10:67.07824: xmove,ymove=69,0
00:00:10:68.02950: xmove,ymove=34,0
00:00:11:14.07237: xmove,ymove=34,0
00:00:11:15.05398: xmove,ymove=0,-61
00:00:11:17.09972: xmove,ymove=0,-61
00:00:11:21.09742: xmove,ymove=0,-60
00:00:11:24.04551: xmove,ymove=0,-61
00:00:11:28.03247: xmove,ymove=0,-61
00:00:11:33.01499: xmove,ymove=0,-61
00:00:11:35.05202: xmove,ymove=0,-60
00:00:11:37.09756: xmove,ymove=0,-122
00:00:11:39.05211: xmove,ymove=0,-60
00:00:11:41.02922: xmove,ymove=-34,0
00:00:11:42.00170: xmove,ymove=0,-61
00:00:11:44.04399: xmove,ymove=0,-61
00:00:11:46.07124: xmove,ymove=0,-60
00:00:11:48.02858: xmove,ymove=0,-61
00:00:11:49.09281: xmove,ymove=-34,-61
00:00:11:51.01038: xmove,ymove=0,-60
00:00:11:53.01658: xmove,ymove=0,-61
00:00:11:54.07173: xmove,ymove=0,-61
00:00:11:57.01897: xmove,ymove=0,-60
00:00:11:60.03541: xmove,ymove=0,-61
00:00:11:62.07417: xmove,ymove=0,-121
00:00:11:64.03921: xmove,ymove=0,-61
00:00:11:66.07486: xmove,ymove=0,-61
00:00:11:68.03784: xmove,ymove=-35,-60
00:00:11:69.09108: xmove,ymove=-34,-61
00:00:11:72.07370: xmove,ymove=0,-121
00:00:11:73.09493: xmove,ymove=0,-61
00:00:11:75.05721: xmove,ymove=0,-61
00:00:11:77.01285: xmove,ymove=0,-61
00:00:11:78.03549: xmove,ymove=-34,-60
00:00:11:79.05648: xmove,ymove=0,-61
00:00:11:82.05506: xmove,ymove=0,-182
00:00:11:83.05592: xmove,ymove=0,-61
00:00:11:85.01084: xmove,ymove=-34,-60
00:00:11:86.07307: xmove,ymove=0,-61
00:00:11:88.03239: xmove,ymove=0,-121
00:00:11:89.08854: xmove,ymove=34,-61
00:00:11:91.05850: xmove,ymove=0,-121
00:00:11:94.07088: xmove,ymove=-68,-61
00:00:11:97.01109: xmove,ymove=0,-121
00:00:11:97.09069: xmove,ymove=0,-61
00:00:11:99.05228: xmove,ymove=0,-121
00:00:12:01.01292: xmove,ymove=0,-61
00:00:12:02.07499: xmove,ymove=0,-122
00:00:12:04.03581: xmove,ymove=0,-60
00:00:12:05.09721: xmove,ymove=-34,-61
00:00:12:07.07929: xmove,ymove=0,-61
00:00:12:09.03079: xmove,ymove=0,-60
00:00:12:15.05915: xmove,ymove=0,-122
00:00:12:17.09747: xmove,ymove=0,-60
00:00:12:19.05198: xmove,ymove=0,-61
00:00:12:21.01421: xmove,ymove=-34,-61
00:00:12:22.07626: xmove,ymove=0,-60
00:00:12:25.01817: xmove,ymove=0,-122
00:00:12:25.09906: xmove,ymove=0,-60
00:00:12:28.03001: xmove,ymove=0,-122
00:00:12:72.09078: xmove,ymove=-35,0
00:00:12:74.09128: xmove,ymove=-34,0
00:00:12:77.03406: xmove,ymove=-34,0
00:00:12:77.09772: xmove,ymove=-34,0
00:00:12:81.04476: xmove,ymove=-34,0
00:00:12:83.05505: xmove,ymove=-34,0
00:00:12:85.02035: xmove,ymove=-34,0
00:00:12:86.07764: xmove,ymove=-34,0
00:00:12:89.01829: xmove,ymove=-69,61
00:00:12:89.09019: xmove,ymove=0,61
00:00:12:91.04734: xmove,ymove=-68,0
00:00:12:93.00716: xmove,ymove=-34,0
00:00:12:94.07529: xmove,ymove=-34,0
00:00:12:97.09260: xmove,ymove=-69,0
00:00:12:99.05173: xmove,ymove=-68,60
00:00:13:01.09106: xmove,ymove=-34,0
00:00:13:03.04986: xmove,ymove=-34,0
00:00:13:05.01596: xmove,ymove=-68,0
00:00:13:06.07273: xmove,ymove=-34,0
00:00:13:07.07665: xmove,ymove=-35,0
00:00:13:09.01198: xmove,ymove=-34,0
00:00:13:10.06672: xmove,ymove=-68,0
00:00:13:13.02991: xmove,ymove=-34,0
00:00:13:14.04667: xmove,ymove=-34,0
00:00:13:15.05356: xmove,ymove=-34,0
00:00:13:17.02194: xmove,ymove=-35,0
00:00:13:18.07250: xmove,ymove=-34,0
00:00:13:19.05527: xmove,ymove=-34,0
00:00:13:21.01608: xmove,ymove=-68,0
00:00:13:22.07611: xmove,ymove=-68,0
00:00:13:25.00738: xmove,ymove=-69,0
00:00:13:25.08956: xmove,ymove=-34,0
00:00:13:27.07689: xmove,ymove=-102,0
00:00:13:29.09665: xmove,ymove=-68,0
00:00:13:32.07965: xmove,ymove=-35,0
00:00:13:33.09311: xmove,ymove=-34,0
00:00:13:35.05474: xmove,ymove=-34,0
00:00:13:37.02345: xmove,ymove=-68,0
00:00:13:38.07179: xmove,ymove=-102,0
00:00:13:40.03712: xmove,ymove=-103,0
00:00:13:42.07157: xmove,ymove=-102,61
00:00:13:44.05477: xmove,ymove=-69,0
00:00:13:45.08875: xmove,ymove=-34,0
00:00:13:46.07352: xmove,ymove=-34,0
00:00:13:49.01468: xmove,ymove=-68,0
00:00:13:49.09744: xmove,ymove=-68,0
00:00:13:51.05548: xmove,ymove=-34,0
00:00:13:53.01993: xmove,ymove=-35,0
00:00:13:53.09598: xmove,ymove=0,61
00:00:13:57.01876: xmove,ymove=-68,0
00:00:13:58.07659: xmove,ymove=-68,0
00:00:13:60.03694: xmove,ymove=-34,0
00:00:13:62.00132: xmove,ymove=-34,0
00:00:13:63.05680: xmove,ymove=-69,0
00:00:13:66.03324: xmove,ymove=-136,0
00:00:13:66.07910: xmove,ymove=-34,60
00:00:14:03.08087: xmove,ymove=-34,0[/code]

The display resolution is 1920x1080(1080p FullHD) on all test cases.

On 2016-12-14 08:56:06 +0000, wrote:

Btw, the same problems happen using Dosbox and Dosbox-X, seeing it's response while testing the Megarace install.exe and moving the mouse during the RDP session. So this means SDL 1.2.13.0(According to the file information in Dosbox's SDL.dll) has the same problem.

On 2017-02-07 19:50:47 +0000, wrote:

So when the mouse is moved, instead of reporting 1 or 2 pixels for moving the mouse a little notch to the right/down/left/up, the values reported are multiplied with(divide by these values to get the actual mouse movement in pixels):
horizontal movement x vertical movement at (output resolution of the RDP session)xres x yres

164 x 109 at 800x600
64 x 85 at 1024x768
51 x 64 at 1280x1024
34 x 60 at 1920x1080

So it depends on the resolution set up in the RDP session settings(including fullscreen option) on the client computer.

On 2017-09-17 21:05:56 +0000, wrote:

Perhaps this problem has something to do wuth the DPI reporting?

On 2018-04-29 17:50:38 +0000, wrote:

A little addition: said horizontal/vertical multipliers seem to depend on the CURRENT display resolution of the computer the SDL app is running on. It only seems to happen when running it from a Windows RDP session(can be detected using the registry or command line parameter in my app).

On 2018-04-29 17:55:58 +0000, wrote:

Tried to find a relation between desktop resolutions and multipliers, but so far can't find one?

On 2018-04-29 18:14:14 +0000, Ryan C. Gordon wrote:

I think this is the thing we just fixed for Windows 10 Creators Update, which we didn’t backport to SDL 1.2....?

—ryan.

On 2018-04-29 21:11:07 +0000, wrote:

Just tested again with SDL2 2.0.8, with the screen at 1920x1080(RDP on mobile at 2560x1440). Now, most movement isn't even reported running in direct input mode(as I call relative mouse mode in my emulator), while coordinates are over the top!

Code:
case SDL_MOUSEMOTION: //Mouse moved?
if (hasmousefocus) //Do we have mouse focus?
{
lock(LOCK_INPUT);
if (Direct_Input) //Direct input? Move the mouse in the emulator itself!
{
#ifdef IS_WINDOWS
RDP = 0; //Testbnon-RDP!
if (RDP) //Needs adjustment?
{
mouse_xmove += floorf((float)event->motion.xrel*(1.0f/34.0f))GPU_xDTM; //Move the mouse horizontally!
mouse_ymove += floorf((float)event->motion.yrel
(1.0f/60.0f))GPU_yDTM; //Move the mouse vertically!
}
else //No adjustment?
#endif
{
mouse_xmove += (float)event->motion.xrel
GPU_xDTM; //Move the mouse horizontally!
mouse_ymove += (float)event->motion.yrelGPU_yDTM; //Move the mouse vertically!
dolog("mouse","xmove,ymove=%i,%i=%f,%f",event->motion.xrel,event->motion.yrel,(float)event->motion.xrel
GPU_xDTM,(float)event->motion.yrel*GPU_yDTM);
}
}
else //Not direct input?
{
GPU_mousemove((word)event->motion.x, (word)event->motion.y, 0xFE); //We're moved to the current coordinates, identify as left mouse button!
}

  	//Always update mouse coordinates for our own GUI handling!
  	mouse_x = event->motion.x; //X coordinate on the window!
  	mouse_y = event->motion.y; //Y coordinate on the window!
  	unlock(LOCK_INPUT);
  }
  break;[/code]

Result of dragging a square of +/- 1x1cm(rough square by touch screen on phone):

00:01:03:45.03916: xmove,ymove=0,18005=0.000000,4763.822754
00:01:12:58.07736: xmove,ymove=0,-311=0.000000,-82.285416
00:01:13:39.04560: xmove,ymove=0,-18005=0.000000,-4763.822754
00:01:14:50.01088: xmove,ymove=0,18005=0.000000,4763.822754
00:01:32:96.01080: xmove,ymove=0,-18005=0.000000,-4763.822754

It seems to have aggrevated by a lot in this case!

On 2018-04-29 21:14:10 +0000, wrote:

Running Windows 10 Pro, Version 1709, Build 16299.371

On 2018-04-29 22:12:20 +0000, wrote:

Created attachment 3231
Results of the log, without RDP

On 2018-04-29 22:12:52 +0000, wrote:

Created attachment 3232
Results of the log, with RDP

On 2018-04-29 22:19:30 +0000, wrote:

I've made two logs this time, one with RDP, one without RDP.

Both display resolutions have been unchanged, Windows 10 Pro updated to the latest Version: 1709, Build 16299.402

As you can see(although the RDP one was made using a touch screen(Windows Remote Desktop Client for Android, zoomed in as far as possible, then moving up, right, bottom and left), it still goes wrong.

The resulting movements still seem ridiculously high: x47(x),x85(y) when having the mouse use relative mouse mode using RDP!

On 2018-04-29 22:37:59 +0000, wrote:

Also, as can be seen from analyzing those numbers, that the DPI ratio for both x and y coordinates seems to be ~0.264583, which is the same for both x and y coordinates. This is a simple dots to mm conversion factor(which defaults to either 25.4/96.0, or (when SDL_GetDisplayDPI(0,NULL,&GPU_xDTM,&GPU_yDTM)==0 ) 25.4/GPU_xDTM and 25.4/GPU_yDTM (Windows defaulting to 96DPI).

So the DPI reported by Windows is the same in both RDP and non-RDP cases and doesn't have anything to do with zooming on the RDP software client.

You also can see that the values reported by SDL in the event->motion.xrel and event->motion.yrel relative coordinate movement changes drastically, from -1/+1 to -47(/-48) to +47(/+48) on the x axis and -85(-86)/+85(+86) on the y axis.

I also see the values -171 and +171 on the y axis, which leads me to believe that it's more like -85.5/+85.5 or maybe up to -85.9/+85.9 on the y axis.

So as you can see, even with Windows updated, SDL2 2.0.8 still makes some huge mistake there. Either that or a massive Windows problem yet unresolved?

On 2018-04-29 22:41:29 +0000, wrote:

So, seeing as the

On 2018-04-29 22:58:17 +0000, wrote:

Just tried the same on SDL2 2.0.5. It has ridiculously little output:
00:00:16:87.04344: xmove,ymove=0,18005=0.000000,4763.822754
00:00:48:50.07132: xmove,ymove=0,-18005=0.000000,-4763.822754

So only once starting input and once stopping input it seems with 2.0.5. Non-RDP acts the same as 2.0.8.

So 2.0.5 is way worse, not reporting movement when supposed to at all.

Something's definitely off with mouse movement during RDP in SDL2...

On 2018-04-29 23:46:29 +0000, wrote:

Just taken a look at(based on your comment on that fix, which I've managed to find by searching for changes on hd.libsdl.org 2.0.8):
http://hg.libsdl.org/SDL/file/f1084c419f33/src/video/windows/SDL_windowsevents.c
as well as:
http://hg.libsdl.org/SDL/file/f1084c419f33/src/events/SDL_mouse.c

I don't see any odd behaviour there. Maybe it's a problem with Windows itself when entering relative mouse mode during an RDP session?

On 2018-04-30 00:00:56 +0000, wrote:

There's definitely something going wrong on with SDL in both 2.0.5 and 2.0.8:

I've just tried mounting the mouse using SDL_SetRelativeMouseMode(SDL_TRUE) on the computer itself(using a keyboard key combination instead of middle mouse button click, but that shouldn't matter, right(it's done in all test samples)?), then I connected with RDP while the mouse was mounted(probably the second mouse motion event) and moved the mouse around(up, right, down, then left) slowly using the Android RDP client(by Microsoft). Guess what? Both SDL versions had (although timing and coordinates were a bit different(because no finger movement is alike, we humans aren't perfect after all)) the same kind of three-packet movement:
00:00:36:11.03480: xmove,ymove=-220,-27=-58.208332,-7.143750
00:00:43:39.09916: xmove,ymove=0,18005=0.000000,4763.822754
00:01:30:10.00704: xmove,ymove=0,-18005=0.000000,-4763.822754

I suspect the first one is when I toggle the mouse mode to relative mouse mode, the second is when I connect using RDP(which the RDP client moves the mouse to the center of the screen) and the third one is when I press the key combination a second time to make the app call SDL_SetRelativeMouseMode(SDL_FALSE).

So it's not just that the relative mouse mode is acting up, SDL mouse events as a whole are acting up(not giving any events at all in this case(connecting to RDP while in relative mouse mode)!!!

On 2018-04-30 20:00:03 +0000, wrote:

As far as I've read on vogons, it might have something to do with expecting relative coordinates(SDL) but receiving absolute coordinates(e.g. move from 100,100 to 101,101 gives 101,101 instead of 1,1)?

@slouken
Copy link
Collaborator

slouken commented Nov 4, 2023

I believe this is fixed in the latest SDL release. Please feel free to reopen this if that's not the case.

@slouken slouken closed this as completed Nov 4, 2023
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

No branches or pull requests

2 participants