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 2750

Summary: Patch FullScreen on MIR / Ubuntu Touch
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: brandon.schaefer, brandontschaefer, sylvain.becker
Version: 2.0.3   
Hardware: Other   
OS: Linux   
Attachments: patch
patch compatible with ubuntu 14.04

Description Sylvain 2014-10-10 11:33:44 UTC
Created attachment 1896 [details]
patch

Hi, 

The platform is Ubuntu Touch + MIR (on ARM tablet/phones).
It probably fix also some fullscreen issue on Ubuntu x86 + MIR !

This is a small patch to correct a typo and add a few functions : 

- The function "MIR_mir_surface_set_state" should use instead of the "_type".
(otherwise the fullscreen is not applied !)

- According to the documentation, mir_wait_for() should be used after the calls of mir_surface_set_state/type. It seems to work without that.

- Fix typo int-MirBool

Thanks,
Sylvain
Comment 1 Brandon Schaefer 2014-10-10 15:05:41 UTC
Patch looks good to me.
Comment 2 Sylvain 2014-10-10 15:23:13 UTC
After double-checking, the lines about "mir_wait_for" should be removed, because it won't compile in ubuntu 14.04. (the file name is different).

And using mir_wait_for does not seem to be mandatory.

so ignore from SDL_mirdyn.h: 
...
  +#include <mir_toolkit/mir_wait.h>
...
  +SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle *wait_handle))
...
Comment 3 Brandon Schaefer 2014-10-11 00:03:02 UTC
Yeah no changes for 14.10 should go into SDL2 trunk atm. As the headers have changed, so we dont want to mess up SDL2 for 14.04.
Comment 4 Sylvain 2014-10-13 08:17:24 UTC
Yes it makes sense.

The patch should work with ubuntu 14.04 provided you skip the (not needed) part about "mir_wait_for" (the two lines above).
Comment 5 Sylvain 2014-10-13 17:25:18 UTC
Created attachment 1898 [details]
patch compatible with ubuntu 14.04

I have updated the patch to compile under ubuntu 14.04
Comment 6 Brandon Schaefer 2014-10-24 13:33:02 UTC
Cool, thank you for the patch! Ill want to double check everything on 14.04 compiles. Otherwise the code it self looks good. (My mistake using the wrong function there!)
Comment 7 Sylvain 2014-10-24 13:48:12 UTC
No problem :)

I think the real issue underneath, is that the compiler should have warned about wrong type usage. In that case: "MirSurfaceState" VS "MirSurfaceType".

Maybe an additional great patch, would to change the declaration of function pointers in "SDL_mirdyn.h" to preserve the original c types/enums. So that compiler can warn about mismatch types.
Comment 8 Brandon Schaefer 2014-10-24 13:55:19 UTC
Yeah onces the MirTypes start getting better defined we should hopefully catch these errors a bit sooner.

Thanks confirmed compiles, and fixes those issues!