fix(gui): skip window pos saving if not changed
This commit is contained in:
@@ -261,8 +261,10 @@ public class JadxSettings extends JadxCLIArgs {
|
||||
|
||||
public void saveWindowPos(Window window) {
|
||||
WindowLocation pos = new WindowLocation(window.getClass().getSimpleName(), window.getBounds());
|
||||
windowPos.put(pos.getWindowId(), pos);
|
||||
partialSync(settings -> settings.windowPos = windowPos);
|
||||
WindowLocation prevPos = windowPos.put(pos.getWindowId(), pos);
|
||||
if (prevPos == null || !prevPos.equals(pos)) {
|
||||
partialSync(settings -> settings.windowPos = windowPos);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean loadWindowPos(Window window) {
|
||||
|
||||
@@ -31,6 +31,21 @@ public class WindowLocation {
|
||||
this.bounds = bounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return windowId.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (o instanceof WindowLocation) {
|
||||
WindowLocation that = (WindowLocation) o;
|
||||
return windowId.equals(that.windowId) && bounds.equals(that.bounds);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WindowLocation{"
|
||||
|
||||
Reference in New Issue
Block a user