<div dir="ltr"><div>Hi,</div><div> the intention is clear, collapse the movements (sum up relative movements) to avoid a queue getting too big. If you need a larger queue you can simply change the check on spice-gtk.</div><div>One question is however why you want all events. About naming and readability I think a "unacked_motion_count" instead of just "motion_count" here would be more appropriate.<br></div><div><br></div><div>Regards,<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"> Frediano</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 25 apr 2022 alle ore 07:46 Walter Mitty <<a href="mailto:waltermitty121906@gmail.com">waltermitty121906@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font style="color:rgb(0,0,0);font-family:Helvetica" size="4">Hi,</font><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4">I’m learning spice source code. And recently, when I used a drawing app I found some mouse input events were dropped. I tried to understand it from the code.</font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4">From code perspective, In inputs-channel.c, spice-gtk will check if<span> </span><b>motion_count</b><span> </span>is smaller than <span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">SPICE_INPUT_MOTION_ACK_BUNCH(</span><span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">(</span><span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">which is 4</span><span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">)</span><span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">) * 2. On spice-server, at </span><span style="color:rgb(111,66,193);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">on_mouse_motion()</span><span style="color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">, </span></font><font style="font-size:large" face="Menlo, Monaco, Courier New, monospace" color="#032f62"><span style="white-space:pre-wrap">on </span><span style="white-space:pre-wrap">every </span></font><span style="font-size:large;color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">SPICE_INPUT_MOTION_ACK_BUNCH</span><span style="font-size:large;color:rgb(3,47,98);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap">mouse motion events, server side sends a </span><font style="font-size:large" face="Menlo, Monaco, Courier New, monospace" color="#24292e"><span style="white-space:pre-wrap">RED_PIPE_ITEM_MOUSE_MOTION_ACK event to client. </span><span style="white-space:pre-wrap">And in</span></font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4" face="Menlo, Monaco, Courier New, monospace" color="#24292e"><span style="white-space:pre-wrap">response, the client reduces <b>motion_count </b>by 4 and continues event sending. It seems that before the client response finishes, some events are dropped.</span></font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4">I wanna avoid event dropping, my idea is taking advantage of the event queue to store all events. And the server retrieves events from the queue to write to the virtual device . </font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4"><br></font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><span style="font-size:large">My question is: Is the event dropping reasonable?</span><span style="font-size:large"> </span><font size="4">Could you please give some advice about how to avoid it? Thanks very much~</font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4"><br></font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4">Regards,</font></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><font size="4">Walter.</font></div><br></div>
</blockquote></div>