Single instance
#1
When running xbmc under windows , sometimes xbmc losses focus (other program popups or windows key get pressed for example) and its seems kinda hard to make xbmc be focused again (with out using a mouse).

Running xbmc again doesn't seem to help (many programs implement single instance policy that if the process is executed again and its already running the existing instance get focused) so assigning that command to the remote button doesn't help.

I wrote loader program that checks if xbmc is running , if its running the set focus on that instance if not execute the xbmc.exe, but i can just wonder if there is a "built in" solution to this scenario.
Reply
#2
Question 
hagayg Wrote:When running xbmc under windows , sometimes xbmc losses focus (other program popups or windows key get pressed for example) and its seems kinda hard to make xbmc be focused again (with out using a mouse).

Running xbmc again doesn't seem to help (many programs implement single instance policy that if the process is executed again and its already running the existing instance get focused) so assigning that command to the remote button doesn't help.

I wrote loader program that checks if xbmc is running , if its running the set focus on that instance if not execute the xbmc.exe, but i can just wonder if there is a "built in" solution to this scenario.

Does your program have the ability to detect if XBMC has lost focus and automatically restore it?
Reply
#3
No , the loader doesn't do that at the moment , i don't really that feature and this kinda of feature will annoy when you just want to switch to other application the xbmc will steal the focus again (so you'll have to quite xbmc in order to switch to other application).

But i guess it could be done as a parameter in the command line.
Reply
#4
If XBMC is already running, and you run it again, the focus will be returned to the running instance. If this isn't happening for you that's something we should look into.

JR
Reply
#5
Well the issue I have is that XBMC minimises to taskbar as if it has lost focus, but it still appears to be the focused program (my remote still works). I'd guess, therefore, that's why starting XBMC again doesn't do much to put it back on the screen.

I have joined another thread discussing this issue at: http://forum.xbmc.org/showthread.php?p=9...post952882

If your this app that you have made can install a keyboard hook, could it potentially tell the difference between XBMC losing focus or being minimised, and the user pressing ALT+TAB or WIN to perform other tasks? I'm given to understand that it would require polling the keyboard every 30ms or so and that you can't check for the "ALT has been pressed since you last checked" message or whatever it is, because it has been depreciated in some way and is only useful for 16-bit apps - at least that's what my coder buddy tells me.
Reply
#6
DarkJester Wrote:Well the issue I have is that XBMC minimises to taskbar as if it has lost focus, but it still appears to be the focused program (my remote still works). I'd guess, therefore, that's why starting XBMC again doesn't do much to put it back on the screen.

Hmm, that's a new one to me. If XBMC has the focus pressing \ twice should fullscreen it again. Since your remote (probably) doesn't have a backslash button you can map any convenient button to the ToggleFullScreen action.

JR
Reply
#7
jhsrennie Wrote:Hmm, that's a new one to me. If XBMC has the focus pressing \ twice should fullscreen it again. Since your remote (probably) doesn't have a backslash button you can map any convenient button to the ToggleFullScreen action.

JR
jhsrennie, unfortunatelly, using the "\" key or using "ToggleFullScreen" action did not solve the problem. I'm experiencing the same problem with Advanced Launcher. If I use XBMC into true fullscreen mode and start an application... when the application is closed, XBMC do not return to fullscreen but stay really focused into the taskbar. To try to solve that, I have added an option into Advanced Launcher to use xbmc.executehttpapi("Action(199)") before starting the application and after the application was closed... but it did not solve the problem : XBMC stay minimized and focused into the taskbar. Also, when XBMC is into this state :
  • pressing "\" key 1 time do nothing,
  • pressing "\" key 1 more time give a black fullscreen (seems XBMC is fullscreen but no way to control it),
  • pressing "\" key another time minimize XBMC to taskbar (XBMC still focused),
  • pressing "\" key another time return to the black fullscreen,
  • etc...
Using the "Enter" key, instead of the "\" give the same results.

The only way I have found to get back XBMC to focus is to click on XBMC application into the task bar or use ALT+TAB keys.
Reply
#8
The way to solve this problem is to simply maximize XBMC. I'm using the small nircmd application to automatically do it using the command line :
Code:
nircmd win max process XBMC.exe
If you are under Windows 7 your can also maximize XBMC using Win+Up Arrow keys.
XBMC have the Minimize built-in function to minimize XBMC. Why XBMC do not have a similar built-in function to maximize it ??
Code:
xbmc.executebuiltin('Maximize')
Reply

Logout Mark Read Team Forum Stats Members Help
Single instance0