From 79a770b638343e91bd4d9e002d02df6922b2fb9f Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 31 Mar 2016 13:15:33 -0500 Subject: [PATCH] wayland: Stop E from consuming all CPU as soon as a selection is made Clipboard fds from clients are regular files, which shouldn't be passed to fd_handler_add. Using the wrong add function causes epoll to return immediately and we end up running idle handlers and burning cpu. Reviewed-by: Mike Blumenkrantz --- src/bin/e_comp_wl_data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c index 8183a9632..299745cd6 100644 --- a/src/bin/e_comp_wl_data.c +++ b/src/bin/e_comp_wl_data.c @@ -937,9 +937,9 @@ e_comp_wl_clipboard_source_create(const char *mime_type, uint32_t serial, int fd if (fd > 0) { source->fd_handler = - ecore_main_fd_handler_add(fd, ECORE_FD_READ, - _e_comp_wl_clipboard_source_save, - e_comp->wl_comp_data, NULL, NULL); + ecore_main_fd_handler_file_add(fd, ECORE_FD_READ | ECORE_FD_ERROR, + _e_comp_wl_clipboard_source_save, + e_comp->wl_comp_data, NULL, NULL); if (!source->fd_handler) { _mime_types_free(&source->data_source);