getWidth on WindowDialog doesn't return correct screen width value
#1
I'm running Frodo with Raspbmc and having a hard time with the coordinate system for laying out controls. When I call WindowDialog, "0,0" corresponds to the top left corner and "0,getHeight()" corresponds to the bottom left corner, but "getWidth(), 0" does not correspond to the top right corner.

I'm running a 1920x1200 display, but for some reason getWidth() = 1152 and getHeight() = 720. That said, 720 does map to 1200 in the sense that it is the bottom of the screen. However, 1152 is not the far right side of the screen...it is short by a few inches.

Does anyone have any experience dealing with anything like this? Some seemingly relevant details from my xbmc.log file are below. Does anyone know why GUI format might be 1152x720 and Display is 1920x1200? Not sure I understand why these are not the same...


Code:
00:13:55 T:3038449664    INFO: GUI format 1152x720, Display 1920x1200 @ 60.00 - Full Screen

Code:
00:13:52 T:3038449664  NOTICE: Found resolution 640 x 480 for display 0 with 640 x 480 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 720 x 480 for display 0 with 720 x 480 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 1280 x 720 for display 0 with 1280 x 720 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 720 x 576 for display 0 with 720 x 576 @ 50.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 640 x 480 for display 0 with 640 x 480 @ 75.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 800 x 600 for display 0 with 800 x 600 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 800 x 600 for display 0 with 800 x 600 @ 75.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 960 x 720 for display 0 with 1024 x 768 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 960 x 720 for display 0 with 1024 x 768 @ 70.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 960 x 720 for display 0 with 1024 x 768 @ 75.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 1152 x 720 for display 0 with 1280 x 800 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 960 x 720 for display 0 with 1280 x 960 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 900 x 720 for display 0 with 1280 x 1024 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 900 x 720 for display 0 with 1280 x 1024 @ 75.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 1152 x 720 for display 0 with 1440 x 900 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 1152 x 720 for display 0 with 1680 x 1050 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found resolution 1152 x 720 for display 0 with 1920 x 1200 @ 60.000000 Hz
00:13:52 T:3038449664  NOTICE: Found ([email protected]) at 32, setting to RES_DESKTOP at 16
00:13:52 T:3038449664  NOTICE: Checking resolution 16
00:13:52 T:3038449664   DEBUG: EGL set HDMI mode (2,68)=0
00:13:52 T:3002070080   DEBUG: EGL tv_service_callback (8,2,68)
00:13:52 T:3038449664   DEBUG: EGL set resolution 1152x720 -> 1920x1200 @ 60.00 fps (2,68) flags:44020004 aspect:1.00
00:13:52 T:3038449664   DEBUG: CreateWindow: Created surface of size 1152x720
Reply
#2
It seems that XBMC provides 16x9 of visible canvas despite the fact that a screen may actually be 16x10 (1920x1200). If you have a 16x10 screen, to be able to use the full visible screen as your canvas use getHeight() as is for your height dimension and use ((getWidth() / 1.6) * 1.77777) as your width dimension. This calculation converts 1152 wide (the 16x10 value) into 1280 (the 16x9 value), which turns out to be the true width of the visible screen. If you use getWidth() without this conversion you will have an unused 128 pixel stripe down the right hand side of the screen.

If anyone else knows how to deal with this in a less hacky manner...or the best route to submit an issue request to the XBMC team to correct this, please let me know.
Reply

Logout Mark Read Team Forum Stats Members Help
getWidth on WindowDialog doesn't return correct screen width value0