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

Switch screen still need attention #8191

Open
kbbytes opened this issue Apr 7, 2024 · 4 comments
Open

Switch screen still need attention #8191

kbbytes opened this issue Apr 7, 2024 · 4 comments
Labels
bug An unintended feature or error in the code. client Related to the client-side.

Comments

@kbbytes
Copy link

kbbytes commented Apr 7, 2024

switch display screen with 3rd party application on DDNet still need attention like using DisplayFusion to use it's functions for sending focused window to next display
resolution and display number won't update

solution: as I think maybe possible to check GetWindowScreen and g_Config.m_GfxScreen to when it's not equel call SwitchWindowScreen
but someone with better knowledge of DDNet take a look at it

@Robyt3
Copy link
Member

Robyt3 commented Apr 21, 2024

@kbbytes Which fullscreen mode are you using in the client? Which operating system are you using?

It seems there are also some issues on Windows 10 when using the default shortcuts Windows+Shift+Left/Right/Up/Down to move windows between screens. It only works correctly in windowed mode but causes similar issues to #7848 and those fixed by #7937 with the other fullscreen modes.

@Robyt3 Robyt3 added bug An unintended feature or error in the code. client Related to the client-side. labels Apr 21, 2024
@kbbytes
Copy link
Author

kbbytes commented Apr 23, 2024

@kbbytes Which fullscreen mode are you using in the client? Which operating system are you using?

It seems there are also some issues on Windows 10 when using the default shortcuts Windows+Shift+Left/Right/Up/Down to move windows between screens. It only works correctly in windowed mode but causes similar issues to #7848 and those fixed by #7937 with the other fullscreen modes.

windowed borderless
windows 11 64bit
I think it's need to check for current screen number and when it's not equel to the gfx_screen call for switch screen method for current monitor screen number or something like that

@Robyt3
Copy link
Member

Robyt3 commented Apr 29, 2024

Might be bug with SDL and we can't completely fix it at the moment. There is a SDL_WINDOWEVENT_DISPLAY_CHANGED but it's only delivered when in windowed mode. We don't currently consider this event, but because it's sent before SDL_WINDOWEVENT_MOVED, checking SDL_GetWindowDisplayIndex gets the correct new display index in windowed mode.

For the desktop fullscreen and exclusive fullscreen, we can use SDL_GetDisplayBounds to get the positions of all screens and thereby find the correct screen based on the position where the window was moved.

However, for windowed fullscreen the position in SDL_WINDOWEVENT_MOVED does not match any of the displays, so this does not work correctly for this fullscreen mode.

Also, this might a potential oddity of Windows 10, but in exclusive fullscreen mode it appears that the window can only be moved to another screen, if the height of that screen is equal or larger to the height of the fullscreen window.

@kbbytes
Copy link
Author

kbbytes commented May 3, 2024

Might be bug with SDL and we can't completely fix it at the moment. There is a SDL_WINDOWEVENT_DISPLAY_CHANGED but it's only delivered when in windowed mode. We don't currently consider this event, but because it's sent before SDL_WINDOWEVENT_MOVED, checking SDL_GetWindowDisplayIndex gets the correct new display index in windowed mode.

For the desktop fullscreen and exclusive fullscreen, we can use SDL_GetDisplayBounds to get the positions of all screens and thereby find the correct screen based on the position where the window was moved.

However, for windowed fullscreen the position in SDL_WINDOWEVENT_MOVED does not match any of the displays, so this does not work correctly for this fullscreen mode.

Also, this might a potential oddity of Windows 10, but in exclusive fullscreen mode it appears that the window can only be moved to another screen, if the height of that screen is equal or larger to the height of the fullscreen window.

Then we can't fix it with a clean code by SDL events for now but I was thinking about it
is it possible to completely disable and prevent windows to switch between screens and implement our own method like before move screen memorize current, next, and previous screens then according to that we add bind for next and previous screen then move it and update variable for screens after move done and for current drop down menu we can use current codes cause it's fine to use without any problem but definitely we can use any 3rd party program for that anymore cuz DDNet itself has it's own windows manager.
well it's just opinion might not work at all, I don't know more than you know about SDL and windows manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unintended feature or error in the code. client Related to the client-side.
Projects
None yet
Development

No branches or pull requests

2 participants