mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
mutter-window: Add error traps check_needs_reshape
A window might change its shape and close immediately and thus causing XShapeGetRectangles to produce a BadWindow, use an error trap to avoid that.
This commit is contained in:
parent
33e2d15495
commit
1123fca3f2
@ -1712,6 +1712,8 @@ static void
|
||||
check_needs_reshape (MutterWindow *self)
|
||||
{
|
||||
MutterWindowPrivate *priv = self->priv;
|
||||
MetaScreen *screen = priv->screen;
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
|
||||
if (!priv->needs_reshape)
|
||||
return;
|
||||
@ -1722,15 +1724,17 @@ check_needs_reshape (MutterWindow *self)
|
||||
#ifdef HAVE_SHAPE
|
||||
if (priv->shaped)
|
||||
{
|
||||
Display *xdisplay = meta_display_get_xdisplay (meta_window_get_display (priv->window));
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
XRectangle *rects;
|
||||
int n_rects, ordering;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
rects = XShapeGetRectangles (xdisplay,
|
||||
priv->xwindow,
|
||||
ShapeBounding,
|
||||
&n_rects,
|
||||
&ordering);
|
||||
meta_error_trap_pop (display, TRUE);
|
||||
|
||||
if (rects)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user