After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664363 - XF86RotateWindows causes the screen to go black
XF86RotateWindows causes the screen to go black
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xrandr
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-11-19 00:04 UTC by Sjoerd Simons
Modified: 2012-12-19 17:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.64 KB, patch)
2011-11-19 00:04 UTC, Sjoerd Simons
none Details | Review
patch (575 bytes, patch)
2012-12-19 11:19 UTC, Heiher
none Details | Review

Description Sjoerd Simons 2011-11-19 00:04:01 UTC
Created attachment 201692 [details] [review]
proposed patch

When hitting the XF86RotateWindows the screen just goes black instead of actually rotating the screen as intending (with the output turned off).

Turns out that gnome-settings-daemon is trying to rotate the screen to an invalid value.. Fixed in attached patch
Comment 1 Bastien Nocera 2011-11-19 13:00:52 UTC
Good catch. We should be adding a -1 value to the enum though.
Comment 2 Bastien Nocera 2012-03-09 11:10:33 UTC
In gnome-desktop:
commit 1746f00f459b60aa7eb440324da60547ddb1a2ca
Author: Bastien Nocera <hadess@hadess.net>
Date:   Fri Mar 9 12:00:59 2012 +0100

    gnome-rr: Add definition for next rotation
    
    In gnome-settings-daemon's XRandR plugin, we were relying on -1
    meaning "next rotation" so that the "rotate display" button would
    work as expected. But given its values, GnomeRRRotation would
    probably have been made unsigned, and thus never matching -1.
    
    We now add an "next rotation" member for the benefit of that
    XRandR plugin.
    
    Spotted by Sjoerd Simons <sjoerd@luon.net>

and in gnome-settings-daemon:

commit f1ced1b94954e206b8ee41a05b9852810f037af5
Author: Sjoerd Simons <sjoerd@luon.net>
Date:   Fri Mar 9 12:08:16 2012 +0100

    xrandr: Fix the rotate display button not working
    
    When hitting the XF86RotateWindows the screen just goes black instead of
    actually rotating the screen as intending (with the output turned off).
    
    Turns out that gnome-settings-daemon is trying to rotate the screen to
    an invalid value. GnomeRRRotation is an enum with only values >= 0, so
    it is likely to be made unsigned. As the rotation argument to
    handle_rotate_windows can be -1 to indicate ``next possible rotation'',
    rotation can't be a GnomeRRRotation as that won't be < 0.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664363
Comment 3 Heiher 2012-12-19 11:19:27 UTC
Created attachment 231870 [details] [review]
patch

The rotate display button still not working, in handle_rotate_windows function, if rotation = 0, then next_rotation = rotation = 0, get_rotation_index() will failed (g_assert_not_reached() is called).
Comment 4 Bastien Nocera 2012-12-19 17:08:38 UTC
commit 3fa29ef7e3eca5befa5fe2131e66743e8040156e
Author: Heiher <admin@heiher.info>
Date:   Wed Dec 19 18:04:10 2012 +0100

    xrandr: Fix "next rotation" not working
    
    The GNOME_RR_ROTATION_NEXT enum value was not handled correctly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664363