From 47a878e4cda703d3a623ca348988a4c1cb00b1ef Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 26 Oct 2007 19:35:07 +0200 Subject: [PATCH] move set_shape in client.c to window_setshape in window.c --- client.c | 13 +------------ client.h | 1 - event.c | 2 +- window.c | 12 ++++++++++++ window.h | 1 + 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/client.c b/client.c index 750e0afd..6d4e264b 100644 --- a/client.c +++ b/client.c @@ -411,7 +411,7 @@ manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf) if(awesomeconf->have_shape) { XShapeSelectInput(c->display, w, ShapeNotifyMask); - set_shape(c); + window_setshape(c->display, c->phys_screen, c->win); } /* grab buttons */ @@ -662,17 +662,6 @@ updatesizehints(Client *c) && c->maxw == c->minw && c->maxh == c->minh); } -void -set_shape(Client *c) -{ - int bounding_shaped; - int i, b; unsigned int u; /* dummies */ - /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */ - if (XShapeQueryExtents(c->display, c->win, &bounding_shaped, &i, &i, - &u, &u, &b, &i, &i, &u, &u) && bounding_shaped) - XShapeCombineShape(c->display, RootWindow(c->display, c->phys_screen), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet); -} - /** Set selected client transparency * \param awesomeconf awesome config * \param arg unused arg diff --git a/client.h b/client.h index 8ca84130..54a204c8 100644 --- a/client.h +++ b/client.h @@ -41,7 +41,6 @@ void unmanage(Client *, long, awesome_config *); inline void updatesizehints(Client *); void updatetitle(Client *); void saveprops(Client *, int); -void set_shape(Client *); UICB_PROTO(uicb_killclient); UICB_PROTO(uicb_moveresize); diff --git a/event.c b/event.c index 9446eea1..34b50aa5 100644 --- a/event.c +++ b/event.c @@ -515,7 +515,7 @@ handle_event_shape(XEvent * e, Client *c = get_client_bywin(*awesomeconf->clients, ev->window); if(c) - set_shape(c); + window_setshape(c->display, c->phys_screen, c->win); } void diff --git a/window.c b/window.c index a206fd3a..10a787af 100644 --- a/window.c +++ b/window.c @@ -20,6 +20,7 @@ */ #include +#include #include "window.h" #include "util.h" @@ -81,6 +82,17 @@ window_configure(Display *disp, Window win, int x, int y, int w, int h, int bord return XSendEvent(disp, win, False, StructureNotifyMask, (XEvent *) & ce); } +void +window_setshape(Display *disp, int screen, Window win) +{ + int bounding_shaped; + int i, b; unsigned int u; /* dummies */ + /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */ + if(XShapeQueryExtents(disp, win, &bounding_shaped, &i, &i, + &u, &u, &b, &i, &i, &u, &u) && bounding_shaped) + XShapeCombineShape(disp, RootWindow(disp, screen), ShapeBounding, 0, 0, win, ShapeBounding, ShapeSet); +} + void window_settrans(Display *disp, Window win, double opacity) { diff --git a/window.h b/window.h index b510365e..896dbb08 100644 --- a/window.h +++ b/window.h @@ -27,6 +27,7 @@ int window_setstate(Display *, Window, long); long window_getstate(Display *, Window); Status window_configure(Display *, Window, int, int, int, int, int); +void window_setshape(Display *, int, Window); void window_settrans(Display *, Window, double); #endif