Skip to content

Show PVR recordings view after replaying a PVR item. #1702

Merged
merged 2 commits into from Nov 21, 2012

5 participants

@axmhari
axmhari commented Oct 31, 2012

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.

@opdenkamp
Team Kodi member

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.

@axmhari
axmhari commented Oct 31, 2012

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.

@mikkle
Team Kodi member
mikkle commented Oct 31, 2012

The problem was introduced in c36ffcb

@ghost
ghost commented Oct 31, 2012

@pieh ^^

@pieh
Team Kodi member
pieh commented Nov 1, 2012

@mikkle
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)

@opdenkamp
Team Kodi member

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.

@ghost
ghost commented Nov 12, 2012

what happens here?

@axmhari
axmhari commented Nov 14, 2012

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.

@opdenkamp
Team Kodi member

@pieh said that he'll look into this one on irc

@axmhari
axmhari commented Nov 15, 2012

I have uploaded an updated version which adds the dummy entry in every PVR view, as @pieh suggested. Please see 71ac2a8.

@opdenkamp
Team Kodi member

hack looks fine to me :) could you update this pr with it

@pieh your call on this.

axmhari added some commits Nov 16, 2012
@axmhari axmhari [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.
a0475cd
@axmhari axmhari [pvr] Save path history on PVR window unload, so that it is available…
… when the window is restored.
42ef712
@axmhari
axmhari commented Nov 16, 2012

Updated as discussed in 71ac2a8.

@pieh pieh merged commit 4bf192d into xbmc:master Nov 21, 2012
@avdleeuw

This commit breaks the EPG timeline window for some reason

@pieh
Team Kodi member
pieh commented Nov 25, 2012

@avdleeuw
Should be fixed in ae04d99 - epg grid didn't like dummy item (without channel/epg data)

@avdleeuw

This is fixed now indeed! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.