move set_shape in client.c to window_setshape in window.c

This commit is contained in:
Julien Danjou 2007-10-26 19:35:07 +02:00
parent bd0dc10842
commit 47a878e4cd
5 changed files with 15 additions and 14 deletions

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -20,6 +20,7 @@
*/
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#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)
{

View File

@ -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