mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-25 10:15:51 +08:00
Save un-maximized/un-iconified bounds in saveToXML()
This addresses https://github.com/NationalSecurityAgency/ghidra/issues/5879
This commit is contained in:
@@ -427,12 +427,16 @@ class RootNode extends WindowNode {
|
||||
Element saveToXML() {
|
||||
Element root = new Element(ROOT_NODE_ELEMENT_NAME);
|
||||
JFrame frame = windowWrapper.getParentFrame();
|
||||
Rectangle r = frame.getBounds();
|
||||
// Save un-maximized/un-iconified bounds rather than e.g. whole screen if maximized
|
||||
int state = frame.getExtendedState(); // Remember current state
|
||||
frame.setExtendedState(JFrame.NORMAL); // Un-maximize & un-iconify
|
||||
Rectangle r = frame.getBounds(); // The un-maximized & un-iconified bounds
|
||||
frame.setExtendedState(state); // Revert to original state
|
||||
root.setAttribute("X_POS", "" + r.x);
|
||||
root.setAttribute("Y_POS", "" + r.y);
|
||||
root.setAttribute("WIDTH", "" + r.width);
|
||||
root.setAttribute("HEIGHT", "" + r.height);
|
||||
root.setAttribute("EX_STATE", "" + frame.getExtendedState());
|
||||
root.setAttribute("EX_STATE", "" + state);
|
||||
if (child != null) {
|
||||
root.addContent(child.saveToXML());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user