mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
Implement bringToFront properly for Qt5 on X11
This commit is contained in:
@@ -159,6 +159,9 @@ if( NOT BUILD_WITH_QT4 )
|
|||||||
find_package(Qt5WebKitWidgets REQUIRED)
|
find_package(Qt5WebKitWidgets REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
find_package(Qt5Xml REQUIRED)
|
find_package(Qt5Xml REQUIRED)
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
find_package(Qt5X11Extras REQUIRED NO_MODULE)
|
||||||
|
endif()
|
||||||
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
|
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
|
||||||
|
|
||||||
if( UNIX AND NOT APPLE )
|
if( UNIX AND NOT APPLE )
|
||||||
|
@@ -411,6 +411,10 @@ IF(LIBATTICA_FOUND)
|
|||||||
ENDIF( TOMAHAWK_QT5 )
|
ENDIF( TOMAHAWK_QT5 )
|
||||||
ENDIF(LIBATTICA_FOUND)
|
ENDIF(LIBATTICA_FOUND)
|
||||||
|
|
||||||
|
if(UNIX AND NOT APPLE AND TOMAHAWK_QT5)
|
||||||
|
list(APPEND LINK_LIBRARIES Qt5::X11Extras)
|
||||||
|
endif()
|
||||||
|
|
||||||
IF( WIN32 )
|
IF( WIN32 )
|
||||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||||
|
@@ -40,10 +40,17 @@
|
|||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
#include <QDesktopServices>
|
#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
|
//FIXME: Qt5: this doesnt fail because Q_WS_X11 is deprecated
|
||||||
//TODO: change to Q_OS_X11 and fix errors
|
//TODO: change to Q_OS_X11 and fix errors
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
#include <QtGui/QX11Info>
|
|
||||||
#include <libqnetwm/netwm.h>
|
#include <libqnetwm/netwm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -358,9 +365,12 @@ bringToFront()
|
|||||||
if ( !widget )
|
if ( !widget )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widget->show();
|
// "Unminimize" first, otherwise the entry in the taskbar will only flash but the window won't come to front
|
||||||
widget->activateWindow();
|
widget->windowHandle()->showNormal();
|
||||||
widget->raise();
|
|
||||||
|
if ( QX11Info::isPlatformX11() ) {
|
||||||
|
QX11Info::setAppTime( QX11Info::getTimestamp() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user