diff --git a/Telegram/SourceFiles/gui/flatinput.cpp b/Telegram/SourceFiles/gui/flatinput.cpp index ef8e91d0c1..0ca7534457 100644 --- a/Telegram/SourceFiles/gui/flatinput.cpp +++ b/Telegram/SourceFiles/gui/flatinput.cpp @@ -43,7 +43,7 @@ namespace { } FlatInput::FlatInput(QWidget *parent, const style::flatInput &st, const QString &pholder, const QString &v) : QLineEdit(v, parent), -_fullph(pholder), _fastph(false), _oldtext(v), _kev(0), _customUpDown(false), _phVisible(!v.length()), +_fullph(pholder), _oldtext(v), _fastph(false), _kev(0), _customUpDown(false), _phVisible(!v.length()), a_phLeft(_phVisible ? 0 : st.phShift), a_phAlpha(_phVisible ? 1 : 0), a_phColor(st.phColor->c), a_borderColor(st.borderColor->c), a_bgColor(st.bgColor->c), _notingBene(0), _st(st) { resize(_st.width, _st.height); diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index a59e15b8a7..0eaa7ad692 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -415,9 +415,24 @@ namespace { } void setupGtk() { - if (!noQtTrayIcon) return; - QLibrary lib_gtk, lib_indicator; + if (!noQtTrayIcon) { + if (!noTryUnity) { + if (loadLibrary(lib_gtk, "gtk-3", 0)) { + setupGtkBase(lib_gtk); + } + if (!useGtkBase) { + if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { + setupGtkBase(lib_gtk); + } + } + if (!useGtkBase) { + noTryUnity = true; + } + } + return; + } + if (loadLibrary(lib_indicator, "appindicator3", 1)) { if (loadLibrary(lib_gtk, "gtk-3", 0)) { setupGtkBase(lib_gtk); @@ -745,6 +760,14 @@ void PsMainWindow::psUpdatedPosition() { void PsMainWindow::psCreateTrayIcon() { if (!noQtTrayIcon) { cSetSupportTray(QSystemTrayIcon::isSystemTrayAvailable()); + if (!noTryUnity) { + if (ps_gtk_init_check(0, 0)) { + DEBUG_LOG(("Checked gtk with gtk_init_check!")); + } else { + DEBUG_LOG(("Failed to gtk_init_check(0, 0)!")); + useUnityCount = false; + } + } return; }