~alan-griffiths/miral/mru-window-visiblity

« back to all changes in this revision

Viewing changes to miral/basic_window_manager.cpp

  • Committer: Alan Griffiths
  • Date: 2017-02-17 12:51:01 UTC
  • mfrom: (504.2.14 miral3)
  • Revision ID: alan@octopull.co.uk-20170217125101-blnfaxjc3okyjgbj
Make the MRU window list aware of visiblity, instead of faking it

Show diffs side-by-side

added added

removed removed

Lines of Context:
1041
1041
                            window_info.state() == mir_window_state_minimized;
1042
1042
 
1043
1043
    policy->advise_state_change(window_info, value);
1044
 
    window_info.state(value);
1045
 
 
1046
 
    mir_surface->configure(mir_window_attrib_state, value);
1047
1044
 
1048
1045
    switch (value)
1049
1046
    {
1050
1047
    case mir_window_state_hidden:
1051
1048
    case mir_window_state_minimized:
1052
 
        mir_surface->hide();
1053
 
 
1054
1049
        if (window == active_window())
1055
1050
        {
1056
1051
            auto const workspaces_containing_window = workspaces_containing(window);
1087
1082
 
1088
1083
            if (window == active_window())
1089
1084
                select_active_window({});
1090
 
 
1091
 
            mru_active_windows.erase(window);
1092
1085
        }
 
1086
 
 
1087
        window_info.state(value);
 
1088
        mir_surface->configure(mir_window_attrib_state, value);
 
1089
        mir_surface->hide();
 
1090
 
1093
1091
        break;
1094
1092
 
1095
1093
    default:
 
1094
        auto const none_active = !active_window();
 
1095
        window_info.state(value);
 
1096
        mir_surface->configure(mir_window_attrib_state, value);
1096
1097
        mir_surface->show();
1097
 
        if (was_hidden && !active_window())
 
1098
        if (was_hidden && none_active)
 
1099
        {
1098
1100
            select_active_window(window);
 
1101
        }
1099
1102
    }
1100
1103
}
1101
1104
 
1920
1923
 
1921
1924
    std::function<void(WindowInfo const& info)> const add_children =
1922
1925
        [&,this](WindowInfo const& info)
 
1926
        {
 
1927
            for (auto const& child : info.children())
1923
1928
            {
1924
 
                for (auto const& child : info.children())
1925
 
                {
1926
 
                    windows.push_back(child);
1927
 
                    add_children(info_for(child));
1928
 
                }
1929
 
            };
 
1929
                windows.push_back(child);
 
1930
                add_children(info_for(child));
 
1931
            }
 
1932
        };
1930
1933
 
1931
1934
    windows.push_back(root);
1932
1935
    add_children(*info);