cvs commit: patches/gpm gpm-1.20.1-segfault.patch gpm-1.20.1-silent.patch gpm-1.20.1-smooth-cursor.patch
tushar at linuxfromscratch.org
tushar at linuxfromscratch.org
Thu Oct 2 23:16:08 PDT 2003
tushar 03/10/03 00:16:08
Added: gpm gpm-1.20.1-segfault.patch gpm-1.20.1-silent.patch
gpm-1.20.1-smooth-cursor.patch
Log:
Added gpm patches from BLFS book
Revision Changes Path
1.1 patches/gpm/gpm-1.20.1-segfault.patch
Index: gpm-1.20.1-segfault.patch
===================================================================
Submitted By: BLFS Book <blfs-book at linuxfromscratch.org>
Date: 2003-10-03
Initial Package Version: 1.20.1
Origin: BLFS Book
Description: Prevent Segfault under certain conditions.
diff -urN gpm-1.20.1.old/src/lib/liblow.c gpm-1.20.1/src/lib/liblow.c
--- gpm-1.20.1.old/src/lib/liblow.c 2002-12-25 03:57:16.000000000 +0500
+++ gpm-1.20.1/src/lib/liblow.c 2003-05-02 21:51:37.000000000 +0600
@@ -199,7 +199,8 @@
Gpm_Stst *new = NULL;
char* sock_name = 0;
- option.consolename = NULL;
+ if (!checked_con)
+ option.consolename = NULL;
gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
1.1 patches/gpm/gpm-1.20.1-silent.patch
Index: gpm-1.20.1-silent.patch
===================================================================
Submitted By: BLFS Book <blfs-book at linuxfromscratch.org>
Date: 2003-10-03
Initial Package Version: 1.20.1
Origin: BLFS Book
Description: Don't output debug messages on screen.
diff -ur gpm-1.20.1.orig/src/lib/report-lib.c gpm-1.20.1/src/lib/report-lib.c
--- gpm-1.20.1.orig/src/lib/report-lib.c 2002-12-25 03:57:16.000000000 +0500
+++ gpm-1.20.1/src/lib/report-lib.c 2003-05-09 20:09:25.000000000 +0600
@@ -28,6 +28,8 @@
{
char *string = NULL;
va_list ap;
+ if (stat != GPM_STAT_OOPS)
+ return;
va_start(ap,text);
switch(stat) {
diff -ur gpm-1.20.1.orig/src/report.c gpm-1.20.1/src/report.c
--- gpm-1.20.1.orig/src/report.c 2002-12-25 03:57:16.000000000 +0500
+++ gpm-1.20.1/src/report.c 2003-05-09 20:10:46.000000000 +0600
@@ -73,6 +73,8 @@
FILE *console = NULL;
va_list ap;
+ if (stat <= GPM_STAT_INFO)
+ return;
va_start(ap,text);
switch(option.run_status) {
1.1 patches/gpm/gpm-1.20.1-smooth-cursor.patch
Index: gpm-1.20.1-smooth-cursor.patch
===================================================================
Submitted By: BLFS Book <blfs-book at linuxfromscratch.org>
Date: 2003-10-03
Initial Package Version: 1.20.1
Origin: BLFS Book
Description: Smooth cursor movement.
--- src/gpm.c_ Sat Jun 8 14:14:19 2002
+++ src/gpm.c Sat Jun 8 14:51:18 2002
@@ -106,6 +106,11 @@
static int mouse_argc[3]; /* 0 for default (unused) and two mice */
static char **mouse_argv[3]; /* 0 for default (unused) and two mice */
+/* pixel-level mouse delta. Should be in event, but I don't want to break interface */
+static int smooth_dx, smooth_dy;
+
+static int number_of_smooth_clients = 0;
+
/*===================================================================*/
/*
* first, all the stuff that used to be in gpn.c (i.e., not main-loop)
@@ -317,7 +322,15 @@
/* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */
MAGIC_P((write(fd,&magic, sizeof(int))));
- write(fd,event, sizeof(Gpm_Event));
+ if (info.eventMask & info.defaultMask & GPM_SMOOTH && !m_type->absolute) {
+ Gpm_Event new = *event;
+ new.dx = smooth_dx;
+ new.dy = smooth_dy;
+ new.type |= GPM_SMOOTH;
+ write(fd,&new, sizeof(Gpm_Event));
+ } else {
+ write(fd,event, sizeof(Gpm_Event));
+ }
return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */
@@ -503,6 +516,7 @@
/* use fine delta values now, if delta is the information */
if (!(m_type)->absolute) {
+ smooth_dx=event->dx; smooth_dy=event->dy;
fine_dx+=event->dx; fine_dy+=event->dy;
event->dx=fine_dx/opt_scale; event->dy=fine_dy/opt_scaley;
fine_dx %= opt_scale; fine_dy %= opt_scaley;
@@ -511,7 +525,7 @@
/* up and down, up and down, ... who does a do..while(0) loop ???
and then makes a break into it... argh ! */
- if (!event->dx && !event->dy && (event->buttons==oldB))
+ if (!event->dx && !event->dy && (event->buttons==oldB) && !number_of_smooth_clients)
do { /* so to break */
static long awaketime;
/*
@@ -680,6 +694,7 @@
FD_CLR(ci->fd,&readySet);
if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */
cinfoPtr = cinfo[vc];
+ if (cinfoPtr->data.eventMask & cinfoPtr->data.defaultMask & GPM_SMOOTH) number_of_smooth_clients--;
cinfo[vc]=cinfo[vc]->next; /* pop the stack */
free(cinfoPtr);
return -1;
@@ -850,6 +865,8 @@
}
free(tty); /* at least here it's not needed anymore */
}
+
+ if (info->data.eventMask & info->data.defaultMask & GPM_SMOOTH) number_of_smooth_clients++;
/* register the connection information in the right place */
info->next=next=cinfo[vc];
--- src/headers/gpm.h_ Sat Jun 8 13:20:25 2002
+++ src/headers/gpm.h Sat Jun 8 14:52:35 2002
@@ -102,8 +102,15 @@
used event to pass over to another handler */
GPM_ENTER=512, /* enter event, user in Roi's */
- GPM_LEAVE=1024 /* leave event, used in Roi's */
+ GPM_LEAVE=1024, /* leave event, used in Roi's */
+
+ GPM_SMOOTH=2048, /* if application want to receive smooth movement,
+ it sets GPM_SMOOTH in both eventMask and defaultMask.
+ In returned event, type GPM_SMOOTH signals that dx and dy
+ are smooth */
};
+
+#define GPM_HAVE_SMOOTH /* so that apps can #ifdef for old/new version */
#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG))
#define Gpm_AnySingle(type) ((type)&GPM_SINGLE)
More information about the patches
mailing list