franglais125 / no-title-bar

Integrates maximized windows with the top panel
https://extensions.gnome.org/extension/1267/no-title-bar/
GNU General Public License v2.0
279 stars 40 forks source link

"Close all windows" issue #48

Open Orycteropus opened 6 years ago

Orycteropus commented 6 years ago

Just a little issue I noticed :

When you use the "close all windows" shortcut, the buttons don't disapear.

To resolve the issue very quickly, I just added the window.is_hidden part in the utils.js file :

function getWindow(includeSnapped) {
    // get all window in stacking order.
    let windows = global.display.sort_windows_by_stacking(
        global.screen.get_active_workspace().list_windows().filter(function (w) {
            return w.get_window_type() !== Meta.WindowType.DESKTOP;
        })
    );

    let i = windows.length;
    while (i--) {
        let window = windows[i];
        if (window.minimized || window.is_hidden()) {
            continue;
        }

        let max_state = window.get_maximized();
        if (max_state === MAXIMIZED) {
            return window;
        }

        if (max_state === VERTICAL && includeSnapped) {
            return window;
        }
    }

    return null;
}

At this time I haven't noticed any problem related to this change.

franglais125 commented 6 years ago

Thanks for the report, and the code suggestion! I'll try to include this as soon as I can... Cheers