From 44d905260f16d7b699a15aca553a8f8eef9b4efe Mon Sep 17 00:00:00 2001 From: Tao Peng Date: Mon, 27 Apr 2015 15:19:48 +0200 Subject: [PATCH 1/3] Shell 3.16: show app title in app menu --- maximus-two-wilfinitlike.gmail.com/app_menu.js | 7 ++++++- maximus-two-wilfinitlike.gmail.com/metadata.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/maximus-two-wilfinitlike.gmail.com/app_menu.js b/maximus-two-wilfinitlike.gmail.com/app_menu.js index dcf0395..5dcca08 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; 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} From 28191e0f74aa0a45bec8c387186776a7dab16eb2 Mon Sep 17 00:00:00 2001 From: Tao Peng Date: Mon, 27 Apr 2015 15:41:15 +0200 Subject: [PATCH 2/3] Shell 3.16: show tooltip --- maximus-two-wilfinitlike.gmail.com/app_menu.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maximus-two-wilfinitlike.gmail.com/app_menu.js b/maximus-two-wilfinitlike.gmail.com/app_menu.js index 5dcca08..a3944f3 100644 --- a/maximus-two-wilfinitlike.gmail.com/app_menu.js +++ b/maximus-two-wilfinitlike.gmail.com/app_menu.js @@ -114,9 +114,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; From afc38e92feee53a6c4a0ec4dd661ed3d0a2f7c68 Mon Sep 17 00:00:00 2001 From: DC* Date: Wed, 13 May 2015 13:59:38 -0300 Subject: [PATCH 3/3] Fixes black bar on top Merged fixes from pixel-saver extension back (https://github.com/deadalnix/pixel-saver/pull/11/commits) Thanks to @matthijskooijman for these changes. --- .../app_menu.js | 6 ++++-- .../decoration.js | 21 ++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/maximus-two-wilfinitlike.gmail.com/app_menu.js b/maximus-two-wilfinitlike.gmail.com/app_menu.js index dcf0395..afe4076 100644 --- a/maximus-two-wilfinitlike.gmail.com/app_menu.js +++ b/maximus-two-wilfinitlike.gmail.com/app_menu.js @@ -70,8 +70,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. 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 ****/