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 2943 - Support for QtWayland content orientation and window flags via SDL hints
Summary: Support for QtWayland content orientation and window flags via SDL hints
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 17:46 UTC by Thomas Perl
Modified: 2016-11-15 09:19 UTC (History)
1 user (show)

See Also:


Attachments
Proposed patch implementing the QtWayland SDL hints (6.36 KB, patch)
2015-04-14 17:53 UTC, Thomas Perl
Details | Diff
Proposed patch implementing the QtWayland SDL hints (6.89 KB, patch)
2015-04-14 18:59 UTC, Thomas Perl
Details | Diff
QtWayland SDL hints (Mercurial patchset) (6.53 KB, patch)
2016-11-13 09:44 UTC, Thomas Perl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Perl 2015-04-14 17:46:46 UTC
Bug for submitting a patch that adds support for specifying the QtWayland surface content orientation and window flags via the SDL hints mechanism.

QtWayland provides a Wayland protocol extension for telling the compositor the content orientation (in which orientation the application's contents are drawn) and for supplying additional window flags that can be interpreted by the compositor:

https://github.com/qtproject/qtwayland/blob/dev/src/extensions/surface-extension.xml

For SDL on Sailfish OS, we need a way to expose these features to the SDL developer. Looking at how these platform-specific hints are solved in other parts of SDL, SDL Hints seem to be the way to go for exposing this.

The use cases are as follows:

1. Application developer wants to develop a landscape application (the native
   framebuffer orientation on Sailfish OS is portrait mode)

   => Developer renders landscape content rotated into the portrait framebuffer,
      tells window manager that the content is landscape, so the window manager
      can align overlays (e.g. volume bars) and system gestures accordingly.

2. Application developer wants to disable system-wide swipe gestures used to
   switch between applications during gameplay, so that the whole screen can
   be used and no areas of the screen can be used for gestures (the developer
   needs to provide an on-screen way of returning the application to a state
   [e.g. pause menu / main menu] in which the system gestures continue to work)

   => Developer enables the "OverridesSystemGestures" window flags during
      gameplay, and clears the flag when the game enters pause mode / menus

Existing hints (e.g. iOS orientation) cannot be re-used, as the iOS orientation hint specifies which orientations are possible, and the window is (presumably?) rotated into these orientations automatically, whereas with QtWayland, the window is never resized/rotated, and the orientation hint tells the window manager the logical orientation of the drawn content (the framebuffer is always portrait mode).
Comment 1 Thomas Perl 2015-04-14 17:53:06 UTC
Created attachment 2122 [details]
Proposed patch implementing the QtWayland SDL hints

Proposed patch attached.
Comment 2 Ryan C. Gordon 2015-04-14 18:51:04 UTC
Tagging this with target-2.0.4 so it's considered for 2.0.4, but I haven't looked at the patch yet, so no promises.  :)

--ryan.
Comment 3 Thomas Perl 2015-04-14 18:59:21 UTC
Created attachment 2123 [details]
Proposed patch implementing the QtWayland SDL hints

Updated patch, added missing "#include "SDL_hints.h"" to SDL_waylandwindow.c
Comment 4 Sam Lantinga 2015-05-28 15:29:38 UTC
FYI, adding a callback automatically calls it with the current value. You don't need to call it explicitly afterward.
Comment 5 Sam Lantinga 2015-05-28 15:30:21 UTC
I'm removing this from the 2.0.4 ship list because we want to get it out ASAP, but this patch should go in soon afterward.
Comment 6 Sam Lantinga 2016-10-08 00:12:56 UTC
Can you please update your patch for the latest SDL in Mercurial?
Comment 7 Thomas Perl 2016-11-13 09:44:14 UTC
Created attachment 2617 [details]
QtWayland SDL hints (Mercurial patchset)

Updated the patch (rebased against Hg tip + removed the explicit call to the callback when adding the hint callback).
Comment 8 Sam Lantinga 2016-11-15 09:19:15 UTC
Patch applied, thanks!
https://hg.libsdl.org/SDL/rev/63c2c6c8762c