[gpm]GPM patch for Links on framebuffer

Mikulas Patocka mikulas@artax.karlin.mff.cuni.cz
Sat, 8 Jun 2002 15:10:37 +0200 (CEST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--1908636959-734879577-1023541837=:18778
Content-Type: TEXT/PLAIN; charset=US-ASCII

Here it is -- patch for reporting mouse movement in pixels.

When application sets bit GPM_SMOOTH in both defaultMask and eventMask,
gpm reports dx and dy in pixels, not in characters (and acknowledges it by
setting GPM_SMOOTH in event.type).

Included is also patch for framebuffer.c in links to take adventage of
this feature.

GPM-UNLINK-PID is a simple fix for bug, that gpm doesn't delete gpm.pid on
errors, thus preventing next starts of gpm.

BTW: why does gpm-1.20 have so agressive debugging messages enabled???
Libgpm on client writes on terminal, gpm daemon writes to log every
connect including the file and line in sources where is it processed.
Could it be turned off?

Mikulas

--1908636959-734879577-1023541837=:18778
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=GPM-SMOOTH-PATCH
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0206081510370.18778@artax.karlin.mff.cuni.cz>
Content-Description: gpm 1.20 with smooth cursor reporting
Content-Disposition: attachment; filename=GPM-SMOOTH-PATCH

LS0tIHNyYy9ncG0uY18JU2F0IEp1biAgOCAxNDoxNDoxOSAyMDAyDQorKysg
c3JjL2dwbS5jCVNhdCBKdW4gIDggMTQ6NTE6MTggMjAwMg0KQEAgLTEwNiw2
ICsxMDYsMTEgQEANCiBzdGF0aWMgaW50IG1vdXNlX2FyZ2NbM107IC8qIDAg
Zm9yIGRlZmF1bHQgKHVudXNlZCkgYW5kIHR3byBtaWNlICovDQogc3RhdGlj
IGNoYXIgKiptb3VzZV9hcmd2WzNdOyAvKiAwIGZvciBkZWZhdWx0ICh1bnVz
ZWQpIGFuZCB0d28gbWljZSAqLw0KIA0KKy8qIHBpeGVsLWxldmVsIG1vdXNl
IGRlbHRhLiBTaG91bGQ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gICAgICAgICAgICAgdXNlZCBldmVudCB0byBwYXNzIG92
ZXIgdG8gYW5vdGhlciBoYW5kbGVyICovDQogDQogICBHUE1fRU5URVI9NTEy
LCAgICAgICAgICAgIC8qIGVudGVyIGV2ZW50LCB1c2VyIGluIFJvaSdzICov
DQotICBHUE1fTEVBVkU9MTAyNCAgICAgICAgICAgIC8qIGxlYXZlIGV2ZW50
LCB1c2VkIGluIFJvaSdzICovDQorICBHUE1fTEVBVkU9MTAyNCwgICAgICAg
ICAgIC8qIGxlYXZlIGV2ZW50LCB1c2VkIGluIFJvaSdzICovDQorDQorICBH
UE1fU01PT1RIPTIwNDgsICAgICAgICAgIC8qIGlmIGFwcGxpY2F0aW9uIHdh
bnQgdG8gcmVjZWl2ZSBzbW9vdGggbW92ZW1lbnQsDQorICAgICAgICAgICAg
ICAgICAgIGl0IHNldHMgR1BNX1NNT09USCBpbiBib3RoIGV2ZW50TWFzayBh
bmQgZGVmYXVsdE1hc2suDQorICAgICAgICAgICAgICAgICAgIEluIHJldHVy
bmVkIGV2ZW50LCB0eXBlIEdQTV9TTU9PVEggc2lnbmFscyB0aGF0IGR4IGFu
ZCBkeQ0KKwkJICAgYXJlIHNtb290aCAqLw0KIH07DQorDQorI2RlZmluZSBH
UE1fSEFWRV9TTU9PVEggICAgIC8qIHNvIHRoYXQgYXBwcyBjYW4gI2lmZGVm
IGZvciBvbGQvbmV3IHZlcnNpb24gKi8NCiANCiAjZGVmaW5lIEdwbV9TdHJp
Y3RTaW5nbGUodHlwZSkgKCgodHlwZSkmR1BNX1NJTkdMRSkgJiYgISgodHlw
ZSkmR1BNX01GTEFHKSkNCiAjZGVmaW5lIEdwbV9BbnlTaW5nbGUodHlwZSkg
ICAgICgodHlwZSkmR1BNX1NJTkdMRSkNCg==
--1908636959-734879577-1023541837=:18778
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=GPM-UNLINK-PID
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0206081510371.18778@artax.karlin.mff.cuni.cz>
Content-Description: fixed bug that gpm doesn't unlink gpm.pid on errors
Content-Disposition: attachment; filename=GPM-UNLINK-PID

LS0tIHJlcG9ydC5jXwlTYXQgSnVuICA4IDEzOjEwOjI0IDIwMDINCisrKyBy
ZXBvcnQuYwlTYXQgSnVuICA4IDEzOjE2OjA1IDIwMDINCkBAIC0xMjEsNiAr
MTIxLDcgQEANCiAgICAgICAgICAgICAgICB2ZnByaW50ZihzdGRlcnIsdGV4
dCxhcCk7DQogICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsIlxuIik7
DQogDQorICAgICAgICAgICAgICAgdW5saW5rKEdQTV9OT0RFX1BJRCk7DQog
ICAgICAgICAgICAgICAgZXhpdCgxKTsgLyp3ZSBzaG91bGQgaGF2ZSBhIG9v
cHMoKWZ1bmN0aW9uLCBidXQgdGhpcyB3b3JrcywgdG9vKi8NCiAgICAgICAg
ICAgICAgICBicmVhazsNCiAgICAgICAgICB9DQpAQCAtMTc4LDYgKzE3OSw3
IEBADQogICAgICAgICAgICAgICAgdmZwcmludGYoc3RkZXJyLHRleHQsYXAp
Ow0KICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCJcbiIpOw0KIA0K
KyAgICAgICAgICAgICAgIHVubGluayhHUE1fTk9ERV9QSUQpOw0KICAgICAg
ICAgICAgICAgIF9leGl0KDEpOyAvKiB3ZSBhcmUgdGhlIGZvcmsoKS1jaGls
ZCAqLw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgIH0NCkBA
IC0yMDcsNyArMjA5LDEwIEBADQogICAgICAgICAgdmZwcmludGYoY29uc29s
ZSx0ZXh0LGFwKTsNCiAgICAgICAgICBmcHJpbnRmKGNvbnNvbGUsIlxuIik7
DQogICAgICAgICAgDQotICAgICAgICAgaWYoc3RhdCA9PSBHUE1fU1RBVF9P
T1BTKSBleGl0KDEpOw0KKyAgICAgICAgIGlmKHN0YXQgPT0gR1BNX1NUQVRf
T09QUykgew0KKyAgICAgICAgICAgIHVubGluayhHUE1fTk9ERV9QSUQpOw0K
KyAgICAgICAgICAgIGV4aXQoMSk7DQorCSB9DQogDQogICAgICAgICAgYnJl
YWs7DQogICAgfSAvKiBzd2l0Y2ggZm9yIGN1cnJlbnQgbW9kdXMgKi8NCg==
--1908636959-734879577-1023541837=:18778
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=LINKS-SMOOTH-PATCH
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0206081510372.18778@artax.karlin.mff.cuni.cz>
Content-Description: patch for mouse movement in links
Content-Disposition: attachment; filename=LINKS-SMOOTH-PATCH

LS0tIGZyYW1lYnVmZmVyLmNfCVNhdCBKdW4gIDggMTM6Mjc6MTggMjAwMg0K
KysrIGZyYW1lYnVmZmVyLmMJU2F0IEp1biAgOCAxNDo1NzoyMyAyMDAyDQpA
QCAtMzUsNiArMzUsMTIgQEANCiANCiAjaW5jbHVkZSAiYXJyb3cuaW5jIg0K
IA0KKyNpZmRlZiBHUE1fSEFWRV9TTU9PVEgNCisjZGVmaW5lIGdwbV9zbW9v
dGggR1BNX1NNT09USA0KKyNlbHNlDQorI2RlZmluZSBncG1fc21vb3RoIDAN
CisjZW5kaWYNCisNCiAjZGVmaW5lIFRUWSAwDQogDQogI2lmbmRlZiBVU0Vf
R1BNX0RYDQpAQCAtODg1LDggKzg5MSwxMyBAQA0KIAl9DQogI2Vsc2UNCiAJ
aWYgKGdldi5keCB8fCBnZXYuZHkpIHsNCi0JCW1vdXNlX3ggKz0gZ2V2LmR4
ICogODsNCi0JCW1vdXNlX3kgKz0gZ2V2LmR5ICogODsNCisJCWlmICghKGdl
di50eXBlICYgZ3BtX3Ntb290aCkpIHsNCisJCQltb3VzZV94ICs9IGdldi5k
eCAqIDg7DQorCQkJbW91c2VfeSArPSBnZXYuZHkgKiA4Ow0KKwkJfSBlbHNl
IHsNCisJCQltb3VzZV94ICs9IGdldi5keDsNCisJCQltb3VzZV95ICs9IGdl
di5keT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