Posts: 247
Joined: Oct 2011
Reputation:
11
:-( can not believe I have been hanging out for this change for over a year now.
Posts: 15,263
Joined: Jan 2009
Reputation:
727
ronie
Team-Kodi Member
Posts: 15,263
if it was, i wouldn't have posted my question ;-)
maybe you can clarify what 'as long as the item do not sit in a onscreen container' means?
Posts: 247
Joined: Oct 2011
Reputation:
11
I am going to have a stab at this, Please correct me if I am wrong.
When you create a ListItem in an addon to "send" to Kodi to be displayed it is not on screen yet. You are constructing it, adding settings, adding properties, setting streams info, setting Info Tags, a bunch of calls to various methods to get your ListItem populated with all your data ready to do a xbmcplugin.addDirectoryItems(pluginhandle, dirItems) to have Kodi take these items and display them. They are not on screen items.
The other side to this is when you are working with ListItems in an addon that are already on screen, like when you query a control for a ListItem that is already displayed.
xbmcgui::ControlList::getListItem(index) returnes a ListItem that is ON SCREEN
In Kodi 17 every call to say setProperty or addStreamInfo has to get UI lock, this is not necessary when you are just constructing your ListItems offscreen. So when you are constructing a ListItem you can tell Kodi that this is not on screen yet and dont worry about trying to get a UI lock for method calls that change internal data.
Posts: 247
Joined: Oct 2011
Reputation:
11
I think it was done for backwards compatibility.
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
yes. i could not change the default because it would break scripts relying on it (windowxml stuff). in that case the listitems are directly backed by an item that sit in the gui container. in that case we have to lock the gui so a redraw is not done while we are updating the item.
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
it won't be a problem on add. the problem is when you modify an existing item. maybe it is normal windows and not winxml, i don't recall the details, but at some point you are directly modifying items that sit in a gui control.