Wrong screen rotation at login

Bug #1316901 reported by Pierre van Male
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Light Display Manager
New
Undecided
Unassigned
meta-gnome3 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Dear all,

I am experiencing a small, but annoying problem with the screen rotation that seems to be a bug.

I am running Ubuntu (unity) 14.04 on an x220t (thinkpad convertible into tablet). There is a rotation button on the screen that makes the screen rotate 90º counter-clockwise (the showkey command return the number 154 when this button is pressed).

This was working from fresh install of Ubuntu (therefore not linked to an additional package alike think-rotate). It does rotate the screen, but not the touchscreen input (finger for example), which makes it pretty useless (the install of the thinkpad-scripts package, ppa:martin-ueding/stable, solved the issue of the screen rotation for me).

The problem is that this rotation button is not only useless, it results with the screen having a wrong rotation at next login.

Following this thread: http://ubuntuforums.org/showthread.php?t=2190452, I realized that pressing the rotation button generate the creation of the ~/.config/monitor.xml file. Then, before rebooting the computer, the line 13 of this file indicates the current rotation (" <rotation>normal</rotation>". However, after reboot and login, the rotation indicated in this file has been changed to the previous position and result in the screen being wrongly rotated. For example, if the rotation was "normal", after reboot, it is "right".

I have not yet figured out if this happen during the log off, the shutting down, the booting or the login process.

The temporary solution is to delete this monitor.xml file (otherwise, the screen is systematically rotated 90º clockwise after login.

Tags: monitor.xml
Revision history for this message
Pierre van Male (vmalep) wrote :

Small addition: the monitor.xml file is modified during the login process. I rebooted and logged in in a terminal before logging in with the graphical interface and the line 13 in the monitor.xml file was still on "normal". Then I logged in with the graphical interface and the line 13 was on "right" position.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in meta-gnome3 (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Holz (daniel-holz91) wrote :

The thread in the Ubuntu forum was created by me. :D

I'm using Ubuntu 14.04 on my a tablet and whenever I turn the screen with the accelerometer, the screen is turned after the next login again. That even happens if I turned the screen back to normal again before.

If I delete monitors.xml everything works fine.

Revision history for this message
Daniel Holz (daniel-holz91) wrote :

I think I finally found the reason for the problem. Everytime the orientation is changed the new orientation is saved in monitors.xml while the original monitors.xml is saved as monitors.xml.backup. By playing around with chattr I found out that this causes Ubuntu to try to restore monitors.xml out of monitors.xml.backup after every login.

So if I turn the screen to the left and then back to normal, monitors.xml says "orientation=normal" and monitors.xml.backup says "orientation=left". After the login Ubuntu overwrites monitors.xml with the backup and uses its configuration and turns the screen to the left.

Revision history for this message
Daniel Holz (daniel-holz91) wrote :

The problem is also happening on the login screen if it was turned.

Revision history for this message
Pierre van Male (vmalep) wrote : Re: [Bug 1316901] Re: Wrong screen rotation at login

And also when you unplug the an external screen, I believe.

Pierre
On 13 Jun 2014 19:01, "Daniel Holz" <email address hidden> wrote:

> The problem is also happening on the login screen if it was turned.
>
> ** Also affects: lightdm
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1316901
>
> Title:
> Wrong screen rotation at login
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/lightdm/+bug/1316901/+subscriptions
>

Revision history for this message
Daniel Holz (daniel-holz91) wrote :

I think I found a workaround: an init-script, that removes monitors.xml and monitors.xml.backup on shutdown and reboot.

Start Gedit as root.

sudo gedit

Copy the following lines

#!/bin/sh
rm /home/USERNAME/.config/monitors.xml
rm /home/USERNAME/.config/monitors.xml.backup
rm /var/lib/lightdm/.config/monitors.xml
rm /var/lib/lightdm/.config/monitors.xml.backup
exit 0

Exchange USERNAME with your own and save the script in /etc/init.d.
File-name doesn't matter. I called it "orientation".

After that make the script executable.

sudo chmod +x /etc/init.d/orientation

And create a link to the script, so it gets executed on shutdown an reboot.

sudo update-rc.d orientation start 1 0 6 .

Revision history for this message
Pierre van Male (vmalep) wrote :

Thanks,

I will test it.

Rather than entering my username, I put an asterisk "*", as it can be
applied to all the users anyway.

BR
Pierre

2014-06-15 16:57 GMT+03:00 Daniel Holz <email address hidden>:

> I think I found a workaround: an init-script, that removes monitors.xml
> and monitors.xml.backup on shutdown and reboot.
>
> Start Gedit as root.
>
>
> sudo gedit
>
>
> Copy the following lines
>
>
> #!/bin/sh
> rm /home/USERNAME/.config/monitors.xml
> rm /home/USERNAME/.config/monitors.xml.backup
> rm /var/lib/lightdm/.config/monitors.xml
> rm /var/lib/lightdm/.config/monitors.xml.backup
> exit 0
>
>
> Exchange USERNAME with your own and save the script in /etc/init.d.
> File-name doesn't matter. I called it "orientation".
>
> After that make the script executable.
>
>
> sudo chmod +x /etc/init.d/orientation
>
>
> And create a link to the script, so it gets executed on shutdown an reboot.
>
>
> sudo update-rc.d orientation start 1 0 6 .
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1316901
>
> Title:
> Wrong screen rotation at login
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/lightdm/+bug/1316901/+subscriptions
>

Revision history for this message
Pierre van Male (vmalep) wrote :

Hi,

The script from Daniel works for me too, but only with the login of the user, not the "*"...

BR
Pierre

Revision history for this message
Saint DanBert (saintdanbert) wrote :

I, too, have this problem. I'm running Linux Mint 17.1 which is based on *buntu 14.04.
I have a ThinkPad X220-tablet. As I recall, I had a similar issue with earlier editions of Mint
based on *buntu 12.04.

{SOAPBOX}
Now that "tablets" and 2-in-1 laptops are fashionable, this user would appreciate some attention paid to the various aspects of Thinkpad X60t, X61t, X200t, X201t, X220t, and later models. X11/Xorg configuration has evolved from manual edits to auto-magic configuration making it very difficult for folks to make reasonable, much less optimal, use of their now very cool workstations.
{/SOAPBOX}

~~~ 8d;-/ Dan

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.