void (@NotNull IdeFrameImpl tabFrame) { Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(tabFrame); ID tabGroup = Foundation.invoke(window, "tabGroup"); Foundation.invoke(tabGroup, "setSelectedWindow:", window); Foundation.invoke(window, "moveTabToNewWindow:", ID.NIL); ApplicationManager.getApplication().invokeLater(() -> MacWinTabsHandlerV2.updateTabBarsAfterMove(tabFrame, null, -1)); }); }