From f22e50af97b45dbf9a63696f33d3c627e0f024b3 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 1 Mar 2011 12:37:34 +0000 Subject: STR 2580: the first Fl::add_timeout() call now calls fl_open_display() because that is necessary for timeout events to be recovered by the event loop. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index eee31a9d7..20fe0d1ef 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -293,11 +293,11 @@ static DataReady dataready; void DataReady::AddFD(int n, int events, void (*cb)(int, void*), void *v) { - fl_open_display(); // necessary for NSApp to be defined RemoveFD(n, events); int i = nfds++; if (i >= fd_array_size) { + fl_open_display(); // necessary for NSApp to be defined and the event loop to work FD *temp; fd_array_size = 2*fd_array_size+1; if (!fds) { temp = (FD*)malloc(fd_array_size*sizeof(FD)); } @@ -544,6 +544,7 @@ static void realloc_timers() { if (mac_timer_alloc == 0) { mac_timer_alloc = 8; + fl_open_display(); // needed because the timer creates an event } mac_timer_alloc *= 2; MacTimeout* new_timers = new MacTimeout[mac_timer_alloc]; -- cgit v1.2.3