Kodi Community Forum

Full Version: Rotating desktop, xbmc does not scale itself
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

When I rotate my desktop using "xrandr -o right/left" xbmc doesnt scale itself. I have to do this for a project. What could I do to fix this? I tried to match the source-code but I didn´t get any results.

I am using Fedora 16 with KDE.
I've been over this with another user. As far as I understand, XBMC is doing everything correctly in choosing rotations (it does rotate, it just doesn't scale correctly).

However, the scaling works fine if you do NOT have rotation (eg setup a skin with a 9:16 skin resolution, use a 9:16 window to run XBMC in and things scale just fine).

What I believe is happening is that the width and height are not being interchanged somewhere in the GL matrix setup - thus, XBMC thinks it's rendering to a screen that's 1280x720 whereas it's actually 720x1280 (due to rotation) and thus the scaling in the horizontal and vertical directions is interchanged.

As I don't have such a setup I can't do much more than that. I'd suggest starting with the TestRender() routine in the GL renderer and get that displaying correctly - once you've fiddled around with the GL matrices there, you probably have a good idea of what is going on.

As I understand, this already works fine on win32 (directX) so is likely going wrong at the renderer level.

Cheers,
Jonathan
Rotation with RandR should be transparent to the applications, what I think happens is XBMC makes its window the same size as the display resolution, but this only works right if you have an upright or upside down orientation, or a square resolution.
XBMC (Linux) does not refresh it's window when receiving an xrandr event from outside. In the context of my work for xvba I have created a patch for this because on HD2000 series menu was scrambled after refresh rate was set back to desktop resolution. SDL ignores xrandr events if not explicitly configured.

I will submit this as a PR to mainline:
https://github.com/FernetMenta/xbmc/comm...d544ae2f1b
So I only have to replace my WinSystemX11.cpp and WinSystemX11.h with your files or did you edit other files too? I have tried this but it didnt work. Sad Thanks for your help so far Smile
I have tried today and it did work. (of course I had to enable rotate in xorg: Option "RandRRotation" "True"). What has been the problem and what version do you use?
(2012-04-05, 09:44)FernetMenta Wrote: [ -> ]XBMC (Linux) does not refresh it's window when receiving an xrandr event from outside. In the context of my work for xvba I have created a patch for this because on HD2000 series menu was scrambled after refresh rate was set back to desktop resolution. SDL ignores xrandr events if not explicitly configured.

small addition: also HD3000 and HD4000 series have the GUI scramble problem
I am using XBMC-11.0 Eden. In xorg.conf I added Option "RandRRotation" "true" under Section Device. Then I rotated my desktop using xrandr and then I started XBMC via console. What exactly does RandRRotation do?
Oh^^ XBMC does not scale itself. I have tried to replace the WinSystemX11 files with yours. Didn´t work for me.
Ah OK. I did not get you right first. The patch allows you to execute xrandr while XBMC is already running. But this does not solve your problem. The point is that current rotation is ignored for scaling. XBMC will always scale to the original x,y dimensions of a selected mode.
Hmmmm...still thanks for your help Wink
What if i just interchange the x and y coordinates of the selected mode? If I have understand you right, that could solve my problem because XBMC always scales to the x and y of the selected mode...Or am I wrong?
That's the problem, yes.