PDCurses icon indicating copy to clipboard operation
PDCurses copied to clipboard

Demo programs (SDL2) freeze when dragged to 2nd monitor on macos

Open rexx-org opened this issue 6 years ago • 9 comments

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.

rexx-org avatar Apr 17 '19 00:04 rexx-org

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.

wmcbrine avatar Apr 18 '19 16:04 wmcbrine

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.

wmcbrine avatar Apr 18 '19 19:04 wmcbrine

OK, you can unfreeze the apps by resizing them, at least the ones that support resizing. Hmm...

wmcbrine avatar Apr 19 '19 03:04 wmcbrine

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.

wmcbrine avatar Apr 19 '19 03:04 wmcbrine

Partial fix: https://github.com/wmcbrine/PDCurses/commit/33b4f5765f6d2bf8419000572e3d8ad514c284eb

wmcbrine avatar Apr 19 '19 20:04 wmcbrine

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.

rexx-org avatar Apr 23 '19 23:04 rexx-org

Resizing of windows dragged to screens of different DPI now works.

wmcbrine avatar Dec 11 '19 05:12 wmcbrine

While SDL has no concept of a controlling terminal, I can make the window open on the screen where the moiuse pointer is.

wmcbrine avatar Dec 20 '19 05:12 wmcbrine

Looks like this is solved, isn't it?

GitMensch avatar Jun 21 '21 05:06 GitMensch