move set_shape in client.c to window_setshape in window.c
This commit is contained in:
parent
bd0dc10842
commit
47a878e4cd
13
client.c
13
client.c
|
@ -411,7 +411,7 @@ manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
||||||
if(awesomeconf->have_shape)
|
if(awesomeconf->have_shape)
|
||||||
{
|
{
|
||||||
XShapeSelectInput(c->display, w, ShapeNotifyMask);
|
XShapeSelectInput(c->display, w, ShapeNotifyMask);
|
||||||
set_shape(c);
|
window_setshape(c->display, c->phys_screen, c->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* grab buttons */
|
/* grab buttons */
|
||||||
|
@ -662,17 +662,6 @@ updatesizehints(Client *c)
|
||||||
&& c->maxw == c->minw && c->maxh == c->minh);
|
&& 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
|
/** Set selected client transparency
|
||||||
* \param awesomeconf awesome config
|
* \param awesomeconf awesome config
|
||||||
* \param arg unused arg
|
* \param arg unused arg
|
||||||
|
|
1
client.h
1
client.h
|
@ -41,7 +41,6 @@ void unmanage(Client *, long, awesome_config *);
|
||||||
inline void updatesizehints(Client *);
|
inline void updatesizehints(Client *);
|
||||||
void updatetitle(Client *);
|
void updatetitle(Client *);
|
||||||
void saveprops(Client *, int);
|
void saveprops(Client *, int);
|
||||||
void set_shape(Client *);
|
|
||||||
|
|
||||||
UICB_PROTO(uicb_killclient);
|
UICB_PROTO(uicb_killclient);
|
||||||
UICB_PROTO(uicb_moveresize);
|
UICB_PROTO(uicb_moveresize);
|
||||||
|
|
2
event.c
2
event.c
|
@ -515,7 +515,7 @@ handle_event_shape(XEvent * e,
|
||||||
Client *c = get_client_bywin(*awesomeconf->clients, ev->window);
|
Client *c = get_client_bywin(*awesomeconf->clients, ev->window);
|
||||||
|
|
||||||
if(c)
|
if(c)
|
||||||
set_shape(c);
|
window_setshape(c->display, c->phys_screen, c->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
12
window.c
12
window.c
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
#include <X11/extensions/shape.h>
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "util.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);
|
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
|
void
|
||||||
window_settrans(Display *disp, Window win, double opacity)
|
window_settrans(Display *disp, Window win, double opacity)
|
||||||
{
|
{
|
||||||
|
|
1
window.h
1
window.h
|
@ -27,6 +27,7 @@
|
||||||
int window_setstate(Display *, Window, long);
|
int window_setstate(Display *, Window, long);
|
||||||
long window_getstate(Display *, Window);
|
long window_getstate(Display *, Window);
|
||||||
Status window_configure(Display *, Window, int, int, int, int, int);
|
Status window_configure(Display *, Window, int, int, int, int, int);
|
||||||
|
void window_setshape(Display *, int, Window);
|
||||||
void window_settrans(Display *, Window, double);
|
void window_settrans(Display *, Window, double);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue