diff options
| author | Manolo Gouy <Manolo> | 2018-10-28 16:22:05 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-10-28 16:22:05 +0000 |
| commit | 2106f867b6f637d6c40710272da2bb7f8795ba4f (patch) | |
| tree | 54e1a1ee5a0c243e92512efbff93ad5a441f0337 /src | |
| parent | d666a6f234465e913248b5f02fe05862d468ae92 (diff) | |
Fixed first drawing of a layer-backed OpenGL window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13087 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 98fa750c0..0b50353d8 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2161,7 +2161,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; FLView implements displayLayer:. Consequently, FLView objects are drawn by the displayLayer: method. An FLView manages also a member variable CGContextRef layer_gc, a bitmap context the size of the view (double on Retina). - All Quartz drawings go to this bitmap. updateLayer finishes by using an image copy + All Quartz drawings go to this bitmap. displayLayer: finishes by using an image copy of the bitmap as the layer's contents. That step fills the window. When resized or when the window flips between low/high resolution displays, FLView receives the viewFrameDidChange message which deletes the bitmap and zeros layer_gc. @@ -2199,11 +2199,7 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) { if (d->wait_for_expose_value) { // 1st drawing of GL window [self did_view_resolution_change]; - NSRect r = [[self window] frame]; - r.size.width -= 1; - [[self window] setFrame:r display:NO]; // very dirty but works. Should find something better. - r.size.width += 1; - [[self window] setFrame:r display:YES]; + [window->as_gl_window()->context() update]; // GL window is empty without this d->wait_for_expose_value = 0; } through_drawRect = YES; |
