Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Don't decorate windows with an empty shape.
Browse files Browse the repository at this point in the history
Some clients (e.g. Wine) set windows to have an empty XShape bounding region.
They may also set those windows to have decorations.  In that situation,
quartz-wm was producing weird small, black windows for what should be
invisible windows.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 901809d)
  • Loading branch information
KenThomases authored and jeremyhu committed Apr 22, 2012
1 parent 8e96895 commit d546ddb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/x-input.m
Expand Up @@ -689,7 +689,8 @@ static void x_event_configure_request(XConfigureRequestEvent *e) {
if (w == nil || w->_id != e->window || e->kind != ShapeBounding)
return;

w->_shaped = YES;
w->_shaped = e->shaped ? YES : NO;
w->_shaped_empty = (e->shaped && (e->width <= 0 || e->height <= 0));

[w update_shape];
}
Expand Down
1 change: 1 addition & 0 deletions src/x-window.h
Expand Up @@ -63,6 +63,7 @@

unsigned _reparented :1;
unsigned _shaped :1;
unsigned _shaped_empty :1;
unsigned _removed :1;
unsigned _deleted :1;
unsigned _focused :1;
Expand Down
3 changes: 2 additions & 1 deletion src/x-window.m
Expand Up @@ -420,7 +420,7 @@ - (void) place_window {
}

-(xp_frame_class) get_xp_frame_class {
if(_fullscreen)
if(_fullscreen || _shaped_empty)
return _frame_behavior | XP_FRAME_CLASS_DECOR_NONE;
return _frame_behavior | _frame_decor;
}
Expand Down Expand Up @@ -918,6 +918,7 @@ - (void) update_shaped
&wws, &hws, &clip, &xbs, &ybs, &wbs, &hbs);

_shaped = bounding ? YES : NO;
_shaped_empty = (bounding && (wws <= 0 || hws <= 0));
}

- (void) update_shape:(X11Rect)or
Expand Down

0 comments on commit d546ddb

Please sign in to comment.