2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Remove some App::wnd() calls.

This commit is contained in:
John Preston
2021-02-25 19:12:51 +04:00
parent 204dd0a869
commit 54f06740d5
27 changed files with 137 additions and 106 deletions

View File

@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/ui_utility.h"
#include "dialogs/dialogs_layout.h"
#include "window/themes/window_theme.h"
#include "window/window_controller.h"
#include "storage/file_download.h"
#include "main/main_session.h"
#include "main/main_account.h"
@@ -34,7 +35,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_layers.h"
#include "styles/style_window.h"
#include <QtCore/QCoreApplication>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
namespace Window {
namespace Notifications {
@@ -47,7 +49,10 @@ int notificationMaxHeight() {
QPoint notificationStartPosition() {
const auto corner = Core::App().settings().notificationsCorner();
const auto r = psDesktopRect();
const auto window = Core::App().activeWindow();
const auto r = window
? window->widget()->desktopRect()
: QGuiApplication::primaryScreen()->availableGeometry();
const auto isLeft = Core::Settings::IsLeftCorner(corner);
const auto isTop = Core::Settings::IsTopCorner(corner);
const auto x = (isLeft == rtl()) ? (r.x() + r.width() - st::notifyWidth - st::notifyDeltaX) : (r.x() + st::notifyDeltaX);