summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-07-11 13:52:16 +0000
committerManolo Gouy <Manolo>2011-07-11 13:52:16 +0000
commit264c73c9ab0f6083a7f76480e0783e55cc1e5cd1 (patch)
tree62a1263dc4985dda1e0e4db6fa6302c3dab244e1 /src
parent20ab9c3c33612a6bdcdd6c7796022bfeda36f0ae (diff)
Mac OS: added missing lock/unlock pairs when running system menu items.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8851 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 1b0130fac..02a40569b 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2881,6 +2881,7 @@ void Fl_X::set_cursor(Fl_Cursor c)
if(!win) return;
if( printer.start_job(1) ) return;
if( printer.start_page() ) return;
+ fl_lock_function();
// scale the printer device so that the window fits on the page
float scale = 1;
printer.printable_rect(&w, &h);
@@ -2903,6 +2904,7 @@ void Fl_X::set_cursor(Fl_Cursor c)
#endif
printer.end_page();
printer.end_job();
+ fl_unlock_function();
}
@end
@@ -2991,6 +2993,7 @@ static void createAppleMenu(void)
@implementation FLMenuItem
- (void) doCallback:(id)unused
{
+ fl_lock_function();
int flRank = [self tag];
const Fl_Menu_Item *items = fl_sys_menu_bar->Fl_Menu_::menu();
const Fl_Menu_Item *item = items + flRank;
@@ -3019,11 +3022,14 @@ static void createAppleMenu(void)
}
}
}
+ fl_unlock_function();
}
- (void) directCallback:(id)unused
{
+ fl_lock_function();
Fl_Menu_Item *item = (Fl_Menu_Item *)[(NSData*)[self representedObject] bytes];
if ( item && item->callback() ) item->do_callback(NULL);
+ fl_unlock_function();
}
@end
@@ -3417,7 +3423,6 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
this->print_widget(win, x_offset, y_offset);
return;
}
- fl_lock_function(); // necessary because of call to Fl::check() below.
int bx, by, bt;
get_window_frame_sizes(bx, by, bt);
Fl_Display_Device::display_device()->set_current(); // send win to front and make it current
@@ -3444,7 +3449,6 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
}
}
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
- fl_unlock_function();
}
#include <dlfcn.h>