mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Use custom method to focus main window on X11
This commit is contained in:
parent
9b88f816d6
commit
f9bba75395
1 changed files with 11 additions and 2 deletions
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "platform/platform_specific.h"
|
||||
#include "platform/platform_window_title.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "base/platform/base_platform_process.h"
|
||||
#include "ui/platform/ui_platform_utility.h"
|
||||
#include "history/history.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
|
@ -314,8 +315,16 @@ void MainWindow::activate() {
|
|||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
setVisible(true);
|
||||
psActivateProcess();
|
||||
raise();
|
||||
activateWindow();
|
||||
// allow to focus even if X11 native code is disabled
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
if (Platform::IsX11()) {
|
||||
base::Platform::ActivateThisProcessWindow(winId());
|
||||
} else
|
||||
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
{
|
||||
raise();
|
||||
activateWindow();
|
||||
}
|
||||
controller().updateIsActiveFocus();
|
||||
if (wasHidden) {
|
||||
if (const auto session = sessionController()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue