fixed unity count, version 0.8.41.dev

This commit is contained in:
John Preston 2015-07-21 18:12:21 +02:00
parent 8339c51017
commit f0c580db2d
2 changed files with 26 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}