Detect window manager using KWindowSystem

Paulo Lieuthier paulolieuthier at gmail.com
Sat Oct 25 12:31:40 BST 2014


Sorry, I've had some problems with my email and the list. Well,
checking the window manager's name is much more reliable, I tested
with many window managers and it worked with all. That's how I'm
doing:

bool LxQtModuleManager::nativeEvent
Filter(const QByteArray & eventType, void * message, long * result)
{
    // a new window manager is started
    if (!mWmStarted && mWaitLoop)
    {
        if (!QString(NETRootInfo(QX11Info::connection(),
NET::SupportingWMCheck).wmName()).isEmpty)
        {
            qDebug() << "Window Manager started";
            mWmStarted = true;
            if (mWaitLoop->isRunning())
                mWaitLoop->exit();
        }
    }

    if (!mTrayStarted && QSystemTrayIcon::isSystemTrayAvailable() && mWaitLoop)
    {
        qDebug() << "System Tray started";
        mTrayStarted = true;
        if (mWaitLoop->isRunning())
            mWaitLoop->exit();

        qApp->removeNativeEventFilter(this);
    }

    return false;
}

The reason for this is that lxqt-session only open the autostart
progams after the window manager is active (and the programs that ask
for a system tray after the system tray is active as well). There
probably is a better way, but that's our solution for now. Thanks for
your help!

Paulo Lieuthier


On Sun, Oct 19, 2014 at 10:15 AM, Thomas Lübking
<thomas.luebking at gmail.com> wrote:
> On Sonntag, 19. Oktober 2014 15:08:51 CEST, Martin Gräßlin wrote:
>
>> Might be worth adding it:
>> bool NETRootInfo::isCompliantWindowManagerRunning() const?
>
>
> It certainly won't harm, but the question is: who actually needs such?
>
> WM's operate on the WM selection - and right now, i cannot imagine why any
> client should check for that (optional client side window management? ;-)
>
> -> @Paulo, why do you need to check for this? (And do you want a bashlet?
> ;-)
>
> Cheers,
> Thomas



-- 

Paulo Lieuthier

Porque ainda um pouquinho de tempo, E o que há de vir virá, e não tardará.
-- Hebreus 10:37
_______________________________________________
kwin mailing list
kwin at kde.org
https://mail.kde.org/mailman/listinfo/kwin


More information about the kde-core-devel mailing list