diff --git a/src/ipc.c b/src/ipc.c index ed1c18ed..78677b84 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -14,23 +14,33 @@ const gint8 magic[6] = {0x69, 0x33, 0x2d, 0x69, 0x70, 0x63}; -json_object *ipc_poll ( int sock ) +json_object *ipc_poll ( int sock, gint32 *etype ) { gint8 ipc_header[14]; gchar *response = NULL; gint32 plen; size_t pos=0; + ssize_t rlen; - if(recv(sock,(gchar *)ipc_header,sizeof(ipc_header),0)==sizeof(ipc_header)) + while(posscan_list); widget_update_all(context); - obj = ipc_poll(context->ipc); + obj = ipc_poll(context->ipc,&etype); while (obj != NULL) { ev = ipc_parse_event(obj); - dispatch_event(&ev,context); + if(etype==0x80000003) + dispatch_event(&ev,context); json_object_put(obj); - obj = ipc_poll(context->ipc); + obj = ipc_poll(context->ipc,&etype); } return TRUE; } diff --git a/src/sfwbar.h b/src/sfwbar.h index 012338ff..d3afedb2 100644 --- a/src/sfwbar.h +++ b/src/sfwbar.h @@ -68,7 +68,7 @@ struct scan_file { int ipc_open(); int ipc_subscribe( int sock ); -json_object *ipc_poll( int sock ); +json_object *ipc_poll( int sock, gint32 *etype ); int ipc_send ( int sock, gint32 type, gchar *command ); struct ipc_event ipc_parse_event ( json_object *obj ); diff --git a/src/taskbar.c b/src/taskbar.c index df52daec..a8da2cad 100644 --- a/src/taskbar.c +++ b/src/taskbar.c @@ -33,11 +33,12 @@ void taskbar_populate ( struct context *context ) { json_object *obj; int sock; + gint32 etype; sock=ipc_open(); if(sock==-1) return; ipc_send(sock,4,""); - obj = ipc_poll(sock); + obj = ipc_poll(sock,&etype); if(obj!=NULL) { taskbar_traverse_tree(obj,context);