[PATCH weston v2] xwm: don't let X windows steal the focus

Daniel Stone daniel at fooishbar.org
Mon Mar 30 11:53:39 PDT 2015


Hi,

On 30 March 2015 at 19:05, Bill Spitzak <spitzak at gmail.com> wrote:
> On 03/29/2015 04:20 AM, Giulio Camuffo wrote:
>> +static void
>> +weston_wm_handle_focus_in(struct weston_wm *wm, xcb_generic_event_t
>> *event)
>> +{
>> +       xcb_focus_in_event_t *focus = (xcb_focus_in_event_t *) event;
>> +       /* Do not let X clients change the focus behind the compositor's
>> +        * back. Reset the focus to the old one if it changed. */
>> +       if (!wm->focus_window || focus->event != wm->focus_window->id)
>> +               weston_wm_send_focus_window(wm, wm->focus_window);
>> +}
>
>
> Is the window id really stored in focus->event?

Yeah, the 'event' field of many X11 events (including literally all
the input events) is set to the window the event was delivered to.

Cheers,
Daniel


More information about the wayland-devel mailing list