-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save and restore window position and maximized state #1
base: master
Are you sure you want to change the base?
Conversation
This fixes a couple of annoyances: - Ghidra did not restore the maximized window state - Window size and position could be moved if Ghidra was exited with window close to edge of screen
Why not submit the PR to the original repo at https://github.com/NationalSecurityAgency/ghidra? |
I'm a github noob, plus I doubt they would merge it as-is due to my commenting out calls to ensureOnScreen(). |
So what? If the fix is not completely correct, somebody who knows the code better will tell you how to improve it. Worst case, the PR will be closed.
Just remove this code? :) |
The main code change could probably be simplified to unconditionally call
|
The code at line 490 may fix the issue. I'd like to know if you undo all changes, except for reading the extended state and then setting it after the call to I'm assuming that no matter the bounds you set, restoring the extended state will then maximize the window, which is the effect you are trying to achieve, I believe. |
I'm not set up to build Ghidra here right now. But anyway... You mean restore the calls to Restoring extended state should maximize the window. But I think when a window is maximized, its bounds correspond to a full-screen window. If you save the bounds of a maximized window, the un-maximized bounds are probably lost. That's what happens with Ghidra currently. If you exit Ghidra with a window maximized, next launch the window appears un-maximized but occupies most of the screen regardless of its previous un-maximized size/position. Suppose you have a window occupying the left third of the screen, then maximize it. Later you exit Ghidra. On launching Ghidra the next time, you would want:
|
I suppose there are many issues that you are trying to fix. My suggestion earlier was really just add the call to When I tested this suggestion, it achieved the effect of having Ghidra open with the Code Browser tool fully maximized, which it was not doing before the change. It seems like you would also like the bounds to be saved as well, in such a way that 'unmaximizing' the window will restore the previous 'unmaximized' bounds. It makes sense that this behavior is not working under certain systems, due to the functionality inside of In thinking about this, it seems like the most direct solution would be to make the first simple change. Then, we could provide an option to disable the |
Perhaps an alternative behavior for So maybe replace
with
Also, call |
This fixes a couple of annoyances:
This removes a couple of calls to WindowUtilities.ensureOnScreen(). Ideally that function would be adjusted somehow instead.