-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notepad++ opes on non existing screen #15150
Comments
Going forward, please paste in your Debug Information, using I think you should be able to fix this issue by doing the following steps:
There is probably an easier way to do this, using something like PowerShell instead of another text editor, but I'm not aware of it. |
The steps seem like they would work. |
No it's not, so something probably ought to be fixed. I looks to me like the relevant code is here, so maybe this is some kind of weird bug with |
It is indeed a strange situation. I used to have a laptop and a sometimes-connected-sometimes-not external screen situation, and Notepad++ never failed to appear on the laptop's screen at the right time. Currently, although this doesn't involve Notepad++, I have a 4th monitor that I keep turned off via its switch but it is connected electronically. This monitor, though, seems to "be there", because when I move the mouse off to the right of monitor number 3, the mouse will move "into" this dark monitor. I'd think it shouldn't. I haven't investigated any further. Anyway, just an interesting thing...nothing to do with Notepad++. |
@alankilborn From my days as SW developer I remember somehow a discussion about such an issue. What we did there was to ask the operating system about the "viewport size" and checked that at least some part of the window would be displayed within that size. |
Notepad++ already calls The bottom line is that it needs to be replicated (your problem) and then looked into. |
@alankilborn |
@stefanino-ch I will try replicating based on what I said HERE which may be similar to your setup. |
@alankilborn |
There really isn't a "check algorithm" in Notepad++. As I'm sure you can see from the code link @molsonkiko provided earlier, Notepad++ isn't doing much with the values, other than passing them on to a Windows function to do the placement of the main window. Windows handles monitor coordinate systems in a "big rectangle" representing all of the "desktop". The upper left of your primary monitor (in your case your laptop screen) is coordinate (0,0) -- in an (x,y) sense -- and thus, if you have extra monitor(s) "placed" to the left of the laptop screen, a negative X value is reasonable and expected. When it is convenient for me to be swapping hardware around, I'll try to replicate your reported problem. |
Is there an existing issue for this?
Description of the Issue
OS: Windows, current version.
Notepad++ installed on laptop.
Laptop is used in two different setups (not all of my workplaces are equipped with the same HW)
If Notepad++ is used in setup 2 on monitor 2 it remembers this position.
After switching (even after a reboot) to setup 1, notepad++ still opens on the not existing screen 2 which is not available. Therefore Notepad++ is not utilizable until switching back to setup 2, and moving it back to the Laptop screen or screen 1.
Steps To Reproduce
Current Behavior
Window is somethimes not available, depending on setup changes (number of external monitors) and on what monitor Notepad++ was last used.
Expected Behavior
At start check if intitial coordinates of the window are within the viewable range.
If this is not the case, change inital coordinates to make sure window is displayed.
Debug Information
Anything else?
No response
The text was updated successfully, but these errors were encountered: