diff --git a/Source/NSMenuItemCell.m b/Source/NSMenuItemCell.m index ab9f42367..389cb8550 100644 --- a/Source/NSMenuItemCell.m +++ b/Source/NSMenuItemCell.m @@ -543,6 +543,10 @@ static NSImage *arrowImageH = nil; if (NSIsEmptyRect(cellFrame)) return; + // Do nothing if the window is deferred + if ([[controlView window] gState] == 0) + return; + [controlView lockFocus]; // Draw the border if needed @@ -563,6 +567,14 @@ static NSImage *arrowImageH = nil; if (_buttoncell_is_transparent) return; + // Do nothing if the cell frame is empty + if (NSIsEmptyRect(cellFrame)) + return; + + // Do nothing if the window is deferred + if ([[controlView window] gState] == 0) + return; + cellFrame = [self drawingRectForBounds: cellFrame]; // Pushed in buttons contents are displaced to the bottom right 1px