unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5876: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found] <9E1D86EA-3249-40E3-A114-EDF45F566EC2@gmail.com>
@ 2005-06-03 22:33 ` Richard Stallman
       [not found] ` <E1DeKiq-0003Y4-Gx@fencepost.gnu.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2005-06-03 22:33 UTC (permalink / raw)
  To: David Reitter; +Cc: aquamacs-bugs, 5876

Does this patch fix it?

*** xmenu.c	24 May 2005 19:13:15 -0400	1.290
--- xmenu.c	03 Jun 2005 18:32:12 -0400	
***************
*** 1235,1240 ****
--- 1235,1243 ----
        if (event.type == ButtonRelease
            && dpyinfo->display == event.xbutton.display)
          {
+ 	  if (x_any_window_to_frame (dpyinfo, event.xexpose.window))
+ 	    popup_activated_flag = 0;
+ 	    
            dpyinfo->grabbed &= ~(1 << event.xbutton.button);
  #ifdef USE_MOTIF /* Pretending that the event came from a
                      Btn1Down seems the only way to convince Motif to








^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5894: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found] ` <E1DeKiq-0003Y4-Gx@fencepost.gnu.org>
@ 2005-06-04  7:04   ` jhd
       [not found]   ` <3EB03BC5-006F-4115-A39E-9FB0CB905846@swipnet.se>
  1 sibling, 0 replies; 7+ messages in thread
From: jhd @ 2005-06-04  7:04 UTC (permalink / raw)
  To: rms; +Cc: david.reitter, 5894, aquamacs-bugs

4 jun 2005 kl. 00.33 skrev Richard Stallman:

> Does this patch fix it?
>
> *** xmenu.c    24 May 2005 19:13:15 -0400    1.290
> --- xmenu.c    03 Jun 2005 18:32:12 -0400
> ***************
> *** 1235,1240 ****
> --- 1235,1243 ----
>         if (event.type == ButtonRelease
>             && dpyinfo->display == event.xbutton.display)
>           {
> +       if (x_any_window_to_frame (dpyinfo, event.xexpose.window))
> +         popup_activated_flag = 0;
> +
>             dpyinfo->grabbed &= ~(1 << event.xbutton.button);
>   #ifdef USE_MOTIF /* Pretending that the event came from a
>                       Btn1Down seems the only way to convince Motif to

xmenu.c is not used on Mac AFAIK, Mac uses macmenu.c instead.  The  
behaviour reported seems to be particular to the Mac port, on X11 yes- 
or-no-p does a quit in the case described.  I briefly looked at it a  
while back, and I can fix the quit behaviour to be the same as on X11.

But I would also like C-g to do a quit as it does on X11, but I could  
not find a way to make PopUpMenuSelect return and pop down the menu  
form within an event handler function.  Anybody knows how to do that?

     Jan D.









^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5906: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found]   ` <3EB03BC5-006F-4115-A39E-9FB0CB905846@swipnet.se>
@ 2005-06-04 17:59     ` Richard Stallman
  2005-06-05  9:41     ` bug#5871: " YAMAMOTO Mitsuharu
       [not found]     ` <wlacm5xhry.wl%mituharu@math.s.chiba-u.ac.jp>
  2 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2005-06-04 17:59 UTC (permalink / raw)
  To: jhd; +Cc: david.reitter, 5906, aquamacs-bugs

    xmenu.c is not used on Mac AFAIK, Mac uses macmenu.c instead.  The  
    behaviour reported seems to be particular to the Mac port, on X11 yes- 
    or-no-p does a quit in the case described.

It did fail for me, on GNU/Linux, before I made that patch, and that
patch fixed it for me.  However, I suppose a patch is also needed in
macmenu.c.  And maybe in w32menu.c.








^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5882: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found] <9E1D86EA-3249-40E3-A114-EDF45F566EC2@gmail.com>
  2005-06-03 22:33 ` bug#5876: [Aquamacs-bugs] Re: yes-or-no-p menu Richard Stallman
       [not found] ` <E1DeKiq-0003Y4-Gx@fencepost.gnu.org>
@ 2005-06-04 19:41 ` jhd
       [not found] ` <22179231-C0E6-4DC5-837C-6B86B0166DEC@swipnet.se>
  3 siblings, 0 replies; 7+ messages in thread
From: jhd @ 2005-06-04 19:41 UTC (permalink / raw)
  To: Richard Stallman; +Cc: aquamacs-bugs, 5882, david.reitter

> Does this patch fix it?
>
> *** xmenu.c     24 May 2005 19:13:15 -0400      1.290
> --- xmenu.c     03 Jun 2005 18:32:12 -0400
> ***************
> *** 1235,1240 ****
> --- 1235,1243 ----
>         if (event.type == ButtonRelease
>             && dpyinfo->display == event.xbutton.display)
>           {
> +         if (x_any_window_to_frame (dpyinfo, event.xexpose.window))
> +           popup_activated_flag = 0;
> +
>             dpyinfo->grabbed &= ~(1 << event.xbutton.button);
>   #ifdef USE_MOTIF /* Pretending that the event came from a
>                       Btn1Down seems the only way to convince Motif to



What this patch does is that it makes the dialog pop down for a click  
in an Emacs window for Lesstif/Motif and Lucid only.  We discussed  
this before, this is not the way a dialog shall behave (as seen in  
other GUI programs), and the code was explicitly changed to not pop  
down dialogs on click outside the dialog around december 2004.

However, it *is* the way a menu shall behave.  Menus are used instead  
of dialogs when compiling on X11 without a toolkit, and on Mac (and  
perhaps W32, I am not sure).  So on those ports, the dialog (really  
menu) shall pop down on a click outside the menu.  And for X11 it  
already does that, and now it does that for Mac also.  I suggest  
reverting this patch.

     Jan D.









^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5871: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found]   ` <3EB03BC5-006F-4115-A39E-9FB0CB905846@swipnet.se>
  2005-06-04 17:59     ` bug#5906: " Richard Stallman
@ 2005-06-05  9:41     ` YAMAMOTO Mitsuharu
       [not found]     ` <wlacm5xhry.wl%mituharu@math.s.chiba-u.ac.jp>
  2 siblings, 0 replies; 7+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-06-05  9:41 UTC (permalink / raw)
  To: jhd; +Cc: david.reitter, aquamacs-bugs, rms, 5871

>>>>> On Sat, 4 Jun 2005 09:04:02 +0200, jhd <jan.h.d@swipnet.se> said:

> But I would also like C-g to do a quit as it does on X11, but I
> could not find a way to make PopUpMenuSelect return and pop down the
> menu form within an event handler function.  Anybody knows how to do
> that?

Installing a Carbon Event handler on a menu seems to work, but only
for Mac OS X 10.3 and later because CancelMenuTracking is not
available on earlier versions.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

static pascal OSStatus
mac_handle_menu_event (next_handler, event, data)
     EventHandlerCallRef next_handler;
     EventRef event;
     void *data;
{
  MenuRef menu = data;

  switch (GetEventKind (event))
    {
    case kEventRawKeyDown:
      {
	char c;

	GetEventParameter (event, kEventParamKeyMacCharCodes, typeChar,
			   NULL, sizeof (char), NULL, &c);
	if (c == 7)		/* C-g */
	  {
	    CancelMenuTracking (menu, true, 0);

	    return noErr;
	  }
	else
	  return CallNextEventHandler (next_handler, event);
      }
      break;

    default:
      break;
    }

  return eventNotHandledErr;
}

static OSErr
install_menu_handler (menu)
     MenuRef menu;
{
  EventTypeSpec specs[] = {{kEventClassKeyboard, kEventRawKeyDown}};

  return InstallMenuEventHandler (menu, mac_handle_menu_event,
				  GetEventTypeCount (specs), specs,
				  menu, NULL);
}








^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5877: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found] ` <22179231-C0E6-4DC5-837C-6B86B0166DEC@swipnet.se>
@ 2005-06-05 20:26   ` Richard Stallman
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2005-06-05 20:26 UTC (permalink / raw)
  To: jhd; +Cc: aquamacs-bugs, david.reitter, 5877

    What this patch does is that it makes the dialog pop down for a click  
    in an Emacs window for Lesstif/Motif and Lucid only.  We discussed  
    this before, this is not the way a dialog shall behave (as seen in  
    other GUI programs), and the code was explicitly changed to not pop  
    down dialogs on click outside the dialog around december 2004.

I see now that you are right.
Sorry.








^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5893: [Aquamacs-bugs] Re: yes-or-no-p menu
       [not found]     ` <wlacm5xhry.wl%mituharu@math.s.chiba-u.ac.jp>
