FVWM: A patch and two bugs

From: Andrew Morton <morton_at_nortelnetworks.com>
Date: Wed, 12 May 1999 06:30:42 +0000

Hello.

I use FVWM2 and the KDE file manager. As KFM is a single-click browser
I have configured FVWM2 to be single-clickable as well. This works OK,
except you need a very steady hand to deiconify an icon with a single
click.

This is because the hard-wired three pixel thresholds in
function.c:IsClick() are too small.

The attached patch against fvwm-snap-19990511 makes this distance
configurable (default is still three). The .fvwm2rc syntax is

MoveDistance 9

I hope I did the diff thing right...

BTW: which Makefile target cleans _everything_ into a diffable form???


Bug reports on fvwm-snap-19990511:

1: I get "Some command line modules have not quit, Starting up after
timeout.`" and a long hang at startup

2: When I run KFM, KFM's icons are _always_ on top of FVWM's windows.


System info:

Pretty stock RedHat 5.2/x86

pwold011:~> rpm -qf /opt/kde/bin/kfm
kdebase-1.1-3rh5x


Cheers,
Andrew.

diff -Naur fvwm-snap-19990511/fvwm/builtins.c fvwm.akpm/fvwm/builtins.c
--- fvwm-snap-19990511/fvwm/builtins.c Thu May 6 21:30:18 1999
+++ fvwm.akpm/fvwm/builtins.c Wed May 12 15:48:16 1999
_at_@ -993,6 +993,19 @@
   Scr.MoveResistance = val[1];
 }
 
+void SetMoveDistance(F_CMD_ARGS)
+{
+ int val[1];
+
+ if (GetIntegerArguments(action, NULL, val, 1) != 1)
+ {
+ fvwm_msg(ERR,"SetMoveDisistance","MoveDistance requires one argument");
+ return;
+ }
+
+ Scr.MoveDistance = val[0];
+}
+
 void SetColormapFocus(F_CMD_ARGS)
 {
   if (MatchToken(action,"FollowsFocus"))
diff -Naur fvwm-snap-19990511/fvwm/functions.c fvwm.akpm/fvwm/functions.c
--- fvwm-snap-19990511/fvwm/functions.c Fri May 7 21:30:20 1999
+++ fvwm.akpm/fvwm/functions.c Wed May 12 15:46:09 1999
_at_@ -167,6 +167,7 @@
   {"modulepath", setModulePath, F_MODULE_PATH, 0},
   {"mouse", mouse_binding, F_MOUSE, 0},
   {"move", move_window, F_MOVE, FUNC_NEEDS_WINDOW},
+ {"movedistance",SetMoveDistance, F_MOVE_DIST, 0},
   {"movetodesk", move_window_to_desk,F_MOVE_TO_DESK, FUNC_NEEDS_WINDOW},
   {"movetopage", move_window_to_page,F_MOVE_TO_PAGE, FUNC_NEEDS_WINDOW},
   {"next", NextFunc, F_NEXT, 0},
_at_@ -382,16 +383,18 @@
 {
   int xcurrent,ycurrent,total = 0;
   Time t0;
+ int dist;
   extern Time lastTimestamp;
 
   xcurrent = x;
   ycurrent = y;
   t0 = lastTimestamp;
+ dist = Scr.MoveDistance;
 
   while(((total < Scr.ClickTime && lastTimestamp - t0 < Scr.ClickTime) ||
          !may_time_out) &&
- x - xcurrent < 3 && x - xcurrent > -3 &&
- y - ycurrent < 3 && y - ycurrent > -3)
+ x - xcurrent < dist && x - xcurrent > -dist &&
+ y - ycurrent < dist && y - ycurrent > -dist)
     {
       usleep(20000);
       total+=20;
diff -Naur fvwm-snap-19990511/fvwm/fvwm.c fvwm.akpm/fvwm/fvwm.c
--- fvwm-snap-19990511/fvwm/fvwm.c Tue May 11 21:30:19 1999
+++ fvwm.akpm/fvwm/fvwm.c Wed May 12 15:42:45 1999
_at_@ -1568,6 +1568,7 @@
 
   Scr.EdgeScrollX = Scr.EdgeScrollY = 100;
   Scr.ScrollResistance = Scr.MoveResistance = 0;
+ Scr.MoveDistance = 3;
   Scr.SnapAttraction = -1;
   Scr.SnapMode = 0;
   Scr.SnapGridX = 1;
diff -Naur fvwm-snap-19990511/fvwm/fvwm2.1 fvwm.akpm/fvwm/fvwm2.1
--- fvwm-snap-19990511/fvwm/fvwm2.1 Sat May 8 21:30:21 1999
+++ fvwm.akpm/fvwm/fvwm2.1 Wed May 12 16:05:57 1999
_at_@ -2300,6 +2300,14 @@
 See also the "AnimatedMove" command, above.
 
 
+.IP "MoveDistance \fIpixels"
+When the user presses a mouse button upon an object \fIfvwm2\fP
+waits to see if the action is a click or a drag. If the mouse
+moves by more than \fIpixels\fP pixels it is assumed to be a drag.
+
+Previous versions of \fIfvwm2\fP hardwired \fIpixels\fP to 3, which
+is now the default value.
+
 .IP "MoveToDesk \fIarg1\fP [ \fIarg2\fP ] [ \fImin max\fP ]"
 Moves the selected window to another desktop (workspace, room).
 
diff -Naur fvwm-snap-19990511/fvwm/misc.h fvwm.akpm/fvwm/misc.h
--- fvwm-snap-19990511/fvwm/misc.h Thu May 6 21:30:21 1999
+++ fvwm.akpm/fvwm/misc.h Wed May 12 15:37:53 1999
_at_@ -151,6 +151,7 @@
 void copy_config(FILE **config_fd);
 void SetEdgeScroll(F_CMD_ARGS);
 void SetEdgeResistance(F_CMD_ARGS);
+void SetMoveDistance(F_CMD_ARGS);
 void CursorStyle(F_CMD_ARGS);
 void ButtonStyle(F_CMD_ARGS);
 #ifdef MULTISTYLE
diff -Naur fvwm-snap-19990511/fvwm/parse.h fvwm.akpm/fvwm/parse.h
--- fvwm-snap-19990511/fvwm/parse.h Sun Apr 18 21:30:25 1999
+++ fvwm.akpm/fvwm/parse.h Wed May 12 15:36:44 1999
_at_@ -122,6 +122,7 @@
   F_DESTROY,
   F_DELETE,
   F_MOVE,
+ F_MOVE_DIST,
   F_MOVE_TO_PAGE,
   F_ICONIFY,
   F_STICK,
diff -Naur fvwm-snap-19990511/fvwm/screen.h fvwm.akpm/fvwm/screen.h
--- fvwm-snap-19990511/fvwm/screen.h Tue May 11 21:30:20 1999
+++ fvwm.akpm/fvwm/screen.h Wed May 12 15:42:10 1999
_at_@ -327,6 +327,7 @@
   int ClickTime; /*Max button-click delay for Function built-in*/
   int ScrollResistance; /* resistance to scrolling in desktop */
   int MoveResistance; /* res to moving windows over viewport edge */
+ int MoveDistance; /* number of pixels of mouse motion to decide it's a move operation */
   int SnapAttraction; /* attractiveness of window edges */
   int SnapMode; /* mode of snap attraction */
   int SnapGridX; /* snap grid X size */


--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Wed May 12 1999 - 01:33:18 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:02 BST