Kodi gui lock?
#1
Can someone explain this function:

http://romanvm.github.io/xbmcstubs/docs/....html#lock

Code:
*Note, This will improve performance when doing a lot of gui manipulation at once.
The main program (xbmc itself) will freeze until xbmcgui.unlock() is called.

What exactly freezes? all gui resources go toward window that calls the lock?

Thanks
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#2
I'm not 100% sure in Kodi, but in other languages those same named functions do the following:

Normally, when you draw something on the Kodi canvas, each time you paint something, it gets painted and Kodi updates the canvas (what the user sees).

eg:
- draw some text in bottom left corner, then update canvas
- add items in a listview and show items in this listview while still adding item (kodi would refresh the canvas (user view), so user would see list with 1 item added, the 2 items added, then 3 items added, ...)
- draw some pictures on the canvas, user would see first paint eg poster, then update canavs, then draw fanart, then canvas updates again, ....

This is 'slow'

When you have a lock/unlock funtion, it is almost always a good idea to use those because it speeds things up (sometimes enormously).

You could test this with a listview, shown on the screen, that you populate with 500000 or more items, if you can lock/unlock it is possible this would be 50 times or more faster (experience of me in another language, not yet used/tested in Kodi).


Just do not forget to unlock, or no updates get painted on the canvas... (Kodi appears to 'hang')
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#3
(2015-09-29, 07:58)Wimpie Wrote: I'm not 100% sure in Kodi, but in other languages those same named functions do the following:

Normally, when you draw something on the Kodi canvas, each time you paint something, it gets painted and Kodi updates the canvas (what the user sees).

eg:
- draw some text in bottom left corner, then update canvas
- add items in a listview and show items in this listview while still adding item (kodi would refresh the canvas (user view), so user would see list with 1 item added, the 2 items added, then 3 items added, ...)
- draw some pictures on the canvas, user would see first paint eg poster, then update canavs, then draw fanart, then canvas updates again, ....

This is 'slow'

When you have a lock/unlock funtion, it is almost always a good idea to use those because it speeds things up (sometimes enormously).

You could test this with a listview, shown on the screen, that you populate with 500000 or more items, if you can lock/unlock it is possible this would be 50 times or more faster (experience of me in another language, not yet used/tested in Kodi).


Just do not forget to unlock, or no updates get painted on the canvas... (Kodi appears to 'hang')

Thanks for the info...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#4
I think it is deprecated in kodi
Reply
#5
(2015-09-29, 16:42)spoyser Wrote: I think it is deprecated in kodi
That could very well be yes. Is it still in our official pydocs? The xbmcstubs are not official
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
http://mirrors.kodi.tv/docs/python-docs/...html#-lock

Hope its still available, sounds like something I could use...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#7
I very much doubt this and we simply forgot to remove it from the docs. Test will prove it or will look in source code
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#8
Tells enough
https://github.com/xbmc/xbmc/blob/5737b0...bmcgui.cpp

Will remove it from the docs
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#9
Thanks, guess no point in trying it....
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#10
(2015-09-29, 17:00)Lunatixz Wrote: Thanks, guess no point in trying it....

Why did you think you needed it?
Reply
#11
(2015-09-29, 18:30)spoyser Wrote:
(2015-09-29, 17:00)Lunatixz Wrote: Thanks, guess no point in trying it....

Why did you think you needed it?

gui draw speeds, I've already greatly improved PTVL's performance...

Was hoping this would divert all of kodis gui resources toward my windows, trying to gain the last bit of performance I could grasp out Smile

Don't think I needed it, but the idea of not wasting cycles on Kodis windows while mine are active was appealing...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#12
for reference
https://github.com/xbmc/xbmc/pull/8161
https://github.com/xbmc/xbmc/pull/8160
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#13
Thanks for the info, I've removed lock/unlock from xbmcstubs
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi gui lock?0