IsOnTop visibility
#1
Hi I'm having trouble with something that seems like it should be straightforward, so apologies in advance if I'm being stupid...

I want some of the content on certain screens, such as myvideonav.xml or home.xml to only show when there are no dialog windows open on top. I also want this behaviour on the dialogs themselves, so some content is hidden when another dialog is opened on top of it.

1) I thought this would be relatively simple case of adding a visibility condition to the content with !Window.IsTopMost(id) giving the id as the current showing window, so as soon as the current window isn't topmost, the content will be hidden. But this does not work.

In my testing, it seems that even though the debug info says Window: home (Home.XML) for example, Window.IsTopMost(home) DOES NOT equal true. Similarly on MyVideoNav, Window.IsTopMost(videos) doesn't return True. Are there hidden windows in operation above these in the stack?

2. I also thought of trying Control.HasFocus(id) assuming that a control on MyVideoNav such as a container displaying videos would lose focus when a dialogwindow is open on top. But this also doesn't work.

When the debug info says Focused: 504 (Panel), for example, using the visibility condition <visible>Control.HasFocus(504)</visible> does not have the impact of hiding the content when a dialogwindow is open, even when the debug info shows Focused as something else, such as 6002 (List) when my shutdownmenu dialog is open.
Reply
#2
Your custom debug overlay window is always going to be on top because it is always visible.

Visibility conditions before the <controls> tag set when the window is visible. So your <visible>!Window.IsVisible(startup)</visible> in the debug overlay is going to make it always visible and, due to its zorder, will always be on top.

So that you can actually disable the window, you would need to use a condition something like:
<visible>[Skin.HasSetting(DebugInfo) | Skin.HasSetting(DebugGrid)] + !Window.IsVisible(startup)</visible>
Reply
#3
Ahhh great thanks so much @jurialmunkey!
Reply
#4
Hmmm, still no luck. I tried disabling custom_debug_overlay. Then I ran a test with a small label control on Home page with a visibility condition of Window.IsTopMost(home) and it still won't show. I tried the ids for all the custom windows, so I don't think it's one of them. And I checked for any visibility conditions before the <controls> tag and couldn't find any or any zorders apart from that custom_debug_overlay. So I've got no idea again...
Reply
#5
i didnt look at your code

on content windows like (videonav,musicnav etc) i suggest use a fade animation for the group you like to to hide,

<animation effect="fade" start="100" end="0" time="200" tween="sine" condition="$EXP[Infodialog_IsActive]">Conditional</animation>

For the dialog itself, you can do something similiar. Or use Visibilty conditions based on propertys

e.g.

SetProperty(InfoDialogActive_hidecontrol,0815,home)

String.IsEqual(Window(home).Property(InfoDialogActive_hidecontrol),0815)

EDIT:
in addition and offtopic but may also usefull

i would also suggest using an include for your debug overlay instead of a window ,

  <controls>
...
...
     <include content="debug_overlay" />
  </controls>
</window>

<include name="debug_overlay">
        <control type="group">

            <visible>Skin.HasSetting(CustomDebug)</visible>
           
---yourstuff---
</include>


And use a toogle function as keymap.xml,
<F6>Skin.ToggleSetting(CustomDebug)</F6>

I found it more practical, than use a custom window, which isnt always avail, so it saved some more visibility conditions
Skins                                                                                        
Reply
#6
Thanks @mardukL , this is working well using the window property method!
Reply
#7
(2019-11-16, 23:59)QuizKid Wrote: Thanks @mardukL , this is working well using the window property method!
On issue I foresee, though, is when you have multiple dialogs open at once. If each sets the window property to hide the required content to true at <onload> then back to false at <onunload>, then if you for example opened the contextmenu, it would hide the content, then if you brought up the shutdownmenu, the content would stay hidden, but then when the shutdownmenu was closed, it the window property would be returned to false so the content would be visible even though the contextmenu was still visible over the top.

This starts getting very complicated in a way that would be easily avoidable if I could get Window.IsTopMost to work properly. Then I could just have the content visible while the window it's displayed in is at the top of the stack with a parameter. Urgh, very frustrating!!
Reply
#8
If enable debug mode does it any other windows/dialogs as visible?
Reply
#9
(2019-11-17, 10:50)Hitcher Wrote: If enable debug mode does it any other windows/dialogs as visible?

