diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/eqwidget.cpp | 3 | ||||
| -rw-r--r-- | src/ui/mainwindow.cpp | 2 | ||||
| -rw-r--r-- | src/ui/playlist.cpp | 3 | ||||
| -rw-r--r-- | src/ui/windowsystem.cpp | 12 | ||||
| -rw-r--r-- | src/ui/windowsystem.h | 2 |
5 files changed, 22 insertions, 0 deletions
diff --git a/src/ui/eqwidget.cpp b/src/ui/eqwidget.cpp index bdcf85f3d..1327b1bd9 100644 --- a/src/ui/eqwidget.cpp +++ b/src/ui/eqwidget.cpp @@ -428,7 +428,10 @@ void EqWidget::keyPressEvent (QKeyEvent *ke) bool EqWidget::event (QEvent *event) { if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) + { WindowSystem::ghostWindow(winId()); + WindowSystem::setWinHint(winId(), "equalizer", "Qmmp"); + } return QWidget::event(event); } #endif diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 2a4c967b0..f4f7fa4e6 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -322,6 +322,7 @@ void MainWindow::readSettings() } #ifdef Q_WS_X11 WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); + WindowSystem::setWinHint(winId(), "player", "Qmmp"); #endif //Call setWindowOpacity only if needed double opacity = settings.value("MainWindow/opacity", 1.0).toDouble(); @@ -400,6 +401,7 @@ void MainWindow::toggleVisibility() } #ifdef Q_WS_X11 WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); + WindowSystem::setWinHint(winId(), "player", "Qmmp"); raise(); #endif } diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp index dcbabb8db..9ecec594c 100644 --- a/src/ui/playlist.cpp +++ b/src/ui/playlist.cpp @@ -438,7 +438,10 @@ void PlayList::readSettings() bool PlayList::event (QEvent *event) { if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) + { WindowSystem::ghostWindow(winId()); + WindowSystem::setWinHint(winId(), "playlist", "Qmmp"); + } return QWidget::event(event); } #endif diff --git a/src/ui/windowsystem.cpp b/src/ui/windowsystem.cpp index 72746434d..4b66ae025 100644 --- a/src/ui/windowsystem.cpp +++ b/src/ui/windowsystem.cpp @@ -1,6 +1,7 @@ /*************************************************************************** * Based on Licq * * Copyright (C) 2006-2009 Licq developers * + * Copyright (C) 2011 Ilya Kotov * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -135,6 +136,17 @@ void WindowSystem::changeWinSticky(WId win, bool stick) SubstructureRedirectMask | SubstructureNotifyMask, &xev); } +void WindowSystem::setWinHint(WId win, const char *res_name, const char *res_class) +{ + Display* dsp = QX11Info::display(); + XClassHint hint; + hint.res_name = strdup(res_name); + hint.res_class = strdup(res_class); + XSetClassHint(dsp, win, &hint); + free(hint.res_name); + free(hint.res_class); +} + unsigned char* WindowSystem::getWindowProperty(WId win, const char* prop) { Display* dsp = QX11Info::display(); diff --git a/src/ui/windowsystem.h b/src/ui/windowsystem.h index 051982de5..a9d8fb001 100644 --- a/src/ui/windowsystem.h +++ b/src/ui/windowsystem.h @@ -1,6 +1,7 @@ /*************************************************************************** * Based on Licq * * Copyright (C) 2006-2009 Licq developers * + * Copyright (C) 2011 Ilya Kotov * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -30,6 +31,7 @@ public: static void ghostWindow(WId id); static QString netWindowManagerName(); static void changeWinSticky(WId win, bool stick); + static void setWinHint(WId win, const char *res_name, const char *res_class); private: static unsigned char* getWindowProperty(WId win, const char* prop); #endif |
