[PATCH weston 1/1] xwayland - input size calculation correction

Scott Moreau oreaus at gmail.com
Sat Dec 23 01:13:34 UTC 2017


Hi Ian and Nandor,

I tested the initial patch and verified it does not fix the scenario I'm
trying, which is with two partially overlapping xcalc windows and hovering
the mouse over the buttons of the one below.

Ian:

The patch you submitted fixes the problem. A couple topical things I
noticed are:


On Thu, Dec 21, 2017 at 4:03 AM, Ray, Ian (GE Healthcare) <ian.ray at ge.com>
wrote:

> On 20/12/2017, 13.19, "Daniel Stone" <daniel at fooishbar.org> wrote:
> >
> > Hi Ian and Nandor,
> >
> > On 20 December 2017 at 10:09, Ian Ray <ian.ray at ge.com> wrote:
> > > The input area for an undecorated non-fullscreen window is based on the
> > > window size itself.
> > >
> > > Fixes a case where mouse events in the `invisible' window margin failed
> > > to reach the window behind.
> >
> > Scott sent some patches to fix similar issues a while ago:
> > https://lists.freedesktop.org/archives/wayland-devel/2017-
> June/thread.html#34332
> >
> > I had some questions here:
> > https://lists.freedesktop.org/archives/wayland-devel/2017-
> December/036116.html
> > https://lists.freedesktop.org/archives/wayland-devel/2017-
> December/036117.html
> >
> > Would you have any input on these?
>
> Hi Daniel,
>
> After checking Scott's earlier work, and review comments, together with
> testing decorated and undecorated windows, it *seems* like the input
> region change is the thing that is needed.
>
> RFC pasted below.
>
> Tested that X cursor changes shape at expected boundaries for both
> decorated and undecorated windows.
>
> Tested that mouse clicks in the shadow are received by the window
> underneath.
>
> However, clicks in the shadow region do not cause focus to change.
> This suggests that there is some other transformation that I have
> not found...
>
> The other reason for the RFC is that it is clear that shared/frame.c
> does not consider the case where there are no decorations.  I'm not
> sure if it should.
>
>
> > Cheers,
> > Daniel
>
> Thanks,
> Ian
>
> ----8<----
>
> Subject: [RFC PATCH weston 1/1] xwm: do not include shadow in input region
>
> The window frame was created with position and size which include
> an offset for margins and shadow.  Set the input region to ignore
> shadow.
>
> Signed-off-by: Ian Ray <ian.ray at ge.com>
> ---
>  xwayland/window-manager.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
> index d529d41..884f0f4 100644
> --- a/xwayland/window-manager.c
> +++ b/xwayland/window-manager.c
> @@ -707,6 +707,22 @@ weston_wm_window_get_child_position(struct
> weston_wm_window *window,
>  }
>
>  static void
> +weston_wm_window_get_input_rect(struct weston_wm_window *window,
> +                               int32_t *x, int32_t *y,
> +                               int32_t *width, int32_t *height)
> +{
> +       struct theme *t = window->wm->theme;
>

t is an unused variable.


> +
> +       if (!window->decorate) {
> +               weston_wm_window_get_child_position(window, x, y);
> +               *width = window->width;
> +               *height = window->height;
> +       } else {
> +               frame_input_rect(window->frame, x, y, width, height);
> +       }
> +}
> +
> +static void
>  weston_wm_window_send_configure_notify(struct weston_wm_window *window)
>  {
>         xcb_configure_notify_event_t configure_notify;
> @@ -1031,6 +1047,7 @@ static void
>  weston_wm_window_create_frame(struct weston_wm_window *window)
>  {
>         struct weston_wm *wm = window->wm;
> +       xcb_rectangle_t rect;
>         uint32_t values[3];
>         int x, y, width, height;
>         int buttons = FRAME_BUTTON_CLOSE;
> @@ -1086,6 +1103,21 @@ weston_wm_window_create_frame(struct
> weston_wm_window *window)
>
>  &wm->format_rgba,
>                                                              width,
> height);
>
> +       weston_wm_window_get_input_rect(window, &rect.x, &rect.y,
> &rect.width, &rect.height);
>

Perhaps a cast could be used when calling weston_wm_window_get_input_rect()
something like

weston_wm_window_get_input_rect(window, (int32_t *)&rect.x, (int32_t
*)&rect.y,
                                        (int32_t *)&rect.width, (int32_t
*)&rect.height);

+
> +       /* The window frame was created with position and size which
> include
> +        * an offset for margins and shadow.  Set the input region to
> ignore
> +        * shadow. */
> +       xcb_shape_rectangles(wm->conn,
> +                            XCB_SHAPE_SO_SET,
> +                            XCB_SHAPE_SK_INPUT,
> +                            0,
> +                            window->frame_id,
> +                            0,
> +                            0,
> +                            1,
> +                            &rect);
> +
>         hash_table_insert(wm->window_hash, window->frame_id, window);
>  }
>
> --
> 2.10.1
>
>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


Thanks,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20171222/c6ad20a6/attachment-0001.html>


More information about the wayland-devel mailing list