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

Fixing offscreen GUI issue #11208

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
10 participants
@MeshCollider
Member

MeshCollider commented 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

@MarcoFalke MarcoFalke added the GUI label Aug 31, 2017

@MarcoFalke MarcoFalke added this to the 0.15.0 milestone Aug 31, 2017

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Aug 31, 2017

Member

Tagged for backport in case there will be another rc

Member

MarcoFalke commented Aug 31, 2017

Tagged for backport in case there will be another rc

@jtimon

This comment has been minimized.

Show comment
Hide comment
@jtimon

jtimon Aug 31, 2017

Member

utACK 7765030

Member

jtimon commented Aug 31, 2017

utACK 7765030

Show outdated Hide outdated src/qt/guiutil.cpp Outdated
Show outdated Hide outdated src/qt/guiutil.cpp Outdated
@achow101

This comment has been minimized.

Show comment
Hide comment
@achow101

achow101 Aug 31, 2017

Member

ACK 7765030

Tested on Windows 10, confirms that this fixes the issue I identified in #11207. However #11171 sounds like it is a different problem.

Member

achow101 commented Aug 31, 2017

ACK 7765030

Tested on Windows 10, confirms that this fixes the issue I identified in #11207. However #11171 sounds like it is a different problem.

@AllanDoensen

This comment has been minimized.

Show comment
Hide comment
@AllanDoensen

AllanDoensen Sep 1, 2017

Contributor

I believe this was fixed here : #10156

Contributor

AllanDoensen commented Sep 1, 2017

I believe this was fixed here : #10156

Show outdated Hide outdated src/qt/guiutil.cpp Outdated
Show outdated Hide outdated src/qt/guiutil.cpp Outdated
Show outdated Hide outdated src/qt/guiutil.cpp Outdated
@luke-jr

luke-jr approved these changes Sep 2, 2017

utACK

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Sep 2, 2017

luke-jr 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())) {

This comment has been minimized.

@jonasschnelli

jonasschnelli Sep 3, 2017

Member

Does this allow a window that is halfway moved out of the screen (I think we should allow this)?

@jonasschnelli

jonasschnelli Sep 3, 2017

Member

Does this allow a window that is halfway moved out of the screen (I think we should allow this)?

This comment has been minimized.

@MeshCollider

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?

@MeshCollider

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?

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Sep 3, 2017

Member

utACK

Member

sipa commented Sep 3, 2017

utACK

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 5, 2017

Member

I believe this was fixed here : #10156

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.

Member

laanwj commented Sep 5, 2017

I believe this was fixed here : #10156

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 MarcoFalke modified the milestones: 0.15.1, 0.15.0 Sep 5, 2017

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 5, 2017

Member

Just tested on macOS and windows 8.1 (VM):
Current master OSX: if I move the window outside of the boundary, it will relocate the window to the maximum boundaries without overlapping the visible area.
With this PR OX: overlapping the boundaries will always lead to reopen it in the screen center.
(I think this is acceptable, but slightly different to the current state).

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)

Member

jonasschnelli commented Sep 5, 2017

Just tested on macOS and windows 8.1 (VM):
Current master OSX: if I move the window outside of the boundary, it will relocate the window to the maximum boundaries without overlapping the visible area.
With this PR OX: overlapping the boundaries will always lead to reopen it in the screen center.
(I think this is acceptable, but slightly different to the current state).

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)

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 6, 2017

Member

So it's unclear whether this is actually needed. Removing the milestone.

Member

laanwj commented Sep 6, 2017

So it's unclear whether this is actually needed. Removing the milestone.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 15, 2017

Member

Closing in favor of #11335

Member

laanwj commented Sep 15, 2017

Closing in favor of #11335

@laanwj laanwj closed this Sep 15, 2017

laanwj added a commit to laanwj/bitcoin that referenced this pull request Sep 15, 2017

Merge bitcoin#11335: Replace save|restoreWindowGeometry with Qt funct…
…ions

e70a784 Replace save|restoreWindowGeometry with Qt functions (MeshCollider)

Pull request description:

  Alternative to bitcoin#11208, closes bitcoin#11207

  According to the [Qt documentation](https://doc.qt.io/qt-4.8/qwidget.html#restoreGeometry), restoreGeometry does all the checks we need, so it would be better to rely on them instead of doing it ourselves.

  ~Haven't tested this properly yet, hence the WIP.~
  Gives expected behavior exactly as the other system apps do based on my tests. Only potential issue is the case when the GUI is almost entirely offscreen with only a single strip of pixels, its not really possible to see the GUI, but if you know it's there you can bring it back onscreen with just the mouse. And that's exactly how notepad behaves on Windows so I don't think its a real issue.

  This also gives much better behavior when closing a maximized window, currently (0.15.0 release) a maximized window will save the window size on close, and then reopen as a not-maximized but still that size, which is really annoying. This reopens as maximized.

  Gitian build here: https://bitcoin.jonasschnelli.ch/build/305

Tree-SHA512: ef68e19b7c79a919389b74c7e12bc633c882906981831d9f0b6461e33cd1ba966edf500ae5e906c896cee4e1fe150fdf7e36900d63e9895d9a0cf9c5146edd18

laanwj added a commit that referenced this pull request Sep 25, 2017

Merge #11335: Replace save|restoreWindowGeometry with Qt functions
13baf72 Replace save|restoreWindowGeometry with Qt functions (MeshCollider)

Pull request description:

  Alternative to #11208, closes #11207

  According to the [Qt documentation](https://doc.qt.io/qt-4.8/qwidget.html#restoreGeometry), restoreGeometry does all the checks we need, so it would be better to rely on them instead of doing it ourselves.

  ~Haven't tested this properly yet, hence the WIP.~
  Gives expected behavior exactly as the other system apps do based on my tests. Only potential issue is the case when the GUI is almost entirely offscreen with only a single strip of pixels, its not really possible to see the GUI, but if you know it's there you can bring it back onscreen with just the mouse. And that's exactly how notepad behaves on Windows so I don't think its a real issue.

  This also gives much better behavior when closing a maximized window, currently (0.15.0 release) a maximized window will save the window size on close, and then reopen as a not-maximized but still that size, which is really annoying. This reopens as maximized.

  Gitian build here: https://bitcoin.jonasschnelli.ch/build/305

Tree-SHA512: a8bde14793b4316192df1fa2eaaeb32b44d5ebc5219c35252379840056cd737a9fd162625fd715987f275fec8375334ec1ec328dbc671563f084c611a938985c

@MeshCollider MeshCollider deleted the MeshCollider:201709_offscreen_fix branch Oct 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment