Subject: FVWM: Do not warp the mouse pointer...

From: Markus Gutschke <[email-masked]>
Date: Wed, 19 Jun 1996 17:49:40 +0200

Hi,

I do not like my mouse pointer to be warped. Fvwm usually does not do
this, unless I tell it to do so explicitly, but there is one case,
when this annoying behavior still shows up. Judging from the context,
I actually believe this to be a bug, as it handles "ClickToFocus"
different from "SloppyFocus" which does not make much sense in this
context. Could you please consider incorporating this (or a similar)
patch in one of the next beta releases? Is posting to the mailing
list, the appropriate way of submitting patches?

Markus

re --- cut here --- cut here --- cut here --- cut here --- cut here --- cut he

--- fvwm-2.0.42/fvwm/builtins.c.orig	Fri Jun 14 12:13:30 1996
+++ fvwm-2.0.42/fvwm/builtins.c	Fri Jun 14 12:14:40 1996
@@ -197,7 +197,7 @@
     x = t->frame_x;
     y = t->frame_y;
   }
-  if(!(t->flags & ClickToFocus))
+  if(!(t->flags & (ClickToFocus|SloppyFocus)))
     XWarpPointer(dpy, None, Scr.Root, 0, 0, 0, 0, x+2,y+2);
   RaiseWindow(t);
   KeepOnTop();
@@ -207,7 +207,7 @@
      (t->frame_x >Scr.MyDisplayWidth)||(t->frame_y>Scr.MyDisplayHeight))
   {
     SetupFrame(t,0,0,t->frame_width, t->frame_height,False);
-    if(!(t->flags & ClickToFocus))
+    if(!(t->flags & (ClickToFocus|SloppyFocus)))
       XWarpPointer(dpy, None, Scr.Root, 0, 0, 0, 0, 2,2);
   }
   UngrabEm();

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: <[email-masked]> (Charles Hines)
Date: Wed, 19 Jun 1996 20:11:26 -0400

>>>>> "Markus" == Markus Gutschke <[email-masked]> writes:

Markus> Hi,

Guten Tag, Markus.  Wie Geht's?

Markus> I do not like my mouse pointer to be warped. Fvwm usually does not do
Markus> this, unless I tell it to do so explicitly, but there is one case,
Markus> when this annoying behavior still shows up. Judging from the context,
Markus> I actually believe this to be a bug, as it handles "ClickToFocus"
Markus> different from "SloppyFocus" which does not make much sense in this
Markus> context. Could you please consider incorporating this (or a similar)
Markus> patch in one of the next beta releases?

Actually, the Focus Warp behavior has already been changed in the next
beta, out soon.

Markus> Is posting to the mailing list, the appropriate way of
Markus> submitting patches?

Sure.

Tchuss!
Chuck

*******************************************************************************
Charles K. Hines <[email-masked]>
IBM Logic Synthesis Developer [BooleDozer (TM)]
Martial Arts Instructor [Modern Arnis, Presas Style Filipino Martial Arts]

         "Go back to sleep, Chuck.  You're just havin' a nightmare
             -- of course, we ARE still in Hell." (Gary Larson)
*******************************************************************************
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Markus Gutschke <[email-masked]>
Date: Thu, 20 Jun 1996 18:31:31 +0200

The new FvwmConsole module looked very promising, but when I tried to
use it, it failed to start. Subsequent debugging revealed several
fatal bugs. I attached diffs that fix all of the bugs that I could
find. I did not bother about fixing compiler warning messages, though.

Markus

re -- cut here -- cut here -- cut here -- cut here -- cut here -- cut here -- c

--- ./modules/FvwmConsole/FvwmConsole.c.orig	Thu Jun 20 17:03:43 1996
+++ ./modules/FvwmConsole/FvwmConsole.c	Thu Jun 20 17:57:27 1996
@@ -26,10 +26,11 @@
 
 void main(int argc, char **argv){
   char *tmp, *s;
-  char client[120];
+  static char client[120];
   char **eargv;
   int i,j;
   char *xterm_a[] = {"-title", name,"-name",name, "-e",client,NULL };
+  #define XARGS (sizeof(xterm_a)/sizeof(char *))
 
   /* initially no child */
   pid = 0;
@@ -57,17 +58,17 @@
 	exit(1);
   }
 
