Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Fix for issues with startup and multiple monitors on windows. #10156
Conversation
jonasschnelli
and others
added some commits
Feb 2, 2017
fanquake
added
the
GUI
label
Apr 5, 2017
|
Makes sense. |
|
This doesn't just affect windows but any setup with variable number monitors. Thanks for the fix. |
laanwj
added some commits
Apr 5, 2017
|
Does this apply to 0.14? |
|
@sipa This applies to 0.14. This bug has existed for many years and is in all bitcoin & alt-coins that I am aware of. |
fanquake
added
the
Needs backport
label
Apr 5, 2017
laanwj
changed the title from
Fix for issues with startup and mutiple monitors on windows.
to
Fix for issues with startup and multiple monitors on windows.
Apr 6, 2017
laanwj
and others
added some commits
Apr 5, 2017
AllanDoensen
referenced this pull request
in BitcoinUnlimited/BitcoinUnlimited
Apr 7, 2017
Merged
Fix for issues with startup and mutliple monitors on windows. #419
laanwj
and others
added some commits
Apr 7, 2017
Thinking of it, I don't think abs fixes this problem.
This is not useful, as agreed. However abs would cause the window to be at (5,5), which reflects the coordinates over both axes and causes something like
I'm not sure that makes sense. What would be the reasoning to put it there? A part of the window will still be outside the screen. If the size of the application is larger than the size of the screen, wouldn't it be better to resize the application to fullscreen? Or alternatively, just ignore the hint, and leave the application at the default size in the center. |
|
@laanwj The screen is placed in a location that the user can easily grab the top & edges. This allows the user to choose a new size. If you do not do the abs() then the user does not have access to a single edge. The user cannot cannot easily grab the application and re-size/move it...hence the move and the abs() . While we could also resize the application to fit, I think if you do that there are many other considerations and the code starts to get messy. I did contemplate it, but this is really an extreme corner case we are talking about here. The important point is that the user has a means of easily interacting with the application when it starts. By placing the application top right comer on the screen guarantees that the user can move & resize that application. Without the abs() that becomes much harder because the user has no edge to select and resize. |
That's not guaranteed to be the case. The window could be twice the size of the screen, for example.
What about my proposal to just go to default settings in that case? I think that is the best fallback if the settings in the QSettings don't make sense (sometimes they get corrupted too), just ignore them. |
|
Yes, that is acceptable. |
|
Should I update it or do you/others want the say first? |
|
That's up to you. To be clear I'm fine with the fix as it is now, as at least it improves things compared to how it is now, but I just think it could be even more robust. |
jnewbery
and others
added some commits
Mar 31, 2017
|
Looks good to me now, utACK after squash. |
|
Seems the right behaviour here is to let the WM give it the default position. (Arguably we shouldn't be saving it at all, but that's another issue.) |
|
Yeah yeah, let's just agree that this is an improvement over not being able to find the window. |
AllanDoensen
added some commits
Apr 4, 2017
|
@AllanDoensen: commit history is messed up. Maybe do a |
|
Oops. I think I have the previous version of this saved somewhere. |
added a commit
that referenced
this pull request
Apr 10, 2017
|
Merged via 51833a1 (retrieved the previous good version and squashed) |
AllanDoensen commentedApr 5, 2017
I noticed a small bug in bitcoin-qt with multiple physical displays. This bug affects me because I use a Windows 10 laptop that sometimes uses a second display.
I can only reproduce this issue on windows 10. I could not reproduce this issue on Ubuntu 16.04 LTS with dual displays running in a VirtualBox VM.
This is a pull request for a fix for this issue.
To demonstrate the bug:
This is not a critical bug, but when it happens the user experience is not good, hence this fix.
As for the code changes….The position of bitcoin-qt is saved into QSettings on exit. When bitcoin-qt restarts it grabs this position and places itself at that location. However it never tests if this position actually still exists. So I have added a test that if the location does not exist on any of the current screens then it re-positions it to the default location.
I also use abs() when calculating the center position. This is because there is the potential for the size of the application to be larger then the size of the current screen, abs() should handle that corner case.
I have tested this change on Windows 10 & Ubuntu 16.04 LTS.