Skip to content

Instantly share code, notes, and snippets.

@azhawkes
Last active December 14, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azhawkes/5009567 to your computer and use it in GitHub Desktop.
Save azhawkes/5009567 to your computer and use it in GitHub Desktop.
Workaround to disable SWT full-screen mode on the Mac, to get around this nasty bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389486
public static void disableFullScreen(Shell shell) {
try {
Field windowField = Shell.class.getDeclaredField("window");
windowField.setAccessible(true);
Object window = windowField.get(shell);
invoke(window.getClass(), window, "setCollectionBehavior", new Long[] { 0L });
} catch (Exception e) {
log.error("couldn't disable full screen mode", e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment