diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-17 16:02:53 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-19 12:41:16 -0400 |
commit | 5ebdf8f3414d00d54d532dcfbe0e8236d8fe9898 (patch) | |
tree | 67831e00e0fae55d479bb02c59d70f3e4f6852d2 | |
parent | 704a22d1c9a69b8f342917c7f978f3433ecdd28c (diff) | |
download | efl-5ebdf8f3414d00d54d532dcfbe0e8236d8fe9898.tar.gz |
wayland: use shell activated state to indicate focus in csd
the current (v6) xdg-shell spec reads as follows:
Client window decorations should be painted as if the window is
active. Do not assume this means that the window actually has
keyboard or pointer focus.
so this is not equivalent to receiving/losing input focus and should not
be propagated as such
@fix
4 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 071f5e8fca..3d56fb7326 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -109,11 +109,6 @@ _xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSE } } - if (win->focused) - _ecore_wl2_input_focus_in_send(win); - else - _ecore_wl2_input_focus_out_send(win); - win->configure_serial = serial; if ((win->geometry.w == w) && (win->geometry.h == h)) w = h = 0; @@ -205,11 +200,6 @@ _zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel E } } - if (win->focused) - _ecore_wl2_input_focus_in_send(win); - else - _ecore_wl2_input_focus_out_send(win); - if ((win->geometry.w == width) && (win->geometry.h == height)) width = height = 0; else if ((!width) && (!height) && (!win->fullscreen) && (!win->maximized) && diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 5f84f914c6..921767aab7 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1552,6 +1552,13 @@ _elm_win_state_change(Ecore_Evas *ee) else efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_UNSTICK, NULL); } +#ifdef HAVE_ELEMENTARY_WL2 + if (sd->wl.win) + { + if (sd->csd.cur_focus != ecore_wl2_window_activated_get(sd->wl.win)) + _elm_win_frame_style_update(sd, 0, 1); + } +#endif if (ch_fullscreen) { _elm_win_frame_style_update(sd, 0, 1); @@ -4365,7 +4372,13 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool maximized = sd->maximized; shadow = sd->csd.need_shadow && (!sd->fullscreen) && (!sd->maximized); if (alpha && borderless) shadow = 0; +#ifdef HAVE_ELEMENTARY_WL2 + if (sd->wl.win) + focus = ecore_wl2_window_activated_get(sd->wl.win); + else +#else focus = ecore_evas_focus_get(sd->ee); +#endif bg_solid = sd->csd.need_bg_solid; bg_standard = sd->csd.need_bg_standard; unresizable = sd->csd.need_unresizable; diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 4d60e19d1b..6f5279424f 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -351,7 +351,7 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_ Ecore_Evas_Engine_Wl_Data *wdata; Ecore_Wl2_Event_Window_Configure *ev; int nw = 0, nh = 0, fw, fh, pfw, pfh; - Eina_Bool prev_max, prev_full, state_change = EINA_FALSE; + Eina_Bool active, prev_max, prev_full, state_change = EINA_FALSE; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -369,6 +369,8 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_ (ev->states & ECORE_WL2_WINDOW_STATE_MAXIMIZED) == ECORE_WL2_WINDOW_STATE_MAXIMIZED; ee->prop.fullscreen = (ev->states & ECORE_WL2_WINDOW_STATE_FULLSCREEN) == ECORE_WL2_WINDOW_STATE_FULLSCREEN; + active = wdata->activated; + wdata->activated = ecore_wl2_window_activated_get(wdata->win); nw = ev->w; nh = ev->h; @@ -377,7 +379,8 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_ pfh = fh = wdata->win->geometry.h - wdata->content.h; if ((prev_max != ee->prop.maximized) || - (prev_full != ee->prop.fullscreen)) + (prev_full != ee->prop.fullscreen) || + (active != wdata->activated)) { state_change = EINA_TRUE; _ecore_evas_wl_common_state_update(ee); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index 34bce19f8b..4dfebf8da8 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -50,6 +50,7 @@ struct _Ecore_Evas_Engine_Wl_Data Eina_Bool sync_done : 1; Eina_Bool defer_show : 1; Eina_Bool reset_pending : 1; + Eina_Bool activated : 1; }; Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name); |