0004062: SendThreadMessage issue with GUI_MSG_ITEM_SELECT message on Filmstrip (1 Viewer)


Worlds greatest bot!
March 26, 2007
Home Country
Germany Germany
There exists an issue when sending a thread message to select an item on a filmstrip control.<br /> <br /> Scenario:<br /> In the trakt plugin; facade images are downloaded in a background thread; when the image is successfully downloaded it's set to the facade using the ThumbnailImage, IconImage and IconImageBig properties.<br /> On the chance that the user has selected a facade item which gets an image update we send a message to force a selection of the current item so skin properties are updated on screen e.g. #selectedthumb. We need to send a GUIMessage using the SendThreadMessage method because we are not on the main thread.<br /> <br /> Code Sample:<br /> GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GUIWindowManager.ActiveWindow, 0, (int)TraktGUIControls.Facade, ItemId, 0, null));<br /> <br /> The Bug:<br /> When in Filmstrip layout and you enter the window (default facade index = 0); after the image for the selected item is set to the facade the Last index of the Filmstrip is selected rather than the First! (the same thing happens regardless of the previous selected index). I have confirmed that the ItemId is definitely not the last index of the facade.<br /> <br /> This works ok in List, Icon and BigIcon layouts. I haven't tested CoverFlow, but wouldn't be surprised if the same as Filmstrip.<br /> <br /> The other way to send a message is to use GUIGraphicsContext.SendMessage, but that can't be used when working from another thread. However this works ok for Filmstrip.<br /> <br /> I can reproduce the issue using MediaPortal 1.2 and MediaPortal 1.3, so it's nothing new.

Continue reading...

Users who are viewing this thread

Top Bottom