LegoFigure11 / RaidCrawler

Raid Viewer for Pokémon Scarlet and Violet
GNU General Public License v3.0
168 stars 59 forks source link

Window location is saving way offscreen #187

Open CardBreaker opened 9 months ago

CardBreaker commented 9 months ago

A member of the SHA community reported this bug to me. It does not happen on my computer, so it may be computer hardware specific. Basically, if you open the program, drag it to a new location, and close the program, it will appear way offscreen the next time the program is opened. His config file showed that the coordinates were -32000, -32000. This appears to be a result of TeraTaidView_MouseMove. I set a breakpoint there and was not able to hit the breakpoint. Location is already a bindable property, so that may explain why the window location saves correctly on my computer if I'm not hitting the breakpoint within the mouse move event.

The TeraRaidView_MouseMove method appears to be incorrect. It's saving the location as the difference between the starting position of the window and the end position after dragging it. I believe we really just want to be saving the end position itself. I gave the bug reporter a test build with this small change and that appeared to fix his issue. For a real fix, we could do that, but I question if the mouse events are even necessary if Location is a bindable property.

CardBreaker commented 9 months ago

Update: The reporter says the issue came back, so modifying the mouse move event didn't help. I made another test build with the mouse move events completely removed and the issue still occurred. His coordinates keep getting set to -32000, -32000 which is oddly specific.