On Tue, 6 Mar 2018 20:13:54 +0100
Emmanuel Gil Peyrot <linkma...@linkmauve.fr> wrote:

> On Mon, Feb 19, 2018 at 12:18:51PM -0700, Scott Moreau wrote:
> > Commit 332d1892 introduced a bug because the window was
> > shaped only when the frame was created, leaving the input
> > region unchanged regardless if the window was resized.
> > This patch updates the input region shape on resize,
> > fixing the problem.  
> 
> This fixes the issue I had with Firefox, thanks!
> 
> Reviewed-by: Emmanuel Gil Peyrot <linkma...@linkmauve.fr>
> Tested-by: Emmanuel Gil Peyrot <linkma...@linkmauve.fr>
> 
> > ---
> >  xwayland/window-manager.c | 46 
> > +++++++++++++++++++++++++++-------------------
> >  1 file changed, 27 insertions(+), 19 deletions(-)
> > 
> > diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
> > index c307e19..5588166 100644
> > --- a/xwayland/window-manager.c
> > +++ b/xwayland/window-manager.c
> > @@ -659,6 +659,30 @@ weston_wm_window_get_input_rect(struct 
> > weston_wm_window *window,
> >  }
> >  
> >  static void
> > +weston_wm_window_shape(struct weston_wm_window *window)
> > +{
> > +   struct weston_wm *wm = window->wm;
> > +   xcb_rectangle_t rect;
> > +   int x, y, width, height;
> > +
> > +   weston_wm_window_get_input_rect(window, &x, &y, &width, &height);
> > +
> > +   rect.x = x;
> > +   rect.y = y;
> > +   rect.width = width;
> > +   rect.height = 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);
> > +}
> > +
> > +static void
> >  weston_wm_window_send_configure_notify(struct weston_wm_window *window)
> >  {
> >     xcb_configure_notify_event_t configure_notify;
> > @@ -789,6 +813,8 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, 
> > xcb_generic_event_t *eve
> >                     xwayland_api->set_xwayland(window->shsurf,
> >                                                window->x, window->y);
> >     }
> > +
> > +   weston_wm_window_shape(window);
> >  }

Hi,

something is wrong:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffedcebc89 in frame_refresh_geometry (frame=0x0) at 
/home/pq/git/weston/shared/frame.c:535
535             struct theme *t = frame->theme;
(gdb) bt
#0  0x00007fffedcebc89 in frame_refresh_geometry (frame=0x0) at 
/home/pq/git/weston/shared/frame.c:535
#1  0x00007fffedcec01f in frame_input_rect (frame=0x0, x=0x7fffffffd548, 
y=0x7fffffffd54c, width=0x7fffffffd550, height=0x7fffffffd554)
    at /home/pq/git/weston/shared/frame.c:630
#2  0x00007fffedcdddb8 in weston_wm_window_get_input_rect 
(window=0x555555e2e280, x=0x7fffffffd548, y=0x7fffffffd54c, 
width=0x7fffffffd550, 
    height=0x7fffffffd554) at /home/pq/git/weston/xwayland/window-manager.c:657
#3  0x00007fffedcdde00 in weston_wm_window_shape (window=0x555555e2e280) at 
/home/pq/git/weston/xwayland/window-manager.c:668
#4  0x00007fffedcde403 in weston_wm_handle_configure_notify (wm=0x555555da3230, 
event=0x555555e2e420) at /home/pq/git/weston/xwayland/window-manager.c:817
#5  0x00007fffedce1441 in weston_wm_handle_event (fd=35, mask=1, 
data=0x555555da3230) at /home/pq/git/weston/xwayland/window-manager.c:2265
#6  0x00007ffff798fd42 in wl_event_loop_dispatch (loop=0x55555576a250, 
timeout=timeout@entry=-1) at src/event-loop.c:641
#7  0x00007ffff798e4fa in wl_display_run (display=0x55555576a170) at 
src/wayland-server.c:1260
#8  0x000055555555c3b7 in main (argc=1, argv=0x7fffffffdbb8) at 
/home/pq/git/weston/compositor/main.c:1867

I triggered this crash with kcachegrind, by opening a drop-down item on
the UI a couple of times. This seems to be a regression caused by this
patch. (Unrelatedly, the kcachegrind menus and drop-downs open at
consistent but wrong positions, but that is not caused by this patch.)

I would guess that something is breaking assumptions between
window->decorate and window->frame, since it crashes on NULL frame.

FWIW, this is my short XWM manual check list:
- xterm, and menus
- geany, and menus, tooltips
- printf 'eka\ntoka\nkol\nnel\nvii\nkuusix\n' | dmenu -l 4
- gimp, and toolboxes, menus, tooltips
- kcachegrind, and menus, tooltips


Thanks,
pq

Attachment: pgpetcfX1zTtx.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to