diff --git a/maximus-two-wilfinitlike.gmail.com/app_menu.js b/maximus-two-wilfinitlike.gmail.com/app_menu.js index dcf0395..33cf36d 100644 --- a/maximus-two-wilfinitlike.gmail.com/app_menu.js +++ b/maximus-two-wilfinitlike.gmail.com/app_menu.js @@ -38,7 +38,12 @@ function updateAppMenu() { } LOG('Override title ' + title); - appMenu._label.setText(title); + if (appMenu._label.set_text) { + // Gnome Shell 3.16 + appMenu._label.set_text(title); + } else if (appMenu._label.setText){ + appMenu._label.setText(title); + } tooltip.text = title; return false; @@ -70,8 +75,10 @@ function changeActiveWindow(win) { * Focus change */ function onFocusChange() { - if (!Shell.WindowTracker.get_default().focus_app && - global.stage_input_mode == Shell.StageInputMode.FOCUSED) { + let input_mode_check = (global.stage_input_mode === undefined) + ? true + : global.stage_input_mode == Shell.StageInputMode.FOCUSED; + if (!Shell.WindowTracker.get_default().focus_app && input_mode_check) { // If the app has just lost focus to the panel, pretend // nothing happened; otherwise you can't keynav to the // app menu. @@ -109,9 +116,9 @@ function onHover(actor) { if (!showTooltip) { WARN('showTooltip is false and delay callback ran.'); } - - let label = appMenu._label._label; - + + // In Shell 3.16 it's appMenu._label + let label = appMenu._label._label || appMenu._label; if(!label.get_clutter_text().get_layout().is_ellipsized()) { // Do not need to hide. tooltipDelayCallbackID = 0; diff --git a/maximus-two-wilfinitlike.gmail.com/decoration.js b/maximus-two-wilfinitlike.gmail.com/decoration.js index 050e58f..2322b27 100644 --- a/maximus-two-wilfinitlike.gmail.com/decoration.js +++ b/maximus-two-wilfinitlike.gmail.com/decoration.js @@ -122,7 +122,26 @@ function setHideTitlebar(win, hide, stopAdding) { cmd[2] = win.get_title(); } LOG(cmd.join(' ')); - Util.spawn(cmd); + + // Run xprop + [success, pid] = GLib.spawn_async(null, cmd, null, + GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD, + null); + + // After xprop completes, unmaximize and remaximize any window + // that is already maximized. It seems that setting the xprop on + // a window that is already maximized doesn't actually take + // effect immediately but it needs a focuse change or other + // action to force a relayout. Doing unmaximize and maximize + // here seems to be an uninvasive way to handle this. This needs + // to happen _after_ xprop completes. + GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, function () { + let flags = win.get_maximized(); + if (flags == Meta.MaximizeFlags.BOTH) { + win.unmaximize(flags); + win.maximize(flags); + } + }); } /**** Callbacks ****/ diff --git a/maximus-two-wilfinitlike.gmail.com/metadata.json b/maximus-two-wilfinitlike.gmail.com/metadata.json index 9a2eaa7..e046c88 100644 --- a/maximus-two-wilfinitlike.gmail.com/metadata.json +++ b/maximus-two-wilfinitlike.gmail.com/metadata.json @@ -1 +1 @@ -{"shell-version": ["3.8", "3.10", "3.12", "3.14"],"uuid": "maximus-two@wilfinitlike.gmail.com", "name": "Maximus Two", "description": "Removes the title bar on maximised windows.\n Based on Pixel Saver (use Window Buttons to get the buttons (you can configure them then)\n You should be albe to use the original Maximus extension if you have 3.4 or 3.6", "url": "https://github.com/wilfm/GnomeExtensionMaximusTwo", "version": 2} +{"shell-version": ["3.8", "3.10", "3.12", "3.14", "3.16"],"uuid": "maximus-two@wilfinitlike.gmail.com", "name": "Maximus Two", "description": "Removes the title bar on maximised windows.\n Based on Pixel Saver (use Window Buttons to get the buttons (you can configure them then)\n You should be albe to use the original Maximus extension if you have 3.4 or 3.6", "url": "https://github.com/wilfm/GnomeExtensionMaximusTwo", "version": 2}