Fullscreen XBMC on one monitor, usable mouse/keyboard on another.
#16
bdallen Wrote:I was curious about this, so I tried to create a simple SDL application exhibiting the fullscreen-mouse-grabbing behavior. Turns out it happens whenever you set the video mode to fullscreen, so I would say it really is a limitation of SDL, and the only way around it is changing SDL.

Here's the code I used if anyone is curious. Note that most of the code has to do with making q and Esc quit the demo and printing error messages if something goes wrong. The only relevent line is really the call to SDL_SetVideoMode with the SDL_FULLSCREEN flag.

If someone submitted a patch to SDL with a non-mouse grabbing fullscreen mode, that would be awesome, but I have no idea how complicated this would be.

Code:
#include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    SDL_Surface *screen;
    if(SDL_Init(SDL_INIT_VIDEO) != 0)
    {
        printf("SDL Init failed: %s", SDL_GetError());
        return 1;
    }

    atexit(SDL_Quit);

    screen = SDL_SetVideoMode(1600, 1200, 16, SDL_FULLSCREEN);
    if(screen == NULL)
    {
        printf("Setting video mode failed: %s", SDL_GetError());
        return 1;
    }

    SDL_Event event;
    int quitFlag = 0;

    while(quitFlag == 0)
    {
        while(SDL_PollEvent(&event))
        {
            if(event.type == SDL_KEYDOWN
               && (event.key.keysym.sym == SDLK_q
                   || event.key.keysym.sym == SDLK_ESCAPE))
            {
                quitFlag = 1;
            }
        }
    }
}
Hope you don't mind put I copied you post into its own thread in the development forum, see: http://forum.xbmc.org/showthread.php?tid=37377

Thought it belong better there for code discussion Nod
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#17
typing "wmctrl -x -r xbmc.bin.xbmc.bin -b toggle,fullscreen" doesn't work for me...
Reply
#18
kamistukai Wrote:typing "wmctrl -x -r xbmc.bin.xbmc.bin -b toggle,fullscreen" doesn't work for me...
Make sure you have XBMC set to run in a windowed mode. I did this in beta1 by going to Settings->Appearance->Screen and choosing a Resolution lower than my display resolution - there were no modes with "(Window)" in the name as suggested by the HOWTO.

That being said, it still doesn't work correctly for me - it just forces a windowed XBMC back into fullscreen with a captured mouse.
Reply
#19
I did eventually get wmctrl to work. However there is a much simpler solution if you don't intend to watch videos and work on the other monitor at the same time - eg if you pause video before working on the other monitor anyway.

By default the backslash key toggles fullscreen. So you can just pause, hit "\", do work on the other display, then when finished refocus the XBMC window and hit "\" again.

Also in KDE you can set a window to run "fullscreen" by right clicking on a the titlebar and selecting Advanced->Fullscreen. This is different from the SDL fullscreen mode and does not grab mouse, and is essentially what wmctrl does. So if you don't want to bother with wmctrl or can't get it working, just run XBMC fullscreen, hit "\" to get a titlebar, and enable KDE's fullscreen. Gnome may have something similar.

I'm curious to know if anyone actually uses XBMC and the other monitor at the same time. I think it's possible to create a standard display mode for XBMC which maximizes the window and removes the border. However it looks like a pain to program until the new version of SDL comes out (although the wmctrl code might help).
Reply
#20
bdallen Wrote:I'm curious to know if anyone actually uses XBMC and the other monitor at the same time.

I cannot actually use it this way due to the limitations described in this thread, but my goal was to use the second monitor (a touchscreen) to control XBMC without starting up the first monitor (a theater projector). For instance, when I listed to music only, I do not need to take life off my projector bulb.

Problem is nVidia does not support scaled cloning. Cloning would be the best bet because, ideally, I would like to be able to see the same thing on the secondary monitor as on the primary and XBMC's GUI is well suited to a touchscreen (nice big buttons and icons). However, my second monitor's native resolution is 1024x768 and the theater monitor is 1080p.

Second idea was to set them up as separate X screens and use the web GUI (probably the AJAX version), which works only if I do not have full screen selected in XBMC (due to the mouse capture problem).

I've basically given up until nVidia supports scaled cloning or until XBMC supports Xinerama mode.
Supporter of all things Linux, Android, XBMC and NextPVR
Reply
#21
jkrellner Wrote:Second idea was to set them up as separate X screens and use the web GUI (probably the AJAX version), which works only if I do not have full screen selected in XBMC (due to the mouse capture problem).
Is this really a problem? If your XBMC screen is off anyway, there is no need to run it in fullscreen. Then if you turn it on again and want fullscreen, you can use "\" (or map a remote button to ToggleFullScreen).

What do you mean by Xinerama mode? Does XBMC not work well if you have Xinerama (or TwinView) enabled? Does it fullscreen across both monitors?
Reply
#22
bdallen Wrote:Is this really a problem? If your XBMC screen is off anyway, there is no need to run it in fullscreen. Then if you turn it on again and want fullscreen, you can use "\" (or map a remote button to ToggleFullScreen).

That's an idea. Maybe I'll play with that. Still, the web GUI was only a short-term solution...
Supporter of all things Linux, Android, XBMC and NextPVR
Reply
#23
jkrellner Wrote:That's an idea. Maybe I'll play with that. Still, the web GUI was only a short-term solution...

I struggled with that problem for long, I even started a thread here some months ago. My setup is simple: I have XBMC on tv-out and my monitor shows a kde deskptop. After struggling, I got it to work, I'll check out how I did it tonight and get back to you.
Reply
#24
dgege Wrote:I struggled with that problem for long, I even started a thread here some months ago. My setup is simple: I have XBMC on tv-out and my monitor shows a kde deskptop. After struggling, I got it to work, I'll check out how I did it tonight and get back to you.

Cool. Let me know because when I have full screen enabled, it locks the mouse. The impact of all this is lessened by the existence of XBMC remote for the iPod, which is amazing. Except that I spent $350 for a touchscreen monitor that I have no use for (yet).
Supporter of all things Linux, Android, XBMC and NextPVR
Reply
#25
dgege Wrote:I struggled with that problem for long, I even started a thread here some months ago. My setup is simple: I have XBMC on tv-out and my monitor shows a kde deskptop. After struggling, I got it to work, I'll check out how I did it tonight and get back to you.

Do let us know. I am trying to find a solution too, I am going to use my VGA out to my big screen TV, so I am looking for a way to run XBMC in full screen on the TV and at the same time use my kbd and mouse in KDE/monitor screen.

I am thinking, will KDE's application specific settings, "focus stealing prevention" force XBMC to release mouse and keyboard?
Reply
#26
ok, what I used is the program "switchscreen" (http://users.tkk.fi/~spniskan/switchscreen/). Here is my init file which launches Xbmx (I put it in .kde/Autostart):

-----------------------------------------
#!/bin/sh

killall -9 irexec
killall -9 irxevent
killall -9 XboxMediaCenter
DISPLAY=":0.1" /srv/xbmc/XBMC/XboxMediaCenter -q &
DISPLAY=":0.1" irexec &
DISPLAY=":0.1" irxevent &
sleep 5
switchscreen -c 0,0 0
sleep 2
switchscreen -c 0,0 0
-----------------------------------------

With that setup, whenever kde starts, it launches Xbmc and then switchscreen takes care of putting the mouse back in the right screen. I have to call it twice for some reason, but it works. I use a IR remote to control Xbmc.

Hope that helps anyone!
Reply
#27
Do you (or anyone else) know if switchscreen requires a window manager? I run all this stuff using XBMC Live, so I do not have a window manager installed (nor do I want one).
Supporter of all things Linux, Android, XBMC and NextPVR
Reply
#28
jkrellner Wrote:Do you (or anyone else) know if switchscreen requires a window manager? I run all this stuff using XBMC Live, so I do not have a window manager installed (nor do I want one).

I'm pretty sure it doesn't. All it does is move the mouse from one screen to the other, I don't see why a WM is necessary. It only uses X11 commands. Try it Smile
Reply
#29
I'll give it a shot. I wish I knew about this before unplugging and packing up the touchscreen!
Supporter of all things Linux, Android, XBMC and NextPVR
Reply
#30
The command:
wmctrl -x -r xbmc.bin.xbmc.bin -b toggle,fullscreen

Doesnt work anymore after I upgraded to Jaunty. XBMC just stays windowed...not going fullscreeen.

Just to have my mouse untrapped, I'm thinking of going back to Hardy heron.

I run XBMC on Ubuntu Jaunty, with the nvidia-glx 180 driver (nvidia 8500 gt card).

Anybody knows what to do?
Reply

Logout Mark Read Team Forum Stats Members Help
Fullscreen XBMC on one monitor, usable mouse/keyboard on another.1