diff options
-rw-r--r-- | include/wlr/render/egl.h | 1 | ||||
-rw-r--r-- | render/egl.c | 7 | ||||
-rw-r--r-- | rootston/desktop.c | 4 | ||||
-rw-r--r-- | types/wlr_idle.c | 15 |
4 files changed, 25 insertions, 2 deletions
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index c42b0325..30de3d26 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -17,6 +17,7 @@ #include <wlr/render/dmabuf.h> struct wlr_egl { + EGLenum platform; EGLDisplay display; EGLConfig config; EGLContext context; diff --git a/render/egl.c b/render/egl.c index cfa37f20..644f94ac 100644 --- a/render/egl.c +++ b/render/egl.c @@ -130,6 +130,8 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, goto error; } + egl->platform = platform; + EGLint major, minor; if (eglInitialize(egl->display, &major, &minor) == EGL_FALSE) { wlr_log(WLR_ERROR, "Failed to initialize EGL"); @@ -319,6 +321,11 @@ bool wlr_egl_is_current(struct wlr_egl *egl) { bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface, pixman_region32_t *damage) { + // Never block when swapping buffers on Wayland + if (egl->platform == EGL_PLATFORM_WAYLAND_EXT) { + eglSwapInterval(egl->display, 0); + } + EGLBoolean ret; if (damage != NULL && (egl->exts.swap_buffers_with_damage_ext || egl->exts.swap_buffers_with_damage_khr)) { diff --git a/rootston/desktop.c b/rootston/desktop.c index 06b785ad..69c71867 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -882,14 +882,18 @@ struct roots_desktop *desktop_create(struct roots_server *server, desktop->tablet_v2 = wlr_tablet_v2_create(server->wl_display); const char *cursor_theme = NULL; +#ifdef WLR_HAS_XWAYLAND const char *cursor_default = ROOTS_XCURSOR_DEFAULT; +#endif struct roots_cursor_config *cc = roots_config_get_cursor(config, ROOTS_CONFIG_DEFAULT_SEAT_NAME); if (cc != NULL) { cursor_theme = cc->theme; +#ifdef WLR_HAS_XWAYLAND if (cc->default_image != NULL) { cursor_default = cc->default_image; } +#endif } char cursor_size_fmt[16]; diff --git a/types/wlr_idle.c b/types/wlr_idle.c index 2d0e8eed..29367ceb 100644 --- a/types/wlr_idle.c +++ b/types/wlr_idle.c @@ -27,6 +27,9 @@ static void idle_timeout_destroy(struct wlr_idle_timeout *timer) { static int idle_notify(void *data) { struct wlr_idle_timeout *timer = data; + if (timer->idle_state) { + return 0; + } timer->idle_state = true; org_kde_kwin_idle_timeout_send_idle(timer->resource); return 1; @@ -36,13 +39,18 @@ static void handle_activity(struct wlr_idle_timeout *timer) { if (!timer->enabled) { return; } - // rearm the timer - wl_event_source_timer_update(timer->idle_source, timer->timeout); + // in case the previous state was sleeping send a resume event and switch state if (timer->idle_state) { timer->idle_state = false; org_kde_kwin_idle_timeout_send_resumed(timer->resource); } + + // rearm the timer + wl_event_source_timer_update(timer->idle_source, timer->timeout); + if (timer->timeout == 0) { + idle_notify(timer); + } } static void handle_timer_resource_destroy(struct wl_resource *timer_resource) { @@ -142,6 +150,9 @@ static void create_idle_timer(struct wl_client *client, if (timer->enabled) { // arm the timer wl_event_source_timer_update(timer->idle_source, timer->timeout); + if (timer->timeout == 0) { + idle_notify(timer); + } } } |