mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 08:05:12 +00:00
Merge branch 'dev' of https://github.com/telegramdesktop/tdesktop into dev
This commit is contained in:
@@ -8,6 +8,7 @@ env:
|
||||
- BUILD_VERSION="disable_register_custom_scheme"
|
||||
- BUILD_VERSION="disable_crash_reports"
|
||||
- BUILD_VERSION="disable_network_proxy"
|
||||
- BUILD_VERSION="disable_desktop_file_generation"
|
||||
|
||||
arch:
|
||||
packages:
|
||||
|
@@ -79,6 +79,10 @@ prepare() {
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_NETWORK_PROXY"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_desktop_file_generation"* ]]; then
|
||||
options+="\nDEFINES += TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
|
||||
fi
|
||||
|
||||
options+='\nINCLUDEPATH += "/usr/lib/glib-2.0/include"'
|
||||
options+='\nINCLUDEPATH += "/usr/lib/gtk-2.0/include"'
|
||||
options+='\nINCLUDEPATH += "/usr/include/opus"'
|
||||
|
@@ -925,13 +925,26 @@ void MainWindow::layerHidden() {
|
||||
setInnerFocus();
|
||||
}
|
||||
|
||||
void MainWindow::onReActivate() {
|
||||
if (auto w = App::wnd()) {
|
||||
if (auto f = QApplication::focusWidget()) {
|
||||
f->clearFocus();
|
||||
}
|
||||
w->windowHandle()->requestActivate();
|
||||
w->activate();
|
||||
if (auto f = QApplication::focusWidget()) {
|
||||
f->clearFocus();
|
||||
}
|
||||
w->setInnerFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::hideMediaview() {
|
||||
if (_mediaView && !_mediaView->isHidden()) {
|
||||
_mediaView->hide();
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
if (App::wnd()) {
|
||||
App::wnd()->activateWindow();
|
||||
}
|
||||
onReActivate();
|
||||
QTimer::singleShot(200, this, SLOT(onReActivate()));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -282,6 +282,8 @@ public slots:
|
||||
void onLogoutSure();
|
||||
void updateGlobalMenu(); // for OS X top menu
|
||||
|
||||
void onReActivate();
|
||||
|
||||
void notifyUpdateAllPhotos();
|
||||
|
||||
void app_activateClickHandler(ClickHandlerPtr handler, Qt::MouseButton button);
|
||||
|
@@ -249,9 +249,9 @@ void MainWindow::psSetupTrayIcon() {
|
||||
trayIcon = new QSystemTrayIcon(this);
|
||||
|
||||
QIcon icon;
|
||||
QFileInfo f(_trayIconImageFile());
|
||||
if (f.exists()) {
|
||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
||||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||
icon = QIcon(path.constData());
|
||||
} else {
|
||||
icon = QIcon(QPixmap::fromImage(App::wnd()->iconLarge(), Qt::ColorOnly));
|
||||
@@ -303,9 +303,9 @@ void MainWindow::psUpdateWorkmode() {
|
||||
void MainWindow::psUpdateIndicator() {
|
||||
_psUpdateIndicatorTimer.stop();
|
||||
_psLastIndicatorUpdate = getms();
|
||||
QFileInfo f(_trayIconImageFile());
|
||||
if (f.exists()) {
|
||||
QByteArray path = QFile::encodeName(f.absoluteFilePath()), name = QFile::encodeName(f.fileName());
|
||||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
|
||||
name = name.mid(0, name.size() - 4);
|
||||
Libs::app_indicator_set_icon_full(_trayIndicator, path.constData(), name);
|
||||
} else {
|
||||
@@ -338,7 +338,7 @@ void MainWindow::psUpdateCounter() {
|
||||
} else if (useStatusIcon && trayIconChecked) {
|
||||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||
Libs::gtk_status_icon_set_from_file(_trayIcon, path.constData());
|
||||
} else {
|
||||
loadPixbuf(_trayIconImageGen());
|
||||
@@ -347,9 +347,9 @@ void MainWindow::psUpdateCounter() {
|
||||
}
|
||||
} else if (trayIcon) {
|
||||
QIcon icon;
|
||||
QFileInfo f(_trayIconImageFile());
|
||||
if (f.exists()) {
|
||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
||||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||
icon = QIcon(path.constData());
|
||||
} else {
|
||||
int32 counter = App::histories().unreadBadge();
|
||||
@@ -524,9 +524,9 @@ void MainWindow::psCreateTrayIcon() {
|
||||
_trayMenu = Libs::gtk_menu_new();
|
||||
if (_trayMenu) {
|
||||
DEBUG_LOG(("Created gtk menu for appindicator!"));
|
||||
QFileInfo f(_trayIconImageFile());
|
||||
if (f.exists()) {
|
||||
QByteArray path = QFile::encodeName(f.absoluteFilePath());
|
||||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||
_trayIndicator = Libs::app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
||||
if (_trayIndicator) {
|
||||
DEBUG_LOG(("Created appindicator!"));
|
||||
|
@@ -434,6 +434,7 @@ void psRegisterCustomScheme() {
|
||||
QString home(_psHomeDir());
|
||||
if (home.isEmpty() || cBetaVersion()) return; // don't update desktop file for beta version
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
|
||||
DEBUG_LOG(("App Info: placing .desktop file"));
|
||||
if (QDir(home + qsl(".local/")).exists()) {
|
||||
QString apps = home + qsl(".local/share/applications/");
|
||||
@@ -480,6 +481,7 @@ void psRegisterCustomScheme() {
|
||||
LOG(("App Error: Could not open '%1' for write").arg(file));
|
||||
}
|
||||
}
|
||||
#endif // TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
|
||||
|
||||
DEBUG_LOG(("App Info: registerting for Gnome"));
|
||||
if (_psRunCommand("gconftool-2 -t string -s /desktop/gnome/url-handlers/tg/command " + escapeShell(escapeShell(QFile::encodeName(cExeDir() + cExeName())) + " -- %s"))) {
|
||||
|
@@ -766,11 +766,11 @@ void InputArea::startBorderAnimation() {
|
||||
}
|
||||
|
||||
void InputArea::focusInEvent(QFocusEvent *e) {
|
||||
_inner.setFocus();
|
||||
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||
}
|
||||
|
||||
void InputArea::mousePressEvent(QMouseEvent *e) {
|
||||
_inner.setFocus();
|
||||
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||
}
|
||||
|
||||
void InputArea::contextMenuEvent(QContextMenuEvent *e) {
|
||||
@@ -1458,11 +1458,11 @@ void InputField::startBorderAnimation() {
|
||||
}
|
||||
|
||||
void InputField::focusInEvent(QFocusEvent *e) {
|
||||
_inner.setFocus();
|
||||
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||
}
|
||||
|
||||
void InputField::mousePressEvent(QMouseEvent *e) {
|
||||
_inner.setFocus();
|
||||
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||
}
|
||||
|
||||
void InputField::contextMenuEvent(QContextMenuEvent *e) {
|
||||
|
@@ -235,6 +235,12 @@ public:
|
||||
bool hasFocus() const {
|
||||
return _inner.hasFocus();
|
||||
}
|
||||
void setFocus() {
|
||||
_inner.setFocus();
|
||||
}
|
||||
void clearFocus() {
|
||||
_inner.clearFocus();
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
||||
|
@@ -521,8 +521,9 @@ PopupMenu::~PopupMenu() {
|
||||
clearActions(true);
|
||||
delete _menu;
|
||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||
if (App::wnd()) {
|
||||
App::wnd()->activateWindow();
|
||||
if (auto w = App::wnd()) {
|
||||
w->onReActivate();
|
||||
QTimer::singleShot(200, w, SLOT(onReActivate()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user