Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unneeded variables and some whitespace.
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
0e2bc12
..
b4b0076
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-8,6
+8,7
@@
* Copyright (c) 2011-2012 Reginald Kennedy <rk@rejii.com>
* Copyright (c) 2011-2012 Lawrence Teo <lteo@lteo.net>
* Copyright (c) 2011-2012 Tiago Cunha <tcunha@gmx.com>
* Copyright (c) 2011-2012 Reginald Kennedy <rk@rejii.com>
* Copyright (c) 2011-2012 Lawrence Teo <lteo@lteo.net>
* Copyright (c) 2011-2012 Tiago Cunha <tcunha@gmx.com>
+ * Copyright (c) 2012 David Hill <dhill@mindcry.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@
-828,9
+829,8
@@
teardown_ewmh(void)
xcb_destroy_window(conn, id);
xcb_delete_property(conn, screens[i].root, sup_check);
xcb_delete_property(conn, screens[i].root, sup_list);
xcb_destroy_window(conn, id);
xcb_delete_property(conn, screens[i].root, sup_check);
xcb_delete_property(conn, screens[i].root, sup_list);
-
- free(pr);
}
}
+ free(pr);
}
}
}
}
@@
-4284,8
+4284,6
@@
resize(struct ws_win *win, union arg *args)
unsigned int shape; /* cursor style */
xcb_cursor_t cursor;
xcb_font_t cursor_font;
unsigned int shape; /* cursor style */
xcb_cursor_t cursor;
xcb_font_t cursor_font;
- xcb_grab_pointer_cookie_t gpc;
- xcb_grab_pointer_reply_t *gpr;
xcb_query_pointer_reply_t *xpr;
xcb_generic_event_t *evt;
xcb_motion_notify_event_t *mne;
xcb_query_pointer_reply_t *xpr;
xcb_generic_event_t *evt;
xcb_motion_notify_event_t *mne;
@@
-4369,16
+4367,9
@@
resize(struct ws_win *win, union arg *args)
xcb_create_glyph_cursor(conn, cursor, cursor_font, cursor_font,
shape, shape + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff);
xcb_create_glyph_cursor(conn, cursor, cursor_font, cursor_font,
shape, shape + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff);
- gpc = xcb_grab_pointer(conn, 0, win->id, MOUSEMASK,
+ xcb_grab_pointer(conn, 0, win->id, MOUSEMASK,
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_WINDOW_NONE, cursor,
XCB_CURRENT_TIME),
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_WINDOW_NONE, cursor,
XCB_CURRENT_TIME),
- gpr = xcb_grab_pointer_reply(conn, gpc, NULL);
- if (!gpr) {
- xcb_free_cursor(conn, cursor);
- xcb_close_font(conn, cursor_font);
- free(xpr);
- return;
- }
xcb_flush(conn);
resizing = 1;
xcb_flush(conn);
resizing = 1;
@@
-4458,7
+4449,6
@@
resize(struct ws_win *win, union arg *args)
xcb_ungrab_pointer(conn, XCB_CURRENT_TIME);
xcb_free_cursor(conn, cursor);
xcb_close_font(conn, cursor_font);
xcb_ungrab_pointer(conn, XCB_CURRENT_TIME);
xcb_free_cursor(conn, cursor);
xcb_close_font(conn, cursor_font);
- free(gpr);
free(xpr);
DNPRINTF(SWM_D_EVENT, "resize: done\n");
}
free(xpr);
DNPRINTF(SWM_D_EVENT, "resize: done\n");
}
@@
-4486,8
+4476,6
@@
move(struct ws_win *win, union arg *args)
struct swm_region *r = NULL;
xcb_font_t cursor_font;
xcb_cursor_t cursor;
struct swm_region *r = NULL;
xcb_font_t cursor_font;
xcb_cursor_t cursor;
- xcb_grab_pointer_cookie_t gpc;
- xcb_grab_pointer_reply_t *gpr;
xcb_query_pointer_reply_t *qpr;
xcb_generic_event_t *evt;
xcb_motion_notify_event_t *mne;
xcb_query_pointer_reply_t *qpr;
xcb_generic_event_t *evt;
xcb_motion_notify_event_t *mne;
@@
-4552,15
+4540,9
@@
move(struct ws_win *win, union arg *args)
xcb_create_glyph_cursor(conn, cursor, cursor_font, cursor_font,
XC_fleur, XC_fleur + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff);
xcb_create_glyph_cursor(conn, cursor, cursor_font, cursor_font,
XC_fleur, XC_fleur + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff);
- gpc = xcb_grab_pointer(conn, 0, win->id, MOUSEMASK,
+ xcb_grab_pointer(conn, 0, win->id, MOUSEMASK,
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
XCB_WINDOW_NONE, cursor, XCB_CURRENT_TIME);
XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
XCB_WINDOW_NONE, cursor, XCB_CURRENT_TIME);
- gpr = xcb_grab_pointer_reply(conn, gpc, NULL);
- if (!gpr) {
- xcb_free_cursor(conn, cursor);
- xcb_close_font(conn, cursor_font);
- return;
- }
/* get cursor offset from window root */
qpr = xcb_query_pointer_reply(conn, xcb_query_pointer(conn, win->id),
/* get cursor offset from window root */
qpr = xcb_query_pointer_reply(conn, xcb_query_pointer(conn, win->id),
@@
-5528,7
+5510,7
@@
updatenumlockmask(void)
+ j];
keycode = xcb_key_symbols_get_keycode(syms,
XK_Num_Lock);
+ j];
keycode = xcb_key_symbols_get_keycode(syms,
XK_Num_Lock);
- if (kc == *keycode)
+ if (kc == *keycode)
numlockmask = (1 << i);
free(keycode);
}
numlockmask = (1 << i);
free(keycode);
}
@@
-6640,7
+6622,7
@@
manage_window(xcb_window_t id)
win->ch.class_name = tmpch.class_name;
win->ch.instance_name = tmpch.instance_name;
win->ch.class_name = tmpch.class_name;
win->ch.instance_name = tmpch.instance_name;
- xcb_get_wm_class_reply_wipe(&tmpch);
+ xcb_icccm_get_wm_class_reply_wipe(&tmpch);
DNPRINTF(SWM_D_CLASS, "manage_window: class: %s, name: %s\n",
win->ch.class_name, win->ch.instance_name);
DNPRINTF(SWM_D_CLASS, "manage_window: class: %s, name: %s\n",
win->ch.class_name, win->ch.instance_name);
@@
-6720,7
+6702,7
@@
free_window(struct ws_win *win)
if (win->wa)
free(win->wa);
if (win->wa)
free(win->wa);
-
+
kill_refs(win);
/* paint memory */
kill_refs(win);
/* paint memory */
@@
-7412,8
+7394,9
@@
scan_xrandr(int i)
return;
} else
ncrtc = srr->num_crtcs;
return;
} else
ncrtc = srr->num_crtcs;
+
+ crtc = xcb_randr_get_screen_resources_current_crtcs(srr);
for (c = 0; c < ncrtc; c++) {
for (c = 0; c < ncrtc; c++) {
- crtc = xcb_randr_get_screen_resources_current_crtcs(srr);
cic = xcb_randr_get_crtc_info(conn, crtc[c],
XCB_CURRENT_TIME);
cir = xcb_randr_get_crtc_info_reply(conn, cic, NULL);
cic = xcb_randr_get_crtc_info(conn, crtc[c],
XCB_CURRENT_TIME);
cir = xcb_randr_get_crtc_info_reply(conn, cic, NULL);