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
This commit is contained in:
Manolo Gouy 2011-03-01 12:37:34 +00:00
parent f7d7eff7ad
commit f22e50af97

View File

@ -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];