2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Fix saving maximized state on Linux

This commit is contained in:
Ilya Fedin
2020-09-18 13:09:05 +04:00
committed by John Preston
parent 70c993774a
commit 4c2779bbaf
4 changed files with 38 additions and 10 deletions

View File

@@ -461,12 +461,6 @@ void MainWindow::initHook() {
handleAppMenuOwnerChanged(service, oldOwner, newOwner);
});
connect(
windowHandle(),
&QWindow::visibleChanged,
this,
[=](bool visible) { handleVisibleChanged(visible); });
if (AppMenuSupported) {
LOG(("Using D-Bus global menu."));
} else {
@@ -775,6 +769,9 @@ void MainWindow::createGlobalMenu() {
void MainWindow::updateGlobalMenuHook() {
}
void MainWindow::handleVisibleChangedHook(bool visible) {
}
#else // DESKTOP_APP_DISABLE_DBUS_INTEGRATION
void MainWindow::createGlobalMenu() {
@@ -1076,7 +1073,7 @@ void MainWindow::updateGlobalMenuHook() {
ForceDisabled(psClearFormat, !markdownEnabled);
}
void MainWindow::handleVisibleChanged(bool visible) {
void MainWindow::handleVisibleChangedHook(bool visible) {
if (AppMenuSupported && !_mainMenuPath.path().isEmpty()) {
if (visible) {
RegisterAppMenu(winId(), _mainMenuPath);

View File

@@ -41,6 +41,7 @@ protected:
void initHook() override;
void unreadCounterChangedHook() override;
void updateGlobalMenuHook() override;
void handleVisibleChangedHook(bool visible) override;
void initTrayMenuHook() override;
bool hasTrayIcon() const override;
@@ -67,7 +68,6 @@ private:
void updateIconCounters();
void updateWaylandDecorationColors();
void handleVisibleChanged(bool visible);
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
StatusNotifierItem *_sniTrayIcon = nullptr;