ContextMenu for FullScreenVideo stays open after Playback (1 Viewer)

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Steps to reproduce:

    1. Play a short video
    2. Open the context menu on the fullscreen video playback (F9)
    3. Let the video finish
    Problem:
    ContextMenu stays open and needs ESC to close

    What would you expect:
    When the video finishes playback, the contextmenu closes itself.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #3
    As usual, noone really cared (not even a single reply confirming it which is really a 1 minute thing) :( so I had a good morning and fixed that bug. Someone should test if it also fixes the issue mentioned above, then you can commit and close that mantis!

    Edit: Patch and Zip updated to reflect the changes mentioned in the following post!
     

    Attachments

    • FixContextMenuOpenAfterFullScreenPlayback_v2.patch
      2.2 KB
    • Windows.zip
      442.3 KB

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Hi offbyone. I cared :) I even tried to fix it few weeks back but stuck into a brick wall. Nice to see you fixed it :)

    Remarks: you only look for Menu dialog which is OK for this scenario BUT better would be to check GUIWindowManager.IsRouted. Then you can use GUIWindowManager.GetWindow(GUIWindowManager.RoutedWindow) to get GUIWindow object.

    What I would personally do is do a static method on GUIDialogWindow.cs:

    public static void CloseRoutedWindow()
    {
    if (GUIWindowManager.IsRouted)
    {
    GUIWindow win = GUIWindowManager.GetWindow(GUIWindowManager.RoutedWindow);
    if (win != null)
    {
    if (win is GUIDialogFile)
    ((GUIDialogFile)win).Close();
    else if (win is VirtualKeyboard)
    ((VirtualKeyboard)win).PageDestroy();
    else
    ((GUIDialogWindow)win).PageDestroy();
    }
    }
    }

    This same bit of code is used in GUIDialogWindow.cs, PageLoad method. I extracted it from there.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #5
    Thanks for the info :) I updated the patch and binaries with your proposal. I have tested this new verison here and it works just as well.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #6
    Small note, as I just tested this with a TV recording:
    The patch only fixes the open context menu after Video Playback finishes, NOT TV!
    TV still completely freezes MP when ending with open context menu.
     

    Quarter

    MP Donator
  • Premium Supporter
  • June 21, 2010
    722
    138
    Queenstown
    Home Country
    New Zealand New Zealand
    Small note, as I just tested this with a TV recording:
    The patch only fixes the open context menu after Video Playback finishes, NOT TV!
    TV still completely freezes MP when ending with open context menu.


    Try pressing the Home button in the topbar with the context menu up as well. Think it might be the same results.

    Edit: No sorry its the keyboard not context menu
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #8
    I found where MP hangs when Playback of a Recording finishes and the ContextMenu is open:

    file: GuiWindow.cs
    method: OnPageDestroy
    Code:
    while (IsAnimating(AnimationType.WindowClose))
                {
                  if (GUIGraphicsContext.CurrentState != GUIGraphicsContext.State.RUNNING)
                  {
                    break;
                  }
                  if (GUIGraphicsContext.Vmr9Active)
                  {
                    if (VMR9Util.g_vmr9 != null)
                    {
                      if (!VMR9Util.g_vmr9.Enabled)
                      {
                        break;
                      }
                    }
                  }
                  GUIWindowManager.Process();
                }
    That while loop runs forever. I think the conditions for reaching the "break;" are not good but I need some help on this!

    When debugging, I set the execution to the next statement after the while and it stopped fine :) So we need to find out how to get out of the while loop in that case without breaking anything else!
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #9
    In a nightly debugging session I found the bug for the TV part (Mantis 3510)! The reason is some bad coding in the TVPlugin. There was a call to ShowPreviousMenu from the Render method, which resulted in a dead end - gui freeze as Render was called again and ....
    Anyway, here's the patch that should fix the OpenContext Menu I reported here and the MP freeze from mantis 3510.
     

    Attachments

    • mantis3510_v2.patch
      5.9 KB
    • Windows.zip
      1.5 MB

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    I managed to reproduce the TVRecordings error yesterday evening. Just tested with and without the patch. The patch is working good :) Thanks offbyone.

    I would just like to add a small cleanup: call the CloseRoutedWindow() in GUIDialogWindow.cs, PageLoad() method so there is no duplicated code :)
     

    Users who are viewing this thread

    Top Bottom