Compare commits
2 commits
029e62d765
...
808495cccf
| Author | SHA1 | Date | |
|---|---|---|---|
| 808495cccf | |||
| 6946c1eaf3 |
2 changed files with 10 additions and 11 deletions
|
|
@ -45,7 +45,7 @@ static void new_protocol(void* data, struct wl_registry* registry,
|
||||||
|
|
||||||
wayland_protocol_callback_table_t* cb = shget(wayland->wl_protocol_setup_map, interface);
|
wayland_protocol_callback_table_t* cb = shget(wayland->wl_protocol_setup_map, interface);
|
||||||
if(cb != NULL) {
|
if(cb != NULL) {
|
||||||
char* inter = malloc(strlen(interface));
|
char* inter = malloc(strlen(interface) + 1);
|
||||||
strcpy(inter, interface);
|
strcpy(inter, interface);
|
||||||
shput(wayland->wl_protocol_map, inter, cb->setup(name, data));
|
shput(wayland->wl_protocol_map, inter, cb->setup(name, data));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -435,8 +435,6 @@ static void keyboard_keymap(void* data,
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
struct xkb_state* xkb_state = xkb_state_new(xkb_keymap);
|
struct xkb_state* xkb_state = xkb_state_new(xkb_keymap);
|
||||||
xkb_keymap_unref(wayland->xkb_keymap);
|
|
||||||
xkb_state_unref(wayland->xkb_state);
|
|
||||||
|
|
||||||
wayland->xkb_keymap = xkb_keymap;
|
wayland->xkb_keymap = xkb_keymap;
|
||||||
wayland->xkb_state = xkb_state;
|
wayland->xkb_state = xkb_state;
|
||||||
|
|
@ -1460,16 +1458,12 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
struct timespec timeout;
|
struct timespec timeout;
|
||||||
|
|
||||||
if(handle->wayland.always_render) {
|
if(handle->wayland.always_render) {
|
||||||
/* call event loop twice to make it to flush out events like mouse events and ensure we don't lag the render when doing that
|
|
||||||
*/
|
|
||||||
event_loop(handle);
|
|
||||||
return event_loop(handle);
|
return event_loop(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout.tv_nsec = 10;
|
timeout.tv_nsec = 10;
|
||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
|
|
||||||
printf("%d\n", handle->wayland.force_render);
|
|
||||||
return handle->wayland.force_render || handle->wayland.events_pending || wl_display_dispatch_timeout(handle->wayland.display, &timeout);
|
return handle->wayland.force_render || handle->wayland.events_pending || wl_display_dispatch_timeout(handle->wayland.display, &timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,12 +140,16 @@ static int create(MwWidget handle) {
|
||||||
EGL_CONTEXT_MINOR_VERSION, 1,
|
EGL_CONTEXT_MINOR_VERSION, 1,
|
||||||
EGL_NONE};
|
EGL_NONE};
|
||||||
EGLDisplay display;
|
EGLDisplay display;
|
||||||
waylandopengl_t* o = r = malloc(sizeof(*o));
|
waylandopengl_t* o = r = malloc(sizeof(*o));
|
||||||
|
MwLL topmost_parent = handle->lowlevel->wayland.parent;
|
||||||
|
topmost_parent->wayland.always_render = MwTRUE;
|
||||||
|
|
||||||
handle->lowlevel->wayland.parent->wayland.always_render = MwTRUE;
|
while(topmost_parent->wayland.parent != NULL) {
|
||||||
handle->lowlevel->wayland.always_render = MwTRUE;
|
topmost_parent = topmost_parent->wayland.parent;
|
||||||
|
topmost_parent->wayland.always_render = MwTRUE;
|
||||||
|
}
|
||||||
|
|
||||||
display = eglGetDisplay(handle->lowlevel->wayland.display);
|
display = eglGetDisplay((EGLNativeDisplayType)handle->lowlevel->wayland.display);
|
||||||
if(display == EGL_NO_DISPLAY) {
|
if(display == EGL_NO_DISPLAY) {
|
||||||
printf("ERROR: eglGetDisplay, %0X\n", eglGetError());
|
printf("ERROR: eglGetDisplay, %0X\n", eglGetError());
|
||||||
return MwFALSE;
|
return MwFALSE;
|
||||||
|
|
@ -284,6 +288,7 @@ static void mwOpenGLSwapBufferImpl(MwWidget handle) {
|
||||||
#ifdef USE_WAYLAND
|
#ifdef USE_WAYLAND
|
||||||
if(handle->lowlevel->common.type == MwLLBackendWayland) {
|
if(handle->lowlevel->common.type == MwLLBackendWayland) {
|
||||||
waylandopengl_t* o = handle->internal;
|
waylandopengl_t* o = handle->internal;
|
||||||
|
eglSwapInterval(o->egl_display, 0);
|
||||||
if(!eglSwapBuffers(o->egl_display, o->egl_surface)) {
|
if(!eglSwapBuffers(o->egl_display, o->egl_surface)) {
|
||||||
printf("ERROR: eglSwapBuffers, %0X\n", eglGetError());
|
printf("ERROR: eglSwapBuffers, %0X\n", eglGetError());
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue