Bug 356228 - DesktopView screen geometry size was strange when kcm_screen rotated 90 degrees then rotated back again
Summary: DesktopView screen geometry size was strange when kcm_screen rotated 90 degre...
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: libkscreen (show other bugs)
Version: git
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Daniel Vrátil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 06:25 UTC by Leslie Zhai
Modified: 2016-04-20 01:37 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
0001-plasmashell-rotate.patch (689 bytes, patch)
2015-12-18 13:32 UTC, Leslie Zhai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leslie Zhai 2015-12-03 06:25:58 UTC
DesktopView screen geometry changed correctly when rotated 90 degrees, but then rotated back again the screen geometry size was strange, shown as https://pbs.twimg.com/media/CVR8VSnUEAAK8cR.png and the right side of DesktopView could not took snapshot by ksnapshot, only left side.

VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
KF5: v5.16.0
Qt5: v5.5.1

Reproducible: Always
Comment 1 Marco Martin 2015-12-03 11:16:06 UTC
there are actually 2 panels?
Comment 2 Leslie Zhai 2015-12-04 01:52:43 UTC
nope, there is ONLY ONE panel! I did NOT add another panels.

1. rotated 90 degree at first, the desktopview is correct
2. then rotated back again, the right side is strange, render more than one panels wrongly!
Comment 3 Leslie Zhai 2015-12-04 02:05:33 UTC
(In reply to Marco Martin from comment #1)
> there are actually 2 panels?

Took photo by mobile phone ;-)

https://pbs.twimg.com/media/CVWLgUPUsAA9X1Q.png

https://pbs.twimg.com/media/CVWLfOPVAAAyH65.jpg
Comment 4 Leslie Zhai 2015-12-10 09:08:45 UTC
but use xrandr it is ok!

xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate normal
Comment 5 Leslie Zhai 2015-12-11 09:19:20 UTC
https://bugreports.qt.io/browse/QTBUG-49902
Comment 6 Leslie Zhai 2015-12-18 13:32:42 UTC
Created attachment 96169 [details]
0001-plasmashell-rotate.patch

monkey patch set config twice:
1. set config once for rotating left && normal, plasmashell QScreen's geometry was wrong
2. set config twice, the plasmashell could work.

PS: when the geometry was wrong, then changed ResolutionSlider to save config, the plasmashell was correct ;-)
Comment 7 Pieterjan Camerlynck 2016-04-18 09:19:17 UTC
https://git.reviewboard.kde.org/r/127656/
Comment 8 Leslie Zhai 2016-04-19 03:03:09 UTC
(In reply to Pieterjan Camerlynck from comment #7)
> https://git.reviewboard.kde.org/r/127656/

Thanks for your great patch, please ship it ;-)
Comment 9 Sebastian Kügler 2016-04-19 11:17:23 UTC
Git commit da2edf3ef61a70eb2fbd7b5e757d605c1f5b000d by Sebastian Kügler.
Committed on 19/04/2016 at 11:14.
Pushed by sebas into branch 'master'.

Verify rotation when updating screen size in XRandR backend

When rotating a single screen to portrait and back to landscape, the
XRandR screen size is not updated.

When for example rotating a display of 1920x1080 portrait, the screen
size is changed to 1080x1920. XRandR::screenChanged() however is called
with rotation = 90 and size = 1920x1080. So the screen size stored
internally remains 1920x1080, instead of being updated to 1080x1920.
When you then rotate the screen back to landscape, it checks the new
screen size (1920x1080) against the stored (1920x1080) and does not
update the screen size (which is at this point 1080x1920).

This should solve https://bugs.kde.org/show_bug.cgi?id=356228 which has
photos of the incorrect behavior.

Patch-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Reviewed-by:Leslie Zhai <xiangzhai83@gmail.com>

M  +6    -2    backends/xrandr/xrandr.cpp

http://commits.kde.org/libkscreen/da2edf3ef61a70eb2fbd7b5e757d605c1f5b000d
Comment 10 Sebastian Kügler 2016-04-19 11:18:52 UTC
Git commit c3cb380aa0835c268a84a4c480854b91ab9a76f2 by Sebastian Kügler.
Committed on 19/04/2016 at 11:18.
Pushed by sebas into branch 'Plasma/5.6'.

Verify rotation when updating screen size in XRandR backend

When rotating a single screen to portrait and back to landscape, the
XRandR screen size is not updated.

When for example rotating a display of 1920x1080 portrait, the screen
size is changed to 1080x1920. XRandR::screenChanged() however is called
with rotation = 90 and size = 1920x1080. So the screen size stored
internally remains 1920x1080, instead of being updated to 1080x1920.
When you then rotate the screen back to landscape, it checks the new
screen size (1920x1080) against the stored (1920x1080) and does not
update the screen size (which is at this point 1080x1920).

This should solve https://bugs.kde.org/show_bug.cgi?id=356228 which has
photos of the incorrect behavior.

Patch-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Reviewed-by:Leslie Zhai <xiangzhai83@gmail.com>

M  +6    -2    backends/xrandr/xrandr.cpp

http://commits.kde.org/libkscreen/c3cb380aa0835c268a84a4c480854b91ab9a76f2
Comment 11 Sebastian Kügler 2016-04-19 11:19:37 UTC
Thanks guys!
Comment 12 Leslie Zhai 2016-04-20 01:37:37 UTC
(In reply to Sebastian Kügler from comment #11)
> Thanks guys!

You are welcome ;-P