From ebe91cef38fb1da315d444d5afa4ebffa6b4c5ec Mon Sep 17 00:00:00 2001 From: vurtun Date: Tue, 12 Jan 2016 12:09:21 +0100 Subject: [PATCH] delayed window activationover one frame to prevent unwanted clicking behavior --- zahnrad.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zahnrad.c b/zahnrad.c index fae3e0a..2aaa18e 100644 --- a/zahnrad.c +++ b/zahnrad.c @@ -6768,12 +6768,17 @@ zr_begin(struct zr_context *ctx, struct zr_layout *layout, zr_remove_window(ctx, win); zr_insert_window(ctx, win); - win->flags &= ~(zr_flags)ZR_WINDOW_ROM; + /* NOTE: I am not really sure if activating a window should directly + * happen on that frame or the following frame. Directly would simplify + * clicking window closing/minimizing but could case wrong behavior. + * For now I activate the window on the next frame to prevent wrong + * behavior. If not wanted just replace line with: + * win->flags &= ~(zr_flags)ZR_WINDOW_ROM; */ + win->flags |= ZR_WINDOW_REMOVE_ROM; ctx->active = win; } if (ctx->end != win) win->flags |= ZR_WINDOW_ROM; - } win->layout = layout;