🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1659

X11 Menu bug in 18.53

#1659
From: Gernot Heiser
Date: Wed, 03 May 1989 13:26
70 lines
2936 bytes
[Note: I haven't been reading this newsgroup for about a month, so this may
already have been reported.]

Emacs version 18.53 when compiled for X11 with menus has the following bug: a
popup menu is clipped to emacs's window rather than moved within. The following
patches fix that:

======================= patch 1 ==========================
*** xterm.h	Tue May  2 14:31:51 1989
--- xterm.h.orig	Tue Sep  8 02:00:07 1987
***************
*** 12,18 ****
  XREPBUFFER;
  
  extern int x_edges_specified;
- extern Window XXwindow;
  
  #ifndef sigmask
  #define sigmask(no) (1L << ((no) - 1))
--- 12,17 ----
======================= end of patch 1 ==========================
======================= patch 2 ==========================
*** xmenu.c	Tue May  2 14:31:50 1989
--- xmenu.c.orig	Tue May 31 09:23:17 1988
***************
*** 217,225 ****
    char *datap;
    int ulx, uly, width, height;
    int dispwidth, dispheight;
- #ifdef X11
-   XWindowAttributes attributes;
- #endif
    
    *error = (char *) 0;		/* Initialize error pointer to null */
    if ((GXMenu = XMenuCreate( X11ONLY (XXdisplay) parent, "emacs" )) == NUL )
--- 217,222 ----
***************
*** 267,275 ****
    XMenuRecompute(X11ONLY (XXdisplay) GXMenu);
  #ifdef X11
    XXscreen = DefaultScreen(XXdisplay);
!   XGetWindowAttributes(XXdisplay, XXwindow, &attributes);
!   dispwidth = attributes.width;
!   dispheight = attributes.height;
  #else
    dispwidth = DisplayWidth();
    dispheight = DisplayHeight();
--- 264,271 ----
    XMenuRecompute(X11ONLY (XXdisplay) GXMenu);
  #ifdef X11
    XXscreen = DefaultScreen(XXdisplay);
!   width = DisplayWidth(XXdisplay, XXscreen);
!   height = DisplayHeight(XXdisplay, XXscreen);
  #else
    dispwidth = DisplayWidth();
    dispheight = DisplayHeight();
======================= end of patch 2 ==========================

[Exporting a varialbe may not be the most elegant fix but anything else would
require more extensive changes.]

There is one more menu bug which I didn't notice with X10 (using 18.49): If no
selection is made from the popup menu, after the menu vanishes the screen is
not refreshed until the next event (e.g. hitting the shift key).
-- 
Gernot Heiser                   Phone:       +41 1/256 23 48
Integrated Systems Laboratory   CSNET/ARPA:  heiser%iis.ethz.ch@relay.cs.net
ETH Zuerich                     UUCP (new):  heiser@iis.uucp
CH-8092 Zuerich, Switzerland    UUCP (old):  {uunet,mcvax,...}!iis!heiser
Technical Details
Message-ID: <857@eiger.iis.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!indri!ames!lll-winken!uunet!mcvax!cernvax!ethz!iis!heiser

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!indri!ames!lll-winken!uunet!mcvax!cernvax!ethz!iis!heiser
From: heiser@iis.UUCP (Gernot Heiser)
Newsgroups: gnu.emacs.bug
Subject: X11 Menu bug in 18.53
Message-ID: <857@eiger.iis.UUCP>
Date: 3 May 89 13:26:38 GMT
Reply-To: heiser@iis.UUCP (Gernot Heiser)
Distribution: gnu
Organization: Integrated Systems Lab., ETH Zuerich
Lines: 70