FLTK logo

[master] b69286f - Remove deprecation warning of graphicsContextWithWindow used with macOS ≤ 10.13

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

[master] b69286f - Remove deprecation warning of graphicsContextWithWindow used with macOS ≤ 10.13 "ManoloFLTK" 04:02 Sep 08  
 
commit b69286f2ca93bdda135cff6189e22d01583c7624
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon Sep 8 12:44:55 2025 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Sep 8 12:44:55 2025 +0200

    Remove deprecation warning of graphicsContextWithWindow used with macOS â?¤ 10.13

 src/Fl_cocoa.mm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index 13d536c..59b8829 100644
--- src/Fl_cocoa.mm
+++ src/Fl_cocoa.mm
@@ -3689,8 +3689,12 @@ void Fl_Cocoa_Window_Driver::make_current()
   } else
 #endif
   {
+// ignore deprecation warning of "graphicsContextWithWindow" because used only with 10.13 or before
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     NSGraphicsContext *nsgc = (through_drawRect ? [NSGraphicsContext currentContext] :
       [NSGraphicsContext graphicsContextWithWindow:fl_window]);
+#pragma clang diagnostic pop
     static SEL gc_sel = fl_mac_os_version >= 101000 ? @selector(CGContext) : @selector(graphicsPort);
     gc = (CGContextRef)[nsgc performSelector:gc_sel];
   }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

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