<div dir="ltr"><div><div><div>Hi Ian and Nandor,<br><br></div>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.<br><br></div>Ian:<br><br></div>The patch you submitted fixes the problem. A couple topical things I noticed are:<div><div><div><div><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 21, 2017 at 4:03 AM, Ray, Ian (GE Healthcare) <span dir="ltr"><<a href="mailto:ian.ray@ge.com" target="_blank">ian.ray@ge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 20/12/2017, 13.19, "Daniel Stone" <<a href="mailto:daniel@fooishbar.org">daniel@fooishbar.org</a>> wrote:<br>
><br>
> Hi Ian and Nandor,<br>
><br>
> On 20 December 2017 at 10:09, Ian Ray <<a href="mailto:ian.ray@ge.com">ian.ray@ge.com</a>> wrote:<br>
> > The input area for an undecorated non-fullscreen window is based on the<br>
> > window size itself.<br>
> ><br>
> > Fixes a case where mouse events in the `invisible' window margin failed<br>
> > to reach the window behind.<br>
><br>
> Scott sent some patches to fix similar issues a while ago:<br>
> <a href="https://lists.freedesktop.org/archives/wayland-devel/2017-June/thread.html#34332" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2017-<wbr>June/thread.html#34332</a><br>
><br>
> I had some questions here:<br>
> <a href="https://lists.freedesktop.org/archives/wayland-devel/2017-December/036116.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2017-<wbr>December/036116.html</a><br>
> <a href="https://lists.freedesktop.org/archives/wayland-devel/2017-December/036117.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2017-<wbr>December/036117.html</a><br>
><br>
> Would you have any input on these?<br>
<br>
</span>Hi Daniel,<br>
<br>
After checking Scott's earlier work, and review comments, together with<br>
testing decorated and undecorated windows, it *seems* like the input<br>
region change is the thing that is needed.<br>
<br>
RFC pasted below.<br>
<br>
Tested that X cursor changes shape at expected boundaries for both<br>
decorated and undecorated windows.<br>
<br>
Tested that mouse clicks in the shadow are received by the window<br>
underneath.<br>
<br>
However, clicks in the shadow region do not cause focus to change.<br>
This suggests that there is some other transformation that I have<br>
not found...<br>
<br>
The other reason for the RFC is that it is clear that shared/frame.c<br>
does not consider the case where there are no decorations.  I'm not<br>
sure if it should.<br>
<br>
<br>
> Cheers,<br>
> Daniel<br>
<br>
Thanks,<br>
Ian<br>
<br>
----8<----<br>
<br>
Subject: [RFC PATCH weston 1/1] xwm: do not include shadow in input region<br>
<br>
The window frame was created with position and size which include<br>
an offset for margins and shadow.  Set the input region to ignore<br>
shadow.<br>
<span class="gmail-"><br>
Signed-off-by: Ian Ray <<a href="mailto:ian.ray@ge.com">ian.ray@ge.com</a>><br>
---<br>
</span> xwayland/window-manager.c | 32 ++++++++++++++++++++++++++++++<wbr>++<br>
 1 file changed, 32 insertions(+)<br>
<br>
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c<br>
index d529d41..884f0f4 100644<br>
--- a/xwayland/window-manager.c<br>
+++ b/xwayland/window-manager.c<br>
@@ -707,6 +707,22 @@ weston_wm_window_get_child_<wbr>position(struct weston_wm_window *window,<br>
 }<br>
<br>
 static void<br>
+weston_wm_window_get_input_<wbr>rect(struct weston_wm_window *window,<br>
+                               int32_t *x, int32_t *y,<br>
+                               int32_t *width, int32_t *height)<br>
+{<br>
+       struct theme *t = window->wm->theme;<br></blockquote><div><br></div><div>t is an unused variable.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+       if (!window->decorate) {<br>
+               weston_wm_window_get_child_<wbr>position(window, x, y);<br>
+               *width = window->width;<br>
+               *height = window->height;<br>
+       } else {<br>
+               frame_input_rect(window-><wbr>frame, x, y, width, height);<br>
+       }<br>
+}<br>
+<br>
+static void<br>
 weston_wm_window_send_<wbr>configure_notify(struct weston_wm_window *window)<br>
 {<br>
        xcb_configure_notify_event_t configure_notify;<br>
@@ -1031,6 +1047,7 @@ static void<br>
 weston_wm_window_create_frame(<wbr>struct weston_wm_window *window)<br>
 {<br>
        struct weston_wm *wm = window->wm;<br>
+       xcb_rectangle_t rect;<br>
        uint32_t values[3];<br>
        int x, y, width, height;<br>
        int buttons = FRAME_BUTTON_CLOSE;<br>
@@ -1086,6 +1103,21 @@ weston_wm_window_create_frame(<wbr>struct weston_wm_window *window)<br>
                                                             &wm->format_rgba,<br>
                                                             width, height);<br>
<br>
+       weston_wm_window_get_input_<wbr>rect(window, &rect.x, &rect.y, &rect.width, &rect.height);<br></blockquote><div><br></div><div>Perhaps a cast could be used when calling weston_wm_window_get_input_<wbr>rect() something like<br></div><div> </div><div>weston_wm_window_get_input_rect(window, (int32_t *)&rect.x, (int32_t *)&rect.y,<br>                                        (int32_t *)&rect.width, (int32_t *)&rect.height);</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+       /* The window frame was created with position and size which include<br>
+        * an offset for margins and shadow.  Set the input region to ignore<br>
+        * shadow. */<br>
+       xcb_shape_rectangles(wm->conn,<br>
+                            XCB_SHAPE_SO_SET,<br>
+                            XCB_SHAPE_SK_INPUT,<br>
+                            0,<br>
+                            window->frame_id,<br>
+                            0,<br>
+                            0,<br>
+                            1,<br>
+                            &rect);<br>
+<br>
        hash_table_insert(wm->window_<wbr>hash, window->frame_id, window);<br>
 }<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
--<br>
2.10.1<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks,</div><div class="gmail_extra">Scott<br></div></div></div></div></div></div></div></div></div>