<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 19, 2018 at 1:13 PM, Derek Foreman <span dir="ltr"><<a href="mailto:derekf@osg.samsung.com" target="_blank">derekf@osg.samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2018-03-16 06:42 PM, Scott Moreau wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Pekka,<span class=""><br>
<br>
On Fri, Mar 16, 2018 at 9:20 AM, Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a> <mailto:<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>>> wrote:<br>
<br>
On Tue, 13 Mar 2018 21:22:04 -0600<br></span><span class="">
Scott Moreau <<a href="mailto:oreaus@gmail.com" target="_blank">oreaus@gmail.com</a> <mailto:<a href="mailto:oreaus@gmail.com" target="_blank">oreaus@gmail.com</a>>> wrote:<br>
<br>
> Commit 332d1892 introduced a bug because the window was<br>
> shaped only when the frame was created, leaving the input<br>
> region unchanged regardless if the window was resized.<br>
> This patch updates the input region shape on resize,<br>
> fixing the problem.<br>
><br>
> ---<br>
><br>
> Changed in v2:<br>
><br>
> - Bail in shape function if (window->override_redirect || !window->frame)<br>
> - Call shape function from send_configure()<br>
><br>
> xwayland/window-manager.c | 53 +++++++++++++++++++++++++++++-<wbr>-----------------<br>
> 1 file changed, 33 insertions(+), 20 deletions(-)<br>
<br>
Hi,<br>
<br>
while trying to wrap my head around this, I started feeling dizzy. For<br>
real. So I have to keep this short.<br>
<br>
<br>
I think this is what happens when trying to sync two display servers.<br>
<br>
<br>
The first decision we should make is, do we want a quick patch for an<br>
immediate issue at hand, or do we want to make things better in the long<br>
run. Taking in this patch as is seems to be the former to me, and given<br>
the phase of the release cycle can be justified.<br>
<br>
The following mind flow is for a long term solution, and the comments<br>
inlined with the code below are for the quick patch.<br>
</span></blockquote>
<br>
FWIW, I'd be open to landing something quick at this point. The bug it fixes seems hugely annoying. I resize an xterm, and I can't click in the new area.<br>
<br>
Alternately, I'm wondering if we should consider reverting the patch that introduced this bug? I guess it wasn't tested well enough, and this behaviour seems more painful than what it was intended to fix?</blockquote><div><br></div><div>I think a revert would be a good place to start. The patch also has whitespace that does not match surrounding code.<br><br></div><div>To clarify the bug, start an xwayland window and resize it to a larger dimension. Mouse input will only work for the size of the window before resize. The rest of the window does not respond to input.<br><br></div><div>Thanks,<br></div><div>Scott<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Taking a step back, the aim to keep the input shape up-to-date whenever<br>
something happens.<br>
<br>
If we have a frame window with decorations, then we call<br>
frame_resize_inside() to adjust its size. Would it not be logical to<br>
set the input shape in at least all those cases?<br>
<br>
<br>
Yes, maybe there can be a function that calls frame_resize_inside and the shape function to replace calls to frame_resize_inside.<br>
<br>
<br>
Except it looks like we can have decorated O-R windows, and those<br>
should be exempt? Oh, I'm told decorated O-R windows don't make sense,<br>
but I see some code in weston that would only apply in such case...<br>
if (window->override_redirect) { ... if (window->frame)<br>
frame_resize_inside(...)<br>
<br>
All windows that go through map_request handler will get the frame<br>
window (window->frame_id) and the frame (window->frame) created. The<br>
only windows that don't get this treatment are therefore windows that<br>
are O-R at the time of mapping them. It's somewhat complicated by the<br>
fact that XWM does not support dynamically changing O-R flag... or<br>
maybe it makes it easier.<br>
<br>
Now, we have configure_request and configure_notify handlers. O-R<br>
windows will not hit configure_request handler, and the X server<br>
processes XWM's configure commands immediately. This sounds like<br>
configure_request handler would be a good place to update the input<br>
shape.<br>
<br>
<br>
Yes<br>
<br>
<br>
configure_notify handler gets called for O-R as well, and it happens<br>
after the fact, so updating there would be a tiny bit late. Would you<br>
agree?<br>
<br>
I was thinking there might be some change that comes in configure notify that we don't know about until the event happens.<br>
<br>
<br>
That leaves the XWM originated resizes, which boils down to...<br>
send_configure(), or actually weston_wm_window_configure()?<br>
<br>
Yes<br>
<br>
<br>
It looks like configure_request handler is open-coding all of<br>
weston_wm_window_configure() but it also adds some bits specific to the<br>
configure request.<br>
<br>
Am I making sense?<br>
<br>
Yes, and thanks for taking the time to try and help unravel this.<br>
<br>
<br>
> diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c<br>
> index c307e19..cd72a59 100644<br>
> --- a/xwayland/window-manager.c<br>
> +++ b/xwayland/window-manager.c<br>
> @@ -659,6 +659,33 @@ weston_wm_window_get_input_rec<wbr>t(struct<br>
weston_wm_window *window,<br>
> }<br>
><br>
> static void<br>
> +weston_wm_window_shape(struct weston_wm_window *window)<br>
> +{<br>
> + struct weston_wm *wm = window->wm;<br>
> + xcb_rectangle_t rect;<br>
> + int x, y, width, height;<br>
> +<br>
> + if (window->override_redirect || !window->frame)<br>
> + return;<br>
> +<br>
> + weston_wm_window_get_input_re<wbr>ct(window, &x, &y, &width,<br>
&height);<br>
> +<br>
> + rect.x = x;<br>
> + rect.y = y;<br>
> + rect.width = width;<br>
> + rect.height = height;<br>
> +<br>
> + /* The window frame was created with position and size<br>
which include<br>
> + * an offset for margins and shadow. Set the input region<br>
to ignore<br>
> + * shadow. */<br>
> + xcb_shape_rectangles(wm->conn<wbr>,<br>
> + XCB_SHAPE_SO_SET,<br>
> + XCB_SHAPE_SK_INPUT,<br>
> + 0, window->frame_id,<br>
> + 0, 0, 1, &rect);<br>
> +}<br>
> +<br>
> +static void<br>
> weston_wm_window_send_configur<wbr>e_notify(struct weston_wm_window<br>
*window)<br>
> {<br>
> xcb_configure_notify_event_t configure_notify;<br>
> @@ -789,6 +816,8 @@ weston_wm_handle_configure_not<wbr>ify(struct<br>
weston_wm *wm, xcb_generic_event_t *eve<br>
> xwayland_api->set_xwayland(wi<wbr>ndow->shsurf,<br>
> window->x,<br>
window->y);<br>
> }<br>
> +<br>
> + weston_wm_window_shape(window<wbr>);<br>
<br>
From Daniel I understood that there would have been a better place to<br>
call this?<br>
<br>
I must have misunderstood.<br>
</blockquote>
<br></div></div>
Since this thread's been quiet for a couple of days, I'll ask:<br>
where should this have gone? :)<br>
<br>
What needs to be resolved to move forward on this? Would rather not get to a weston final with this bug present.<br>
<br>
Thanks,<br>
Derek<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
> }<br>
><br>
> static void<br>
> @@ -983,7 +1012,6 @@ weston_wm_window_create_frame(<wbr>struct<br>
weston_wm_window *window)<br>
> {<br>
> struct weston_wm *wm = window->wm;<br>
> uint32_t values[3];<br>
> - xcb_rectangle_t rect;<br>
> int x, y, width, height;<br>
> int buttons = FRAME_BUTTON_CLOSE;<br>
><br>
> @@ -1040,26 +1068,9 @@ weston_wm_window_create_frame(<wbr>struct<br>
weston_wm_window *window)<br>
> &wm->format_rgba,<br>
> width,<br>
height);<br>
><br>
> - weston_wm_window_get_input_re<wbr>ct(window, &x, &y, &width,<br>
&height);<br>
> - rect.x = x;<br>
> - rect.y = y;<br>
> - rect.width = width;<br>
> - rect.height = height;<br>
> -<br>
> - /* The window frame was created with position and size<br>
which include<br>
> - * an offset for margins and shadow. Set the input region<br>
to ignore<br>
> - * shadow. */<br>
> - xcb_shape_rectangles(wm->conn<wbr>,<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>
> + weston_wm_window_shape(window<wbr>);<br>
> }<br>
><br>
> /*<br>
> @@ -2726,6 +2737,8 @@ send_configure(struct weston_surface<br>
*surface, int32_t width, int32_t height)<br>
> window->configure_source =<br>
> wl_event_loop_add_idle(wm->se<wbr>rver->loop,<br>
> weston_wm_window_configure,<br>
window);<br>
> +<br>
> + weston_wm_window_shape(window<wbr>);<br>
<br>
This means we do the shaping immediately, but the configure is postponed<br>
to the idle handler. Shouldn't those go together?<br>
<br>
Yes but what are you proposing to do to make them go together, call the shape function from weston_wm_window_configure() instead?<br>
<br>
<br>
OTOH, weston_wm_window_configure() is also called from<br>
weston_mw_window_set_toplevel(<wbr>). To me it seems it would be appropriate<br>
to call weston_wm_window_shape() from weston_wm_window_configure().<br>
Is it?<br>
<br>
> }<br>
><br>
> static void<br>
<br>
<br>
Thanks,<br>
pq<br>
<br>
<br>
Thanks,<br>
<br>
Scott<br>
<br>
<br>
<br></div></div><span class="">
______________________________<wbr>_________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedeskto<wbr>p.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>
<br>
</span></blockquote>
<br>
</blockquote></div><br></div></div>