Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Nyberg <jens.nyberg@gmail.com>
  • Loading branch information
jezze committed Nov 3, 2018
1 parent 903c52a commit c86d63c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
31 changes: 21 additions & 10 deletions lib/fudge/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ struct event_header *event_createvideomode(struct event_header *oheader, unsigne

}

struct event_header *event_forward(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target, unsigned int session)
struct event_header *event_forward(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target)
{

unsigned int i;

event_create(oheader, type, target, session);
event_create(oheader, type, target, iheader->session);

for (i = 0; i < iheader->nroutes; i++)
event_route(oheader, iheader->routes[i]);
Expand All @@ -383,29 +383,29 @@ struct event_header *event_forward(struct event_header *oheader, struct event_he

}

struct event_header *event_forwardfile(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session, unsigned int descriptor)
struct event_header *event_forwardfile(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int descriptor)
{

event_forward(oheader, iheader, EVENT_FILE, target, session);
event_forward(oheader, iheader, EVENT_FILE, target);
addfile(oheader, descriptor);

return oheader;

}

struct event_header *event_forwardstop(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session)
struct event_header *event_forwardstop(struct event_header *oheader, struct event_header *iheader, unsigned int target)
{

event_forward(oheader, iheader, EVENT_STOP, target, session);
event_forward(oheader, iheader, EVENT_STOP, target);

return oheader;

}

struct event_header *event_forwardinit(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session)
struct event_header *event_forwardinit(struct event_header *oheader, struct event_header *iheader, unsigned int target)
{

event_forward(oheader, iheader, EVENT_INIT, target, session);
event_forward(oheader, iheader, EVENT_INIT, target);

return oheader;

Expand All @@ -414,7 +414,13 @@ struct event_header *event_forwardinit(struct event_header *oheader, struct even
struct event_header *event_request(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target, unsigned int session)
{

event_forward(oheader, iheader, type, target, session);
unsigned int i;

event_create(oheader, type, target, session);

for (i = 0; i < iheader->nroutes; i++)
event_route(oheader, iheader->routes[i]);

event_route(oheader, iheader->target);

return oheader;
Expand Down Expand Up @@ -567,7 +573,12 @@ struct event_header *event_requestwmconfigure(struct event_header *oheader, stru
struct event_header *event_reply(struct event_header *oheader, struct event_header *iheader, unsigned int type)
{

event_forward(oheader, iheader, type, iheader->source, iheader->session);
unsigned int i;

event_create(oheader, type, iheader->source, iheader->session);

for (i = 0; i < iheader->nroutes; i++)
event_route(oheader, iheader->routes[i]);

if (oheader->nroutes)
oheader->target = oheader->routes[--oheader->nroutes];
Expand Down
8 changes: 4 additions & 4 deletions lib/fudge/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ struct event_header *event_createmouserelease(struct event_header *oheader, unsi
struct event_header *event_createmousemove(struct event_header *oheader, char relx, char rely);
struct event_header *event_createtimertick(struct event_header *oheader, unsigned int counter);
struct event_header *event_createvideomode(struct event_header *oheader, unsigned int w, unsigned int h, unsigned int bpp);
struct event_header *event_forward(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target, unsigned int session);
struct event_header *event_forwardfile(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session, unsigned int descriptor);
struct event_header *event_forwardstop(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session);
struct event_header *event_forwardinit(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session);
struct event_header *event_forward(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target);
struct event_header *event_forwardfile(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int descriptor);
struct event_header *event_forwardstop(struct event_header *oheader, struct event_header *iheader, unsigned int target);
struct event_header *event_forwardinit(struct event_header *oheader, struct event_header *iheader, unsigned int target);
struct event_header *event_request(struct event_header *oheader, struct event_header *iheader, unsigned int type, unsigned int target, unsigned int session);
struct event_header *event_requestfile(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session, unsigned int descriptor);
struct event_header *event_requestdata(struct event_header *oheader, struct event_header *iheader, unsigned int target, unsigned int session);
Expand Down
6 changes: 3 additions & 3 deletions src/utils/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ static unsigned int onfile(struct event_header *iheader, struct event_header *oh
if (!id)
return 0;

event_forwardinit(oheader, iheader, id, iheader->session);
event_forwardinit(oheader, iheader, id);
event_send(oheader);
event_forwardfile(oheader, iheader, id, iheader->session, FILE_P0);
event_forwardfile(oheader, iheader, id, FILE_P0);
event_send(oheader);
event_forwardstop(oheader, iheader, id, iheader->session);
event_forwardstop(oheader, iheader, id);
event_send(oheader);

return 0;
Expand Down
6 changes: 3 additions & 3 deletions src/utils/motd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ static unsigned int onfile(struct event_header *iheader, struct event_header *oh
if (!id)
return 0;

event_forwardinit(oheader, iheader, id, iheader->session);
event_forwardinit(oheader, iheader, id);
event_send(oheader);
event_forwardfile(oheader, iheader, id, iheader->session, FILE_P0);
event_forwardfile(oheader, iheader, id, FILE_P0);
event_send(oheader);
event_forwardstop(oheader, iheader, id, iheader->session);
event_forwardstop(oheader, iheader, id);
event_send(oheader);

return 0;
Expand Down

0 comments on commit c86d63c

Please sign in to comment.