Set a dialog window to never have focus?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #1
I have created a custom window for use with the PM3.HD skin that displays system time etc when OnClick activated by the Button Menu. I want this to stay onscreen until I click the same Button Menu button again, but since the custom window has focus it renders XBMC unusable until you press the back button on controller/remote.

Is there a way to make this control never have focus, so it just overlays itself on all windows and makes the GUI behave normally?

Here's a copy of the xml file...

Quote:<window type="dialog" id="4567">
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
<controls>
<!-- OSD -->
<control type="image" id="150">
<description>media info background image 2</description>
<posx>0</posx>
<posy>693</posy>
<width>1290</width>
<height>100</height>
<texture>black-back.png</texture>
</control>
<control type="label" id="16101">
<description>always visible temps</description>
<posx>660</posx>
<posy>693</posy>
<label>CPU: $INFO[System.CPUTemperature] ($INFO[System.CPUUsage]), GPU:
$INFO[System.GPUTemperature], HDD: $INFO[System.HDDTemperature], Fan: $INFO[System.FanSpeed]</label>
<textcolor>white</textcolor>
<align>center</align>
<font>font8</font>
</control>
<control type="label" id="170">
<description>always visible player time</description>
<visible>Player.HasMedia</visible>
<posx>1260</posx>
<posy>693</posy>
<label>$INFO[VideoPlayer.Time]$INFO[Player.Duration, / ]</label>
<textcolor>green</textcolor>
<align>right</align>
<font>font8</font>
</control>
<control type="label" id="171">
<description>always visible no player</description>
<visible>!Player.HasMedia</visible>
<posx>1260</posx>
<posy>693</posy>
<label>No file loaded</label>
<textcolor>green</textcolor>
<align>right</align>
<font>font8</font>
</control>
<control type="label" id="180">
<description>always visible system time</description>
<visible>!System.HasAlarm(shutdowntimer)</visible>
<posx>10</posx>
<posy>693</posy>
<label>$INFO[System.Time]</label>
<textcolor>green</textcolor>
<align>left</align>
<font>font8</font>
</control>
<control type="label" id="190">
<description>always visible system time & shutdown</description>
<visible>System.HasAlarm(shutdowntimer)</visible>
<posx>10</posx>
<posy>693</posy>
<label>$INFO[System.Time] (Shutdown Timer: $INFO[System.Alarmpos])</label>
<textcolor>green</textcolor>
<align>left</align>
<font>font8</font>
</control>
</controls>
</window>
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #2
The way to do this is to have the <visible> of the window depend on a skin bool, then toggle that skin bool on the click of the button.

Cheers,
Jonathan

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.


[Image: badge.gif]
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #3
jmarshall Wrote:The way to do this is to have the <visible> of the window depend on a skin bool, then toggle that skin bool on the click of the button.

Cheers,
Jonathan

I've added "<visible>System.HasSetting(display)</visible>" to the custom window xml just after setting window id/overlay/animation and set the Button menu to toggle using Skin.SetBool(display) to enable and Skin.Reset(display) to disable but it doesn't toggle the window. Do I need to change something in the Settings.xml file?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #4
Skin, not System - you have a Skin bool.

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.


[Image: badge.gif]
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #5
Okay I've changed the trigger button to <onclick>Skin.SetBool(display)</onclick>, the reverse trigger to <onclick>Skin.Reset(display)</onclick> and the custom window has <visible>Skin.HasSetting(display)</visible> right after the <window type="dialog" id="4567"> so before all the controls.

Although the trigger buttons, which have different labels, are changing between states the custom window is never shown. Do I have to set conditional visibility tags for all the seperate window controls/images, is that why it isn't loading the window?

As a stopgap I've been using System.HasNetwork tag trigged by the XBMC.ActivateWindow boolean, which loads the window in a way that disables the GUI, then after pressing back functions as it should. This leads me to believe the window isn't triggering because it isn't loading at boot time, which I don't understand because I've named the window "Custom1.xml" and then "Custom1_SkinSetting.xml" in line with the wiki documentation.

