summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-30 16:20:51 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-30 16:20:51 +0200
commita61d8fb6828c5f480aa913f8d96289a8ead26833 (patch)
treed9712a5dab7fc9fd7e12619b08ea546ece41144a /src/drivers
parent4f6965d39f9fcc0b2eaa4cc97ed096da5c16623d (diff)
macOS: simpler code for auxiliary NSView supporting widgets on a GL3 window.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index 741ab3373..c72fe6c77 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -313,17 +313,11 @@ void Fl_Cocoa_Gl_Window_Driver::swap_buffers() {
char Fl_Cocoa_Gl_Window_Driver::swap_type() {return copy;}
-static void delayed_redraw(Fl_Gl_Window *win) {
- win->redraw();
-}
-
void Fl_Cocoa_Gl_Window_Driver::resize(int is_a_resize, int w, int h) {
if (pWindow->shown()) apply_scissor();
[(NSOpenGLContext*)pWindow->context() update];
if (gl1ctxt) {
- [[gl1ctxt view] setFrame:[[[gl1ctxt view] superview] frame]];
[gl1ctxt update];
- Fl::add_timeout(0.01, (Fl_Timeout_Handler)delayed_redraw, pWindow);
}
}
@@ -474,6 +468,8 @@ void Fl_Cocoa_Gl_Window_Driver::switch_to_GL1() {
if (!gl1ctxt) {
NSView *view = [fl_xid(pWindow) contentView];
win_view_struct.gl1view = [[NSView alloc] initWithFrame:[view frame]];
+ [win_view_struct.gl1view setAutoresizingMask:
+ NSViewWidthSizable|NSViewHeightSizable];
NSOpenGLPixelFormat *gl1pixelformat = mode_to_NSOpenGLPixelFormat(
FL_RGB8 | FL_ALPHA | FL_SINGLE, NULL);
gl1ctxt = [[NSOpenGLContext alloc]