aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2011-03-22 10:49:46 +0000
committerokan2011-03-22 10:49:46 +0000
commit235a8f52c8f74d78040514f71ba5664c913d6622 (patch)
tree898398be186f2af0a23d9048aee5195def12d5b7
parentebcb441521708792051913bc8ce6b0891b402d77 (diff)
downloadcwm-235a8f52c8f74d78040514f71ba5664c913d6622.tar.gz
remove XXX and move a configure event out of the event handler functions.
reminded by a similiar diff from Thomas Pfaff. ok oga@
-rw-r--r--calmwm.h6
-rw-r--r--client.c8
-rw-r--r--xevents.c24
-rw-r--r--xutil.c21
4 files changed, 28 insertions, 31 deletions
diff --git a/calmwm.h b/calmwm.h
index 5fc5372..75ac1ad 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.h,v 1.119 2011/03/22 10:47:59 okan Exp $
+ * $Id: calmwm.h,v 1.120 2011/03/22 10:49:46 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -375,9 +375,6 @@ struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
void (*)(struct menu *, int));
void menu_init(struct screen_ctx *);
-/* XXX should be xu_ */
-void xev_reconfig(struct client_ctx *);
-
void xev_loop(void);
void xu_getatoms(void);
@@ -390,6 +387,7 @@ void xu_ptr_setpos(Window, int, int);
void xu_ptr_getpos(Window, int *, int *);
void xu_key_grab(Window, int, int);
void xu_key_ungrab(Window, int, int);
+void xu_configure(struct client_ctx *);
void xu_sendmsg(Window, Atom, long);
int xu_getprop(Window, Atom, Atom, long, u_char **);
int xu_getstrprop(Window, Atom, char **);
diff --git a/client.c b/client.c
index 536bcf6..d4b0afd 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.77 2011/02/13 20:09:57 okan Exp $
+ * $Id: client.c,v 1.78 2011/03/22 10:49:46 okan Exp $
*/
#include <sys/param.h>
@@ -114,7 +114,7 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
XAddToSaveSet(X_Dpy, cc->win);
/* Notify client of its configuration. */
- xev_reconfig(cc);
+ xu_configure(cc);
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
xu_setstate(cc, cc->state);
@@ -390,14 +390,14 @@ client_resize(struct client_ctx *cc)
XMoveResizeWindow(X_Dpy, cc->win, cc->geom.x,
cc->geom.y, cc->geom.width, cc->geom.height);
- xev_reconfig(cc);
+ xu_configure(cc);
}
void
client_move(struct client_ctx *cc)
{
XMoveWindow(X_Dpy, cc->win, cc->geom.x, cc->geom.y);
- xev_reconfig(cc);
+ xu_configure(cc);
}
void
diff --git a/xevents.c b/xevents.c
index 1ff1b58..b05df53 100644
--- a/xevents.c
+++ b/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: xevents.c,v 1.50 2010/09/25 20:04:55 okan Exp $
+ * $Id: xevents.c,v 1.51 2011/03/22 10:49:46 okan Exp $
*/
/*
@@ -166,7 +166,7 @@ xev_handle_configurerequest(XEvent *ee)
wc.border_width = cc->bwidth;
XConfigureWindow(X_Dpy, cc->win, e->value_mask, &wc);
- xev_reconfig(cc);
+ xu_configure(cc);
} else {
/* let it do what it wants, it'll be ours when we map it. */
wc.x = e->x;
@@ -213,25 +213,6 @@ test:
}
-void
-xev_reconfig(struct client_ctx *cc)
-{
- XConfigureEvent ce;
-
- ce.type = ConfigureNotify;
- ce.event = cc->win;
- ce.window = cc->win;
- ce.x = cc->geom.x;
- ce.y = cc->geom.y;
- ce.width = cc->geom.width;
- ce.height = cc->geom.height;
- ce.border_width = cc->bwidth;
- ce.above = None;
- ce.override_redirect = 0;
-
- XSendEvent(X_Dpy, cc->win, False, StructureNotifyMask, (XEvent *)&ce);
-}
-
static void
xev_handle_enternotify(XEvent *ee)
{
@@ -429,7 +410,6 @@ xev_handle_expose(XEvent *ee)
client_draw_border(cc);
}
-
volatile sig_atomic_t _xev_quit = 0;
void
diff --git a/xutil.c b/xutil.c
index 2473ecc..b50242a 100644
--- a/xutil.c
+++ b/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: xutil.c,v 1.32 2010/05/22 22:32:08 okan Exp $
+ * $Id: xutil.c,v 1.33 2011/03/22 10:49:46 okan Exp $
*/
#include <sys/param.h>
@@ -119,6 +119,25 @@ xu_key_ungrab(Window win, int mask, int keysym)
}
void
+xu_configure(struct client_ctx *cc)
+{
+ XConfigureEvent ce;
+
+ ce.type = ConfigureNotify;
+ ce.event = cc->win;
+ ce.window = cc->win;
+ ce.x = cc->geom.x;
+ ce.y = cc->geom.y;
+ ce.width = cc->geom.width;
+ ce.height = cc->geom.height;
+ ce.border_width = cc->bwidth;
+ ce.above = None;
+ ce.override_redirect = 0;
+
+ XSendEvent(X_Dpy, cc->win, False, StructureNotifyMask, (XEvent *)&ce);
+}
+
+void
xu_sendmsg(Window win, Atom atm, long val)
{
XEvent e;