mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-10 05:33:50 +00:00
Merge tag 'v7.0.4' into dev
This commit is contained in:
@@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "core/launcher.h"
|
||||
#include "core/proxy_rotation_manager.h"
|
||||
#include "core/ui_integration.h"
|
||||
#include "core/version.h"
|
||||
#include "chat_helpers/emoji_keywords.h"
|
||||
#include "chat_helpers/stickers_emoji_image_loader.h"
|
||||
#include "base/platform/base_platform_global_shortcuts.h"
|
||||
@@ -45,6 +46,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "iv/iv_delegate_impl.h"
|
||||
#include "iv/iv_instance.h"
|
||||
#include "iv/iv_data.h"
|
||||
#include "iv/editor/iv_editor_session.h"
|
||||
#include "iv/editor/iv_editor_window.h"
|
||||
#include "lang/lang_translator.h"
|
||||
#include "lang/lang_cloud_manager.h"
|
||||
#include "lang/lang_hardcoded.h"
|
||||
@@ -97,7 +100,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtCore/QMimeDatabase>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QScreen>
|
||||
#include <QtGui/QWindow>
|
||||
|
||||
#include <ksandbox.h>
|
||||
|
||||
@@ -219,6 +221,7 @@ void Application::closeAdditionalWindows() {
|
||||
}
|
||||
}
|
||||
_iv->closeAll();
|
||||
Iv::Editor::CloseAllWindows();
|
||||
}
|
||||
|
||||
Application::~Application() {
|
||||
@@ -550,6 +553,7 @@ void Application::startMediaView() {
|
||||
// only after first show and then hide.
|
||||
InvokeQueued(this, [=] {
|
||||
_mediaView = std::make_unique<Media::View::OverlayWidget>();
|
||||
_mediaView->setSystemMediaControls(_mediaControlsManager.get());
|
||||
});
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_WIN
|
||||
// On Windows we needed such hack for the main window, otherwise
|
||||
@@ -557,9 +561,11 @@ void Application::startMediaView() {
|
||||
// was broken / lost to some invalid values.
|
||||
const auto current = _lastActivePrimaryWindow->widget()->geometry();
|
||||
_mediaView = std::make_unique<Media::View::OverlayWidget>();
|
||||
_mediaView->setSystemMediaControls(_mediaControlsManager.get());
|
||||
_lastActivePrimaryWindow->widget()->Ui::RpWidget::setGeometry(current);
|
||||
#else
|
||||
_mediaView = std::make_unique<Media::View::OverlayWidget>();
|
||||
_mediaView->setSystemMediaControls(_mediaControlsManager.get());
|
||||
#endif // Q_OS_MAC || Q_OS_WIN
|
||||
}
|
||||
|
||||
@@ -735,10 +741,9 @@ bool Application::eventFilter(QObject *object, QEvent *e) {
|
||||
} break;
|
||||
|
||||
case QEvent::ThemeChange: {
|
||||
if (Platform::IsLinux()
|
||||
&& object == QGuiApplication::allWindows().constFirst()) {
|
||||
Core::App().refreshApplicationIcon();
|
||||
Core::App().tray().updateIconCounters();
|
||||
if (Platform::IsLinux() && object == qApp) {
|
||||
refreshApplicationIcon();
|
||||
tray().updateIconCounters();
|
||||
}
|
||||
} break;
|
||||
}
|
||||
@@ -1164,7 +1169,25 @@ void Application::checkStartUrls() {
|
||||
if (!cRefStartUrls().isEmpty()
|
||||
&& _lastActivePrimaryWindow
|
||||
&& !_lastActivePrimaryWindow->locked()) {
|
||||
_lastActivePrimaryWindow->widget()->sendPaths();
|
||||
auto interprets = QStringList();
|
||||
auto paths = QStringList();
|
||||
cRefStartUrls() = ranges::views::all(
|
||||
cRefStartUrls()
|
||||
) | ranges::views::filter([&](const QUrl &url) {
|
||||
if (url.scheme() == u"interpret"_q) {
|
||||
interprets.append(url.path());
|
||||
return false;
|
||||
} else if (url.isLocalFile()) {
|
||||
paths.append(url.toLocalFile());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}) | ranges::to<QList<QUrl>>;
|
||||
if (!interprets.isEmpty() || !paths.isEmpty()) {
|
||||
_lastActivePrimaryWindow->widget()->handleStartFiles(
|
||||
std::move(interprets),
|
||||
std::move(paths));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1385,6 +1408,13 @@ Window::Controller *Application::activePrimaryWindow() const {
|
||||
return _lastActivePrimaryWindow;
|
||||
}
|
||||
|
||||
void Application::setActivePrimaryWindow(
|
||||
not_null<Window::Controller*> window) {
|
||||
if (window->isPrimary()) {
|
||||
_lastActivePrimaryWindow = window;
|
||||
}
|
||||
}
|
||||
|
||||
Window::Controller *Application::separateWindowFor(
|
||||
Window::SeparateId id) const {
|
||||
for (const auto &[existingId, window] : _windows) {
|
||||
@@ -1403,7 +1433,9 @@ Window::Controller *Application::ensureSeparateWindowFor(
|
||||
return window;
|
||||
};
|
||||
if (const auto existing = separateWindowFor(id)) {
|
||||
if (id.thread && id.type == Window::SeparateType::Chat) {
|
||||
if (id.thread
|
||||
&& id.type == Window::SeparateType::Chat
|
||||
&& !passcodeLocked()) {
|
||||
existing->sessionController()->showThread(
|
||||
id.thread,
|
||||
showAtMsgId,
|
||||
@@ -1417,6 +1449,9 @@ Window::Controller *Application::ensureSeparateWindowFor(
|
||||
std::make_unique<Window::Controller>(id, showAtMsgId)
|
||||
).first->second.get();
|
||||
processCreatedWindow(result);
|
||||
if (passcodeLocked()) {
|
||||
result->setupPasscodeLock();
|
||||
}
|
||||
result->firstShow();
|
||||
result->finishFirstShow();
|
||||
return activate(result);
|
||||
@@ -1661,7 +1696,9 @@ bool Application::closeActiveWindow() {
|
||||
if (_mediaView && _mediaView->isActive()) {
|
||||
_mediaView->close();
|
||||
return true;
|
||||
} else if (_iv->closeActive() || calls().closeCurrentActiveCall()) {
|
||||
} else if (_iv->closeActive()
|
||||
|| Iv::Editor::CloseActiveWindow()
|
||||
|| calls().closeCurrentActiveCall()) {
|
||||
return true;
|
||||
} else if (const auto window = activeWindow()) {
|
||||
if (window->widget()->isActive()) {
|
||||
|
||||
Reference in New Issue
Block a user