@ 2005-06-06 17:27       ` jhd
  0 siblings, 0 replies; 7+ messages in thread
From: jhd @ 2005-06-06 17:27 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: david.reitter, aquamacs-bugs, rms, 5893

>
> Installing a Carbon Event handler on a menu seems to work, but only
> for Mac OS X 10.3 and later because CancelMenuTracking is not
> available on earlier versions.

Thanks.  I guess the best I can do is to put in a configure test for  
CancelMenuTracking and use it if available.

     Jan D.









^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-06 17:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9E1D86EA-3249-40E3-A114-EDF45F566EC2@gmail.com>
2005-06-03 22:33 ` bug#5876: [Aquamacs-bugs] Re: yes-or-no-p menu Richard Stallman
     [not found] ` <E1DeKiq-0003Y4-Gx@fencepost.gnu.org>
2005-06-04  7:04   ` bug#5894: " jhd
     [not found]   ` <3EB03BC5-006F-4115-A39E-9FB0CB905846@swipnet.se>
2005-06-04 17:59     ` bug#5906: " Richard Stallman
2005-06-05  9:41     ` bug#5871: " YAMAMOTO Mitsuharu
     [not found]     ` <wlacm5xhry.wl%mituharu@math.s.chiba-u.ac.jp>
2005-06-06 17:27       ` bug#5893: " jhd
2005-06-04 19:41 ` bug#5882: " jhd
     [not found] ` <22179231-C0E6-4DC5-837C-6B86B0166DEC@swipnet.se>
2005-06-05 20:26   ` bug#5877: " Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).