Moved WorkMode global variable from facades to core settings.

This commit is contained in:
23rd
2021-05-27 22:45:52 +03:00
parent 16db8468fa
commit 5334372671
13 changed files with 64 additions and 36 deletions

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
#include "mainwindow.h"
#include "core/application.h"
#include "core/core_settings.h"
#include "core/sandbox.h"
#include "boxes/peer_list_controllers.h"
#include "boxes/about_box.h"
@@ -28,7 +29,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/event_filter.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/input_fields.h"
#include "facades.h"
#include "app.h"
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
@@ -809,7 +809,7 @@ void MainWindow::handleSNIHostRegistered() {
_sniAvailable = true;
if (Global::WorkMode().value() == dbiwmWindowOnly) {
if (Core::App().settings().workMode() == dbiwmWindowOnly) {
return;
}
@@ -825,7 +825,7 @@ void MainWindow::handleSNIHostRegistered() {
SkipTaskbar(
windowHandle(),
Global::WorkMode().value() == dbiwmTrayOnly);
Core::App().settings().workMode() == dbiwmTrayOnly);
}
void MainWindow::handleSNIOwnerChanged(
@@ -834,7 +834,7 @@ void MainWindow::handleSNIOwnerChanged(
const QString &newOwner) {
_sniAvailable = IsSNIAvailable();
if (Global::WorkMode().value() == dbiwmWindowOnly) {
if (Core::App().settings().workMode() == dbiwmWindowOnly) {
return;
}
@@ -860,7 +860,8 @@ void MainWindow::handleSNIOwnerChanged(
SkipTaskbar(
windowHandle(),
(Global::WorkMode().value() == dbiwmTrayOnly) && trayAvailable());
(Core::App().settings().workMode() == dbiwmTrayOnly)
&& trayAvailable());
}
void MainWindow::handleAppMenuOwnerChanged(
@@ -1330,7 +1331,7 @@ void MainWindow::handleNativeSurfaceChanged(bool exist) {
if (exist) {
SkipTaskbar(
windowHandle(),
(Global::WorkMode().value() == dbiwmTrayOnly)
(Core::App().settings().workMode() == dbiwmTrayOnly)
&& trayAvailable());
}