-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix for issues with startup and multiple monitors on windows. #10156
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
Conversation
…ir from emplace_back
This is step one in abstracting the use of boost::filesystem.
Step two in abstracting away boost::filesystem. To repeat this, simply run: ``` git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g' ```
Abstracts away how a path is opened to a `FILE*`. Reduces the number of places where path is converted to a string for anything else but printing.
Having these inside functions is silly and redundant now.
If we want to keep these numbers, could generate them using autoconf. But this seems unnecessary.
|
Makes sense. |
|
This doesn't just affect windows but any setup with variable number monitors. Thanks for the fix. |
faafa80 init: Remove redundant logging code (MarcoFalke) Tree-SHA512: 5ad0e9aba0e25a36025dd4ee5e5fddd2c0039f95bafd0f33300ea59e2f9bba807da6a1a8b4311d6aad5a360b99163edf4a4f161cb13f0f38580d8d6b504c94ad
…f GetLogCategory() fails) cd7f394 initialize flag variable to 0 (and continue if GetLogCategory() fails) (John Newbery) Tree-SHA512: d0f2653bd0e71ed763220cb08d3a5335c5bdfe2f54ff7f9302d97f3265d7aa7f57606fe416a61aaac1535dbb046d0fb40a61f5a9d5cf234b042268e00ee7679d
|
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. |
d80baaa fixup - align summary row correctly and make colors/glyphs globals (John Newbery) bb92d83 [tests] Add unicode symbols for tests passing/failing/skipping (John Newbery) 63062bd [tests] color test results and sort alphabetically (John Newbery) Tree-SHA512: a5b85c05480722abd6e483d1817b7527ca487b8bb8292bc81efba158df5a619b8103ed43b790396071ab0710f39457895a79460480044324798c81331bbade5a
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. |
This commit reduces spammy logging by the test framework. It truncates logging send/receive message in mininode to 500 characters. mininode was previously logging the entire message sent received, which can be up to 1MB for a full block.
If the application is detected to be in an invalid position then the default size and position are now used. Use of use of abs() has been removed.
|
Looks good to me now, utACK after squash. |
45ce471 Reduce spammy test logging (John Newbery) Tree-SHA512: 64b2ce29fb62a4e738840bbaf93563559451c2ef078ba66ecfc1dbe34adefea61ad2ad2d768444cb2e0b30cb3cbe47e38ed818d4c91f7723a3d1ba9fdd0043f9
|
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. |
Changes after comments from @laanwj. If the application is detected to be in an invalid position then the default size and position are now used. Use of use of abs() has been removed.
|
@AllanDoensen: commit history is messed up. Maybe do a |
|
Oops. I think I have the previous version of this saved somewhere. |
…ndows. e9ff818 Fix for issues with startup and multiple monitors on windows. (Allan Doensen) Tree-SHA512: 8502042a9b5a2fd6f5e409163bee9bd7c85e34c158754f393065f8cc6cdd0f8505b9a1803069d01fc1fb2df04d1b2ed6291388851f2ed3608eb2dd53fc22e06e
|
Merged via 51833a1 (retrieved the previous good version and squashed) |
Github-Pull: bitcoin#10156 Rebased-From: 1896818
If the application is detected to be in an invalid position then the default size and position are now used. Use of use of abs() has been removed. Github-Pull: bitcoin#10156 Rebased-From: 3b58485
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.