GNU bug report logs - #75056
31.0.50; tty-child-frames with server / multiple clients possible hangs

Previous Next

Package: emacs;

Reported by: Len Trigg <lenbok <at> gmail.com>

Date: Tue, 24 Dec 2024 05:44:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: rudalics <at> gmx.at, lenbok <at> gmail.com, 75056 <at> debbugs.gnu.org
Subject: bug#75056: 31.0.50; tty-child-frames with server / multiple clients possible hangs
Date: Fri, 31 Jan 2025 14:03:02 +0200
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  lenbok <at> gmail.com,  75056 <at> debbugs.gnu.org
> Date: Fri, 31 Jan 2025 11:28:19 +0100
> 
> martin rudalics <rudalics <at> gmx.at> writes:
> 
> >> Just came to my mind that one could re-implemented tty menus in Lisp
> >> using child frames.
> >
> > I have never looked into the menu bar drawing code.  Does it use a
> > painter's algorithm?
> 
> The menu bar itself, the stripe at the top of a frame is pretty special.
> On GUIs without external, i.e. toolkit, menu bar, a window is used to
> display it, on ttys not IIRC.

It's not a window on TTY frames, indeed.  See the commentary to
display_menu_bar:

  /* Redisplay the menu bar in the frame for window W.

     The menu bar of X frames that don't have X toolkit support is
     displayed in a special window W->frame->menu_bar_window.

     The menu bar of terminal frames is treated specially as far as
     glyph matrices are concerned.  Menu bar lines are not part of
     windows, so the update is done directly on the frame matrix rows
     for the menu bar.  */

And the corresponding code:

    else
  #endif /* not USE_X_TOOLKIT and not USE_GTK */
      {
	/* This is a TTY frame, i.e. character hpos/vpos are used as
	   pixel x/y.  */
	init_iterator (&it, w, -1, -1, f->desired_matrix->rows,
		       MENU_FACE_ID);
	it.first_visible_x = 0;
	it.last_visible_x = FRAME_COLS (f);
      }

> The menus themselves are drawn, simplifying, in these steps
> 
> 1. Save away the frame's whole current matrix
> 
> 2. Produce a desired matrix that contains the menu
> 
> 3. Update the display. Maybe loop for highlighting item.
> 
> 4. In the end, restore the display from the current matrix saved in the
>    first step.
> 
> That's save_and_enable_current_matrix, tty_menu_display,
> restore_desired_matrix and alike. The event loop is somewhere in
> tty_menu_activate IIRC.

Right.




This bug report was last modified 110 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.