Posts: 6,810
Joined: Jul 2010
Reputation:
198
Are you doing this on XBMC?
Posts: 112
Joined: Jan 2012
Reputation:
3
Sorry for not giving the full background story. I'll explain a little more. I want to have an absolute pointing device such as the Wii remote to navigate the menus in xbmc. The existing methods of doing this in Linux involve using old userspace drivers that perform poorly in that they give very inaccurate pointing and they are poorly made. The more modern approach is to use the hid-wiimote kernel module and to create a userspace tool to interact with the driver using the libxwiimote.so library. There is no way of doing this yet as nobody has made any userspace mouse emulation that uses the IR of the wiimote and user absolute, not relative, pointing. I decided to take a shot at it.
The method I am taking is using the data that I poll from the wiimote to determine and exact X,Y coordinate to warp the mouse to. I can call this code in a loop where I continuously poll the wiimote and warp the pointer. I dont have everything working yet as I am not the most experienced in this area but it is a challenge that I am up for in my spare time. When I call the above mentioned code in c I can get the mouse to warp to a set of absolute coordinates as long as xbmc is in windowed mode. Also using something like xterm works as it is windowed too.
The problem is when I put xbmc in full screen. The same code starts warping the mouse relative to its current position and not from the top left of the xbmc window. I am trying to figure out if full screen in xbmc is just a windowed mode that takes up the entire screen and that is positioned perfectly to hide the window decoration or is it something else all together? I'm fighting the warping and having a hard time getting it to go to absolute coordinates when in full screen so I am trying to figure out more about the way full screen works or I am looking for any hints that might help me figure out the path forward. The end goal is to use my wiimote with the kernel driver and the user space application I am creating to provide a way to accurately control xbmc.
Posts: 112
Joined: Jan 2012
Reputation:
3
Thanks for the feedback. I tried using all top level windows as well as the re-parented child window for GL and I still have the same issue. Mouse warping is always relative not absolute while in full screen. The current work around I am using is setting XBMC to windowed mode and setting the windowed mode width and height to that of the screen resolution in advancedsettings.xml. Not the most robust solution, but it keeps me moving forward. I can work with this for now but I wish I knew why I cant do an absolute warp in fullscreen.
I noticed that other programs such as ZSNES do the same thing. Windowed mode will do absolute warping and the same code in full screen only does relative. I bet it is SDL based too. Probably something to do with the way SDL functions.
Posts: 6,810
Joined: Jul 2010
Reputation:
198
SDL sets the override redirect flag on the fullscreen window. This shouldn't be done when running inside a window manager.