mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
macOS Window menu: select in menu new top window after window deletion
This commit is contained in:
@@ -631,8 +631,9 @@ void Fl_MacOS_Sys_Menu_Bar_Driver::remove_window(Fl_Window *win)
|
|||||||
if (item->user_data() == win) {
|
if (item->user_data() == win) {
|
||||||
bool doit = item->value();
|
bool doit = item->value();
|
||||||
remove(index);
|
remove(index);
|
||||||
if (doit) {
|
if (doit) { // select Fl::first_window() in Window menu
|
||||||
item = (Fl_Menu_Item*)bar->menu() + find_first_window() + 1;
|
item = (Fl_Menu_Item*)bar->menu() + find_first_window() + 1;
|
||||||
|
while (item->label() && item->user_data() != Fl::first_window()) item++;
|
||||||
if (item->label()) {
|
if (item->label()) {
|
||||||
((Fl_Window*)item->user_data())->show();
|
((Fl_Window*)item->user_data())->show();
|
||||||
setonly(item);
|
setonly(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user