Skip to content

Commit 628fa63

Browse files
ririRobLoach
authored andcommitted
fix #735
1 parent 7c77328 commit 628fa63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

demo/xcb_cairo/nuklear_xcb.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Nuklear XCB/Cairo Render Backend - v0.0.2
44
* Copyright 2021 Richard Gill
5-
*
5+
*
66
* Grabbed and adapted from https://github.com/griebd/nuklear_xcb
77
* Copyright 2017 Adriano Grieb
88
*
@@ -378,7 +378,7 @@ NK_API int nk_xcb_handle_event(struct nk_xcb_context *xcb_ctx, struct nk_context
378378
xcb_client_message_event_t *cm = (xcb_client_message_event_t *)event;
379379
if (cm->data.data32[0] == xcb_ctx->del_atom->atom)
380380
{
381-
return NK_XCB_EVENT_STOP;
381+
events = NK_XCB_EVENT_STOP;
382382
}
383383
}
384384
break;
@@ -388,7 +388,7 @@ NK_API int nk_xcb_handle_event(struct nk_xcb_context *xcb_ctx, struct nk_context
388388
}
389389
free(event);
390390
}
391-
while ((event = xcb_poll_for_event(xcb_ctx->conn)));
391+
while ((events != NK_XCB_EVENT_STOP) && (event = xcb_poll_for_event(xcb_ctx->conn)));
392392
nk_input_end(nk_ctx);
393393

394394
return events;
@@ -802,7 +802,7 @@ NK_API int nk_cairo_render(struct nk_cairo_context *cairo_ctx, struct nk_context
802802
/* the coordinates system in cairo is not intuitive, scale, translate,
803803
* are applied to source. Refer to
804804
* "https://www.cairographics.org/FAQ/#paint_from_a_surface" for details
805-
*
805+
*
806806
* if you set source_origin to (0,0), it would be like source origin
807807
* aligned to dest origin, then if you draw a rectangle on (x, y, w, h).
808808
* it would clip out the (x, y, w, h) of the source on you dest as well.

0 commit comments

Comments
 (0)