⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 repeater-patch.mail

📁 gpm-1.20.0.tar.gz
💻 MAIL
字号:
From - Thu Sep 27 00:19:14 2001Return-Path: <gpm-admin@lists.linux.it>Delivered-To: nico@schottelius.orgReceived: (qmail 32662 invoked by uid 0); 25 Sep 2001 21:10:43 -0000Received: from unknown (HELO pcsystems.de) (217.89.38.234)  by dns.schottelius.org with SMTP; 25 Sep 2001 21:10:43 -0000Received: (qmail 3023 invoked by uid 577); 25 Sep 2001 21:25:10 -0000Delivered-To: nicos@pcsystems.deReceived: (qmail 3020 invoked by uid 0); 25 Sep 2001 21:25:10 -0000Received: from spock.linux.it (62.177.1.105)  by dns.pcsystems.de with SMTP; 25 Sep 2001 21:25:10 -0000Received: from spock.linux.it (localhost [127.0.0.1])	by spock.linux.it (Postfix) with ESMTP	id A90A119828; Tue, 25 Sep 2001 23:28:25 +0200 (CEST)Delivered-To: gpm@spock.linux.itReceived: from mir.prosa.it (unknown [212.94.129.18])	by spock.linux.it (Postfix) with ESMTP id 89C35196B4	for <gpm@lists.linux.it>; Tue, 25 Sep 2001 23:27:25 +0200 (CEST)Received: by mir.prosa.it (Postfix)	id A3DC02F532; Tue, 25 Sep 2001 23:36:00 +0200 (CEST)Delivered-To: gpm@mir.prosa.itReceived: from chmls20.mediaone.net (chmls20.mediaone.net [24.147.1.156])	by mir.prosa.it (Postfix) with ESMTP id 712192F4F0	for <gpm@mir.prosa.it>; Tue, 25 Sep 2001 23:35:59 +0200 (CEST)Received: from pimlott.ne.mediaone.net (root@pimlott.ne.mediaone.net [24.128.40.85])	by chmls20.mediaone.net (8.11.1/8.11.1) with ESMTP id f8PLRkx16126	for <gpm@lists.prosa.it>; Tue, 25 Sep 2001 17:27:46 -0400 (EDT)Received: by pimlott.ne.mediaone.net	via sendmail from stdin	id <m15lzYa-005aKAC@pimlott.ne.mediaone.net> (Debian Smail3.2.0.111)	for gpm@lists.prosa.it; Tue, 25 Sep 2001 17:15:56 -0400 (EDT) From: andrew@pimlott.ne.mediaone.net (Andrew Pimlott)Date: Tue, 25 Sep 2001 17:15:56 -0400To: gpm@mir.prosa.itSubject: Re: [Gpm] repeat and accelMessage-ID: <20010925171556.A16902@pimlott.ne.mediaone.net>Mail-Followup-To: gpm@lists.prosa.itReferences: <20010319174348.A22751@morgana.systemy.it>Mime-Version: 1.0Content-Type: text/plain; charset=us-asciiContent-Disposition: inlineUser-Agent: Mutt/1.3.15iIn-Reply-To: <20010319174348.A22751@morgana.systemy.it>; from rubini@gnu.org on Mon, Mar 19, 2001 at 05:43:48PM +0100Sender: gpm-admin@lists.linux.itErrors-To: gpm-admin@lists.linux.itX-BeenThere: gpm@lists.linux.itX-Mailman-Version: 2.0beta5Precedence: bulkList-Id: General Purpose Mouse, development <gpm.lists.linux.it>X-Mozilla-Status: 8011X-Mozilla-Status2: 00000000X-UIDL: 1001452243.32666.suppeOn Mon, Mar 19, 2001 at 05:43:48PM +0100, Alessandro Rubini wrote:> Who is going to fix it?I dropped the ball on this one because I am lame, but I'm officially tiredof running a patched gpm, so it's time to submit what I did.  Having amaintainer is some incentive. :-)The problem, to recall, is that sometimes the repeater functions are askedto repeat more bits of dx and dy motion than the protocol can represent.The result is erratic mouse movement (in the application using /dev/gpmdata)when you move the mouse sufficiently fast.  The discussion on this was inFebruary or March (in case there is no archive, I can send it).I noticed that this is not such a problem with stock gpm, because the onlyrepeaters are msc and summa.  summa is presumably only meant for people withtablets, and msc seems (?!) to have 9 bits of delta, which is enough to hidethe problem in most cases.  However, in Debian, sun and ms3 are bothrepeated and use 8 bits of delta, which shows the problem better.There are two issues involved: 1) different protocols support a differentnumber of bits of dx; and 2) the "-d accel" feature can cause the repeateddx to be bigger than the original dx.  One proposal was to ignoreacceleration when repeating.  This is consistent with ignoring "-rresponsiveness" (aka opt_scale), which is done currently.  However, thiswould not solve issue 1; also, since the gpm default value for accelerationis 2, pretty much everyone who uses the repeater would notice his mouse slowdown in applications that use the repeater.  So, I decided that the bestthing to do would be to limit the values repeated to the range supported bythe protocol, and leave the acceleration alone.Patch against gpm-1.19.5 is below.  Feel free to change for style, but Iwould like to keep the capping factored out so I can apply it to therepeaters in Debian gpm.  I don't really know what's up with msc, but I wentby Alessandro's comment in the last discussion.Andrew--- mice.c.orig Tue Sep 25 17:48:30 2001+++ mice.c      Tue Sep 25 17:48:32 2001@@ -203,6 +203,21 @@ int realposx=-1, realposy=-1;  /*========================================================================*/+/* + * When repeating, it is important not to try to repeat more bits of dx and+ * dy than the protocol can handle.  Otherwise, you may end up repeating the+ * low bits of a large value, which causes erratic motion.+ */++static int limit_delta(int delta, int min, int max)+{+    return+        delta > max ? max :+        delta < min ? min+                    : delta;+}++/*========================================================================*/ /*  * Ok, here we are: first, provide the functions; initialization is later.  * The return value is the number of unprocessed bytes@@ -423,10 +438,13 @@ static int R_msc(Gpm_Event *state, int fd) {   signed char buffer[5];+  int dx, dy;    /* sluggish... */   buffer[0]=(state->buttons ^ 0x07) | 0x80;+  dx = limit_delta(state->dx, -256, 254);   buffer[3] =  state->dx - (buffer[1] = state->dx/2); /* Markus */+  dy = limit_delta(state->dy, -256, 254);   buffer[4] = -state->dy - (buffer[2] = -state->dy/2);   return write(fd,buffer,5); _______________________________________________gpm mailing listgpm@lists.linux.ithttp://www.linux.it/mailman/listinfo/gpm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -