From 628fa6339c74414ebd2d841dcaa95c747c355514 Mon Sep 17 00:00:00 2001 From: Richard Gill Date: Mon, 18 Nov 2024 13:45:03 +0100 Subject: [PATCH] fix #735 --- demo/xcb_cairo/nuklear_xcb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/xcb_cairo/nuklear_xcb.h b/demo/xcb_cairo/nuklear_xcb.h index 2dd62f90c..6bf0165cc 100644 --- a/demo/xcb_cairo/nuklear_xcb.h +++ b/demo/xcb_cairo/nuklear_xcb.h @@ -2,7 +2,7 @@ * * Nuklear XCB/Cairo Render Backend - v0.0.2 * Copyright 2021 Richard Gill - * + * * Grabbed and adapted from https://github.com/griebd/nuklear_xcb * Copyright 2017 Adriano Grieb * @@ -378,7 +378,7 @@ NK_API int nk_xcb_handle_event(struct nk_xcb_context *xcb_ctx, struct nk_context xcb_client_message_event_t *cm = (xcb_client_message_event_t *)event; if (cm->data.data32[0] == xcb_ctx->del_atom->atom) { - return NK_XCB_EVENT_STOP; + events = NK_XCB_EVENT_STOP; } } break; @@ -388,7 +388,7 @@ NK_API int nk_xcb_handle_event(struct nk_xcb_context *xcb_ctx, struct nk_context } free(event); } - while ((event = xcb_poll_for_event(xcb_ctx->conn))); + while ((events != NK_XCB_EVENT_STOP) && (event = xcb_poll_for_event(xcb_ctx->conn))); nk_input_end(nk_ctx); return events; @@ -802,7 +802,7 @@ NK_API int nk_cairo_render(struct nk_cairo_context *cairo_ctx, struct nk_context /* the coordinates system in cairo is not intuitive, scale, translate, * are applied to source. Refer to * "https://www.cairographics.org/FAQ/#paint_from_a_surface" for details - * + * * if you set source_origin to (0,0), it would be like source origin * aligned to dest origin, then if you draw a rectangle on (x, y, w, h). * it would clip out the (x, y, w, h) of the source on you dest as well.