killactive/closewindow, active closes the whole app
#13228
-
|
One application can spawn multiple (sub)windows. When I do This affects on some applications. Three examples are listed below from my experience: Jetbrains IDEs: When I opened multiple projects, Tencent LinuxQQ: Closing the main window makes the whole app crash (qq-crash.tar.gz if this is useful), plus the tray icon disappears (because of the crash). However if you close the window via QQ's top-right "X" button, it won't happen. The tray icon will leave still, and you can click it to call the QQ main window back to show again. Steam: After closing the window using This java swing application demonstrates the issue: import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
public class HyprlandSwingRepro {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
makeWin("Window 1", 100);
makeWin("Window 2", 500);
});
}
private static void makeWin(String title, int x) {
JFrame f = new JFrame(title);
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JButton btn = new JButton("Close " + title);
btn.addActionListener(e -> f.setVisible(false));
f.add(btn, BorderLayout.CENTER);
f.setPreferredSize(new Dimension(300, 200));
f.pack();
f.setLocation(x, 200);
f.setVisible(true);
}
}To run it: javac HyprlandSwingRepro.java
java HyprlandSwingReproThis Java app starts two windows. Close one window (via Ran a bisect and this is introduced by #13156. Could you have a look please? @gulafaran |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Just tested and confirmed this got fixed by a20142b. cc and thx @vaxerski! Closing ~ |
Beta Was this translation helpful? Give feedback.
Just tested and confirmed this got fixed by a20142b. cc and thx @vaxerski! Closing ~