mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
SystemMonitor: Actually reuse existing process properties windows
This commit is contained in:
parent
eff7ea5b84
commit
5d379fcfb4
Notes:
sideshowbarker
2024-07-18 20:46:53 +09:00
Author: https://github.com/awesomekling
Commit: 5d379fcfb4
1 changed files with 4 additions and 1 deletions
|
@ -301,13 +301,16 @@ int main(int argc, char** argv)
|
|||
auto pid = selected_id(ProcessModel::Column::PID);
|
||||
|
||||
RefPtr<GUI::Window> process_window;
|
||||
if (!process_windows.contains(pid)) {
|
||||
auto it = process_windows.find(pid);
|
||||
if (it == process_windows.end()) {
|
||||
process_window = build_process_window(pid);
|
||||
process_window->on_close_request = [pid, &process_windows] {
|
||||
process_windows.remove(pid);
|
||||
return GUI::Window::CloseRequestDecision::Close;
|
||||
};
|
||||
process_windows.set(pid, *process_window);
|
||||
} else {
|
||||
process_window = it->value;
|
||||
}
|
||||
process_window->show();
|
||||
process_window->move_to_front();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue