summaryrefslogtreecommitdiff
path: root/src/nsmenu.m
diff options
context:
space:
mode:
authorAdrian Robert <Adrian.B.Robert@gmail.com>2009-02-13 13:30:35 +0000
committerAdrian Robert <Adrian.B.Robert@gmail.com>2009-02-13 13:30:35 +0000
commitba301db32981a147c1866bf90781ec3c2714f5b7 (patch)
tree36e4702a6812f85761493a7dfdcbd0979cbccd08 /src/nsmenu.m
parent5ae6e65f654ad1c405b8d2113007866e6b595fe6 (diff)
downloademacs-ba301db32981a147c1866bf90781ec3c2714f5b7.tar.gz
* nsfns.m (ns-read-file-name): BLOCK_INPUT while showing dialog. \n \n* nsmenu.m (pop_down_menu): Check popup_activated_flag. \n(ns_popup_dialog, EmacsDialogPanel-runDialogAt:): Let \npop_down_menu do the cleanup work as it is always called. (Bug#2154) \n \n* nsfont.m (nsfont_make_fontset_for_font): For now, don't try to \nset fontset font for 'mathematical-' sub-scripts. (Bug #2218)\n
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r--src/nsmenu.m23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index f6b2075a841..636b71cf308 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1494,12 +1494,15 @@ static Lisp_Object
pop_down_menu (Lisp_Object arg)
{
struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
- popup_activated_flag = 0;
- BLOCK_INPUT;
- [NSApp endModalSession: popupSession];
- [((EmacsDialogPanel *) (p->pointer)) close];
- [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
- UNBLOCK_INPUT;
+ if (popup_activated_flag)
+ {
+ popup_activated_flag = 0;
+ BLOCK_INPUT;
+ [NSApp endModalSession: popupSession];
+ [((EmacsDialogPanel *) (p->pointer)) close];
+ [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
+ UNBLOCK_INPUT;
+ }
return Qnil;
}
@@ -1565,12 +1568,8 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
record_unwind_protect (pop_down_menu, make_save_value (dialog, 0));
popup_activated_flag = 1;
tem = [dialog runDialogAt: p];
- popup_activated_flag = 0;
- unbind_to (specpdl_count, Qnil);
+ unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */
}
-
- [dialog close];
- [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
UNBLOCK_INPUT;
return tem;
@@ -1879,6 +1878,7 @@ void process_dialog (id window, Lisp_Object list)
{
int ret;
+ /* initiate a session that will be ended by pop_down_menu */
popupSession = [NSApp beginModalSessionForWindow: self];
while (popup_activated_flag
&& (ret = [NSApp runModalSession: popupSession])
@@ -1889,7 +1889,6 @@ void process_dialog (id window, Lisp_Object list)
timer_check (1);
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
}
- [NSApp endModalSession: popupSession];
{ /* FIXME: BIG UGLY HACK!!! */
Lisp_Object tmp;