Bring RenderDoc window to foreground when event is selected from RGP

This commit is contained in:
baldurk
2018-04-25 10:55:36 +01:00
parent 2d0f675ca8
commit 048d2c4f4e
5 changed files with 22 additions and 3 deletions
+16
View File
@@ -1675,6 +1675,22 @@ QString GetSystemUsername()
return username;
}
void BringToForeground(QWidget *window)
{
#ifdef Q_OS_WIN
SetWindowPos((HWND)window->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
window->setWindowState(Qt::WindowActive);
window->raise();
window->showNormal();
window->show();
SetWindowPos((HWND)window->winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
#else
window->activateWindow();
window->raise();
window->showNormal();
#endif
}
bool IsDarkTheme()
{
float baseLum = getLuminance(QApplication::palette().color(QPalette::Base));
+2
View File
@@ -539,6 +539,8 @@ void setEnabledMultiple(const QList<QWidget *> &widgets, bool enabled);
QString GetSystemUsername();
void BringToForeground(QWidget *window);
bool IsDarkTheme();
float getLuminance(const QColor &col);
+1 -2
View File
@@ -221,8 +221,7 @@ void RGPInterop::EventSelected(RGPInteropEvent event)
m_Ctx.SetEventID({}, eventId, eventId);
m_Ctx.GetMainWindow()->Widget()->activateWindow();
m_Ctx.GetMainWindow()->Widget()->raise();
BringToForeground(m_Ctx.GetMainWindow()->Widget());
}
void RGPInterop::ConnectionEstablished()
+2
View File
@@ -88,6 +88,8 @@ win32 {
LIBS += $$_PRO_FILE_PWD_/3rdparty/pyside/x64/shiboken2.lib
}
LIBS += user32.lib
# Link against the core library
LIBS += $$DESTDIR/renderdoc.lib
+1 -1
View File
@@ -134,7 +134,7 @@
<PreprocessorDefinitions>PYSIDE2_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>shiboken2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>user32.lib;shiboken2.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="!Exists('$(SolutionDir)\qrenderdoc\3rdparty\pyside\include\PySide2\pyside.h')">