]> Dogcows Code - chaz/openbox/commitdiff
Handle InputShape type shaping too.
authorMikael Magnusson <mikachu@gmail.com>
Thu, 29 Jan 2009 21:33:44 +0000 (22:33 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Thu, 29 Jan 2009 21:35:56 +0000 (22:35 +0100)
Many composite apps use this to pass through clicks where they are transparent.

openbox/client.h
openbox/event.c
openbox/frame.c
openbox/frame.h

index a3d50b0e83d5610fd6edd529eec13e2b75e65d05..f55c7ac6e788b0bd0a4a35a8cc61b31629e2cd65 100644 (file)
@@ -246,6 +246,8 @@ struct _ObClient
 
     /*! 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 */
index 467af11c104a2d96c23845973dd4687e17205e38..8eb612a11859f1e9705198a129f44eaa882f5326 100644 (file)
@@ -1567,9 +1567,22 @@ static void event_handle_client(ObClient *client, XEvent *e)
     default:
         ;
 #ifdef SHAPE
-        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);
+            }
         }
 #endif
     }
index 704560bdd95aa2edbf6d1f8a95763521faa1d2e8..5e60d11c21437bf38cc0e9bd3b3a6d8266982899 100644 (file)
@@ -267,25 +267,26 @@ void frame_adjust_theme(ObFrame *self)
     set_theme_statics(self);
 }
 
-void frame_adjust_shape(ObFrame *self)
-{
 #ifdef SHAPE
+void frame_adjust_shape_kind(ObFrame *self, int kind)
+{
     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 */
-        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 */
-        XShapeCombineShape(ob_display, self->window, ShapeBounding,
+        XShapeCombineShape(ob_display, self->window, kind,
                            self->size.left,
                            self->size.top,
                            self->client->window,
-                           ShapeBounding, ShapeSet);
+                           kind, ShapeSet);
 
         num = 0;
         if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
@@ -308,9 +309,17 @@ void frame_adjust_shape(ObFrame *self)
         }
 
         XShapeCombineRectangles(ob_display, self->window,
-                                ShapeBounding, 0, 0, xrect, num,
+                                kind, 0, 0, xrect, num,
                                 ShapeUnion, Unsorted);
     }
+}
+#endif
+
+void frame_adjust_shape(ObFrame *self)
+{
+#ifdef SHAPE
+  frame_adjust_shape_kind(self, ShapeBounding);
+  frame_adjust_shape_kind(self, ShapeInput);
 #endif
 }
 
index fd5adf748701d49f943ad5a743564f3136a3ea64..8687381d0694209dc336352c79aaea28b10406aa 100644 (file)
@@ -205,6 +205,9 @@ void frame_free(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);
This page took 0.034092 seconds and 4 git commands to generate.