[Sugar-devel] prevent screen rotation in a sugar activity?

Jon Nettleton jon.nettleton at gmail.com
Wed Jan 26 21:02:25 EST 2011

> Is there really no way to know when the Record activity is "upside down" on
> the 10.1.3 xo (and as a result xvimagesink in the wrong place)?

Your question is a bit unclear so here are a few scenarios and answers.

If you are looking to query what the current rotation of the screen is
then you could use a python module like python-xrandr to query that
property.  Of course you could also get the dimensions of the gdk
screen and compare width to height to gather that info as well.

To know when a screen has changed you will need to attach a function
to the  GdkScreen's "size-changed" signal.  Once you get that signal
you could use either of the above methods to figure out the rotation
and re-layout appropriately.

There is nothing specific within Gdk that allows you to request a
screen orientation.  It has been a while but I believe that the Maemo
guys added a window property that could be set to force a specific
rotation.  This could probably be implemented in sugar if really

If you wait just a little while longer we are finishing the bits to get
accelerated xvideo rotation finished.

I hope one or all of these suggestions helps you fix your problem


More information about the Devel mailing list