mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
Fix compile on mingw32
This commit is contained in:
@@ -561,12 +561,25 @@ setNam( QNetworkAccessManager* nam )
|
|||||||
void
|
void
|
||||||
bringToFront()
|
bringToFront()
|
||||||
{
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
QWidgetList widgetList = qApp->topLevelWidgets();
|
||||||
|
int i = 0;
|
||||||
|
while( !widgetList.at( i )->isWindow() )
|
||||||
|
i++;
|
||||||
|
QWidget *widget = widgetList.at( i );
|
||||||
|
|
||||||
|
widget->show();
|
||||||
|
widget->activateWindow();
|
||||||
|
widget->raise();
|
||||||
|
|
||||||
|
WId wid = widget->winId();
|
||||||
|
|
||||||
HWND hwndActiveWin = GetForegroundWindow();
|
HWND hwndActiveWin = GetForegroundWindow();
|
||||||
int idActive = GetWindowThreadProcessId(hwndActiveWin, NULL);
|
int idActive = GetWindowThreadProcessId(hwndActiveWin, NULL);
|
||||||
if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
|
if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
|
||||||
{
|
{
|
||||||
SetForegroundWindow( win );
|
SetForegroundWindow( wid );
|
||||||
SetFocus( win );
|
SetFocus( wid );
|
||||||
AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
|
AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user