From 897ef1b9391870ec259b911d2c707433ebadbfea Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Fri, 2 Aug 2013 17:42:51 +0200 Subject: [PATCH] try to avoid native crash when native menu on Linux is enabled --- .../intellij/openapi/wm/impl/welcomeScreen/WelcomeFrame.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomeFrame.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomeFrame.java index 321bc2abd632..dd0c89de48bc 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomeFrame.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomeFrame.java @@ -32,6 +32,7 @@ import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.project.ProjectManagerAdapter; import com.intellij.openapi.util.DimensionService; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.wm.*; import com.intellij.openapi.wm.impl.IdeFrameImpl; import com.intellij.openapi.wm.impl.IdeGlassPaneImpl; @@ -41,6 +42,7 @@ import com.intellij.ui.AppUIUtil; import com.intellij.ui.BalloonLayout; import com.intellij.ui.BalloonLayoutImpl; import com.intellij.util.ui.UIUtil; +import org.java.ayatana.ApplicationMenu; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -159,6 +161,9 @@ public class WelcomeFrame extends JFrame implements IdeFrame { if (ourInstance == null) { IdeFrame frame = EP.getExtensions().length == 0 ? new WelcomeFrame() : EP.getExtensions()[0].createFrame(); + if (SystemInfo.isLinux) { + ApplicationMenu.tryInstall(((JFrame)frame)); + } ((JFrame)frame).setVisible(true); ourInstance = frame; }