diff --git a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java index 8e44bf754..a8d69efca 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java @@ -302,8 +302,19 @@ protected void mouseClicked(final int xCoord, final int yCoord, final int btn) { return; } super.mouseClicked(xCoord, yCoord, btn); + if (doDelayedGuiInit) { + // the super.mouseClicked call just above ends up looping on the button list + // and execute the action for any button below the mouse. + // Therefore, if we initGui() the terminal in the actionPerformed method below + // it will run the actionPerformed a second time for the new button + // that will end up being below the mouse after the initGui() + initGui(); + doDelayedGuiInit = false; + } } + private boolean doDelayedGuiInit; + @Override protected void actionPerformed(final GuiButton btn) { if (btn == guiButtonAssemblersOnly) { @@ -323,7 +334,7 @@ protected void actionPerformed(final GuiButton btn) { if (btn == this.terminalStyleBox) { AEConfig.instance.settings.putSetting(iBtn.getSetting(), next); - initGui(); + doDelayedGuiInit = true; } else if (btn == searchStringSave) { AEConfig.instance.preserveSearchBar = next == YesNo.YES; }