Many composite apps use this to pass through clicks where they are transparent.
/*! The window uses shape extension to be non-rectangular? */
gboolean shaped;
/*! The window uses shape extension to be non-rectangular? */
gboolean shaped;
+ /*! The window uses shape extension to have non-rectangular input? */
+ gboolean shaped_input;
/*! The window is modal, so it must be processed before any windows it is
related to can be focused */
/*! The window is modal, so it must be processed before any windows it is
related to can be focused */
- if (extensions_shape && e->type == extensions_shape_event_basep) {
- client->shaped = ((XShapeEvent*)e)->shaped;
- frame_adjust_shape(client->frame);
+ {
+ int kind;
+ if (extensions_shape && e->type == extensions_shape_event_basep) {
+ switch (((XShapeEvent*)e)->kind) {
+ case ShapeBounding:
+ case ShapeClip:
+ client->shaped = ((XShapeEvent*)e)->shaped;
+ kind = ShapeBounding;
+ break;
+ case ShapeInput:
+ client->shaped_input = ((XShapeEvent*)e)->shaped;
+ kind = ShapeInput;
+ break;
+ }
+ frame_adjust_shape_kind(client->frame, kind);
+ }
set_theme_statics(self);
}
set_theme_statics(self);
}
-void frame_adjust_shape(ObFrame *self)
-{
+void frame_adjust_shape_kind(ObFrame *self, int kind)
+{
gint num;
XRectangle xrect[2];
gint num;
XRectangle xrect[2];
- if (!self->client->shaped) {
+ if (!((kind == ShapeBounding && self->client->shaped) ||
+ (kind == ShapeInput && self->client->shaped_input))) {
/* clear the shape on the frame window */
/* clear the shape on the frame window */
- XShapeCombineMask(ob_display, self->window, ShapeBounding,
+ XShapeCombineMask(ob_display, self->window, kind,
self->size.left,
self->size.top,
None, ShapeSet);
} else {
/* make the frame's shape match the clients */
self->size.left,
self->size.top,
None, ShapeSet);
} else {
/* make the frame's shape match the clients */
- XShapeCombineShape(ob_display, self->window, ShapeBounding,
+ XShapeCombineShape(ob_display, self->window, kind,
self->size.left,
self->size.top,
self->client->window,
self->size.left,
self->size.top,
self->client->window,
- ShapeBounding, ShapeSet);
num = 0;
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
num = 0;
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
}
XShapeCombineRectangles(ob_display, self->window,
}
XShapeCombineRectangles(ob_display, self->window,
- ShapeBounding, 0, 0, xrect, num,
+ kind, 0, 0, xrect, num,
+}
+#endif
+
+void frame_adjust_shape(ObFrame *self)
+{
+#ifdef SHAPE
+ frame_adjust_shape_kind(self, ShapeBounding);
+ frame_adjust_shape_kind(self, ShapeInput);
void frame_show(ObFrame *self);
void frame_hide(ObFrame *self);
void frame_adjust_theme(ObFrame *self);
void frame_show(ObFrame *self);
void frame_hide(ObFrame *self);
void frame_adjust_theme(ObFrame *self);
+#ifdef SHAPE
+void frame_adjust_shape_kind(ObFrame *self, int kind);
+#endif
void frame_adjust_shape(ObFrame *self);
void frame_adjust_area(ObFrame *self, gboolean moved,
gboolean resized, gboolean fake);
void frame_adjust_shape(ObFrame *self);
void frame_adjust_area(ObFrame *self, gboolean moved,
gboolean resized, gboolean fake);