mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 17:51:04 +00:00
Screen Resizing: workaround for layout changes not resizing properly
This commit is contained in:
parent
6f209424ca
commit
07a7a86cf5
@ -1677,7 +1677,8 @@ void GMainWindow::ToggleWindowMode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::ResizeScreen(const int scale) {
|
void GMainWindow::ResizeScreen() {
|
||||||
|
const int scale = UISettings::values.fixed_screen_size;
|
||||||
if (!scale || !emulation_running) {
|
if (!scale || !emulation_running) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1714,9 +1715,19 @@ void GMainWindow::ChangeScreenSize() {
|
|||||||
new_scale = 4;
|
new_scale = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool needs_workaround = UISettings::values.fixed_screen_size == 1 && new_scale == 1;
|
||||||
UISettings::values.fixed_screen_size = new_scale;
|
UISettings::values.fixed_screen_size = new_scale;
|
||||||
|
|
||||||
ResizeScreen(new_scale);
|
ResizeScreen();
|
||||||
|
|
||||||
|
if (needs_workaround) {
|
||||||
|
// Workaround for a bug when the layout is switched to one
|
||||||
|
// with a smaller minimum size, which would make the window
|
||||||
|
// not resize properly, when in 1x.
|
||||||
|
// TODO (vitor-k): repro and report to Qt and/or find a
|
||||||
|
// better workaround
|
||||||
|
QTimer::singleShot(100, this, &GMainWindow::ResizeScreen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::ChangeScreenLayout() {
|
void GMainWindow::ChangeScreenLayout() {
|
||||||
|
@ -120,7 +120,7 @@ private:
|
|||||||
void ConnectWidgetEvents();
|
void ConnectWidgetEvents();
|
||||||
void ConnectMenuEvents();
|
void ConnectMenuEvents();
|
||||||
|
|
||||||
void ResizeScreen(int scale);
|
void ResizeScreen();
|
||||||
void UncheckWindowSize();
|
void UncheckWindowSize();
|
||||||
|
|
||||||
void PreventOSSleep();
|
void PreventOSSleep();
|
||||||
|
Loading…
Reference in New Issue
Block a user