[PATCH weston v2] compositor: allow to control the vt switching

Giulio Camuffo giuliocamuffo at gmail.com
Wed Jun 29 08:48:33 UTC 2016


2016-06-23 9:37 GMT+02:00 Daniel Stone <daniel at fooishbar.org>:
> 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.

Maybe... on the other hand this allows to set the switcher back to
NULL, and fall back to the standard behavior. Not sure if that is
something we need.

>
> Cheers,
> Daniel


More information about the wayland-devel mailing list