-
Notifications
You must be signed in to change notification settings - Fork 57
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
[Feature] Add support for windows position restore #1016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't take into account whatever the user may or may not have screens available for positioning.
In the case of some monitors, depending on the port used, the screen may or may not be listed as available when they are not switched on. This code has the side effect of potentially moving the windows out of reach without any way of figuring out how to restore it if they're not tech-savvy enough.
And no, we shouldn't rely on tech-support to let everybody know how certain key combinations or window manager may be used depending on the system they use.
src/courtroom.cpp
Outdated
auto maybe_point = Options::getInstance().windowPosition("courtroom"); | ||
if (maybe_point.has_value()) { | ||
qDebug() << maybe_point.value(); | ||
QMainWindow::move(maybe_point.value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
src/aoapplication.cpp
Outdated
int x = (geometry.width() - w_lobby->width()) / 2; | ||
int y = (geometry.height() - w_lobby->height()) / 2; | ||
w_lobby->move(x, y); | ||
auto point = Options::getInstance().windowPosition("lobby"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previously stated.
src/options.h
Outdated
@@ -280,6 +288,8 @@ class Options | |||
*/ | |||
QSettings favorite; | |||
|
|||
QSettings windows; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a more robust system for keeping track of screens before restoring position.
src/courtroom.cpp
Outdated
if (Options::getInstance().restoreWindowPositionEnabled()) | ||
{ | ||
auto maybe_point = Options::getInstance().windowPosition("courtroom"); | ||
if (maybe_point.has_value() && ao_app->pointExistsOnScreen(maybe_point.value())) | ||
{ | ||
qDebug() << maybe_point.value(); | ||
QMainWindow::move(maybe_point.value()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The position should be restored on creation of the courtroom, within AOApplication, not from within the Courtroom.
Additionally, it should be consistent with the Lobby, centering if required to the primary screen, no reason it shouldn't here.
No description provided.