[PATCH weston v2] compositor: allow to control the vt switching
Daniel Stone
daniel at fooishbar.org
Thu Jun 23 07:37:26 UTC 2016
Hi Guilio,
On 5 June 2016 at 03:48, Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> @@ -97,8 +97,17 @@ switch_vt_binding(struct weston_keyboard *keyboard,
> uint32_t time, uint32_t key, void *data)
> {
> struct weston_compositor *compositor = data;
> + struct weston_launcher *launcher = compositor->launcher;
> + int vt = key - KEY_F1 + 1;
> + weston_compositor_vt_switcher_func_t switcher = launcher->vt_switcher;
>
> - weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1);
> + if (vt == launcher->iface->get_vt(launcher))
> + return;
This bit seems like it should be a separate change.
> + if (switcher)
> + launcher->vt_switcher(compositor, vt);
> + else
> + weston_launcher_activate_vt(launcher, vt);
In keeping with most of the rest of our vfunc handling, perhaps it'd
be better to set a default vt_switcher() hook which just called
weston_launcher_activate_vt() directly, saving the conditional here.
Cheers,
Daniel
More information about the wayland-devel
mailing list