X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fgraphicalui.cpp;h=d1e106d10722c335c9363b749d9b7caf2440e7c3;hp=1c17a5e81ab92b3cc8ec23e1d5040b6937299c6a;hb=09ced75541a8702726ed5d66ebc628db2bd50423;hpb=99678e189313b168c410fa15cd10cb673b73c8a2 diff --git a/src/uisupport/graphicalui.cpp b/src/uisupport/graphicalui.cpp index 1c17a5e8..d1e106d1 100644 --- a/src/uisupport/graphicalui.cpp +++ b/src/uisupport/graphicalui.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This contains code from KStatusNotifierItem, part of the KDE libs * @@ -31,7 +31,7 @@ #ifdef Q_WS_X11 # include #endif -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 # include # include #endif @@ -146,6 +146,9 @@ bool GraphicalUi::eventFilter(QObject *obj, QEvent *event) } +// NOTE: Window activation stuff seems to work just fine in Plasma 5 without requiring X11 hacks. +// TODO: Evaluate cleaning all this up once we can get rid of Qt4/KDE4 + // Code taken from KStatusNotifierItem for handling minimize/restore bool GraphicalUi::checkMainWidgetVisibility(bool perform) @@ -166,7 +169,7 @@ bool GraphicalUi::checkMainWidgetVisibility(bool perform) return true; } -#elif defined(HAVE_KDE) && defined(Q_WS_X11) +#elif defined(HAVE_KDE4) && defined(Q_WS_X11) KWindowInfo info1 = KWindowSystem::windowInfo(mainWidget()->winId(), NET::XAWMState | NET::WMState | NET::WMDesktop); // mapped = visible (but possibly obscured) bool mapped = (info1.mappingState() == NET::Visible) && !info1.isMinimized(); @@ -261,7 +264,7 @@ void GraphicalUi::minimizeRestore(bool show) void GraphicalUi::activateMainWidget() { -#ifdef HAVE_KDE +#ifdef HAVE_KDE4 # ifdef Q_WS_X11 KWindowInfo info = KWindowSystem::windowInfo(mainWidget()->winId(), NET::WMDesktop | NET::WMFrameExtents); if (_onAllDesktops) { @@ -282,7 +285,7 @@ void GraphicalUi::activateMainWidget() KWindowSystem::forceActiveWindow(mainWidget()->winId()); # endif -#else /* HAVE_KDE */ +#else /* HAVE_KDE4 */ #ifdef Q_WS_X11 // Bypass focus stealing prevention @@ -300,13 +303,13 @@ void GraphicalUi::activateMainWidget() mainWidget()->raise(); mainWidget()->activateWindow(); -#endif /* HAVE_KDE */ +#endif /* HAVE_KDE4 */ } void GraphicalUi::hideMainWidget() { -#if defined(HAVE_KDE) && defined(Q_WS_X11) +#if defined(HAVE_KDE4) && defined(Q_WS_X11) KWindowInfo info = KWindowSystem::windowInfo(mainWidget()->winId(), NET::WMDesktop | NET::WMFrameExtents); _onAllDesktops = info.onAllDesktops(); #endif