What am I missing here?
(This post was last modified: 2010-04-06 13:19 by zackpliskin.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #6
If the window loads via ActivateWindow() then XBMC knows about it, so the naming of it isn't the problem.

All it needs is type="dialog" and a <visible> condition and it should work just fine.

Try with a simple visible condition that you know is triggering (eg control.hasfocus(some_id)) or something.

Cheers,
Jonathan

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.


[Image: badge.gif]
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #7
I tried Window.IsVisible(0), System.Platform.Xbox and a few other things so the custom1 window should show when the home screen pops up after the splash. It doesn't.

Being thorough, I also tried trimming the custom window down by removing the background image and all but one label so all I was getting was the system time in the bottom left corner. I tried changing the <window type="dialog" id="4567"> to seperate <> tags for each parameter. I tried changing the window id numbers as well. I cross-referenced some of these with the <visible> tag tests, but there was no difference.

Probing further, I tried the newest version of the PM3.HD to rule out any potential problems because the version of PM3.HD I run is an older one that I've modified, replacing just the DialogButtonMenu.xml and adding my own custom1.xml file to the 720p skin folder. No luck there: different skin version, same behaviour.

I even tried an older build since I'm using the exobuzz version of XBMC to allow iPlayer to work. I tested by copying my modified PM3.HD skin across. Same behaviour.

Literally the only way I can get this thing to appear is to use XBMC.ActivateWindow() via a button, and it seems that only after that does the conditional visibility of the custom window come in to play.

Perhaps this is a bug of some kind?
(This post was last modified: 2010-04-07 01:49 by zackpliskin.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #8
Can't think of any other reason why it wouldn't work , so there does appear to be a bug. Most strange that something like this has lasted for so long.

Will look into it.

Cheers,
Jonathan

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.


[Image: badge.gif]
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #9
jmarshall Wrote:Can't think of any other reason why it wouldn't work , so there does appear to be a bug. Most strange that something like this has lasted for so long.

Will look into it.

Cheers,
Jonathan

If you need more info on the issue for your own testing (i.e. copy of the files, debug report) let me know. I'm happy to contribute to the development of XBMC; it's good software.
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #10
Incidentally I came up with a temporary solution for this problem: using two <onclick> functions.

The <visible> tag of the custom window uses Skin.HasSetting(osd), and the ID is 666.

For the button which activates the custom window:
Quote:<onclick>Skin.SetBool(osd)</onclick>
<onclick>XBMC.ActivateWindow(666)</onclick>
<visible>!Window.IsVisible(666)</visible>

For the button which deactivates the custom window:
Quote:<onclick>Skin.Reset(osd)</onclick>
<onclick>Close.Dialog(666)</onclick>
<visible>Window.IsVisible(666)</visible>

I'm still getting the problem where the window steals focus when it first appears, necessitating use of the BACK button, but these additions to the XML files have at least given some measure of conditional visibility for now.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #11
r29126 should do the trick.

Cheers,
Jonathan

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.


[Image: badge.gif]
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #12
jmarshall Wrote:r29126 should do the trick.

Cheers,
Jonathan

Thanks dude, I'll check it out. Smile
find quote
zackpliskin Offline
Senior Member
Posts: 145
Joined: Dec 2008
Reputation: 0
Post: #13
Well I've finally had some time to play about with the recent iPlayer compatible version of the Xbox build, r29407 based on the T3CH 27th April build, and sadly the problem remains.

The Skin.SetBool() tag will activate this custom window ONLY if it has been at activated least once already with XBMC.ActivateWindow(). Meaning that from a fresh boot, with only the SetBool tag, the window will never be shown.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #14
I have no idea whether or not the XBox branch has been updated with this fix or not.

Please try one of the platforms we support.

Cheers,
Jonathan

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.


[Image: badge.gif]
find quote