FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.13k stars 143 forks source link

RA2 failed to navigate the view using the mouse on full screen & borderless mode on Proton #258

Closed A1ca7raz closed 8 months ago

A1ca7raz commented 8 months ago

I use Linux and multiple monitors, so I need to lock my cursor to screen. But with devmode on I cannot move my view right or bottom just like the picture below. Top and left works fine. Screenshot_20231029_001430 The red arrow points to my cursor. It didn't turn to navigating cursor. The blue arrows point to top-right and bottom-left corner where right or bottom navigating can be triggled. Screenshot_20231029_000448

When devmode is off, everything works fine but my cursor would move out of the screen.

This is my monitor layout, and the 1440p one is my primary monitor. 图片

FunkyFr3sh commented 8 months ago

That seems to be a bug in wine, you're the second one to report it. This does not happen on windows.

What wine version is it?

A1ca7raz commented 8 months ago

What wine version is it?

Proton-GE 8.16

FunkyFr3sh commented 8 months ago

I'm not sure if there's anything I can do. I could possibly add a temporary workaround, but in the end, they'll have to fix it.

Apparently they broke "ClipCursor" in a way that you can't move the cursor to the very right and the very bottom anymore. C&C games don't handle such issues very well, they need the cursor to reach the very last line/row to trigger the scroll. Other games are a bit smarter, there's often between 2-5 lines/rows that trigger the scroll

FunkyFr3sh commented 8 months ago

Just to verify, here's a test build that logs the ClipCursor calls to cnc-ddraw-*.log:

ddraw.zip

If you want, do a test run and upload the log and and I can double check just to be sure it's really a problem within ClipCursor

A1ca7raz commented 8 months ago

cnc-ddraw-1.log

FunkyFr3sh commented 8 months ago

Yeah, that confirms what I thought. They broke "ClipCursor".

Not sure where to report the issue, no idea if it's specific to Proton GE or regular Proton or wine... You probably have to use a older build for now until they've fixed it.

They're probably not even aware of the issue yet, in most games you wouldn't notice that there's something wrong.

FunkyFr3sh commented 8 months ago

This here probably works (increased width/height of the rectangle by 1):

ddraw.zip

A1ca7raz commented 8 months ago

It doesn't work on fullscreen mode and fullscreen upscaled mode. On borderless mode I can move the cursor to bottom, but right is still broken. This is the log of ra2md on fullscreen upscaled mode. cnc-ddraw-1.log This is the log on borderless mode. cnc-ddraw-1.log

FunkyFr3sh commented 8 months ago

Ah okay, so their bug is that they check the size of the window and subtract 1 from it. That's why borderless works (it does add +1 to the height)

FunkyFr3sh commented 8 months ago

Closing this as it's not a cnc-ddraw related bug