Attempt at some QT fixes.

This commit is contained in:
OBattler
2022-07-31 23:31:59 +02:00
parent 5df6c51661
commit 16f7460c73
4 changed files with 13 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ void D3D9Renderer::resizeEvent(QResizeEvent *event)
void D3D9Renderer::blit(int x, int y, int w, int h) void D3D9Renderer::blit(int x, int y, int w, int h)
{ {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || surfaceInUse) { if (blitDummied || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || surfaceInUse) {
video_blit_complete_monitor(m_monitor_index); video_blit_complete_monitor(m_monitor_index);
return; return;
} }

View File

@@ -1594,7 +1594,11 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
void MainWindow::blitToWidget(int x, int y, int w, int h, int monitor_index) void MainWindow::blitToWidget(int x, int y, int w, int h, int monitor_index)
{ {
if (monitor_index >= 1) { if (monitor_index >= 1) {
#ifdef STRICTER_CHECK
if (renderers[monitor_index] && renderers[monitor_index]->isVisible()) renderers[monitor_index]->blit(x, y, w, h); if (renderers[monitor_index] && renderers[monitor_index]->isVisible()) renderers[monitor_index]->blit(x, y, w, h);
#else
if (renderers[monitor_index]) renderers[monitor_index]->blit(x, y, w, h);
#endif
else video_blit_complete_monitor(monitor_index); else video_blit_complete_monitor(monitor_index);
} }
else ui->stackedWidget->blit(x, y, w, h); else ui->stackedWidget->blit(x, y, w, h);
@@ -2053,6 +2057,8 @@ void MainWindow::on_actionShow_non_primary_monitors_triggered()
{ {
show_second_monitors ^= 1; show_second_monitors ^= 1;
blitDummied = true;
if (show_second_monitors) { if (show_second_monitors) {
for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) { for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) {
auto& secondaryRenderer = renderers[monitor_index]; auto& secondaryRenderer = renderers[monitor_index];
@@ -2079,5 +2085,7 @@ void MainWindow::on_actionShow_non_primary_monitors_triggered()
} }
} }
} }
blitDummied = false;
} }

View File

@@ -435,7 +435,7 @@ RendererStack::blitRenderer(int x, int y, int w, int h)
void void
RendererStack::blitCommon(int x, int y, int w, int h) RendererStack::blitCommon(int x, int y, int w, int h)
{ {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || imagebufs.empty() || std::get<std::atomic_flag *>(imagebufs[currentBuf])->test_and_set() || blitDummied) { if (blitDummied || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || imagebufs.empty() || std::get<std::atomic_flag *>(imagebufs[currentBuf])->test_and_set()) {
video_blit_complete_monitor(m_monitor_index); video_blit_complete_monitor(m_monitor_index);
return; return;
} }

View File

@@ -73,6 +73,9 @@ wchar_t* ui_window_title(wchar_t* str)
extern "C" void qt_blit(int x, int y, int w, int h, int monitor_index) extern "C" void qt_blit(int x, int y, int w, int h, int monitor_index)
{ {
if (blitDummied)
return;
main_window->blitToWidget(x, y, w, h, monitor_index); main_window->blitToWidget(x, y, w, h, monitor_index);
} }