diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-06-17 20:08:42 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-06-17 20:09:15 +0200 |
| commit | 87b73723edbe2df4785e08fd627ac33357782afb (patch) | |
| tree | 3b33ce2ad12200406ba6cda28981110133651ab0 | |
| parent | 5005d047657437abf6ab780bb1c35623a7222c3d (diff) | |
macOS Window menu: select in menu new top window after window deletion
| -rw-r--r-- | src/Fl_MacOS_Sys_Menu_Bar.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index 10d82b09a..f75db1d81 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -631,8 +631,9 @@ void Fl_MacOS_Sys_Menu_Bar_Driver::remove_window(Fl_Window *win) if (item->user_data() == win) { bool doit = item->value(); remove(index); - if (doit) { + if (doit) { // select Fl::first_window() in Window menu item = (Fl_Menu_Item*)bar->menu() + find_first_window() + 1; + while (item->label() && item->user_data() != Fl::first_window()) item++; if (item->label()) { ((Fl_Window*)item->user_data())->show(); setonly(item); |
