🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1251

minor nit on X11 mouse support in the minibuffer

#1251
From: Dave Cohrs
Date: Fri, 16 Dec 1988 16:49
72 lines
3217 bytes
18.52, as distributed, doesn't fully support the X11 mouse.  It works
fine for normal windows, but support for the minibuffer, when active,
just doesn't cut it.  You can't select it with the mouse, and you
can't reposition point using the mouse.  The following patches to
x11fns.c solve both of these problems.  I've been running emacs with
these mods for a couple weeks without any problems, so I'm pretty sure
of their correctness.

There were various problems, all in the coordinates-in-window-p
function:

- it assumed all windows have a mode line
- it wouldn't let you select the last line in the "screen"
  in any case
- it didn't take into account the width of the prompt that usually
  appears in the minibuffer when calculating relative coordinates.

Dave Cohrs

RCS file: RCS/x11fns.c,v
retrieving revision 1.1
diff -c -r1.1 x11fns.c
*** /tmp/,RCSt1a04978   Fri Dec 16 10:30:29 1988
--- x11fns.c    Fri Dec 16 10:25:18 1988
***************
*** 477,482 ****
--- 477,484 ----
       register Lisp_Object coordinate, window;
  {
        register Lisp_Object xcoord, ycoord;
+       extern Lisp_Object minibuf_window;
+       extern int minibuf_prompt_width;
  
        if (!CONSP (coordinate))
                wrong_type_argument (Qlistp, coordinate);
***************
*** 492,504 ****
                return Qnil;
  
        XFASTINT (xcoord) -= XFASTINT (XWINDOW (window)->left);
-       if (XINT (ycoord) == (screen_height - 1))
-               return Qnil;
  
!       if ((XINT (ycoord) < XINT (XWINDOW (window)->top)) ||
!           (XINT (ycoord) >= (XINT (XWINDOW (window)->top) +
!                              XINT (XWINDOW (window)->height)) - 1))
!               return Qnil;
  
        XFASTINT (ycoord) -= XFASTINT (XWINDOW (window)->top);
        return Fcons (xcoord, Fcons (ycoord, Qnil));
--- 494,514 ----
                return Qnil;
  
        XFASTINT (xcoord) -= XFASTINT (XWINDOW (window)->left);
  
!       if (window == minibuf_window) {
!               XFASTINT (xcoord) -= minibuf_prompt_width;
!               if(XINT (xcoord) < 0)
!                       XFASTINT (xcoord) = 0;
!               if ((XINT (ycoord) < XINT (XWINDOW (window)->top)) ||
!                   (XINT (ycoord) >= (XINT (XWINDOW (window)->top) +
!                                      XINT (XWINDOW (window)->height))))
!                       return Qnil;
!       } else {
!               if ((XINT (ycoord) < XINT (XWINDOW (window)->top)) ||
!                   (XINT (ycoord) >= (XINT (XWINDOW (window)->top) +
!                                      XINT (XWINDOW (window)->height)) - 1))
!                       return Qnil;
!       }
  
        XFASTINT (ycoord) -= XFASTINT (XWINDOW (window)->top);
        return Fcons (xcoord, Fcons (ycoord, Qnil));
Technical Details
Message-ID: <8812161649.AA05014@romano.cs.wisc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!dave

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!dave
From: dave@CS.WISC.EDU (Dave Cohrs)
Newsgroups: gnu.emacs.bug
Subject: minor nit on X11 mouse support in the minibuffer
Message-ID: <8812161649.AA05014@romano.cs.wisc.edu>
Date: 16 Dec 88 16:49:35 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 72