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:
parent
5d1261eddb
commit
61ffb5c4d8
10 changed files with 202 additions and 9 deletions
|
|
@ -4680,6 +4680,32 @@ void OBSBasic::closeEvent(QCloseEvent *event)
|
|||
QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool OBSBasic::nativeEvent(const QByteArray &, void *message, qintptr *)
|
||||
#else
|
||||
bool OBSBasic::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 OBSBasic::changeEvent(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::WindowStateChange) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue