mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
qt/gs_frame: Hotfix
- Dynamically check the loaded QT library version in case of mismatch - Fixes using 5.11.1 builds with non-buggy libraries and vice versa
This commit is contained in:
parent
3c7f02d99d
commit
f505ac7b63
2 changed files with 22 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "gs_frame.h"
|
#include "gs_frame.h"
|
||||||
|
|
||||||
#include "Utilities/Config.h"
|
#include "Utilities/Config.h"
|
||||||
#include "Utilities/Timer.h"
|
#include "Utilities/Timer.h"
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QLibraryInfo>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "rpcs3_version.h"
|
#include "rpcs3_version.h"
|
||||||
|
@ -28,6 +29,9 @@ constexpr auto qstr = QString::fromStdString;
|
||||||
gs_frame::gs_frame(const QString& title, const QRect& geometry, QIcon appIcon, bool disableMouse)
|
gs_frame::gs_frame(const QString& title, const QRect& geometry, QIcon appIcon, bool disableMouse)
|
||||||
: QWindow(), m_windowTitle(title), m_disable_mouse(disableMouse)
|
: QWindow(), m_windowTitle(title), m_disable_mouse(disableMouse)
|
||||||
{
|
{
|
||||||
|
// Workaround for a Qt bug affecting 5.11.1 binaries
|
||||||
|
m_use_5_11_1_workaround = QLibraryInfo::version() == QVersionNumber(5, 11, 1);
|
||||||
|
|
||||||
//Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
|
//Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
|
||||||
std::string version = rpcs3::version.to_string();
|
std::string version = rpcs3::version.to_string();
|
||||||
version = version.substr(0 , version.find_last_of("-"));
|
version = version.substr(0 , version.find_last_of("-"));
|
||||||
|
@ -329,14 +333,18 @@ bool gs_frame::nativeEvent(const QByteArray &eventType, void *message, long *res
|
||||||
while (wm_event_raised.load(std::memory_order_consume) && !Emu.IsStopped());
|
while (wm_event_raised.load(std::memory_order_consume) && !Emu.IsStopped());
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard lock(wm_event_lock);
|
MSG* msg;
|
||||||
|
if (m_use_5_11_1_workaround)
|
||||||
|
{
|
||||||
// https://bugreports.qt.io/browse/QTBUG-69074?focusedCommentId=409797&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-409797
|
// https://bugreports.qt.io/browse/QTBUG-69074?focusedCommentId=409797&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-409797
|
||||||
#if (QT_VERSION == QT_VERSION_CHECK(5, 11, 1))
|
msg = *reinterpret_cast<MSG**>(message);
|
||||||
MSG* msg = *reinterpret_cast<MSG**>(message);
|
}
|
||||||
#else
|
else
|
||||||
MSG* msg = reinterpret_cast<MSG*>(message);
|
{
|
||||||
#endif
|
msg = reinterpret_cast<MSG*>(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::lock_guard lock(wm_event_lock);
|
||||||
|
|
||||||
switch (msg->message)
|
switch (msg->message)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/RSX/GSRender.h"
|
#include "Emu/RSX/GSRender.h"
|
||||||
|
@ -41,6 +41,8 @@ private:
|
||||||
bool m_interactive_resize = false; // resize signal received while dragging window
|
bool m_interactive_resize = false; // resize signal received while dragging window
|
||||||
bool m_minimized = false;
|
bool m_minimized = false;
|
||||||
|
|
||||||
|
bool m_use_5_11_1_workaround = false; // QT ABI bug workaround
|
||||||
|
|
||||||
public:
|
public:
|
||||||
gs_frame(const QString& title, const QRect& geometry, QIcon appIcon, bool disableMouse);
|
gs_frame(const QString& title, const QRect& geometry, QIcon appIcon, bool disableMouse);
|
||||||
~gs_frame();
|
~gs_frame();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue