Kodi Community Forum

Full Version: How to lock main window when notification dialog is open?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

How to lock main window when notification dialog is open?
It is necessary to block all actions, key buttons on remote control or keyboard, while dialog box is displayed. When window disappears, remove all locks.

What code need to be inserted into DialogNotification.xml?

th.
I guess you could use a fake button to block action.
So you'd need <defaultcontrol>BUTTON-ID<defaultcontrol> or <onload>setfocus(BUTTON-ID)</onload>

then add in controls a hidden button control type with:
<onback>noop</onback> and same for onright/onleft/onup/ondown...
(2019-03-14, 13:43)cartman.dos Wrote: [ -> ]I guess you could use a fake button to block action.
So you'd need <defaultcontrol>BUTTON-ID<defaultcontrol> or <onload>setfocus(BUTTON-ID)</onload>

then add in controls a hidden button control type with:
<onback>noop</onback> and same for onright/onleft/onup/ondown...
Thanks for answering.
It did not help, everything remained as well, here is my code in DialogNotification.xml:

<?xml version="1.0" encoding="UTF-8"?>
<window>
    <defaultcontrol>410</defaultcontrol>
    <onload>setfocus(410)</onload>

    <controls>
        
        <control type="group">
        
            <control type="button" id="410">
                <label>test</label>
                <left>0</left>
                <top>0</top>
                <width>10</width>
                <height>10</height>
                <font>font_Title</font>
                <textcolor></textcolor>
                <texturefocus border="0"></texturefocus>
                <texturenofocus border="0"></texturenofocus>
                <onback>noop</onback>
                <onleft>noop</onleft>
                <onright>noop</onright>
                <onup>noop</onup>
                <ondown>noop</ondown>
             </control>
...
(2019-03-14, 13:56)noolinrut Wrote: [ -> ]
(2019-03-14, 13:43)cartman.dos Wrote: [ -> ]I guess you could use a fake button to block action.
So you'd need <defaultcontrol>BUTTON-ID<defaultcontrol> or <onload>setfocus(BUTTON-ID)</onload>

then add in controls a hidden button control type with:
<onback>noop</onback> and same for onright/onleft/onup/ondown...
Thanks for answering.
It did not help, everything remained as well, here is my code in DialogNotification.xml:

<?xml version="1.0" encoding="UTF-8"?>
<window>
    <defaultcontrol>410</defaultcontrol>
    <onload>setfocus(410)</onload>

    <controls>
        
        <control type="group">
        
            <control type="button" id="410">
                <label>test</label>
                <left>0</left>
                <top>0</top>
                <width>10</width>
                <height>10</height>
                <font>font_Title</font>
                <textcolor></textcolor>
                <texturefocus border="0"></texturefocus>
                <texturenofocus border="0"></texturenofocus>
                <onback>noop</onback>
                <onleft>noop</onleft>
                <onright>noop</onright>
                <onup>noop</onup>
                <ondown>noop</ondown>
             </control>
...
 
 check in skin debug mode, is this control is getting focused when notification pops?
Not focused. What to do?
I just wonder why wouldn't get focused in the first place and if creating a custom window that is visible while notification, then doing the same idea with the button will work instead  Huh
(2019-03-14, 16:04)cartman.dos Wrote: [ -> ]I just wonder why wouldn't get focused in the first place and if creating a custom window that is visible while notification, then doing the same idea with the button will work instead  Huh
 I did not understand what you meant. I use Home.xml and DialogNotification.xml, there are no custom windows.
(2019-03-14, 18:40)noolinrut Wrote: [ -> ]
(2019-03-14, 16:04)cartman.dos Wrote: [ -> ]I just wonder why wouldn't get focused in the first place and if creating a custom window that is visible while notification, then doing the same idea with the button will work instead  Huh
 I did not understand what you meant. I use Home.xml and DialogNotification.xml, there are no custom windows. 
 Try adding in dialognotification:
Code:
<onload>ActivateWindow(busydialognocancel)</onload>
<onunload>Dialog.close(busydialognocancel)</onunload>

Then you could hide busy dialog if you want in dialogbusy.xml
Code:
<visible>!Window.IsVisible(notification)</visible>
Thank you very much! Such a hack worked!