Skip to content

Commit

Permalink
Fix small problem in win->wait_for_expose() for a window that has sub…
Browse files Browse the repository at this point in the history
…windows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11348 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Mar 11, 2016
1 parent 28f24b1 commit 75d6668
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Fl_cocoa.mm
Expand Up @@ -654,6 +654,7 @@ - (Fl_Window *)getFl_Window;
- (void)recursivelySendToSubwindows:(SEL)sel;
- (void)setSubwindowFrame;
- (void)checkSubwindowFrame;
- (void)waitForExpose;
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- (NSPoint)convertBaseToScreen:(NSPoint)aPoint;
Expand Down Expand Up @@ -774,6 +775,16 @@ - (void)checkSubwindowFrame {
}
}

-(void)waitForExpose
{
if ([self getFl_Window]->shown()) {
// this makes freshly created windows appear on the screen, if they are not there already
NSModalSession session = [NSApp beginModalSessionForWindow:self];
[NSApp runModalSession:session];
[NSApp endModalSession:session];
}
}

/* With Mac OS 10.11 the green window button makes window fullscreen (covers system menu bar and dock).
When there are subwindows, they are by default constrained not to cover the menu bar
(this is arguably a Mac OS bug).
Expand Down Expand Up @@ -3097,12 +3108,7 @@ - (NSInteger)windowLevel {

void Fl_Cocoa_Window_Driver::wait_for_expose()
{
if (pWindow->shown()) { //TODO: do that also for pWindow's subwindows
// this makes freshly created windows appear on the screen, if they are not there already
NSModalSession session = [NSApp beginModalSessionForWindow:Fl_X::i(pWindow)->xid];
[NSApp runModalSession:session];
[NSApp endModalSession:session];
}
[fl_xid(pWindow) recursivelySendToSubwindows:@selector(waitForExpose)];
}

/*
Expand Down

0 comments on commit 75d6668

Please sign in to comment.