Opened 11 years ago

Closed 9 years ago

#1916 closed defect (wontfix)

[PATCH] Fullscreen doesn't work on multi-monitor setups with SDL1.2

Reported by: yunta Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords: patch
Cc: Patch:

Description

I have 2 monitors. When started, 0ad detects screen size as the total size of all monitors, and proceeds to fail setting fullscreen mode with that size. Attached patch modifies screen size detection to use xrandr and return size of primary output. Not tested with sdl 2.0. Works in my setup (sdl 1.2), with one and both-monitors enabled. Due to sdl1.2 weirdness (doesn't seem to honour SDL_VIDEO_WINDOW_POS with fullscreen windows), primary display has to be left-top-most (at 0,0 coords).

Attachments (1)

xrandr.patch (2.6 KB ) - added by yunta 11 years ago.

Download all attachments as: .zip

Change History (18)

by yunta, 11 years ago

Attachment: xrandr.patch added

comment:1 by yunta, 11 years ago

Summary: Fullscreen doesn't work on multi-monitor setups with SDL1.2[PATCH] Fullscreen doesn't work on multi-monitor setups with SDL1.2

comment:2 by yunta, 11 years ago

Keywords: review added

comment:3 by zoot, 11 years ago

Keywords: multimon added

comment:4 by Kieran P, 11 years ago

Keywords: patch added; multimon removed
Milestone: BacklogAlpha 14
Priority: Should HaveNice to Have

comment:5 by Markus, 11 years ago

I just tried it. It picks the correct primary display. (For me its the right of two displays.)

But it did not return cleanly. I quit pyrogenesis and it is no longer running. But the whole screen (both displays!) is black with the system cursor. (Had to restart X as I dont know how to recover from that.)

Version 0, edited 11 years ago by Markus (next)

comment:6 by historic_bruno, 11 years ago

I don't have a multi-monitor setup to test this, but it seems like it may be better to let SDL 2.0 provide a better solution, and avoid adding another dependency (xrandr). If the patch can be updated to work more correctly with SDL 1.2 that would be OK.

Apparently in SDL 2.0 there are (undocumented) macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) and SDL_WINDOWPOS_CENTERED_DISPLAY(X) which can be passed to SDL_CreateWindow. So we could make the preferred display a config option :)

Do the other screens go blank with SDL 2.0?

in reply to:  6 comment:7 by Markus, 11 years ago

Replying to historic_bruno:

Do the other screens go blank with SDL 2.0?

No. It just displays the desktop as before for me (on the secondary screen). Although the mouse is not able to leave the 0ad screen.

Last edited 11 years ago by Markus (previous) (diff)

comment:8 by Kieran P, 11 years ago

Milestone: Alpha 14Alpha 15

comment:9 by sanderd17, 11 years ago

Keywords: reviewed added; review removed

Markus has reviewed it, and there clearly are some problems with it. Taking it out of the review queue for now. If someone has improvements, the patch can be resubmitted for review.

comment:10 by sanderd17, 11 years ago

Keywords: reviewed removed

comment:11 by wraitii, 10 years ago

Milestone: Alpha 15Alpha 16

comment:12 by sanderd17, 10 years ago

Milestone: Alpha 16Backlog

Backlogging due to lack of progress

comment:13 by Stan, 10 years ago

Milestone: BacklogAlpha 17

Pushing it back to A17 since it seems we are moving to SDL2

comment:14 by historic_bruno, 10 years ago

Milestone: Alpha 17Alpha 18

SDL 1.2 will still be the default for A17 on Linux, so this problem won't be resolved by then. I can test multiple displays on Windows using my laptop, but someone else should test with latest SDL2 and Linux.

comment:15 by historic_bruno, 10 years ago

Works a lot better on Windows now. Extending my laptop's display onto a second monitor, I was able to play the game fullscreen on either display, while the other remained available. Using the display config setting, I could choose which display the game started on :)

comment:16 by Itms, 9 years ago

Milestone: Alpha 18Alpha 19

comment:17 by historic_bruno, 9 years ago

Milestone: Alpha 19
Resolution: wontfix
Status: newclosed

Closing as wontfix since SDL2 is now a reasonable option on Linux too.

Note: See TracTickets for help on using tickets.