From ebbee5301b975f2afcf22a0649b3ba7724c78089 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 19 Apr 2019 13:03:49 +0200 Subject: macOS: simpler handling of GL windows when first displayed. tested on macOS versions 10.3, 10.6, 10.9, 10.14 --- src/Fl_cocoa.mm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/Fl_cocoa.mm') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index a85343213..a6eb88b4d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2186,10 +2186,6 @@ static FLTextInputContext* fltextinputcontext_instance = nil; Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window); [self did_view_resolution_change]; if (d->wait_for_expose_value) { // 1st drawing of layer-backed GL window - Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); - if (plugin) { - [plugin->context(window) update]; // layer-backed GL windows may be empty without this - } d->wait_for_expose_value = 0; } window->clear_damage(FL_DAMAGE_ALL); @@ -2336,13 +2332,6 @@ static FLTextInputContext* fltextinputcontext_instance = nil; through_drawRect = YES; Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window); [self did_view_resolution_change]; - if (window->as_gl_window() && d->wait_for_expose_value) { // 1st drawing of GL window - Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); - if (plugin) { - [plugin->context(window) update]; // GL windows may be empty without this - } - } - d->wait_for_expose_value = 0; Fl_X *i = Fl_X::i(window); if ( i->region ) { @@ -3661,6 +3650,7 @@ int Fl_Darwin_System_Driver::clipboard_contains(const char *type) { } void Fl_Cocoa_Window_Driver::destroy(FLWindow *xid) { + [[xid parentWindow] removeChildWindow:xid]; // necessary until 10.6 at least if (fl_sys_menu_bar && Fl_Sys_Menu_Bar_Driver::window_menu_style()) Fl_MacOS_Sys_Menu_Bar_Driver::driver()->remove_window([xid getFl_Window]); [xid close]; -- cgit v1.2.3