Bug 43935 - Add API for finding out the tablet laptop display rotation status
Summary: Add API for finding out the tablet laptop display rotation status
Status: RESOLVED WONTFIX
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-18 10:44 UTC by Carlos Garnacho Parro
Modified: 2013-10-14 07:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch, add tablet-display-is-[present|rotated] (18.23 KB, patch)
2011-12-18 10:44 UTC, Carlos Garnacho Parro
Details | Splinter Review

Description Carlos Garnacho Parro 2011-12-18 10:44:15 UTC
Created attachment 54547 [details] [review]
Patch, add tablet-display-is-[present|rotated]

The tablet rotation status is reported by the linux kernel through SW_TABLET_MODE events from an input device, and upower does already listen to other SW_* events from input devices, so I'm attaching a patch that adds the ::tablet-display-is-present and ::tablet-display-is-rotated boolean properties.

This patch has been tested on an HP Touchsmart TX2 and a Lenovo X220t, both tablet laptops.
Comment 1 Bastien Nocera 2012-01-30 06:08:31 UTC
My first reaction would be that this has nothing to do in upower.

The fact that the device is a "tablet display" should already be exported through other means (libwacom if using the wacom driver for example). If it's not possibel to give more details than that, it's actually pretty useless (how does one know how to associate the XRandR output with the device for example?

The orientation itself could be exported through a udev property, similarly to this:
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=src/extras/accelerometer/accelerometer.c;hb=HEAD#l234
And the input device sending a kevent when it actually changes.
Comment 2 Paul Wolneykien 2012-02-23 13:19:32 UTC
Please, look at my comment to #3421:
https://bugs.freedesktop.org/show_bug.cgi?id=3421#c5

The mentioned tool is also capable to rotate the screen based on data from a gravisensor (accelerometer).
Comment 3 Bastien Nocera 2012-10-05 16:45:29 UTC
I mentioned on linux-input that it would be nicer to have:
- a uevent in the device driver when the state changes
- a property in udev keeping the current state

The user-space code (gnome-settings-daemon) can then do the work to associate the the display with its state, and do the right thing.
Comment 4 Bastien Nocera 2013-10-14 07:10:23 UTC
Closing as per comment 3.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.