[ewmh/awesome] Comsmetics

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-09 12:56:52 +02:00
parent a664203639
commit ea7c1ceeb3
2 changed files with 10 additions and 8 deletions

View File

@ -407,8 +407,8 @@ main(int argc, char **argv)
{ {
/* view at least one tag */ /* view at least one tag */
tag_view(globalconf.screens[screen_nbr].tags, true); tag_view(globalconf.screens[screen_nbr].tags, true);
for(statusbar = globalconf.screens[screen_nbr].statusbar;
for(statusbar = globalconf.screens[screen_nbr].statusbar; statusbar; statusbar = statusbar->next) statusbar; statusbar = statusbar->next)
statusbar_init(statusbar); statusbar_init(statusbar);
} }
@ -458,13 +458,16 @@ main(int argc, char **argv)
/* check for shape extension */ /* check for shape extension */
shape_query = xcb_get_extension_data(globalconf.connection, &xcb_shape_id); shape_query = xcb_get_extension_data(globalconf.connection, &xcb_shape_id);
if((globalconf.have_shape = shape_query->present)) if((globalconf.have_shape = shape_query->present))
xcb_set_event_handler(globalconf.evenths, (shape_query->first_event + XCB_SHAPE_NOTIFY), xcb_set_event_handler(globalconf.evenths,
(xcb_generic_event_handler_t) event_handle_shape, NULL); (shape_query->first_event + XCB_SHAPE_NOTIFY),
(xcb_generic_event_handler_t) event_handle_shape,
NULL);
/* check for randr extension */ /* check for randr extension */
randr_query = xcb_get_extension_data(globalconf.connection, &xcb_randr_id); randr_query = xcb_get_extension_data(globalconf.connection, &xcb_randr_id);
if((globalconf.have_randr = randr_query->present)) if((globalconf.have_randr = randr_query->present))
xcb_set_event_handler(globalconf.evenths, (randr_query->first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY), xcb_set_event_handler(globalconf.evenths,
(randr_query->first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY),
(xcb_generic_event_handler_t) event_handle_randr_screen_change_notify, (xcb_generic_event_handler_t) event_handle_randr_screen_change_notify,
NULL); NULL);

5
ewmh.c
View File

@ -117,8 +117,7 @@ ewmh_init_atoms(void)
for(i = 0; i < ATOM_NUMBER; i++) for(i = 0; i < ATOM_NUMBER; i++)
{ {
r = xcb_intern_atom_reply(globalconf.connection, cs[i], NULL); if(!(r = xcb_intern_atom_reply(globalconf.connection, cs[i], NULL)))
if(!r)
/* An error occured, get reply for next atom */ /* An error occured, get reply for next atom */
continue; continue;
@ -435,7 +434,7 @@ ewmh_get_window_icon(xcb_window_t w)
xcb_get_property_unchecked(globalconf.connection, false, w, xcb_get_property_unchecked(globalconf.connection, false, w,
net_wm_icon, CARDINAL, 0, UINT32_MAX), net_wm_icon, CARDINAL, 0, UINT32_MAX),
NULL); NULL);
if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2 || if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2 ||
!(data = (uint32_t *) xcb_get_property_value(r))) !(data = (uint32_t *) xcb_get_property_value(r)))
{ {
if(r) if(r)