We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2803

Summary: Patch adding multiple Wayland display outputs
Product: SDL Reporter: Dmitry <dcherkassov>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: bugs, gabomdq, icculus, x414e54
Version: 2.0.3Keywords: target-2.0.4
Hardware: All   
OS: Linux   
Bug Depends on: 2913    
Bug Blocks:    
Attachments: HG patch
Other version of this patch

Description Dmitry 2014-12-05 17:38:34 UTC
Created attachment 1955 [details]
HG patch

This patch add wayland multiple output support.

Output number can be specified for fullscreen windows via SDL_WINDOWPOS_CENTERED_DISPLAY(X) option in SDL_CreateWindow.

P.S i am not fully fluent with mercurial and develop in git, so just in case here is the git patch:

http://dump.bitcheese.net/files/ykexyfo/0001-Add-multiple-display-outputs.git.patch
Comment 1 bugs 2015-03-28 19:15:16 UTC
Created attachment 2096 [details]
Other version of this patch

This patch is implemented on top of bug 2913, which uses imo a better design than the previous patch.
Comment 2 Ryan C. Gordon 2015-04-07 19:25:05 UTC
Ok, to be clear, we want to apply Attachment #2017 [details] from Bug #2913, and then Attachment #2096 [details] from this bug on top of that, right?

And not Attachment #1955 [details] at all?

--ryan.
Comment 3 bugs 2015-04-07 20:10:54 UTC
That’s exact, Attachment #1955 [details] was introducing a lot of unneeded complexity in there.
Comment 4 Ryan C. Gordon 2015-04-08 02:43:43 UTC
(In reply to Ryan C. Gordon from comment #2)
> Ok, to be clear, we want to apply Attachment #2017 [details] from Bug #2913,

(oops, I meant Attachment #2107 [details])

--ryan.
Comment 5 Ryan C. Gordon 2015-04-08 02:47:35 UTC
(In reply to bugs from comment #1)
> Created attachment 2096 [details]
> Other version of this patch
> 
> This patch is implemented on top of bug 2913, which uses imo a better design
> than the previous patch.

This patch is now https://hg.libsdl.org/SDL/rev/d001cff818bb, thanks!

--ryan.
Comment 6 x414e54 2015-04-12 01:28:08 UTC
Hi good work on the multiple output support.

I have a few issues about the way SDL is currently handling outputs:

1. SDL is currently not listening for the global_remove events:

So if any output is removed then SDL would be trying to fullscreen to a non existent display.

2. SDL appears not to be tracking the output the surface is on. 

This means the window will always fullscreen to the primary display or display the application picked via SDL_SetWindowPosition or SDL_SetWindowDisplayMode. Even if the user moved the window to a different display it will fullscreen on the one it was created on (not good).
 
It is possible to emulate this by tracking the surface enter/leave events but the surface may be on/overlapping multiple outputs.