aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 21:58:43 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 21:58:43 +0100
commit205539adafbf911afc4be0d501e0043a6b5d1a08 (patch)
tree321ee288aa18b41b044aa21f8a80c0fef5166abf /nk_pugl
parent7e2c978c94bc2e23edffa5a4dc45f8da838e3439 (diff)
parent181f85d6ee31eaff4464984257cc3c6bc0b1cf4f (diff)
downloadsherlock.lv2-205539adafbf911afc4be0d501e0043a6b5d1a08.tar.xz
Merge commit '181f85d6ee31eaff4464984257cc3c6bc0b1cf4f'
Diffstat (limited to 'nk_pugl')
-rw-r--r--nk_pugl/nk_pugl.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h
index d7acd39..d876dfc 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -97,7 +97,8 @@ struct _nk_pugl_window_t {
void *buffer;
size_t size;
} last;
- bool was_left;
+ bool has_left;
+ bool has_entered;
GLuint font_tex;
nkglGenerateMipmap glGenerateMipmap;
@@ -318,7 +319,7 @@ _nk_pugl_render_gl2(nk_pugl_window_t *win)
}
// only render if there were actually any changes
- if(has_changes || win->was_left)
+ if(has_changes || win->has_left || win->has_entered)
#endif
{
// convert shapes into vertexes if there were changes
@@ -359,6 +360,8 @@ _nk_pugl_render_gl2(nk_pugl_window_t *win)
nk_buffer_clear(&win->vbuf);
nk_buffer_clear(&win->ebuf);
+
+ win->has_entered = false;
}
nk_clear(&win->ctx);
@@ -712,7 +715,7 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e)
// fall-through
case PUGL_FOCUS_OUT:
{
- win->was_left = true;
+ win->has_left = true;
puglPostRedisplay(win->view);
break;
}
@@ -720,7 +723,8 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e)
// fall-through
case PUGL_FOCUS_IN:
{
- win->was_left = false;
+ win->has_left = false;
+ win->has_entered = true;
puglPostRedisplay(win->view);
break;
}
@@ -737,6 +741,7 @@ nk_pugl_init(nk_pugl_window_t *win)
win->async = (atomic_flag)ATOMIC_FLAG_INIT;
win->disp = XOpenDisplay(0);
#endif
+ win->has_left = true;
// init pugl
win->view = puglInit(NULL, NULL);