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
Fixing offscreen GUI issue #11208
Conversation
MarcoFalke
added
the
GUI
label
Aug 31, 2017
MarcoFalke
added this to the 0.15.0 milestone
Aug 31, 2017
|
Tagged for backport in case there will be another rc |
MarcoFalke
added
the
Needs backport
label
Aug 31, 2017
|
utACK 7765030 |
| - { | ||
| - QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + | ||
| + QRect screen = QApplication::desktop()->screenGeometry(); |
MeshCollider
Sep 1, 2017
Member
Yep sounds good. I'll fix it to availableGeometry(screen_number) too now that I think about it. Will push it as a separate commit for review before squashing.
| - QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + | ||
| + QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + if ((!pos.x() && !pos.y()) || pos.x() > screen.width() || pos.y() > screen.height() || (QApplication::desktop()->screenNumber(parent) == -1)) { |
promag
Aug 31, 2017
Contributor
How about
if (!screen.contains(parent->geometry()) || QApplication::desktop()->screenNumber(parent) == -1) {And I think the first condition is enough, not sure though.
MeshCollider
Sep 1, 2017
Member
parent->geometry() does not include the window frame, so perhaps frameGeometry()? But yeah I guess a check for full containment makes sense rather than just the point pos()
achow101
referenced this pull request
Aug 31, 2017
Closed
[Windows] GUI window can still appear off screen. #11207
|
I believe this was fixed here : #10156 |
| - if ((!pos.x() && !pos.y()) || (QApplication::desktop()->screenNumber(parent) == -1)) | ||
| - { | ||
| - QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + |
| - QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + | ||
| + int screen_number = QApplication::desktop()->screenNumber(parent); | ||
| + QRect screen = QApplication::desktop()->availableGeometry(screen_number); |
MeshCollider
Sep 1, 2017
Member
Do you mean -1? If the parameter is -1, it returns the default screen
| + | ||
| + int screen_number = QApplication::desktop()->screenNumber(parent); | ||
| + QRect screen = QApplication::desktop()->availableGeometry(screen_number); | ||
| + if ((!pos.x() && !pos.y()) || screen_number == -1 || !screen.contains(parent->frameGeometry())) { |
promag
Sep 1, 2017
Contributor
If I understand correctly, !pos.x() && !pos.y() should be replaced with !settings.contains(strSettings + "Pos").
MeshCollider
Sep 1, 2017
Member
Safer to check after converting it to a point, just to make sure conversion worked properly?
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Sep 2, 2017
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Sep 2, 2017
| - QRect screen = QApplication::desktop()->screenGeometry(); | ||
| + int screen_number = QApplication::desktop()->screenNumber(parent); | ||
| + QRect screen = QApplication::desktop()->availableGeometry(screen_number); | ||
| + if ((!pos.x() && !pos.y()) || screen_number == -1 || !screen.contains(parent->frameGeometry())) { |
jonasschnelli
Sep 3, 2017
Member
Does this allow a window that is halfway moved out of the screen (I think we should allow this)?
MeshCollider
Sep 3, 2017
Member
No I don't think it does, but I thought about that and the expected behaviour of most software is that it launches within the screen even if you moved it partially out last time?
|
utACK |
I was about to remark this - there have been a few PRs before in the last few years 'fixing' this issue, but it keeps returning (or wasn't fixed properly after all). So normally we would make sure of this by unit tests but I don't think that's an option here due to the GUI-ness. So I suggest creating a manual testplan before/after, so we can verify that this bug is squashed. |
MarcoFalke
modified the milestones:
0.15.1,
0.15.0
Sep 5, 2017
|
Just tested on macOS and windows 8.1 (VM): Could not reproduce the issue on Windows 8.1 (did run on a very large screen, closes Bitcoin-Qt while having the main window on the right bottom, reduce screen by times 4, re-started Qt and had the window visible) |
jonasschnelli
referenced this pull request
Sep 5, 2017
Closed
[0.15] Mention offscreen issue in release notes #11245
|
So it's unclear whether this is actually needed. Removing the milestone. |
laanwj
removed
the
Needs backport
label
Sep 6, 2017
laanwj
removed this from the 0.15.1 milestone
Sep 6, 2017
MeshCollider
referenced this pull request
Sep 15, 2017
Merged
Replace save|restoreWindowGeometry with Qt functions #11335
|
Closing in favor of #11335 |
MeshCollider commentedAug 31, 2017
•
Edited 1 time
-
MeshCollider
Aug 31, 2017
Fixes #11207
This still obviously needs to be confirmed as the cause of the issues in question, this is the current assumption
Edit: c.f. #11335