Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rexx-org opened this issue Apr 17, 2019 · 9 comments
Open

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

rexx-org opened this issue Apr 17, 2019 · 9 comments

Comments

@rexx-org
Copy link

rexx-org commented Apr 17, 2019

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.

@wmcbrine
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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

@wmcbrine
Copy link
Owner

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
Copy link
Owner

Partial fix: 33b4f57

@rexx-org
Copy link
Author

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.

wmcbrine added a commit that referenced this issue Dec 11, 2019
alternate screen (see #61). sdltest needs work yet.
@wmcbrine
Copy link
Owner

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

wmcbrine added a commit that referenced this issue Dec 20, 2019
@wmcbrine
Copy link
Owner

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

wmcbrine added a commit that referenced this issue Dec 21, 2019
"new style" stable under Linux. Other fixes still applied.
@GitMensch
Copy link
Contributor

Looks like this is solved, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants