From 93770e0b10573a03562261a64c8e93a333f3d0b5 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Tue, 2 Jun 2015 13:15:48 +0900 Subject: [PATCH] Support 'focus_skip_set' request - set ec->icccm.accepts_focus as zero Change-Id: Ieeb74d2ca16977e51582bedd5c868d5f40a9ce0a Signed-off-by: Duna Oh --- src/bin/e_client.c | 9 +++------ src/bin/e_comp_object.c | 9 +++------ src/bin/e_comp_wl.c | 4 ++++ src/bin/e_comp_wl.h | 1 + src/bin/e_pixmap.c | 1 + src/modules/wl_desktop_shell/e_mod_main.c | 4 ++++ 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index c599e78..a278ff2 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -3562,12 +3562,9 @@ e_client_focus_set_with_pointer(E_Client *ec) /* note: this is here as it seems there are enough apps that do not even * expect us to emulate a look of focus but not actually set x input * focus as we do - so simply abort any focuse set on such windows */ - if (e_pixmap_is_x(ec->pixmap)) - { - /* be strict about accepting focus hint */ - if ((!ec->icccm.accepts_focus) && - (!ec->icccm.take_focus)) return; - } + /* be strict about accepting focus hint */ + if ((!ec->icccm.accepts_focus) && + (!ec->icccm.take_focus)) return; if (ec->lock_focus_out) return; if (ec == focused) return; evas_object_focus_set(ec->frame, 1); diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index e6b253d..7bfc7da 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -1517,12 +1517,9 @@ _e_comp_intercept_focus(void *data, Evas_Object *obj, Eina_Bool focus) * expect us to emulate a look of focus but not actually set x input * focus as we do - so simply abort any focuse set on such windows */ /* be strict about accepting focus hint */ - if (e_pixmap_is_x(ec->pixmap)) - { - /* be strict about accepting focus hint */ - if ((!ec->icccm.accepts_focus) && - (!ec->icccm.take_focus)) return; - } + /* be strict about accepting focus hint */ + if ((!ec->icccm.accepts_focus) && + (!ec->icccm.take_focus)) return; if (focus && ec->lock_focus_out) return; if (e_object_is_del(E_OBJECT(ec)) && focus) CRI("CAN'T FOCUS DELETED CLIENT!"); diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 84f60cc..2ebbfa6 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2573,6 +2573,10 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) ec->comp_data->scaler.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); ec->comp_data->scaler.buffer_viewport.surface.width = -1; + E_Comp_Client_Data *p_cdata = e_pixmap_cdata_get(ec->pixmap); + EINA_SAFETY_ON_NULL_RETURN(p_cdata); + ec->comp_data->accepts_focus = p_cdata->accepts_focus; + /* add this client to the hash */ /* eina_hash_add(clients_win_hash, &win, ec); */ e_hints_client_list_set(); diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 659f13a..83514fc 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -324,6 +324,7 @@ struct _E_Comp_Wl_Client_Data Eina_Bool set_win_type : 1; Eina_Bool frame_update : 1; Eina_Bool focus_update : 1; + unsigned char accepts_focus : 1; }; struct _E_Comp_Wl_Output diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index d7a59e0..a9268ac 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -162,6 +162,7 @@ _e_pixmap_new(E_Pixmap_Type type) cp->cdata->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); cp->cdata->pending.buffer_viewport.surface.width = -1; cp->cdata->pending.buffer_viewport.changed = 0; + cp->cdata->accepts_focus = 1; #endif return cp; } diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 91c9b75..ad96658 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -1211,6 +1211,10 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour ec->border.changed = ec->changes.border = !ec->borderless; ec->netwm.type = E_WINDOW_TYPE_NORMAL; ec->comp_data->set_win_type = EINA_TRUE; + + E_Comp_Client_Data *p_cdata = e_pixmap_cdata_get(ep); + EINA_SAFETY_ON_NULL_RETURN(p_cdata); + ec->icccm.accepts_focus = ec->icccm.take_focus = p_cdata->accepts_focus; } static void -- 2.7.4