1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 21:27:58 +02:00

Fix compile on mingw32

This commit is contained in:
Jeff Mitchell
2011-08-27 02:37:50 -04:00
parent dccc4e6225
commit 4b5caaceef

View File

@@ -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);
} }
} }