PDCurses
PDCurses copied to clipboard
Demo programs (SDL2) freeze when dragged to 2nd monitor on macos
I have installed the SDL2 and SDL2_ttf frameworks (v2.0.9) on a MacBook running macos 10.14.4 (Mojave) which has a second monitor attached. I can run the demos successfully on the laptop screen, but when I drag the demo program window to the second monitor the demo program freezes. All I can do is close the window. If I start a demo program from the second monitor, it displays on the laptop screen. Again dragging to the second monitor freezes the program. I assume that SDL2 doesn't work on a second monitor, but I can't find any bug reports against SDL2 related to this.
Confirmed... interesting, it seems like the display stops updating, but the apps still respond to input (e.g. exit on 'q'. where applicable). I'll investigate further.
SDL2 does have awareness of multiple monitors. I suspect this is related to moving the window to a monitor with a different DPI (e.g. a built-in Retina monitor to an external non-Retina). The suggested solutions I'm seeing for similar-sounding problems involve making the app DPI-aware... which, see issue #18.
OK, you can unfreeze the apps by resizing them, at least the ones that support resizing. Hmm...
OK, I can fix it by removing the check that the new size is different from the old size in the resizing handler. Will clean this up a bit before commit.
Partial fix: https://github.com/wmcbrine/PDCurses/commit/33b4f5765f6d2bf8419000572e3d8ad514c284eb
Confirmed patch works as intended, but resizing a window once dragged to the non-retina display is badly broken. Does seem related to #18 It is also annoying that an SDL program launched from a terminal session in the secondary monitor opens on the primary display.
Resizing of windows dragged to screens of different DPI now works.
While SDL has no concept of a controlling terminal, I can make the window open on the screen where the moiuse pointer is.
Looks like this is solved, isn't it?