mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove old key in WindowStateServiceImpl
This commit is contained in:
@@ -278,12 +278,15 @@ abstract class WindowStateServiceImpl extends WindowStateService implements Pers
|
||||
boolean maximized, boolean maximizedSet,
|
||||
boolean fullScreen, boolean fullScreenSet) {
|
||||
WindowState state = myStateMap.get(keyPair.first);
|
||||
if (state == null) {
|
||||
// may be convert the old key state to the new key
|
||||
state = myStateMap.remove(oldKeyPair.first);
|
||||
|
||||
// may be convert the old key state to the new key
|
||||
WindowState oldState = myStateMap.remove(oldKeyPair.first);
|
||||
if (oldState != null) {
|
||||
oldState.scaleDown(oldKeyPair.second);
|
||||
if (state != null) {
|
||||
state.scaleDown(oldKeyPair.second);
|
||||
myStateMap.put(keyPair.first, state);
|
||||
state.merge(oldState);
|
||||
} else {
|
||||
myStateMap.put(keyPair.first, state = oldState);
|
||||
}
|
||||
}
|
||||
if (state != null) {
|
||||
@@ -459,6 +462,18 @@ abstract class WindowStateServiceImpl extends WindowStateService implements Pers
|
||||
}
|
||||
return myLocation != null || mySize != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges this state with the passed one, prefering this state.
|
||||
*/
|
||||
private void merge(@NotNull WindowState state) {
|
||||
if (myLocation == null && state.myLocation != null) {
|
||||
myLocation = state.myLocation.getLocation();
|
||||
}
|
||||
if (mySize == null && state.mySize != null) {
|
||||
mySize = state.mySize.getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isVisible(WindowState state) {
|
||||
|
||||
Reference in New Issue
Block a user