diff options
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/wayland/display_server_wayland.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp index adc9beed66..93096fcdcc 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.cpp +++ b/platform/linuxbsd/wayland/display_server_wayland.cpp @@ -1238,7 +1238,7 @@ void DisplayServerWayland::process_events() { } else { try_suspend(); } - } else if (wayland_thread.get_reset_frame()) { + } else if (!wayland_thread.is_suspended() || wayland_thread.get_reset_frame()) { // At last, a sign of life! We're no longer suspended. suspended = false; } diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 7bdc75db29..0ba49f900e 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -3245,6 +3245,8 @@ void WaylandThread::window_create(DisplayServer::WindowID p_window_id, int p_wid zxdg_exported_v1_add_listener(ws.xdg_exported, &xdg_exported_listener, &ws); } + wl_surface_commit(ws.wl_surface); + // Wait for the surface to be configured before continuing. wl_display_roundtrip(wl_display); } diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index edf3a40ccb..d6eb101a68 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -1519,7 +1519,7 @@ Color DisplayServerX11::screen_get_pixel(const Point2i &p_position) const { if (image) { XColor c; c.pixel = XGetPixel(image, 0, 0); - XFree(image); + XDestroyImage(image); XQueryColor(x11_display, XDefaultColormap(x11_display, i), &c); color = Color(float(c.red) / 65535.0, float(c.green) / 65535.0, float(c.blue) / 65535.0, 1.0); break; @@ -1637,11 +1637,12 @@ Ref<Image> DisplayServerX11::screen_get_image(int p_screen) const { } } } else { - XFree(image); - ERR_FAIL_V_MSG(Ref<Image>(), vformat("XImage with RGB mask %x %x %x and depth %d is not supported.", (uint64_t)image->red_mask, (uint64_t)image->green_mask, (uint64_t)image->blue_mask, (int64_t)image->bits_per_pixel)); + String msg = vformat("XImage with RGB mask %x %x %x and depth %d is not supported.", (uint64_t)image->red_mask, (uint64_t)image->green_mask, (uint64_t)image->blue_mask, (int64_t)image->bits_per_pixel); + XDestroyImage(image); + ERR_FAIL_V_MSG(Ref<Image>(), msg); } img = Image::create_from_data(width, height, false, Image::FORMAT_RGBA8, img_data); - XFree(image); + XDestroyImage(image); } return img; |