Bug Weird focus/unfocus behavior on DialogVideoInfo.xml
#1
Bug 
Hello all,

I have noticed some weird behavior of <onfocus> and <onunfocus> on DialogVideoInfo.xml.
My code looks like:

Code:
<defaultcontrol always="true">9010</defaultcontrol>
  <onunload>ClearProperty(DialogVideoInfo.CurrentView)</onunload>
  <onunload>ClearProperty(DialogVideoInfo.PreviousView)</onunload>
  ...
  <controls>
    <control type="button" id="9010">
      ...
      <onfocus>SetProperty(DialogVideoInfo.CurrentView,9010)</onfocus>
      <onunfocus>SetProperty(DialogVideoInfo.PreviousView,9010)</onunfocus>
    </control>
    ...

When I go into DialogVideoInfo for first time everything is correct, CurrentView is 9010 and PreviousView is empty. But when I leave dialog (onunload should care about cleanup) and open it again i get 9010 in both properties. To me it looks like dialog remember last focused item and unfocuses it after init. When I leave dialog with different button (with similar code) focused I get different number in PreviousView property, so it back ups my guess.

To me it doesn't seem like correct behavior. Should I create ticket for it?
Reply
#2
You need to specify the window if you clear the properties in onunload:

PHP Code:
<onunload>ClearProperty(DialogVideoInfo.CurrentView,movieinformation)</onunload

My guess is that it tries to clear the property in the previous window because that is already active when onunload is executed but I never investigated it further.
Image
Reply
#3
I tried to move my properties to home but it doesn't help. I think properties clearing on onunload works fine even on local window, i checked it with different use-case.
IMHO this problem isn't related to properties. I added

Code:
<onunfocus>Notification(Test,Notification)</onunfocus>

on button which isn't default control and when I leave dialog with that button focused I get no notification. But when I go to dialog again I immediately get notification.
Reply
#4
How to test it on Confluence:
  • In DialogVideoInfo.xml update button with id="5" (lines 957-961) like

    Code:
    <control type="button" id="5">
      <description>Cast/Review</description>
      <include>ButtonInfoDialogsCommonValues</include>
      <label>206</label>
      <onunfocus>Notification(Test,Notification)</onunfocus>
    </control>
  • Go into DialogVideoInfo.xml and focus Cast button.
  • Leave dialog. Nothing happens, no notification.
  • Go into DialogVideoInfo.xml again. Notification immediately appears even when Browse button is focused by default.
Reply
#5
That seems reasonable to me - after all, the control has lost focus, right?
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
Reply
#6
I don't think so.
Of course control lost focus but in meantime it was (together with dialog) deinited and inited again for different list item/data.
I would more expect unfocus to be called before dialog deinit than after new initialization.
Reply
#7
Only theory (not at computer with XBMC now):

Is this problem somehow related to feature that XBMC remeber last position in Window (not sure if it applies to dialogs too)? From outside point of view it looks like DialogVideoInfo first focus last used control and then defocus and focus defined default control. If that's case then it should IMHO ignore that remembered control on windows where is defined default control. Otherwise it makes onfocus/onunfocus usage quite complicated because it may have unexpected side effects during dialog start. Of course with my limited skinning experience I'm not able to consider all consequences.
Reply

Logout Mark Read Team Forum Stats Members Help
Weird focus/unfocus behavior on DialogVideoInfo.xml0