UI: Add OBSQTDisplay::OnMove()/OnDisplayChange()

This plumbing will be useful when handling color space changes.

Currently does nothing, and only Windows is wired for now.
This commit is contained in:
jpark37
2022-02-08 23:34:45 -08:00
committed by Jim
parent 5d1261eddb
commit 61ffb5c4d8
10 changed files with 202 additions and 9 deletions

View File

@@ -31,6 +31,11 @@
#include <qpointer.h>
#include <util/c99defs.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN 1
#include <Windows.h>
#endif
using namespace std;
static void CreateTransitionScene(OBSSource scene, const char *text,
@@ -512,6 +517,33 @@ void OBSBasicProperties::closeEvent(QCloseEvent *event)
Cleanup();
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message,
qintptr *)
#else
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message, long *)
#endif
{
#ifdef _WIN32
const MSG &msg = *static_cast<MSG *>(message);
switch (msg.message) {
case WM_MOVE:
for (OBSQTDisplay *const display :
findChildren<OBSQTDisplay *>()) {
display->OnMove();
}
break;
case WM_DISPLAYCHANGE:
for (OBSQTDisplay *const display :
findChildren<OBSQTDisplay *>()) {
display->OnDisplayChange();
}
}
#endif
return false;
}
void OBSBasicProperties::Init()
{
show();