[Top][All Lists]

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

Re: menubar segfault

From: Scott Lanning
Subject: Re: menubar segfault
Date: Sun, 6 Jan 2002 00:09:18 -0500

On 5 Jan 2002, Jason Rumney wrote:
>Yes, the menubar callbacks are run asynchronously, so you need to be
>very careful about altering frame parameters and accessing Lisp
>variables to avoid clearing data from under the redisplay or garbage
>collection code. I thought from previous experience that this was only
>a problem with Fx_show_tip, but obviously Fx_hide_tip needs care too.
>We probably need to push an event onto the keyboard buffer instead of
>calling Fx_hide_tip directly. But I think the following help event
>that is pushed should result in Fx_hide_tip being called, so perhaps
>that call to Fx_hide_tip needs to be moved to where the keyboard
>event that is already being pushed is handled.

I feel awful that my first patch in emacs caused segfaulting.
Not a good way to start... :(

I followed your advice and moved Fx_hide_tip from function
`menu_highlight_callback' in src/xmenu.c to where I think the
help event is handled, `kbd_buffer_get_event' in src/keyboard.c.
If I understand correctly, then here is a patch to version
that doesn't seem to segfault (also w32 version for you :)

diff -urN src-orig/keyboard.c src/keyboard.c
--- src-orig/keyboard.c Sat Jan  5 23:49:22 2002
+++ src/keyboard.c      Sat Jan  5 23:49:20 2002
@@ -3747,6 +3747,8 @@
                       list5 (frame, help, window, object, position));
          clear_event (event);
          kbd_fetch_ptr = event + 1;
+         Fx_hide_tip ();
       else if (event->kind == FOCUS_IN_EVENT)
diff -urN src-orig/w32menu.c src/w32menu.c
--- src-orig/w32menu.c  Sun Jan  6 00:04:03 2002
+++ src/w32menu.c       Sun Jan  6 00:05:05 2002
@@ -2226,8 +2226,6 @@
         Windows code on the non-toolkit version.  */
       if (f)
-         Fx_hide_tip ();
          XSETFRAME (frame, f);
          kbd_buffer_store_help_event (frame, help);
diff -urN src-orig/xmenu.c src/xmenu.c
--- src-orig/xmenu.c    Sat Jan  5 23:49:26 2002
+++ src/xmenu.c Sat Jan  5 23:49:15 2002
@@ -1191,8 +1191,6 @@
   f = menubar_id_to_frame (id);
   if (f)
-      Fx_hide_tip ();
       XSETFRAME (frame, f);
       kbd_buffer_store_help_event (frame, help);

reply via email to

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