Qt: Refactor render widget state transitions
Recreate widget each time. Fixes fullscreen mode switches on D3D11 and hopefully Wayland.
This commit is contained in:
@@ -2,49 +2,26 @@
|
||||
#include "common/types.h"
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
class QKeyEvent;
|
||||
class QResizeEvent;
|
||||
|
||||
class HostDisplay;
|
||||
|
||||
class QtHostInterface;
|
||||
|
||||
class QtDisplayWidget : public QWidget
|
||||
class QtDisplayWidget final : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtDisplayWidget(QtHostInterface* host_interface, QWidget* parent);
|
||||
virtual ~QtDisplayWidget();
|
||||
QtDisplayWidget(QWidget* parent);
|
||||
~QtDisplayWidget();
|
||||
|
||||
virtual HostDisplay* getHostDisplayInterface();
|
||||
|
||||
virtual bool hasDeviceContext() const;
|
||||
virtual bool createDeviceContext(QThread* worker_thread, bool debug_device);
|
||||
virtual bool initializeDeviceContext(bool debug_device);
|
||||
virtual void destroyDeviceContext();
|
||||
|
||||
// this comes back on the emu thread
|
||||
virtual void windowResized(s32 new_window_width, s32 new_window_height);
|
||||
|
||||
virtual QPaintEngine* paintEngine() const override;
|
||||
QPaintEngine* paintEngine() const override;
|
||||
|
||||
int scaledWindowWidth() const;
|
||||
int scaledWindowHeight() const;
|
||||
qreal devicePixelRatioFromScreen() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void windowResizedEvent(int width, int height);
|
||||
void windowRestoredEvent();
|
||||
void windowClosedEvent();
|
||||
void windowKeyEvent(int key_code, bool pressed);
|
||||
|
||||
protected:
|
||||
qreal devicePixelRatioFromScreen() const;
|
||||
|
||||
virtual bool createImGuiContext();
|
||||
virtual void destroyImGuiContext();
|
||||
virtual bool createDeviceResources();
|
||||
virtual void destroyDeviceResources();
|
||||
|
||||
virtual bool event(QEvent* event) override;
|
||||
|
||||
QtHostInterface* m_host_interface;
|
||||
bool event(QEvent* event) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user