[layout] Change {layout,statusbar}_refresh proto

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-21 14:13:40 +02:00
parent 88c9671ab1
commit 819ba3f191
6 changed files with 16 additions and 21 deletions

View File

@ -472,8 +472,8 @@ main(int argc, char **argv)
signal(SIGHUP, &exit_on_signal); signal(SIGHUP, &exit_on_signal);
/* refresh everything before waiting events */ /* refresh everything before waiting events */
statusbar_refresh(); statusbar_refresh(NULL);
layout_refresh(); layout_refresh(NULL);
/* main event loop, also reads status text from socket */ /* main event loop, also reads status text from socket */
while(running) while(running)
@ -504,8 +504,8 @@ main(int argc, char **argv)
break; break;
buf[r] = '\0'; buf[r] = '\0';
luaA_docmd(buf); luaA_docmd(buf);
statusbar_refresh(); statusbar_refresh(NULL);
layout_refresh(); layout_refresh(NULL);
} }
if(dbusfd >= 0 && FD_ISSET(dbusfd, &rd)) if(dbusfd >= 0 && FD_ISSET(dbusfd, &rd))
@ -516,8 +516,8 @@ main(int argc, char **argv)
xcb_handle_event(globalconf.evenths, ev); xcb_handle_event(globalconf.evenths, ev);
p_delete(&ev); p_delete(&ev);
} }
statusbar_refresh(); statusbar_refresh(NULL);
layout_refresh(); layout_refresh(NULL);
xcb_aux_sync(globalconf.connection); xcb_aux_sync(globalconf.connection);
} }

View File

@ -94,20 +94,14 @@ arrange(int screen)
/** Refresh the screen disposition /** Refresh the screen disposition
* \return true if the screen was arranged, false otherwise * \return true if the screen was arranged, false otherwise
*/ */
int void *
layout_refresh(void) layout_refresh(void *v __attribute__ ((unused)))
{ {
int screen; int screen;
int arranged = 0;
for(screen = 0; screen < globalconf.screens_info->nscreen; screen++) for(screen = 0; screen < globalconf.screens_info->nscreen; screen++)
if(globalconf.screens[screen].need_arrange) if(globalconf.screens[screen].need_arrange)
{
arrange(screen); arrange(screen);
arranged++;
}
return arranged;
} }
/** Get current layout used on screen. /** Get current layout used on screen.

View File

@ -28,7 +28,7 @@
typedef void (LayoutArrange)(int); typedef void (LayoutArrange)(int);
LayoutArrange * layout_get_current(int); LayoutArrange * layout_get_current(int);
int layout_refresh(void); void * layout_refresh(void *);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -287,14 +287,14 @@ mouse_client_move(int snap)
move_client_to_screen(c, newscreen, true); move_client_to_screen(c, newscreen, true);
globalconf.screens[c->screen].need_arrange = true; globalconf.screens[c->screen].need_arrange = true;
globalconf.screens[newscreen].need_arrange = true; globalconf.screens[newscreen].need_arrange = true;
layout_refresh(); layout_refresh(NULL);
} }
if((target = client_get_bywin(globalconf.clients, mquery_pointer_r->child)) if((target = client_get_bywin(globalconf.clients, mquery_pointer_r->child))
&& target != c && !target->isfloating) && target != c && !target->isfloating)
{ {
client_list_swap(&globalconf.clients, c, target); client_list_swap(&globalconf.clients, c, target);
globalconf.screens[c->screen].need_arrange = true; globalconf.screens[c->screen].need_arrange = true;
layout_refresh(); layout_refresh(NULL);
} }
p_delete(&mquery_pointer_r); p_delete(&mquery_pointer_r);
} }
@ -440,7 +440,7 @@ mouse_client_resize(void)
{ {
curtags[0]->mwfact = mwfact; curtags[0]->mwfact = mwfact;
globalconf.screens[c->screen].need_arrange = true; globalconf.screens[c->screen].need_arrange = true;
layout_refresh(); layout_refresh(NULL);
} }
} }
p_delete(&ev); p_delete(&ev);

View File

@ -224,8 +224,8 @@ statusbar_position_update(statusbar_t *statusbar, position_t position)
statusbar_draw(statusbar); statusbar_draw(statusbar);
} }
void void *
statusbar_refresh() statusbar_refresh(void *p __attribute__ ((unused)))
{ {
int screen; int screen;
statusbar_t *statusbar; statusbar_t *statusbar;
@ -236,6 +236,7 @@ statusbar_refresh()
statusbar = statusbar->next) statusbar = statusbar->next)
if(statusbar->need_update) if(statusbar->need_update)
statusbar_draw(statusbar); statusbar_draw(statusbar);
return NULL;
} }
statusbar_t * statusbar_t *

View File

@ -36,7 +36,7 @@ statusbar_delete(statusbar_t **statusbar)
p_delete(statusbar); p_delete(statusbar);
} }
void statusbar_refresh(void); void * statusbar_refresh(void *);
statusbar_t * statusbar_getbyname(int, const char *); statusbar_t * statusbar_getbyname(int, const char *);
DO_RCNT(statusbar_t, statusbar, statusbar_delete) DO_RCNT(statusbar_t, statusbar, statusbar_delete)