Skip to content

Commit

Permalink
Refactored out last argument, btn, from jbwm_grab_button(). Added non…
Browse files Browse the repository at this point in the history
…null

attribute.
  • Loading branch information
alisabedard committed May 26, 2017
1 parent 6372186 commit cf60031
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion new.c
Expand Up @@ -191,7 +191,7 @@ static void do_grabs(Display * d, const Window w)
XSelectInput(d, w, EnterWindowMask | PropertyChangeMask
| ColormapChangeMask);
// keys to grab:
jbwm_grab_button(d, w, jbwm_get_grab_mask(), AnyButton);
jbwm_grab_button(d, w, jbwm_get_grab_mask());
}
void jbwm_new_client(Display * d, struct JBWMScreen * s, const Window w)
{
Expand Down
2 changes: 1 addition & 1 deletion title_bar.c
Expand Up @@ -72,7 +72,7 @@ static Window new_title_bar(Display * d, struct JBWMClient * restrict c)
XSelectInput(d, t, ExposureMask);
XMapRaised(d, t);
XMapSubwindows(d, t);
jbwm_grab_button(d, t, 0, AnyButton);
jbwm_grab_button(d, t, None);
return t;
}
static XftColor * get_color(Display * d, const int8_t screen)
Expand Down
6 changes: 2 additions & 4 deletions util.c
Expand Up @@ -6,7 +6,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
__attribute__((noreturn))
void jbwm_error(const char * restrict msg)
{
perror(msg);
Expand Down Expand Up @@ -34,7 +33,6 @@ jbwm_pixel_t jbwm_get_pixel(Display * dpy,
r = 0;
return r;
}
__attribute__((warn_unused_result,nonnull))
void *jbwm_get_property(Display * dpy, Window w,
Atom property, uint16_t * num_items)
{
Expand All @@ -52,9 +50,9 @@ void *jbwm_get_property(Display * dpy, Window w,
return value;
}
void jbwm_grab_button(Display * d, const Window w,
const unsigned int mask, const unsigned int btn)
const unsigned int mask)
{
XGrabButton(d, btn, mask, w, false,
XGrabButton(d, AnyButton, mask, w, false,
ButtonPressMask | ButtonReleaseMask, GrabModeAsync,
GrabModeSync, None, None);
}
Expand Down
2 changes: 1 addition & 1 deletion util.h
Expand Up @@ -18,7 +18,7 @@ void * jbwm_get_property(Display * dpy, const Window w,
Atom property, uint16_t * num_items)
__attribute__((warn_unused_result,nonnull));
void jbwm_grab_button(Display * d, const Window w,
const unsigned int mask, const unsigned int btn);
const unsigned int mask) __attribute__((nonnull(1)));
#ifdef DEBUG
void jbwm_print_atom(Display * d, const Atom a, const char * src,
const uint16_t line);
Expand Down

0 comments on commit cf60031

Please sign in to comment.