Mir

[Enhancement] Add an API to adjust preferred surface orientation at runtime

Bug #1382209 reported by Sylvain Becker
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Wishlist
Alberto Aguirre
mir (Ubuntu)
Fix Released
Wishlist
Unassigned
qtmir (Ubuntu)
Triaged
High
Unassigned

Bug Description

Sometimes, applications are written to take advantage of the entire surface of screen. So they need a way to tell MIR, the orientation they want for drawing themselves. This can be portrait for some, landscape for others, or even combinations.
Without this feature, portrait application get distorted when running in a landscape oriented device.

So, it would be nice to have an API, in MIR client, to precisely lock the orientation of the MirSurface used for drawing.

My use case is a full-screen game, that require always Portrait Orientation. Another is a full-screen game that requires always Landscape.

Better (future):
- allow this even for non full-screen applications
- allow combination like Portait+PortraitUpsideDown, or LandscapeLeft+LandscapeRight
- allow to change the orientation when the application run (so not only when creating/requesting the surface).

Remarks :
- touch event may need to be translated into the correct coordinates system!

Tags: enhancement

Related branches

summary: - [Enhancement] Add an API to lock screen orientation
+ [Enhancement] Add an API to lock window orientation
description: updated
summary: - [Enhancement] Add an API to lock window orientation
+ [Enhancement] Add an API to lock window/screen orientation
description: updated
description: updated
summary: - [Enhancement] Add an API to lock window/screen orientation
+ [Enhancement] Add an API to lock surface orientation
description: updated
description: updated
description: updated
Changed in mir:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: enhancement
Revision history for this message
kevin gunn (kgunn72) wrote : Re: [Enhancement] Add an API to lock surface orientation

just a note of update, I am putting this in our team's "list of stuff" we want to address soon

Revision history for this message
Gerry Boland (gerboland) wrote :

Related bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1379777 "Allow applications to specify the orientations supported "

Would a hint in the desktop file be enough - which means it's a property set once at startup?
Or do you need the ability to change the supported surface orientations at runtime?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

For Mir an app's supported orientations means {portrait, landscape}.

That is separate to the actual orientation gravity {normal, inverted, left, right} and whether it is locked.

Changed in mir:
assignee: nobody → Alberto Aguirre (albaguirre)
milestone: none → 0.10.0
status: Triaged → In Progress
Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mir (0.10.0+15.04.20150107.2-0ubuntu1) vivid; urgency=medium

Changed in mir (Ubuntu):
importance: Undecided → Wishlist
status: New → Fix Released
Revision history for this message
Laurie Bradshaw (lauriebradshaw) wrote :

I've been trying to integrate with the system rotation instead of doing it myself for neverball, neverputt and tuxracer.

mir_surface_set_preferred_orientation doesn't seem to do anything on my bq aquaris, with or without X-Ubuntu-Supported-Orientations in the desktop file, is this due to missing shell support?

I want to change the orientation according to user preference, but not have the system auto rotate, as that conflicts with using the accelerometer to control the game.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Added a QtMir task. The required glue may be absent.

Revision history for this message
Gerry Boland (gerboland) wrote :

@lauriebradshaw
thanks for the comment, this is on our todo list. As you're missing this, we'll try bump it up the list
-G

summary: - [Enhancement] Add an API to lock surface orientation
+ [Enhancement] Add an API to adjust preferred surface orientation at
+ runtime
Changed in qtmir:
status: New → Triaged
importance: Undecided → High
Changed in qtmir (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Michal Predotka (mpredotka) wrote :

I'm looking forward to this feature. I have an which displays moving text. It would be great if a user could decide if she wants the text displayed in portrait or landscape regardless of phone orientation and if that orientation is locked or not.

Michał Sawicz (saviq)
Changed in qtmir (Ubuntu):
status: Confirmed → Triaged
no longer affects: qtmir
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers