Fixed #55 with `zr_window_set_focus` not working

While setting a window to active `zr_window_set_focus` did not
transfer the window on top of the window stack. This wrong
behavior should now be fixed and do what it is supposed to do.
This commit is contained in:
vurtun 2016-03-02 13:09:50 +01:00
parent 8159391640
commit 4c9eb66b7d
2 changed files with 4 additions and 1 deletions

View File

@ -8136,6 +8136,10 @@ zr_window_set_focus(struct zr_context *ctx, const char *name)
title_len = (int)zr_strsiz(name);
title_hash = zr_murmur_hash(name, (int)title_len, ZR_WINDOW_TITLE);
win = zr_find_window(ctx, title_hash);
if (ctx->end != win) {
zr_remove_window(ctx, win);
zr_insert_window(ctx, win);
}
ctx->active = win;
}

View File

@ -1979,4 +1979,3 @@ void zr_menu_end(struct zr_context*);
#endif
#endif /* ZR_H_ */