mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Use last windows location when restoring the application.
This commit is contained in:
parent
ea1fb992f2
commit
70f8e3ca65
3 changed files with 14 additions and 3 deletions
|
|
@ -528,12 +528,20 @@ void App::smartShowWindow (QQuickWindow *window) {
|
|||
window->show();
|
||||
window->raise();// Raise ensure to get focus on Mac
|
||||
window->requestActivate();
|
||||
QSettings settings;
|
||||
if(settings.contains("geometry"))
|
||||
window->setGeometry(settings.value("geometry").toRect());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
bool App::hasFocus () const {
|
||||
return getMainWindow()->isActive() || (mCallsWindow && mCallsWindow->isActive());
|
||||
}
|
||||
void App::saveGeometry(){
|
||||
QSettings settings;
|
||||
settings.setValue("geometry", getMainWindow()->geometry());
|
||||
}
|
||||
|
||||
void App::stateChanged(Qt::ApplicationState pState) {
|
||||
DesktopTools::applicationStateChanged(pState);
|
||||
auto core = CoreManager::getInstance();
|
||||
|
|
@ -1106,4 +1114,4 @@ void App::checkForUpdates(bool force) {
|
|||
CoreManager::getInstance()->getCore()->checkForUpdate(
|
||||
Utils::appStringToCoreString(applicationVersion())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,6 @@ class DefaultTranslator;
|
|||
class ImageListModel;
|
||||
class Notifier;
|
||||
|
||||
|
||||
class App : public SingleApplication {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -117,6 +116,8 @@ public:
|
|||
Q_INVOKABLE static void smartShowWindow (QQuickWindow *window);
|
||||
Q_INVOKABLE static void checkForUpdates(bool force = false);
|
||||
|
||||
Q_INVOKABLE void saveGeometry();
|
||||
|
||||
public slots:
|
||||
void stateChanged(Qt::ApplicationState);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ ApplicationWindow {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
onActiveFocusItemChanged: Logic.handleActiveFocusItemChanged(activeFocusItem)
|
||||
onClosing: Logic.handleClosing(close)
|
||||
onClosing: {App.saveGeometry()
|
||||
Logic.handleClosing(close)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue