mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 11:51:44 +02:00
Implement bringToFront properly for Qt5 on X11
This commit is contained in:
@@ -411,6 +411,10 @@ IF(LIBATTICA_FOUND)
|
||||
ENDIF( TOMAHAWK_QT5 )
|
||||
ENDIF(LIBATTICA_FOUND)
|
||||
|
||||
if(UNIX AND NOT APPLE AND TOMAHAWK_QT5)
|
||||
list(APPEND LINK_LIBRARIES Qt5::X11Extras)
|
||||
endif()
|
||||
|
||||
IF( WIN32 )
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
|
@@ -40,10 +40,17 @@
|
||||
#include <QStyleOption>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <QWindow>
|
||||
#include <QX11Info>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//FIXME: Qt5: this doesnt fail because Q_WS_X11 is deprecated
|
||||
//TODO: change to Q_OS_X11 and fix errors
|
||||
#ifdef Q_WS_X11
|
||||
#include <QtGui/QX11Info>
|
||||
#include <libqnetwm/netwm.h>
|
||||
#endif
|
||||
|
||||
@@ -358,9 +365,12 @@ bringToFront()
|
||||
if ( !widget )
|
||||
return;
|
||||
|
||||
widget->show();
|
||||
widget->activateWindow();
|
||||
widget->raise();
|
||||
// "Unminimize" first, otherwise the entry in the taskbar will only flash but the window won't come to front
|
||||
widget->windowHandle()->showNormal();
|
||||
|
||||
if ( QX11Info::isPlatformX11() ) {
|
||||
QX11Info::setAppTime( QX11Info::getTimestamp() );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user