No, it doesn't show anything else in the list of open windows
Reply
#10
(2019-11-17, 00:44)QuizKid Wrote:
(2019-11-16, 23:59)QuizKid Wrote: Thanks @mardukL , this is working well using the window property method!
On issue I foresee, though, is when you have multiple dialogs open at once. If each sets the window property to hide the required content to true at <onload> then back to false at <onunload>, then if you for example opened the contextmenu, it would hide the content, then if you brought up the shutdownmenu, the content would stay hidden, but then when the shutdownmenu was closed, it the window property would be returned to false so the content would be visible even though the contextmenu was still visible over the top.

This starts getting very complicated in a way that would be easily avoidable if I could get Window.IsTopMost to work properly. Then I could just have the content visible while the window it's displayed in is at the top of the stack with a parameter. Urgh, very frustrating!!  
i never tested Window.IsTopMost .-( ...

May you get incorrect result if you use dubug overlay as WINDOW instead of an 'group' , i read also somewhere that zorder got some issues.

I suggestest using
setproperty as custom onclick, not as default onload.
(if you wanna hide/show show specific controls inside your current dialog/window, but it'll fail on other usage)
e.g.

<oninfo>Action(info)</oninfo>
<oninfo>SetProperty(home,hide77,value)</oninfo>

or

<onclick>SetProperty(dialog,hide88,home)</onclick>
<onclick>SetProperty(dialog,hide77,home)</onclick>

You'll just have to clear the prop onuload in the window you'll like to clear
<onunload>ClearProperty(dialog,home)</onunload>

(home) -> e.g. fade out
id(99) by animation or by visibility cond $EXP[Infodialog_IsActive] (if you like to have other stuff of (home) visible in dialogs)
<expression name="Infodialog_IsActive">Window.IsActive(musicinformation) | Window.IsActive(songinformation) | Window.IsActive(movieinformation) | Window.IsActive(addoninformation) | Window.IsActive(pvrguideinfo) | Window.IsActive(pvrrecordinginfo) | Window.IsActive(pictureinfo)</expression>
   
 -home active -> click info for an item -
      (movieinformation) should be top most and now over (home) and home id(99) is fadedout=0 or not visible  - click 's' key (shutdownmenu)

- home + movieinformation + dialogbutton(is top most) are visible , so i think
 (- so my suggested methos with setprop is supposed to used as onclick/onfocus action for containers/items can fail here if you press key instead of custom button -
so better define and use visibility condition like

- !Window.IsTopMost(movieinformation) , should be true  here
     if not you'll need to define an visible cond with all posibilitys

Window.IsActive(dialogbuttonmenu) | Window.IsActive(shutdown) ...



So, if you use that labels as debug overlay may also can help (dont use it in a debug window, which will result in getting incorrect labels)

Property(xmlfile) :     $INFO[Window.Property(xmlfile)]
System.CurrentWindow :     $INFO[System.CurrentWindow]


Currently Hidden id Window(home).Property(dialog) :  $INFO[Window(home).Property(dialog)]

Sorry if this can be hardly readable,as it is not well written. i'am a bit tired, but i hope you get me ;-)
Skins                                                                                        
Reply
#11
Hi again, i tested Window.IsTopMost now

Its not working if Skin.ToggleDebug is enebled/true
tested with fade anim, hide control group in Window(addonbroser) if Window(addoninformation) IsTopMost.
<animation effect="fade" start="100" end="0" time="200" tween="sine" condition="Window.IsActive(AddonBrowser) + Window.IsTopMost(addoninformation)">Conditional</animation>

As soon as i eneble debug mode via key (skin.toggledebug) , Window.IsTopMost gets corrupted by toggle debug

In Video you'll see that a group in the middle will be visible, trough toggle debug
Window.IsTopMost(addoninformation) is return false in that case.

Unsure if that helps, but at least its interesting
Skins                                                                                        
Reply
#12
(2019-11-18, 11:21)mardukL Wrote: Hi again, i tested Window.IsTopMost now

Its not working if Skin.ToggleDebug is enebled/true
tested with fade anim, hide control group in Window(addonbroser) if Window(addoninformation) IsTopMost.
<animation effect="fade" start="100" end="0" time="200" tween="sine" condition="Window.IsActive(AddonBrowser) + Window.IsTopMost(addoninformation)">Conditional</animation>

As soon as i eneble debug mode via key (skin.toggledebug) , Window.IsTopMost gets corrupted by toggle debug

In Video you'll see that a group in the middle will be visible, trough toggle debug
Window.IsTopMost(addoninformation) is return false in that case.

Unsure if that helps, but at least its interesting

Thanks @mardukL for the help. I'll check out your advice and info tonight, but I think it's a big help! Much appreciated Smile
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
IsOnTop visibility00