[fixed] tray icon restores to wrong monitor (1 Viewer)

jimekus

Portal Member
July 13, 2012
19
3
71
New Zealand New Zealand
I have three monitors where (1) is my MP movie Samsung TV, (2) is my 22" Benq computer monitor and (3) is an old CRT that I occasionally use for physics experiments. After MP is closed to the tray and then later restored it now comes back up on monitor 3 everytime. I have to use Alt+Enter to be able to use Ultramon to send it back to monitor 1. This computer is an Asus F2A85M-M with an AMD A6-5400K APU and 8gb of Ram.
 
Last edited:

elliottmc

Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    United Kingdom United Kingdom
    Country flag
    It would probably best if you can make a shorter log that shows the problem without all of the extra stuff. Use the log collector - start MediaPortal Debug-Mode from the start menu. There are explanations in the forum and documentation.
     

    jimekus

    Portal Member
    July 13, 2012
    19
    3
    71
    New Zealand New Zealand
    FWIW, after a clean Win7x64 install and a clean install of MP 1.8 without restoring my backup, the problem is still there. I uninstalled 1.8 and put on 1.7.1 and the problem is also still there. I hope these logs help.
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,220
    New Zealand New Zealand
    Country flag
    Sorry, those logs are no good. Literally the only thing in the MP log is:
    [2014-06-08 15:18:27,725] [Log ] [MPMain ] [WARN ] - Main: MediaPortal is already running

    If you didn't previously, please use the watchdog/debug-mode option 1 to start MP and reproduce the problem.

    If you tried option 1 and this is what you got, please manually set log verbosity to debug (http://wiki.team-mediaportal.com/1_...ion/00_Configuration/11_General#Log_verbosity), reproduce the problem, then use the watchdog to export the logs with option 3.
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,220
    New Zealand New Zealand
    Country flag
    Yep, that's much more helpful (y)

    This is what I see:
    [collapse][2014-06-08 15:40:28,843] [Log ] [MPMain ] [INFO ] - D3D: Restoring from tray
    [2014-06-08 15:40:28,844] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,845] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO End (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 1280x720 - MaxTrackSize: 1280x720)
    [2014-06-08 15:40:28,855] [Log ] [MPMain ] [DEBUG] - Main: WM_ACTIVATE (WA_ACTIVE)
    [2014-06-08 15:40:28,855] [Log ] [MPMain ] [INFO ] - Main: Activation request received
    [2014-06-08 15:40:28,857] [Log ] [MPMain ] [DEBUG] - Main: WM_SIZE (SIZE_MINIMIZED: 0x0)
    [2014-06-08 15:40:28,868] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,870] [Log ] [MPMain ] [INFO ] - Main: Screen MP OnGetMinMaxInfo is displayed on changed from \\.\DISPLAY1 to \\.\DISPLAY3
    [2014-06-08 15:40:28,871] [Log ] [MPMain ] [INFO ] - Main: OnGetMinMaxInfo Bounds of display changed from 1280x720 @ 1280,0 to 1280x768 @ -1280,0
    [2014-06-08 15:40:28,872] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo Information.DeviceName Manager.Adapters \\.\DISPLAY1
    [2014-06-08 15:40:28,873] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo current screen detected \\.\DISPLAY3
    [2014-06-08 15:40:28,873] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo current screen \\.\DISPLAY1
    [2014-06-08 15:40:28,874] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo start screen \\.\DISPLAY1
    [2014-06-08 15:40:28,875] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo change current screen \\.\DISPLAY1 with current detected screen \\.\DISPLAY3
    [2014-06-08 15:40:28,877] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo set current screen bounds {X=-1280,Y=0,Width=1280,Height=768} to Bounds {X=-32000,Y=-32000,Width=160,Height=27}
    [2014-06-08 15:40:28,878] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,881] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo (changeScreen) change current screen \\.\DISPLAY3 with current detected screen \\.\DISPLAY3
    [2014-06-08 15:40:28,882] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO End (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 1280x768 - MaxTrackSize: 1280x768)
    [2014-06-08 15:40:28,885] [Log ] [MPMain ] [DEBUG] - Main: WM_SIZE (SIZE_RESTORED: 1280x768)
    [2014-06-08 15:40:28,886] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo recreate swap chain
    [2014-06-08 15:40:28,888] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain()[/collapse]

    So MP certainly knows it is changing screen.

    I think the reason for the screen change is that MP is being restored from a different screen than the one you want it to run on. Can you confirm?
     

    jimekus

    Portal Member
    July 13, 2012
    19
    3
    71
    New Zealand New Zealand
    Yep, that's much more helpful (y)

    This is what I see:
    [collapse][2014-06-08 15:40:28,843] [Log ] [MPMain ] [INFO ] - D3D: Restoring from tray
    [2014-06-08 15:40:28,844] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,845] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO End (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 1280x720 - MaxTrackSize: 1280x720)
    [2014-06-08 15:40:28,855] [Log ] [MPMain ] [DEBUG] - Main: WM_ACTIVATE (WA_ACTIVE)
    [2014-06-08 15:40:28,855] [Log ] [MPMain ] [INFO ] - Main: Activation request received
    [2014-06-08 15:40:28,857] [Log ] [MPMain ] [DEBUG] - Main: WM_SIZE (SIZE_MINIMIZED: 0x0)
    [2014-06-08 15:40:28,868] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,870] [Log ] [MPMain ] [INFO ] - Main: Screen MP OnGetMinMaxInfo is displayed on changed from \\.\DISPLAY1 to \\.\DISPLAY3
    [2014-06-08 15:40:28,871] [Log ] [MPMain ] [INFO ] - Main: OnGetMinMaxInfo Bounds of display changed from 1280x720 @ 1280,0 to 1280x768 @ -1280,0
    [2014-06-08 15:40:28,872] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo Information.DeviceName Manager.Adapters \\.\DISPLAY1
    [2014-06-08 15:40:28,873] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo current screen detected \\.\DISPLAY3
    [2014-06-08 15:40:28,873] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo current screen \\.\DISPLAY1
    [2014-06-08 15:40:28,874] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo start screen \\.\DISPLAY1
    [2014-06-08 15:40:28,875] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo change current screen \\.\DISPLAY1 with current detected screen \\.\DISPLAY3
    [2014-06-08 15:40:28,877] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo set current screen bounds {X=-1280,Y=0,Width=1280,Height=768} to Bounds {X=-32000,Y=-32000,Width=160,Height=27}
    [2014-06-08 15:40:28,878] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,881] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo (changeScreen) change current screen \\.\DISPLAY3 with current detected screen \\.\DISPLAY3
    [2014-06-08 15:40:28,882] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO End (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 1280x768 - MaxTrackSize: 1280x768)
    [2014-06-08 15:40:28,885] [Log ] [MPMain ] [DEBUG] - Main: WM_SIZE (SIZE_RESTORED: 1280x768)
    [2014-06-08 15:40:28,886] [Log ] [MPMain ] [DEBUG] - Main: Screen MP OnGetMinMaxInfo recreate swap chain
    [2014-06-08 15:40:28,888] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain()[/collapse]

    So MP certainly knows it is changing screen.

    I think the reason for the screen change is that MP is being restored from a different screen than the one you want it to run on. Can you confirm?
    That's right. MP launches to monitor 1 and monitor 2 is my primary monitor where the system tray is. Monitor 3 is where MP restores to. I don't know when this behavior started but I hope you can fix it.
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,220
    New Zealand New Zealand
    Country flag
    I don't know when this behavior started...
    My pick would be MP 1.4.

    ...but I hope you can fix it.
    I'm not sure that I personally can fix it - I'm no expert with D3D. Just trying to collect all the information about what is actually going on.

    The screen is changed on receipt of one of these messages from Windows:
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms632626(v=vs.85).aspx

    As the link says, the message means a window is about to change size or position. It seems reasonable to infer that a change in position could infer a change in screen.

    The thing that doesn't make sense to me is that MP is receiving two of these messages in quick succession. Why Windows would send two I don't know.

    The first message has no meaningful effect:
    [2014-06-08 15:40:28,844] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO Start (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 2x2 - MaxTrackSize: 3852x780)
    [2014-06-08 15:40:28,845] [Log ] [MPMain ] [DEBUG] - Main: WM_GETMINMAXINFO End (MaxSize: 1280x720 - MaxPostion: 0,0 - MinTrackSize: 1280x720 - MaxTrackSize: 1280x720)

    Interestingly that means MP thinks it is running on screen 1 at that time, because it doesn't attempt to change screen.

    The second message triggers the screen change stuff based on this single line of code:
    Code:
    Screen screen = Screen.FromControl(this);
    In plain English I would read that as "which screen am I actually running on?". The response is "screen 3"... which is different to the previous "screen 1" answer, so then starts the screen change process.

    I don't see anything obviously wrong with the code or logic. Clearly the result is not what you want, but I don't think it would be right to just remove that "which screen am I actually running on" check.
     

    Users who are viewing this thread

    Similar threads

    Top Bottom