Currently after playing a PVR item, some undefined view will be displayed (a mixture of channels and recordings view). This happens because the renderer will set the focus to the default button (TV channels) during the items list update, since the list is empty at this time and cannot have the focus. I have fixed this by displaying the (translated) string "searching..." while the update is in progress. Furthermore the history is saved, if the a PVR view is closed, so that it is restored, when the view is opened again.
hmm this looks like an evil hack around the actual issue. did you happen to find out why it's setting the focus to tv channels? it didn't do that earlier so it looks like someone broke this.
Yes, correct, it is a newer problem, I think it came up somewhere with the merge of PVR into the main line, but I did not track it down.
The situation is: When returning from the movie, the old view and focus are restored. This means the recordings list will get the focus again. It will then have the old content still available. But as long as the PVR state is not fully restored, the correct sorting is not available, so the entries will be completely unsorted. When the list gets the focus, PVRWindow also gets the focus. As the old view was the recordings view, this will be focused again. It will then trigger an update of the recordings list. In the current version the list will be cleared before the update. In the directory update the render loop checks, if the currently focused control is focusable, but a list with no entries is not. So it sets the focus to the default control for PVR, which is the button "TV channels" in the left side bar. The recording entries in the list will remain unsorted and without function. So you have to go to "Recordings" again to get the correct list.
The whole execution tree can be seen nicely when placing a breakpoint here. When returing from a movie it gets hit twice.
In another approach I cleared the list after the update and just before adding the new entries. Then the unsorted list was displayed during the update, which was not very nice.
Also it is possible to set the focus to the respective button in the side bar, when the view is restored. But I don't like this solution either, because you have to press a button to hide the side bar again.
After all the proposed fix was the easiest and best looking solution.
Perhaps it would be possible to update the list, before the view is displayed at all. This could be a bigger change though, but I haven't checked that yet. I am also open for other ideas.
The problem was introduced in c36ffcb
hm, this doesn't seem like a problem here - this would be more acurate imo 274cb40
Because same CGUIWindowPVR instance (media window) is used to display few very different contents (channels, recordings, epg, etc) we need to explicitly clear item list before we get new item list so we don't display "stall" items from 1 PVR content on other PVR tab while we fetch new directory content and process it. And as empty list isn't focusable we switch to default control and hence this bug.
IMO proper fix would be to get each PVR tab seperate media window, but it's rather late now for such change, so I guess we will need to use some sort of hack to "fix" it (f.e. disable checking if current control is still focusable when content list is selected and we're updating that list or add dummy item as in proposed commit - would just need to add same in all CGUIWindowPVRCommon::UpdateDate overrides)
yeah the plan was to split it up after frodo. your call on what hack to add for now. dummy item or disable that check.
what happens here?
I think that disabling the check if it is focusable may have side effects elsewhere. Adding the dummy item is specific to the problematic view and should therefore be the safer alternative. But as it is still a hack I think I should probably add a FIXME comment.
If desired, I could do that and rebase to current master on Thursday.
@pieh said that he'll look into this one on irc
I have uploaded an updated version which adds the dummy entry in every PVR view, as @pieh suggested. Please see 71ac2a8.
hack looks fine to me :) could you update this pr with it
@pieh your call on this.
[pvr] Show last view when restoring the PVR window.
Workaround for the problem, that the default PVR window is shown, when the empty items list loses the focus during update. This is accomplished by adding some dummy entry.
[pvr] Save path history on PVR window unload, so that it is available…
… when the window is restored.
Updated as discussed in 71ac2a8.
This commit breaks the EPG timeline window for some reason
Should be fixed in ae04d99 - epg grid didn't like dummy item (without channel/epg data)
This is fixed now indeed! Thank you!