Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b9234fc
)
cleanup get_iconic function
author
David Hill
<dhill@conformal.com>
Thu, 12 Jul 2012 18:30:52 +0000
(14:30 -0400)
committer
Reginald Kennedy
<rk@rejii.com>
Fri, 20 Jul 2012 21:58:32 +0000
(
05:58
+0800)
spectrwm.c
patch
|
blob
|
history
diff --git
a/spectrwm.c
b/spectrwm.c
index
06f0960
..
f9b2d43
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-375,7
+375,7
@@
struct ws_win {
int floatmaxed; /* whether maxed by max_stack */
int floating;
int manual;
int floatmaxed; /* whether maxed by max_stack */
int floating;
int manual;
- int iconic;
+ int32_t iconic;
int bordered;
unsigned int ewmh_flags;
int font_size_boundary[SWM_MAX_FONT_STEPS];
int bordered;
unsigned int ewmh_flags;
int font_size_boundary[SWM_MAX_FONT_STEPS];
@@
-733,29
+733,28
@@
update_iconic(struct ws_win *win, int newv)
xcb_delete_property(conn, win->id, iprop);
}
xcb_delete_property(conn, win->id, iprop);
}
-int
+int32_t
get_iconic(struct ws_win *win)
{
get_iconic(struct ws_win *win)
{
- int32_t v = 0, *vtmp;
+ int32_t v = 0;
xcb_atom_t iprop;
xcb_atom_t iprop;
- xcb_get_property_cookie_t pc;
xcb_get_property_reply_t *pr = NULL;
iprop = get_atom_from_string("_SWM_ICONIC");
if (iprop == XCB_ATOM_NONE)
goto out;
xcb_get_property_reply_t *pr = NULL;
iprop = get_atom_from_string("_SWM_ICONIC");
if (iprop == XCB_ATOM_NONE)
goto out;
- pc = xcb_get_property(conn, False, win->id, iprop, XCB_ATOM_INTEGER,
- 0, 1);
- pr = xcb_get_property_reply(conn, pc, NULL);
+ pr = xcb_get_property_reply(conn,
+ xcb_get_property(conn, False, win->id, iprop, XCB_ATOM_INTEGER,
+ 0, 1),
+ NULL);
if (!pr)
goto out;
if (pr->type != XCB_ATOM_INTEGER || pr->format != 32)
goto out;
if (!pr)
goto out;
if (pr->type != XCB_ATOM_INTEGER || pr->format != 32)
goto out;
- vtmp = xcb_get_property_value(pr);
- v = *vtmp;
+ v = *((int32_t *)xcb_get_property_value(pr));
out:
out:
- if (pr != NULL)
+ if (pr)
free(pr);
return (v);
}
free(pr);
return (v);
}