bug-gnu-emacs
[Top][All Lists]
Advanced

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

More X-related buglets


From: Martin Schwenke
Subject: More X-related buglets
Date: Fri, 20 Oct 2000 13:33:57 +1100 (EST)

In GNU Emacs 20.7.2 (i386-debian-linux-gnu, X toolkit)
 of Wed Jun 21 2000 on raven
configured using `configure  i386-debian-linux-gnu --prefix=/usr 
--sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib 
--infodir=/usr/share/info --with-pop=yes --with-x=yes --with-x-toolkit=yes'

* When the last frame on a display is closed, (x-display-list) still
  shows the display as being in use.  When the display corresponds to
  an SSH session, the session can not be terminated because there is
  still an open connection.  Killing the SSH session can cause Emacs
  to exit.

  I guess that leaving the connection to the X display open is an
  optimisation, but there are cases like the above where the
  optimisation causes a problem.  Since there will usually continue to
  be frames on Emacs' original display, closing connections to other
  displays doesn't seem to carry too much overhead.

  In particular this happens when I use gnuserv/gnuclient (from
  XEmacs).  By the way, if I get time I will try to improve the
  GNU Emacs version of gnuserv/gnuclient so that it does similar
  things to the XEmacs one.

* x-close-connection can cause Emacs to exit.

  This seems to occur when a connection previously existed, but has
  already been closed.

The following very, very gross hack works around both of these bugs:

(defun x-close-connection-if-no-frames (display)
  "Close an open connection to DISPLAY if DISPLAY has no frames."

  (if (and
       (member display (x-display-list))
       (not 
        (eval (cons 'or
                    (mapcar
                     '(lambda (f) (equal (frame-parameter f 'display)
                                         display))
                     (frame-list))))))
      (x-close-connection display)))

(defadvice delete-frame (around
                         x-close-connection-delete-frame
                         first
                         nil
                         activate)
    (let ((display (frame-parameter frame 'display)))
      ad-do-it
      (x-close-connection-if-no-frames display)))

peace & happiness,
martin

-- 
Martin Schwenke,  Technical Support Engineer,  Linuxcare, Inc.
+61 2 6262 8990
martins@linuxcare.com,  http://linuxcare.com.au/
Linuxcare.  Support for the revolution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]