amethyst / bracket-lib

The Roguelike Toolkit (RLTK), implemented for Rust.
MIT License
1.51k stars 108 forks source link

Resolution changes when moving terminal window between monitors #173

Closed mikecargal closed 3 years ago

mikecargal commented 3 years ago

I'm working through the examples in Hands-on Rust (hi Herbert!).

In trying to debug some typo I have somewhere, I moved the terminal window for the dungeon crawler app to another monitor (so I could view my println! output I'm using to debug).

Latest release of Mac OS (Big Sur). 5k iMac with 27" cinema display attached.

When do a I run the app (from a terminal on the cinema display), the window looks like this on the Cinema display:

Screen Shot 2020-11-23 at 8 32 56 AM

But when I drag it to the 5k display, it changes to this (no resizing involved):

Screen Shot 2020-11-23 at 8 33 05 AM

Out of curiosity, I moved the terminal to the 5k display and ran it.

The app looks like this on the 5k display:

Screen Shot 2020-11-23 at 8 42 41 AM

And like this when dragged to the Cinema display:

Screen Shot 2020-11-23 at 8 43 27 AM

It appears that resolution is being assessed from information obtained from the screen the app is started from (and it appears correctly there), but needs to be re-assessed when moved to another display.

Both screen resolutions are set to "Default for display". (Cinema display is 2560x1440)

thebracket commented 3 years ago

I really need to get a bigger monitor! It looks like I'll need to handle the "moved" event for the window and call the same resizing code post-move. I have three monitors, but they are all 1080p. I'll see if I can reproduce and fix this. Thanks!

thebracket commented 3 years ago

c5cd5bd seems to have fixed this on Windows. Setup a CRAZY situation with 3 monitors each on differing resolutions and display scales and dragged the astar_mouse example between them. After this fix, it behaved as intended.

thebracket commented 3 years ago

You indicated in the other thread that this is working now. :-) So I'm going to mark the ticket as "closed"; if the problem recurs, feel free to re-open this.