qt: Fix performance regression

This commit is contained in:
Cacodemon345
2022-07-12 14:41:38 +06:00
parent ef869d7a3d
commit 27e4124574
10 changed files with 42 additions and 104 deletions

View File

@@ -32,6 +32,7 @@ static QString sb_text, sb_buguitext, sb_mt32lcdtext;
extern "C" {
#include "86box/86box.h"
#include <86box/plat.h>
#include <86box/ui.h>
#include <86box/mouse.h>
@@ -64,6 +65,17 @@ void mouse_poll() {
main_window->pollMouse();
}
extern "C" int vid_resize;
void plat_resize_request(int w, int h, int monitor_index)
{
if (vid_resize & 2) {
plat_resize_monitor(fixed_size_x, fixed_size_y, monitor_index);
}
else {
plat_resize_monitor(w, h, monitor_index);
}
}
void plat_resize_monitor(int w, int h, int monitor_index) {
if (monitor_index >= 1) main_window->resizeContentsMonitor(w, h, monitor_index);
else main_window->resizeContents(w, h);