Nyerguds / MobiusMapEditor

Enhanced version of the C&C Tiberian Dawn and Red Alert map editor based on the source code released by Electronic Arts.
Other
23 stars 3 forks source link

Allow tool form to stray outside the window #2

Closed btigi closed 2 years ago

btigi commented 2 years ago

If you have multiple monitors then having the tool window constrained to the main window is a big usability hit.

Nyerguds commented 2 years ago

having the tool window constrained to the main window

Um. They aren't? I've been developing this on dual monitor without any issues. Clamping only makes windows not stray outside of the screen. They are not restricted to the inside of the editor window.

Early versions of the original editor had loads of problems with tool windows disappearing under the taskbar and being lost forever there, that's why they added that clamping logic.

Nyerguds commented 2 years ago

Oh, that's peculiar. The window can be moved to a different monitor with no issues, but the tool windows will snap to the screen the main window is in.

That's a bug in the clamping logic though. Just an option to disable it is not a fix for that, it's just a bad workaround.

Nyerguds commented 2 years ago

The actual fix was just to change this line Rectangle workingArea = Screen.FromControl(this).WorkingArea; to this Rectangle workingArea = Screen.FromControl(activeToolForm).WorkingArea; Now clamping still works as expected, but it just happens on the monitor that the tool is moved to.

Thanks for the bug report, though, this is a purely personal project, so I am currently not planning to accept any pull requests. You can always open an issue if you discover a bug.