Bug 168308

Summary: Rotating desktop/changing orientation doesn't work
Product: [Unmaintained] kephal Reporter: arrenlex
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: notmart, stefnn
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: ksnapshot screenshot of desktop rotated using xrandr
Photograph of screen in xrandr-rotated state.
ksnapshot after returning to normal orientation
small patch that exchanges width<->height when rotated
actually *use* the rotated newSize in the commited patch

Description arrenlex 2008-08-04 10:20:30 UTC
Version:            (using KDE 4.1.0)
Installed from:    Ubuntu Packages
OS:                Linux

I have a tablet pc and am trying to rotate the screen from landscape into portrait mode.

If I use KDE's own orientation box in system settings, there is no effect for any orientation option. It just gives me the "your screen layout has changed, please press accept within 15 seconds to keep it" but the screen remains in standard landscape mode. This is true for all three other orientations.

Using xrandr -o 1 , the desktop will repaint in a rotated state. The panel will divide the monitor from top to bottom about 3/4 of the way, and the right half has the black kdm background (not the blue desktop background!). In this state the desktop does not respond to user input (mouse moves, though) and I have to kill it and return to kdm. If I launch the session remotely (over ssh) I can reactivate the desktop by unrotating it again (success varies). I will attach some screenshots\photographs.

This is kde 4.1.0 from the http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu repository installed as an upgrade to kubuntu hardy kde4-remix. The tablet is running Intel 945 graphics on the i810 driver... wobbly windows work and are fast, transparency works great, but sometimes menus start black or like static and then repaint correctly half a second later. No other display bugs that I've noticed.

I'm happy to provide any more information you need. Hope this gets fixed! :) Rotation worked great in 3.5 using xrandr and I miss that functionality.
Comment 1 arrenlex 2008-08-04 10:22:13 UTC
Created attachment 26620 [details]
ksnapshot screenshot of desktop rotated using xrandr

I rotated my screen over an ssh session, launched ksnapshot, then unrotated it
to make the window appear allowing me to save the file. Compare this to the
photograph of what's actually on the display (upcoming).
Comment 2 arrenlex 2008-08-04 10:24:54 UTC
Created attachment 26621 [details]
Photograph of screen in xrandr-rotated state.

(brightened with the gimp for easier visibility). Note that this differs from
the ksnapshot screenshot in that a) the panel is 3/4 of the way down the
screen, not at the bottom like ksnapshot thinks it is, b) below the panel is
the kdm black background, not white or transparency or squares like ksnapshot
thinks it is.
Comment 3 arrenlex 2008-08-04 10:27:22 UTC
Created attachment 26622 [details]
ksnapshot after returning to normal orientation

This is what happens every time I return to normal orientation. Note 

a) bottom panel is back to the default Oxygen colour scheme, whereas normally I
have a glass theme on it (or maybe it's just the glass theme with a black
background? Hmm..)

b) The almost total lack of desktop except the strip at the top, but that's
hard to miss. :)

c) It's useable in this state... new windows will appear and move over the
black area just fine, it's not a void.
Comment 4 Marco Martin 2008-12-28 20:42:31 UTC
things have changed a bit after this report, since kephal is used now.
however, on my laptop i can still reproduce it and is even worse, also the panel is on a too high position.
it seems that Kephal::ScreenUtils::desktopGeometry() always return the not rotated geometry, i.e on that laptop always 1024x768 rather than 768x1024,
so seems to be a problem in kephal
Comment 5 Marco Martin 2008-12-28 20:42:31 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 stefnn 2008-12-29 15:39:07 UTC
yes, as far as i tested it, kephal always returns the unrotated screen size.

I am not quite sure at which point in the kephal design the rotation should be taken into account and change the screen size when rotated, but I made a patch (that works for me) against /libs/kephal/xrandr12/randrcrtc.cpp from kde 4.2 beta 2 (see attachment).
 
Comment 7 stefnn 2008-12-29 15:40:33 UTC
Created attachment 29727 [details]
small patch that exchanges width<->height when rotated
Comment 8 Marco Martin 2008-12-29 21:12:59 UTC
stefnn: that patch works perfectly here!
can it go in or can cause problems?
Comment 9 Aaron J. Seigo 2009-01-05 05:15:59 UTC
SVN commit 905796 by aseigo:

rotated? then rotate the geometry!
based on a patch by stefnn
BUG:168308


 M  +9 -1      randrcrtc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=905796
Comment 10 stefnn 2009-01-05 15:27:19 UTC
Created attachment 29933 [details]
actually *use* the rotated newSize in the commited patch

Thanks for addressing this issue!
But right now the newSize is being calculated but not used. (see patch attached).
Comment 11 stefnn 2009-03-06 21:38:22 UTC
*bumping this as kephal still does not include the correct patch in kde-4.2.1 and trunk.
Comment 12 Christoph Feck 2009-07-20 13:28:03 UTC
SVN commit 999687 by cfeck:

Actually use the rotated newSize

Patch by stefnn

BUG: 200600
CCBUG: 168308


 M  +2 -2      randrcrtc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=999687
Comment 13 Christoph Feck 2009-07-20 13:30:45 UTC
SVN commit 999689 by cfeck:

Actually use the rotated newSize (backport r999687)

CCBUG: 200600
CCBUG: 168308


 M  +2 -2      randrcrtc.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=999689