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