summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-01 12:37:34 +0000
committerManolo Gouy <Manolo>2011-03-01 12:37:34 +0000
commitf22e50af97b45dbf9a63696f33d3c627e0f024b3 (patch)
treefd1a1aa7bf0c051e272f46aebc6e89f5339e7e69
parentf7d7eff7ad584b22ef43211f833073e0dad5ff10 (diff)
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
-rw-r--r--src/Fl_cocoa.mm3
1 files changed, 2 insertions, 1 deletions
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];