Bug <defaultcontrol> being ignored
#1
I have a fixedlist with a movement value of 1, a focus position of 2 and the whole list is 3 rows. It's filled with static content but always start control on the 2nd item instead of the first completing ignoring <defaultcontrol>1</defaultcontrol> when the first item is id="1".

If however I use <defaultcontrol always="true">1</defaultcontrol> it will gain control on the first item but this then breaks regaining control at the last item selected.

Thanks.
Reply
#2
Mind sharing a dummy window to make it easier for us?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
I vaguely remember reading over the <defaultcontrol> handling code when I was debugging an issue that appeared after my settings dialog refactor and I was wondering if it always worked correctly. Seems like it really doesn't. I'll try to find the time to look into it. Do you happen to have a simple diff or modified XML for confluence so I can easily test this?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#4
Reading the code (don't have a build environment here) it looks like the problem is that the static list provider (CStaticListProvider) interprets the default item value as an index and not as a control ID. Therefore setting <defaultcontrol> to 1 will lead to the second item being selected (as the indexing starts with 0). Not sure though why it would work when you set it to always focus the default control.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
I thought it might have been using index instead of the actual control ID but even using 0 has no effect. If I remove the movement tag it will focus on the first item whether I use default control or not, and actually trying to set it to another value other than 0 has no affect whatsoever.

I have found that if you use always="true" then you must use IDs for the items otherwise that doesn't work either.

I'll knock up some test code for Confluence later.

Thanks.
Reply
#6
Actually it's easy to reproduce just by using Confluence's home menu.

Simply add <defaultcontrol>0</defaultcontrol> around line 830 and refresh the skin - no matter what value you use it always defaults to the 2nd item.

Then change it to <defaultcontrol always="true">nn</defaultcontrol> (where nn is a number of an item in the content) and it will work.

Thanks.
Reply
#7
Kinda works for me when focusposition is removed. TBH, i have no idea how it should behave.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#8
The first time it's used it should behave the same as always="true" and focus on the default value, which is generally the first item in the list. This behaviour can be seen in a non-static list by looking at Confluence's Poster Wrap view where the first item is focused when you first load that window.

Thanks.
Reply
#9
You're sure it has nothing to do with <focusedposition> being overridden when using 'always' within the <defaultcontrol> option?

EDIT: Just noticed that in Confluence <defaultcontrol>11</defaultcontrol> works just fine.. it will focus on tvshows.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#10
I think it might possibly be because the items in my fixedlist aren't visible when the window loads due to visible conditions not being met immediately.

EDIT: OK so I decided to use SetFocus(id,position) so I can get focus on the first item but realised that only uses position and not item.

Is there any chance of getting a SetFocusItem control for static lists?

Thanks.
Reply
#11
(2015-01-06, 12:12)Hitcher Wrote: I think it might possibly be because the items in my fixedlist aren't visible when the window loads due to visible conditions not being met immediately.

Sounds plausible. From a brief look at the CStaticListProvider code only visible items are considered as "items".
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#12
(2015-01-06, 12:12)Hitcher Wrote: EDIT: OK so I decided to use SetFocus(id,position) so I can get focus on the first item but realised that only uses position and not item.

Is there any chance of getting a SetFocusItem control for static lists?

Thanks.

I am not entirely sure how that would help. Performing a manual SetFocus on something that's not there (yet) won't work either. Maybe i misunderstood ..
Btw, by modifying static / fixed lists you kinda make them non-static Smile Not sure if it's just bad naming or if they were not meant to be used that way.

It's really hard to get into the guilib stuff :/
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#13
Sorry by static list I meant one filled with predefined static content by the skin.

I would be setting focus on the fixedlist from another control by which time it's been filled.
Reply
#14
Seems to be working for me in Amber:

PHP Code:
<control type="fixedlist" id="300" description="Main Bar">
        ...
        <
onup>300</onup>
        <
ondown>300</ondown>
        <
onleft>9001</onleft>
        <
onright>700</onright>
        <
onback>9001</onback>
        <
pagecontrol>-</pagecontrol>
        <
focusposition>5</focusposition>
        <
defaultcontrol always="true">15</defaultcontrol>
    <
movement>0</movement

Will set focus to item id=15 (weather in my case) every time I return/load home page.

PHP Code:
<control type="fixedlist" id="300" description="Main Bar">
        ...
        <
onup>300</onup>
        <
ondown>300</ondown>
        <
onleft>9001</onleft>
        <
onright>700</onright>
        <
onback>9001</onback>
        <
pagecontrol>-</pagecontrol>
        <
focusposition>5</focusposition>
        <
defaultcontrol>15</defaultcontrol>
    <
movement>0</movement

Will set initial focus to item id=15 but will honor last focused item (if focus was changed to, say, movies) when I return to home page.

I have:

PHP Code:
<defaultcontrol always="true">300</defaultcontrol

on my Home.xml, if that makes any difference. And I have this mess in my static item list:

PHP Code:
<include condition="Skin.HasSetting(plexbmc)">Plexbmc.Items</include>
<
item id="21" description="Custom1">
      <
visible>!IsEmpty(Skin.String(CustomHome.1.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.1.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.1.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.1.Path)]</onclick>
    </
item>
    <
item id="1" description="Pictures">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>!Skin.HasSetting(Pictures.Hide)</visible>
      <
label>$LOCALIZE[1]</label>
      <
thumb fallback="special://skin/backgrounds/Pictures.jpg">$INFO[Skin.String(Pictures.Background)]</thumb>
      <
onclick>ActivateWindow(Pictures,root)</onclick>
    </
item>
    <
item id="22" description="Custom2">
      <
visible>!IsEmpty(Skin.String(CustomHome.2.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.2.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.2.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.2.Path)]</onclick>
    </
item>
    <
item id="2" description="Addons">
      <
visible>!Skin.HasSetting(Addons.Hide)</visible>
      <
label>$LOCALIZE[24001]</label>
      <
thumb fallback="special://skin/backgrounds/Addons.jpg">$INFO[Skin.String(Addons.Background)]</thumb>
      <
onclick>ActivateWindow(1119)</onclick>
    </
item>
    <
item id="23" description="Custom3">
      <
visible>!IsEmpty(Skin.String(CustomHome.3.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.3.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.3.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.3.Path)]</onclick>
    </
item>
    <
item id="3" description="Videos">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>!Skin.HasSetting(Videos.Hide)</visible>
      <
label>$LOCALIZE[3]</label>
      <
thumb fallback="special://skin/backgrounds/Videos.jpg">$INFO[Skin.String(Videos.Background)]</thumb>
      <
onclick>ActivateWindow(Videos,root)</onclick>
    </
item>
    <
item id="24" description="Custom.4">
      <
visible>!IsEmpty(Skin.String(CustomHome.4.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.4.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.4.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.4.Path)]</onclick>
    </
item>
    <
item id="4" description="MyMovies">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>!Skin.HasSetting(Movies.Hide) + Library.HasContent(Movies)</visible>
      <
label fallback="20342">$VAR[MovieEntryPointLabel2]</label>
      <
thumb fallback="special://skin/backgrounds/Movies.jpg">$INFO[Skin.String(Movies.Background)]</thumb>
      <
onclick>$VAR[MovieEntryPoint]</onclick>
    </
item>
    <
item id="25" description="Custom.5">
      <
visible>!IsEmpty(Skin.String(CustomHome.5.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.5.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.5.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.5.Path)]</onclick>
    </
item>
    <
item id="5" description="MyTV">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>!Skin.HasSetting(TVShows.Hide) + Library.HasContent(TVShows)</visible>
      <
label fallback="20343">$VAR[TVEntryPointLabel2]</label>
      <
thumb fallback="special://skin/backgrounds/TVShows.jpg">$INFO[Skin.String(TVShows.Background)]</thumb>
      <
onclick>$VAR[TVEntryPoint]</onclick>
    </
item>
    <
item id="26" description="Custom.6">
      <
visible>!IsEmpty(Skin.String(CustomHome.6.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.6.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.6.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.6.Path)]</onclick>
    </
item>
    <
item id="6" description="Music">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>!Skin.HasSetting(Music.Hide)</visible>
      <
label>$LOCALIZE[2]</label>
      <
thumb fallback="special://skin/backgrounds/Music.jpg">$INFO[Skin.String(Music.Background)]</thumb>
      <
onclick condition="Library.HasContent(Music) + !Skin.HasSetting(ArtistView)">ActivateWindow(MusicLibrary,root)</onclick>
      <
onclick condition="!Library.HasContent(Music)">ActivateWindow(MusicFiles,root)</onclick>
      <
onclick condition="Library.HasContent(Music) + Skin.HasSetting(ArtistView)">ActivateWindow(MusicLibrary,Artists)</onclick>
    </
item>
    <
item id="27" description="Custom.7">
      <
visible>!IsEmpty(Skin.String(CustomHome.7.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.7.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.7.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.7.Path)]</onclick>
    </
item>
    <
item id="13" description="Clips">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>Skin.HasSetting(Clips.Show) + Library.HasContent(MusicVideos)</visible>
      <
label>$LOCALIZE[31972]</label>
      <
thumb fallback="special://skin/backgrounds/Clips.jpg">$INFO[Skin.String(Clips.Background)]</thumb>
      <
onclick condition="Library.HasContent(music)">ActivateWindow(10501,"videodb://musicvideos/")</onclick>
      <
onclick condition="!Library.HasContent(music)">ActivateWindow(10502,"videodb://musicvideos/")</onclick>
    </
item>
    <
item id="14" description="Concerts">
      <
visible>!Skin.HasSetting(plexbmc)</visible>
      <
visible>Skin.HasSetting(Concerts.Show) + Library.HasContent(MusicVideos)</visible>
      <
label>$LOCALIZE[31971]</label>
      <
thumb fallback="special://skin/backgrounds/Concerts.jpg">$INFO[Skin.String(Concerts.Background)]</thumb>
      <
onclick>ActivateWindow(VideoLibrary,MusicVideoTitles,return)</onclick>
    </
item>
    <
item id="28" description="Custom.8">
      <
visible>!IsEmpty(Skin.String(CustomHome.8.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.8.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.8.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.8.Path)]</onclick>
    </
item>
    <
item id="300" description="PVR">
      <
visible>System.GetBool(pvrmanager.enabled)</visible>
      <
label>$LOCALIZE[31500]</label>
      <
thumb fallback="special://skin/backgrounds/Pvr.jpg">$INFO[Skin.String(Pvr.Background)]</thumb>
      <
onclick>ActivateWindow(TVChannels)</onclick>
    </
item>
    <
item id="7" description="Favorites">
      <
visible>!Skin.HasSetting(Favourites.Hide)</visible>
      <
label>$LOCALIZE[1036]</label>
      <
thumb fallback="special://skin/backgrounds/Favourites.jpg">$INFO[Skin.String(Favourites.Background)]</thumb>
      <
onclick>ActivateWindow(Favourites)</onclick>
    </
item>
    <
item id="29" description="Custom.9">
      <
visible>!IsEmpty(Skin.String(CustomHome.9.Path))</visible>
      <
label>$INFO[Skin.String(CustomHome.9.Label)]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.9.Background)]</thumb>
      <
onclick>$INFO[Skin.String(CustomHome.9.Path)]</onclick>
    </
item>
    <
item id="8" description="DVD">
      <
visible>System.HasMediaDVD + !Skin.HasSetting(DVD.Hide)</visible>
      <
label>$LOCALIZE[427]</label>
      <
thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(DVD.Background)]</thumb>
      <
onclick condition="System.HasMediaDvd">PlayDVD()</onclick>
      <
onclick condition="!System.HasMediaDvd">Notification($LOCALIZE[164],$LOCALIZE[219],5,DefaultIconWarning.png)</onclick>
    </
item>
    <
item id="15" description="Weather">
      <
visible>!Skin.HasSetting(Weather.Hide)</visible>
      <
label>$LOCALIZE[8]</label>
      <
thumb fallback="special://skin/backgrounds/Weather.jpg">$INFO[Skin.String(Weather.Background)]</thumb>
      <
onclick>ActivateWindow(Weather)</onclick>
    </
item>
... 
My skins:

Amber
Quartz

Reply
#15
Probably because your visible conditions are pretty much instantly verified as true whereas mine are for content that has to be loaded from the library.
Reply

Logout Mark Read Team Forum Stats Members Help
<defaultcontrol> being ignored0