aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2008-07-11 14:21:28 +0000
committerokan2008-07-11 14:21:28 +0000
commita3e52a291110ce7b866a0d11eeda1619d25f952b (patch)
tree781c99337b95a8386d0e787a95a49bf97148621c /xutil.c
parentdc3045573c35f2ee31dc1c012da1ff4408b6f264 (diff)
downloadcwm-a3e52a291110ce7b866a0d11eeda1619d25f952b.tar.gz
spacing, declaration lineup to be consistent throughout cwm,
readability, and a bit of knf. ok oga@
Diffstat (limited to '')
-rw-r--r--xutil.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/xutil.c b/xutil.c
index a76d5c0..f6553f1 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.7 2008/06/17 23:40:33 oga Exp $
+ * $Id: xutil.c,v 1.8 2008/07/11 14:21:28 okan Exp $
*/
#include "headers.h"
@@ -65,9 +65,9 @@ xu_btn_ungrab(Window win, int mask, u_int btn)
void
xu_ptr_getpos(Window rootwin, int *x, int *y)
{
- int tmp0, tmp1;
- u_int tmp2;
- Window w0, w1;
+ Window w0, w1;
+ int tmp0, tmp1;
+ u_int tmp2;
XQueryPointer(X_Dpy, rootwin, &w0, &w1, &tmp0, &tmp1, x, y, &tmp2);
}
@@ -81,8 +81,8 @@ xu_ptr_setpos(Window win, int x, int y)
void
xu_key_grab(Window win, int mask, int keysym)
{
- KeyCode code;
- int i;
+ KeyCode code;
+ int i;
code = XKeysymToKeycode(X_Dpy, keysym);
if ((XKeycodeToKeysym(X_Dpy, code, 0) != keysym) &&
@@ -98,7 +98,7 @@ xu_key_grab(Window win, int mask, int keysym)
void
xu_sendmsg(struct client_ctx *cc, Atom atm, long val)
{
- XEvent e;
+ XEvent e;
memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage;
@@ -114,9 +114,9 @@ xu_sendmsg(struct client_ctx *cc, Atom atm, long val)
int
xu_getprop(struct client_ctx *cc, Atom atm, Atom type, long len, u_char **p)
{
- Atom realtype;
- u_long n, extra;
- int format;
+ Atom realtype;
+ u_long n, extra;
+ int format;
if (XGetWindowProperty(X_Dpy, cc->win, atm, 0L, len, False, type,
&realtype, &format, &n, &extra, p) != Success || *p == NULL)
@@ -131,8 +131,10 @@ xu_getprop(struct client_ctx *cc, Atom atm, Atom type, long len, u_char **p)
int
xu_getstate(struct client_ctx *cc, int *state)
{
- Atom wm_state = XInternAtom(X_Dpy, "WM_STATE", False);
- long *p = NULL;
+ Atom wm_state;
+ long *p = NULL;
+
+ wm_state = XInternAtom(X_Dpy, "WM_STATE", False);
if (xu_getprop(cc, wm_state, wm_state, 2L, (u_char **)&p) <= 0)
return (-1);
@@ -146,8 +148,8 @@ xu_getstate(struct client_ctx *cc, int *state)
void
xu_setstate(struct client_ctx *cc, int state)
{
- long dat[2];
- Atom wm_state;
+ Atom wm_state;
+ long dat[2];
/* XXX cache */
wm_state = XInternAtom(X_Dpy, "WM_STATE", False);