Error in the window location when disabling the second monitor

  • If the last location of the program window was on the second monitor located on the right, then when you try to start the program without the second monitor, the program window will be located outside of the viewport.

    It helps to either completely reinstall or change the “x” parameter in the “GUIConfig name= “AppPosition”” block in the file “C:\Users******\AppData\Roaming\Notepad++\config.xml”.

    Please fix this problem , it really tormented me.

  • @Александр-Вилков

    Solving these types of problems isn’t easy.
    I’ve seen similar things with “big name” programs, Outlook, Excel, Chrome…
    If those developers can’t solve it very well, there is no hope. :-)

  • One trick which can be used in this case is to press alt+spacebar and then M to move the window with the arrow keys.

  • @Ekopalypse said in Error in the window location when disabling the second monitor:

    press alt+spacebar and then M to move the window with the arrow keys.

    Yes, and you get a strong hint for which arrow key to use to bring the window back into view by where the popup menu appears when you press Alt+spacebar: You hold down the arrow key opposite where the popup appears.

    Example: If the popup window appears on the righthand side of your monitor, it means the window is far off to the right, and you want to hold down the left arrow key to move it back into viewable space.

  • @Alan-Kilborn
    If deleting lines in config.xml solves the problem then this is a self inflicted wound that Notepad++ can fix by itself.
    There is nothing automatic about config.xml. Notepad++ must be reading it and then Move the Window explicitly into an invalid location. A few ‘if’ statements before this Move should fix the issue.

    I would also expect an option of “remember window location” that could be unselected to allow Windows to select a valid location.

    The TagLEET plugin normally opens its window near the selected text but I also added tests against Monitor coordinates in case NP++ is strangely located outside the screen.
    It is mostly a pair of calls to MonitorFromWindow and GetMonitorInfo, then compare coordinates to the returned rect.

  • @gstavi

    Sure. That’s why in 2020 I am continually applying the Alt+Spacebar solution to the big name programs I already mentioned when my monitor configuration changes, and I’ll add these others to the list as well: WinZip and SnagIt

  • Supporting multiple monitor configurations is a relatively new technology since laptops and docking stations became popular.

    There is lots of SW and lot of bugs.
    Some of the bugs are due to incompetence and other just effect a small percentage of users so developers are unaware or don’t care.
    There are 2 rather different scenarios:

    • Changing screen configuration while application is running.
    • Relaunching application in a different screen configuration.

    The ‘relaunch’ scenario should be much simpler. If an application is not doing anything Windows will just select valid coordinates for its main window. if an application moves itself into an invalid location that “it saved” this is “self inflicted” and negligence on behalf of its developers.

    The “changing” scenario is far more difficult. I can testify that changing between high DPI and normal DPI screens is not handled correctly even by the desktop (explorer) and not by relaunching explorer.exe. It requires log off and log in to fix.

  • With merging this PR npp uses new code to calculate where the find dialog
    needs to be shown. I hope/assume that it will be used in other areas
    as well once it is known as a stable feature.

Log in to reply