-  if( ( eargv =(char **)safemalloc((argc-2)*sizeof(char *)) ) == NULL ) {
+  if( ( eargv =(char **)safemalloc((argc-FARGS+XARGS)*sizeof(char *)) ) == NULL ) {
 	ErrMsg( "allocation" );
   }
 
   /* copy arguments */
   eargv[0] = XTERM;
   j= 1;
-  for ( i=FARGS ; i<=argc; i++,j++ ) {
+  for ( i=FARGS ; i<argc; i++,j++ ) {
 	eargv[j] = argv[i];
   }
-  j--;
+
   for ( i=0 ; xterm_a[i] != NULL ; j++, i++ ) {
 	eargv[j] = xterm_a[i];
   }
--- ./modules/FvwmConsole/FCtest.c.orig	Thu Jun 20 17:33:32 1996
+++ ./modules/FvwmConsole/FCtest.c	Thu Jun 20 17:57:38 1996
@@ -27,10 +27,11 @@
 
 void main(int argc, char **argv){
   char *tmp, *s;
-  char client[120];
+  static char client[120];
   char **eargv;
   int i,j;
   char *xterm_a[] = {"-title", name,"-name",name, "-e",client,NULL };
+  #define XARGS (sizeof(xterm_a)/sizeof(char *))
 
   /* initially no child */
   pid = 0;
@@ -58,17 +59,17 @@
 	exit(1);
   }
 
-  if( ( eargv =(char **)safemalloc((argc-2)*sizeof(char *)) ) == NULL ) {
+  if( ( eargv =(char **)safemalloc((argc-FARGS+XARGS)*sizeof(char *)) ) == NULL ) {
 	ErrMsg( "allocation" );
   }
 
   /* copy arguments */
   eargv[0] = XTERM;
   j= 1;
-  for ( i=FARGS ; i<=argc; i++,j++ ) {
+  for ( i=FARGS ; i<argc; i++,j++ ) {
 	eargv[j] = argv[i];
   }
-  j--;
+
   for ( i=0 ; xterm_a[i] != NULL ; j++, i++ ) {
 	eargv[j] = xterm_a[i];
   }
--- ./modules/FvwmConsole/getline.c.orig	Thu Jun 20 17:51:10 1996
+++ ./modules/FvwmConsole/getline.c	Thu Jun 20 18:06:16 1996
@@ -1,8 +1,9 @@
 #include "FvwmConsole.h"
 
-static   char cmd[256];
 
 #ifndef HAVE_READLINE
+static   char cmd[256];
+
 /* no readline - starts here */
 char *getline() {
   if( fgets(cmd,256,stdin) == NULL  ) {
@@ -15,10 +16,10 @@
 /* readline - starts here */
 #include <readline/readline.h>
 
-#define PROMPT ""
+#define PROMPT "> "
 
 char *getline() {
-  char *line;
+  static char *line = NULL;
 
   /* If the buffer has already been allocated, return the memory to the free pool. */
   if (line != (char *)NULL) {
@@ -29,19 +30,18 @@
   /* Get a line from the user. */
   line  = readline (PROMPT);
      
-  if( line == NULL ) {
-	return(NULL);
-  } 
+  if( line != NULL ) {
 
 	/* If the line has any text in it, save it on the history. */
 	if (*line != '\0')
 	  add_history (line);
 	
 	/* add cr at the end*/
-	strncpy( cmd, line, 254 );
-	strcat( cmd, NEWLINE ); 
+	if ((line = realloc(line,strlen(line)+2)) != NULL)
+	  strcat(line, NEWLINE ); 
+  }
 
-  return (cmd);
+  return (line);
 
 }
 /* readline - end here */