Skip to content

Commit

Permalink
[GEF] Add workaround for PaletteView not showing contents on Mac
Browse files Browse the repository at this point in the history
- See #944
  • Loading branch information
Phillipus committed Jul 7, 2023
1 parent d964041 commit 3c767cb
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.gef.ui.views.palette;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;

import org.eclipse.ui.IEditorPart;
Expand All @@ -33,6 +34,8 @@
public class PaletteView extends PageBookView {

private boolean viewInPage = true;

private static final boolean isMac = "cocoa".equals(SWT.getPlatform()); //$NON-NLS-1$

/**
* The ID for this view. This is the same as the String used to register
Expand All @@ -58,6 +61,17 @@ public void perspectiveActivated(IWorkbenchPage page,
}
};

@Override
protected void showPageRec(PageRec pageRec) {
super.showPageRec(pageRec);

// Bug on Mac - PaletteView contents are not redrawn if PaletteView is hidden and reshown
// See https://github.com/archimatetool/archi/issues/944
if(isMac && pageRec.page instanceof PaletteViewerPage && !pageRec.page.getControl().isDisposed()) {
pageRec.page.getControl().redraw();
}
}

/**
* Creates a default page saying that a palette is not available.
*
Expand Down

0 comments on commit 3c767cb

Please sign in to comment.