Remove screen change detection since it breaks make changing screen. (Still need to test windows)

This commit is contained in:
James Rowe 2019-09-18 10:40:48 -06:00
parent 5d97e44279
commit 6fff8e3921
2 changed files with 1 additions and 19 deletions

View file

@ -144,8 +144,7 @@ QByteArray GRenderWindow::saveGeometry() {
} }
qreal GRenderWindow::windowPixelRatio() const { qreal GRenderWindow::windowPixelRatio() const {
// QOpenGLWidget isn't backed by a native window, so we need to use the top level window instead return devicePixelRatio();
return QApplication::activeWindow()->devicePixelRatio();
} }
std::pair<u32, u32> GRenderWindow::ScaleTouch(const QPointF pos) const { std::pair<u32, u32> GRenderWindow::ScaleTouch(const QPointF pos) const {
@ -250,7 +249,6 @@ void GRenderWindow::focusOutEvent(QFocusEvent* event) {
void GRenderWindow::resizeEvent(QResizeEvent* event) { void GRenderWindow::resizeEvent(QResizeEvent* event) {
QOpenGLWidget::resizeEvent(event); QOpenGLWidget::resizeEvent(event);
NotifyClientAreaSizeChanged(std::make_pair(event->size().width(), event->size().height()));
OnFramebufferSizeChanged(); OnFramebufferSizeChanged();
} }
@ -298,10 +296,6 @@ void GRenderWindow::paintGL() {
void GRenderWindow::showEvent(QShowEvent* event) { void GRenderWindow::showEvent(QShowEvent* event) {
QWidget::showEvent(event); QWidget::showEvent(event);
// windowHandle() is not initialized until the Window is shown, so we connect it here.
connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
Qt::UniqueConnection);
} }
std::unique_ptr<Frontend::GraphicsContext> GRenderWindow::CreateSharedContext() const { std::unique_ptr<Frontend::GraphicsContext> GRenderWindow::CreateSharedContext() const {

View file

@ -185,15 +185,6 @@ protected:
framebuffer_layout = layout; framebuffer_layout = layout;
} }
/**
* Update internal client area size with the given parameter.
* @note EmuWindow implementations will usually use this in window resize event handlers.
*/
void NotifyClientAreaSizeChanged(const std::pair<unsigned, unsigned>& size) {
client_area_width = size.first;
client_area_height = size.second;
}
private: private:
/** /**
* Handler called when the minimal client area was requested to be changed via SetConfig. * Handler called when the minimal client area was requested to be changed via SetConfig.
@ -206,9 +197,6 @@ private:
Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout
unsigned client_area_width; ///< Current client width, should be set by window impl.
unsigned client_area_height; ///< Current client height, should be set by window impl.
WindowConfig config; ///< Internal configuration (changes pending for being applied in WindowConfig config; ///< Internal configuration (changes pending for being applied in
/// ProcessConfigurationChanges) /// ProcessConfigurationChanges)
WindowConfig active_config; ///< Internal active configuration WindowConfig active_config; ///< Internal active configuration