[PATCH] Help Viewer - mouse issues



Hello,

Here are 3 patches to the mouse issues in the Help Viewer.

1) mouse-rightbutton.patch
Returning to a previous node by pressing right mouse button
doesn't work in xterm. It works only in Linux console with GPM.
The problem is that help_event() catches only GPM_UP event,
and it seems that xterm doesn't report which mouse button
was released. Handling GPM_DOWN instead of GPM_UP will fix it.

2) mouse-offbytwo.patch
Last two lines of the help window (the bottom line and a frame)
are not mouse-clickable. So the user will not be able to follow
a link with a mouse, if it is situated at the bottom line.
And the frame needs to be clickable because it serves a special
purpose - page scrolling.

3) mouse-linkfollow.patch
When following a link with a mouse, an extra '\n' is insterted
at the top of the window (just follow any link with a keyboard,
then return back, and follow the same link with a mouse,
and you should see the difference).


P.S.
And finally, it would be nice to add mouse auto-repeating and
wheel-scrolling. I don't provide such a patch because I think
it's better to do it after dealing with above issues.


Regards,
 Grigory

--- help.c.orig	2006-12-31 02:03:48.000000000 +0300
+++ help.c	2007-01-03 18:38:51.000000000 +0300
@@ -474,7 +474,7 @@ help_event (Gpm_Event *event, void *vp)
     Widget *w = vp;
     Link_Area *current_area;
 
-    if (! (event->type & GPM_UP))
+    if (! (event->type & GPM_DOWN))
 	return 0;
 
     /* The event is relative to the dialog window, adjust it: */
--- help.c.orig	2006-12-31 02:03:48.000000000 +0300
+++ help.c	2007-01-03 18:47:50.000000000 +0300
@@ -840,7 +840,7 @@ interactive_display (const char *filenam
     ((Widget *) help_bar)->y -= whelp->y;
     ((Widget *) help_bar)->x -= whelp->x;
 
-    md = mousedispatch_new (1, 1, help_lines, HELP_WINDOW_WIDTH - 2);
+    md = mousedispatch_new (1, 1, help_lines + 2, HELP_WINDOW_WIDTH - 2);
 
     add_widget (whelp, md);
     add_widget (whelp, help_bar);
--- help.c.orig	2006-12-31 02:03:48.000000000 +0300
+++ help.c	2007-01-03 18:55:56.000000000 +0300
@@ -520,7 +520,7 @@ help_event (Gpm_Event *event, void *vp)
 	history_ptr = (history_ptr+1) % HISTORY_SIZE;
 	history [history_ptr].page = currentpoint;
 	history [history_ptr].link = current_area->link_name;
-	currentpoint = help_follow_link (currentpoint, current_area->link_name);
+	currentpoint = help_follow_link (currentpoint, current_area->link_name) + 1;
 	selected_item = NULL;
     } else{
 	if (event->y < 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]