FLTK logo

[master] 4196daa - macOS: fixed problem in resizing of widget-containing OpenGL 3 window.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4196daa - macOS: fixed problem in resizing of widget-containing OpenGL 3 window. "ManoloFLTK" Sep 30, 2022  
 
commit 4196daa77e727846952b11d20b94f457c591d6e4
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sat Oct 1 07:31:42 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sat Oct 1 07:31:42 2022 +0200

    macOS: fixed problem in resizing of widget-containing OpenGL 3 window.

 src/Fl_Gl_Window.cxx                           | 1 -
 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git src/Fl_Gl_Window.cxx src/Fl_Gl_Window.cxx
index b6c8f01..4bd4397 100644
--- src/Fl_Gl_Window.cxx
+++ src/Fl_Gl_Window.cxx
@@ -262,7 +262,6 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
   if (is_a_resize) valid(0);
   pGlWindowDriver->resize(is_a_resize, W, H);
   Fl_Window::resize(X,Y,W,H);
-  //pGlWindowDriver->resize(is_a_resize, W, H);//essai
 }
 
 /**
diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index c72fe6c..429fad3 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -322,10 +322,10 @@ void Fl_Cocoa_Gl_Window_Driver::resize(int is_a_resize, int w, int h) {
 }
 
 void Fl_Cocoa_Gl_Window_Driver::apply_scissor() {
+  if (glIsEnabled(GL_SCISSOR_TEST)) glDisable(GL_SCISSOR_TEST);
   CGRect *extents = Fl_Cocoa_Window_Driver::driver(pWindow)->subRect();
   if (extents) {
     remove_gl_context_opacity((NSOpenGLContext*)pWindow->context());
-    glDisable(GL_SCISSOR_TEST);
     GLdouble vals[4];
     glGetDoublev(GL_COLOR_CLEAR_VALUE, vals);
     glClearColor(0., 0., 0., 0.);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.