diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-09-24 17:56:23 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-09-24 17:56:35 +0200 |
| commit | 0f12e96d138af1ea1fa371b858ee2094401621b7 (patch) | |
| tree | b44006a46cb7bfb5403ebcb24fc41e5e8daf1f33 /src | |
| parent | c3857517b01c5085a385f8750038d7a069be64a7 (diff) | |
macOS platform: facilitate use when another toolkit handles the system menu.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 10 |
1 files changed, 7 insertions, 3 deletions
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++) { |
