diff options
author | Florian Müllner <fmuellner@gnome.org> | 2018-02-20 18:29:00 +0100 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2018-02-23 11:42:06 +0100 |
commit | 5bf51ad60b57ff1c70ee1f538d35e29c962ed617 (patch) | |
tree | 9f8517e18aa0467b90a3a52c25195051028c49c8 | |
parent | fa5d1f0a939f3e326081f522c58f41f492b2cfe2 (diff) | |
download | gnome-shell-wip/fmuellner/use-fallback-titles.tar.gz |
workspace: Fall back to app name in window captionwip/fmuellner/use-fallback-titles
Just like we did for the window list in app icons' context menu,
provide a fallback for window captions in the window picker rather
than showing blank items to the user.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
-rw-r--r-- | js/ui/workspace.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/ui/workspace.js b/js/ui/workspace.js index d049eae61..228a8b1cd 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -447,12 +447,13 @@ var WindowOverlay = new Lang.Class({ this.border = new St.Bin({ style_class: 'window-clone-border' }); let title = new St.Label({ style_class: 'window-caption', - text: metaWindow.title }); + text: this._getCaption() }); title.clutter_text.ellipsize = Pango.EllipsizeMode.END; windowClone.actor.label_actor = title; this._updateCaptionId = metaWindow.connect('notify::title', w => { this.title.text = w.title; + this.title.text = this._getCaption(); this.relayout(false); }); @@ -565,6 +566,16 @@ var WindowOverlay = new Lang.Class({ } }, + _getCaption() { + let metaWindow = this._windowClone.metaWindow; + if (metaWindow.title) + return metaWindow.title; + + let tracker = Shell.WindowTracker.get_default(); + let app = tracker.get_window_app(metaWindow); + return app.get_name(); + }, + _animateOverlayActor(actor, x, y, width, height) { let params = { x: x, y: y, |