[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] ui/sdl2-2d.c: macOS Mojave checks for UI running
From: |
帝都 久利寿 |
Subject: |
[Qemu-trivial] [PATCH] ui/sdl2-2d.c: macOS Mojave checks for UI running off the main thread -- run sdl2_window_resize on the main thread via dispatch_async; |
Date: |
Thu, 25 Oct 2018 02:21:06 +0900 |
Signed-off-by: kristopher tate <address@hidden>
---
ui/sdl2-2d.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c
index 091ecfc..4b931c9 100644
--- a/ui/sdl2-2d.c
+++ b/ui/sdl2-2d.c
@@ -29,6 +29,9 @@
#include "ui/input.h"
#include "ui/sdl2.h"
#include "sysemu/sysemu.h"
+#if defined(__APPLE__)
+ #include <dispatch/dispatch.h>
+#endif
void sdl2_2d_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
@@ -87,7 +90,13 @@ void sdl2_2d_switch(DisplayChangeListener *dcl,
} else if (old_surface &&
((surface_width(old_surface) != surface_width(new_surface)) ||
(surface_height(old_surface) !=
surface_height(new_surface)))) {
+#if defined(__APPLE__)
+ dispatch_async(dispatch_get_main_queue(), ^{
+ sdl2_window_resize(scon);
+ });
+#else
sdl2_window_resize(scon);
+#endif
}
SDL_RenderSetLogicalSize(scon->real_renderer,
--
2.17.1 (Apple Git-112)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-trivial] [PATCH] ui/sdl2-2d.c: macOS Mojave checks for UI running off the main thread -- run sdl2_window_resize on the main thread via dispatch_async;,
帝都 久利寿 <=