Posts: 123
Joined: Mar 2015
Reputation:
3
2015-05-15, 21:57
(This post was last modified: 2015-05-16, 00:03 by pbureau.)
Hi,
I am running a kodi Helix 14.02 build, and I am trying to call ActivateWindow() from the <onunload> tag in my VideoFullScreen.xml window definition, trying to invoke a specific window on video exit.
With all the windows I tried, kodi enters an infinite loop and ends up crashing. The only exception seems to be dialogs (it works with "movieinformation" for instance).
Is this a bug or am I missing something?
Posts: 17,409
Joined: Aug 2007
Reputation:
586
Hitcher
Team-Kodi Member
Posts: 17,409
Have you tried using a conditional onload for all the other windows where the condition is Window.Previous(fullscreenvideo)?
Posts: 123
Joined: Mar 2015
Reputation:
3
no problem.
By the way, is the <previouswindow> tag actually intended to provide this functionality? Which means ActivateWindow() is actually not meant to be supported inside the <onunload> tag??
This would be fine, except it seems that <previouswindow> will not work for dialogs (such as "movieinformation"), is this normal?
Posts: 123
Joined: Mar 2015
Reputation:
3
agreed, but do you think the fix should be to enable usage of ActivateWindow() inside <onunload>, or should <onunload> ignores ActivateWindow() actions (probably throwing a LOGINFO), thus only preventing the infinite loop?
Posts: 6,684
Joined: Mar 2009
Reputation:
147
phil65
Retired Team-Kodi Member
Posts: 6,684
2015-05-16, 01:49
(This post was last modified: 2015-05-16, 01:50 by phil65.)
either enabling the usage of ActivateWindow() or ignoring the call in case it would lead to a crash (for dialogs this works fine for example). Ignoring it in general is not a good idea since that could break skins.
Posts: 123
Joined: Mar 2015
Reputation:
3
ok I have prepared (and going to submit) a patch for this, however I don't think that trying to support ActivateWindow() from the <onunload> tag actually makes sense. When the onunload actions are invoked, we are already in the ActivateWindow() execution of the stack previous windows, that would need to be aborted and replaced by the action defined window. The fact that dialogs don't break the application is more a side effect than because it has been designed that way.
The <previouswindow> tag is really meant to provide this functionality in skins...
The proposed patch simply ignores ActivateWindow() statements.