Skip to content

Commit

Permalink
Compext.c: print received vs expected sequence number
Browse files Browse the repository at this point in the history
Should help in debugging "unexpected async reply" problems
  • Loading branch information
uli42 committed Mar 10, 2021
1 parent c2e58a9 commit 2770b8e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3450,6 +3450,13 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf,

state = (_NXCollectImageState *) data;

#ifdef DEBUG_IMAGE
fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n",
__func__,
(long) rep -> generic.sequenceNumber, (long)state -> sequence,
rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536);
#endif

if ((rep -> generic.sequenceNumber % 65536) !=
((int)(state -> sequence) % 65536))
{
Expand Down Expand Up @@ -3838,6 +3845,13 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf,

state = (_NXCollectPropertyState *) data;

#ifdef DEBUG_PROPERTY
fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n",
__func__,
(long) rep -> generic.sequenceNumber, (long)state -> sequence,
rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536);
#endif

if ((rep -> generic.sequenceNumber % 65536) !=
((int)(state -> sequence) % 65536))
{
Expand Down Expand Up @@ -4203,6 +4217,13 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf,

state = (_NXCollectGrabPointerState *) data;

#ifdef DEBUG_POINTER
fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n",
__func__,
(long) rep -> generic.sequenceNumber, (long)state -> sequence,
rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536);
#endif

if ((rep -> generic.sequenceNumber % 65536) !=
((int)(state -> sequence) % 65536))
{
Expand Down Expand Up @@ -4488,6 +4509,13 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf,

state = (_NXCollectInputFocusState *) data;

#ifdef DEBUG_INPUT
fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n",
__func__,
(long) rep -> generic.sequenceNumber, (long)state -> sequence,
rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536);
#endif

if ((rep -> generic.sequenceNumber % 65536) !=
((int)(state -> sequence) % 65536))
{
Expand Down

0 comments on commit 2770b8e

Please sign in to comment.