From 0f12e96d138af1ea1fa371b858ee2094401621b7 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 24 Sep 2021 17:56:23 +0200 Subject: macOS platform: facilitate use when another toolkit handles the system menu. --- src/Fl_cocoa.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 92e6d19f7..7d28d5747 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1716,6 +1716,7 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { if (![NSApp isActive]) foreground_and_activate(); if (![NSApp servicesMenu]) createAppleMenu(); + else Fl_Sys_Menu_Bar::window_menu_style(Fl_Sys_Menu_Bar::no_window_menu); main_screen_height = CGDisplayBounds(CGMainDisplayID()).size.height; [[NSNotificationCenter defaultCenter] addObserver:[FLWindowDelegate singleInstance] selector:@selector(anyWindowWillClose:) @@ -3459,11 +3460,14 @@ static NSBitmapImageRep *pdf_to_nsbitmapimagerep(NSData *pdfdata) { hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace - bytesPerRow:4 * width - bitsPerPixel:32]; + bytesPerRow:0 + bitsPerPixel:0]; NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];// 10.4 + [[NSColor clearColor] set]; + NSRect r = NSMakeRect(0, 0, width, height); + NSRectFill(r); [image drawInRect:dest_r]; // 10.9 [NSGraphicsContext restoreGraphicsState]; [localPool release]; @@ -3611,7 +3615,7 @@ static Fl_RGB_Image* get_image_from_clipboard(Fl_Widget *receiver) { NSPasteboard *clip = [NSPasteboard generalPasteboard]; NSArray *present = [clip types]; // types in pasteboard in order of decreasing preference - NSArray *possible = [NSArray arrayWithObjects:TIFF_pasteboard_type, PDF_pasteboard_type, PICT_pasteboard_type, nil]; + NSArray *possible = [NSArray arrayWithObjects:PDF_pasteboard_type, TIFF_pasteboard_type, PICT_pasteboard_type, nil]; NSString *found = nil; NSUInteger rank; for (NSUInteger i = 0; (!found) && i < [possible count]; i++) { -- cgit v1.2.3