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
This commit is contained in:
Mike Blumenkrantz 2017-05-17 16:02:53 -04:00
parent 704a22d1c9
commit 5ebdf8f341
4 changed files with 19 additions and 12 deletions

View File

@ -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) &&

View File

@ -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;

View File

@ -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);

View File

@ -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);