aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 21:57:51 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 21:57:51 +0100
commitb3b9ed95687ff3cba244d4a159ccd2e3a244c8a0 (patch)
tree4b4aec5bf9727f2ae841003f1151fd13b8992ec1 /nk_pugl
parent308b99889a6b67398bb7cffebd0402b93b077310 (diff)
parent181f85d6ee31eaff4464984257cc3c6bc0b1cf4f (diff)
downloadsynthpod-b3b9ed95687ff3cba244d4a159ccd2e3a244c8a0.tar.xz
Merge commit '181f85d6ee31eaff4464984257cc3c6bc0b1cf4f' into nk
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 d4ba3e51..51e8405c 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -101,7 +101,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;
@@ -326,7 +327,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
@@ -367,6 +368,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);
@@ -720,7 +723,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;
}
@@ -728,7 +731,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;
}
@@ -745,6 +749,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);