Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3a6e8f82c | |||
| ce10ad64c4 | |||
| 5b43d4733c | |||
| 3671d5a299 | |||
| a024d9f005 | |||
| d94a3500f6 |
@@ -1,3 +1,12 @@
|
|||||||
|
3.32.1
|
||||||
|
======
|
||||||
|
* Fix windowsNavigator extension after ES6 port [Florian; #143]
|
||||||
|
* screenshot-window-sizer: Add phone screenshot sizes [Adrien; !65]
|
||||||
|
* Misc. bug fixes and cleanups [Fabian; !62]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Florian Müllner, Adrien Plazas, Fabian P. Schmidt
|
||||||
|
|
||||||
3.32.0
|
3.32.0
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ Bugs should be reported to the GNOME [bug tracking system][bug-tracker].
|
|||||||
|
|
||||||
## Extensions
|
## Extensions
|
||||||
|
|
||||||
|
* alternate-tab (**OBSOLETE**)
|
||||||
|
|
||||||
|
Lets you use classic Alt+Tab (window-based instead of app-based) in GNOME Shell.
|
||||||
|
This extension is obsolete since GNOME 3.30, see [this blogpost][alternatetab-post]
|
||||||
|
for further details.
|
||||||
|
|
||||||
* apps-menu
|
* apps-menu
|
||||||
|
|
||||||
Lets you reach an application using gnome 2.x style menu on the panel.
|
Lets you reach an application using gnome 2.x style menu on the panel.
|
||||||
@@ -74,3 +80,4 @@ file for details.
|
|||||||
[shell-page]: https://wiki.gnome.org/Projects/GnomeShell
|
[shell-page]: https://wiki.gnome.org/Projects/GnomeShell
|
||||||
[bug-tracker]: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues
|
[bug-tracker]: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues
|
||||||
[license]: COPYING
|
[license]: COPYING
|
||||||
|
[alternatetab-post]: https://blogs.gnome.org/fmuellner/2018/10/11/the-future-of-alternatetab-and-why-you-need-not-worry/
|
||||||
|
|||||||
+1
-1
Submodule data/gnome-shell-sass updated: 1b708a862f...1a569565e6
@@ -63,7 +63,9 @@ let SIZES = [
|
|||||||
[800, 450],
|
[800, 450],
|
||||||
[1024, 576],
|
[1024, 576],
|
||||||
[1200, 675],
|
[1200, 675],
|
||||||
[1600, 900]
|
[1600, 900],
|
||||||
|
[360, 654], // Phone portrait maximized
|
||||||
|
[720, 360] // Phone landscape fullscreen
|
||||||
];
|
];
|
||||||
|
|
||||||
function cycleScreenshotSizes(display, window, binding) {
|
function cycleScreenshotSizes(display, window, binding) {
|
||||||
|
|||||||
@@ -1,50 +1,65 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
/* exported enable disable */
|
/* exported init */
|
||||||
const { Clutter, St } = imports.gi;
|
const { Clutter, St } = imports.gi;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Workspace = imports.ui.workspace;
|
const Workspace = imports.ui.workspace;
|
||||||
const WorkspacesView = imports.ui.workspacesView;
|
const WorkspacesView = imports.ui.workspacesView;
|
||||||
|
|
||||||
function injectToFunction(parent, name, func) {
|
var MyWindowOverlay = class extends Workspace.WindowOverlay {
|
||||||
let origin = parent[name];
|
constructor(windowClone, parentActor) {
|
||||||
parent[name] = function() {
|
super(windowClone, parentActor);
|
||||||
let ret;
|
|
||||||
ret = origin.apply(this, arguments);
|
|
||||||
if (ret === undefined)
|
|
||||||
ret = func.apply(this, arguments);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
return origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
let winInjections, workspaceInjections, workViewInjections, createdActors, connectedSignals;
|
this._id = null;
|
||||||
|
this._text = new St.Label({
|
||||||
|
style_class: 'extension-windowsNavigator-window-tooltip',
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
parentActor.add_actor(this._text);
|
||||||
|
}
|
||||||
|
|
||||||
function resetState() {
|
showTooltip() {
|
||||||
winInjections = {};
|
|
||||||
workspaceInjections = {};
|
|
||||||
workViewInjections = {};
|
|
||||||
createdActors = [];
|
|
||||||
connectedSignals = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function enable() {
|
|
||||||
resetState();
|
|
||||||
|
|
||||||
Workspace.WindowOverlay.prototype.showTooltip = function() {
|
|
||||||
this._text.raise_top();
|
this._text.raise_top();
|
||||||
this._text.show();
|
this._text.show();
|
||||||
this._text.text = (this._windowClone.slotId + 1).toString();
|
this._text.text = (this._windowClone.slotId + 1).toString();
|
||||||
};
|
}
|
||||||
winInjections['showTooltip'] = undefined;
|
|
||||||
|
|
||||||
Workspace.WindowOverlay.prototype.hideTooltip = function() {
|
hideTooltip() {
|
||||||
if (this._text && this._text.visible)
|
if (this._text && this._text.visible)
|
||||||
this._text.hide();
|
this._text.hide();
|
||||||
};
|
}
|
||||||
winInjections['hideTooltip'] = undefined;
|
|
||||||
|
|
||||||
Workspace.Workspace.prototype.showTooltip = function() {
|
relayout(animate) {
|
||||||
|
super.relayout(animate);
|
||||||
|
|
||||||
|
let [cloneX, cloneY, cloneWidth_, cloneHeight_] = this._windowClone.slot;
|
||||||
|
|
||||||
|
let textX = cloneX - 2;
|
||||||
|
let textY = cloneY - 2;
|
||||||
|
this._text.set_position(Math.floor(textX) + 5, Math.floor(textY) + 5);
|
||||||
|
this._text.raise_top();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var MyWorkspace = class extends Workspace.Workspace {
|
||||||
|
constructor(metaWorkspace, monitorIndex) {
|
||||||
|
super(metaWorkspace, monitorIndex);
|
||||||
|
|
||||||
|
if (metaWorkspace && metaWorkspace.index() < 9) {
|
||||||
|
this._tip = new St.Label({
|
||||||
|
style_class: 'extension-windowsNavigator-window-tooltip',
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
this.actor.add_actor(this._tip);
|
||||||
|
|
||||||
|
this.actor.connect('notify::scale-x', () => {
|
||||||
|
this._tip.set_scale(1 / this.actor.scale_x, 1 / this.actor.scale_x);
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
this._tip = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
showTooltip() {
|
||||||
if (this._tip == null || this._actualGeometry == null)
|
if (this._tip == null || this._actualGeometry == null)
|
||||||
return;
|
return;
|
||||||
this._tip.text = (this.metaWorkspace.index() + 1).toString();
|
this._tip.text = (this.metaWorkspace.index() + 1).toString();
|
||||||
@@ -64,61 +79,74 @@ function enable() {
|
|||||||
this._tip.y = area.y;
|
this._tip.y = area.y;
|
||||||
this._tip.show();
|
this._tip.show();
|
||||||
this._tip.raise_top();
|
this._tip.raise_top();
|
||||||
};
|
}
|
||||||
workspaceInjections['showTooltip'] = undefined;
|
|
||||||
|
|
||||||
Workspace.Workspace.prototype.hideTooltip = function() {
|
hideTooltip() {
|
||||||
if (this._tip == null)
|
if (this._tip == null)
|
||||||
return;
|
return;
|
||||||
if (!this._tip.get_parent())
|
if (!this._tip.get_parent())
|
||||||
return;
|
return;
|
||||||
this._tip.hide();
|
this._tip.hide();
|
||||||
};
|
}
|
||||||
workspaceInjections['hideTooltip'] = undefined;
|
|
||||||
|
|
||||||
Workspace.Workspace.prototype.getWindowWithTooltip = function(id) {
|
getWindowWithTooltip(id) {
|
||||||
for (let i = 0; i < this._windows.length; i++) {
|
for (let i = 0; i < this._windows.length; i++) {
|
||||||
if ((this._windows[i].slotId + 1) == id)
|
if ((this._windows[i].slotId + 1) == id)
|
||||||
return this._windows[i].metaWindow;
|
return this._windows[i].metaWindow;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
}
|
||||||
workspaceInjections['getWindowWithTooltip'] = undefined;
|
|
||||||
|
|
||||||
Workspace.Workspace.prototype.showWindowsTooltips = function() {
|
showWindowsTooltips() {
|
||||||
for (let i in this._windowOverlays) {
|
for (let i in this._windowOverlays) {
|
||||||
if (this._windowOverlays[i] != null)
|
if (this._windowOverlays[i] != null)
|
||||||
this._windowOverlays[i].showTooltip();
|
this._windowOverlays[i].showTooltip();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
workspaceInjections['showWindowsTooltips'] = undefined;
|
|
||||||
|
|
||||||
Workspace.Workspace.prototype.hideWindowsTooltips = function() {
|
hideWindowsTooltips() {
|
||||||
for (let i in this._windowOverlays) {
|
for (let i in this._windowOverlays) {
|
||||||
if (this._windowOverlays[i] != null)
|
if (this._windowOverlays[i] != null)
|
||||||
this._windowOverlays[i].hideTooltip();
|
this._windowOverlays[i].hideTooltip();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
workspaceInjections['hideWindowsTooltips'] = undefined;
|
};
|
||||||
|
|
||||||
WorkspacesView.WorkspacesView.prototype._hideTooltips = function() {
|
var MyWorkspacesView = class extends WorkspacesView.WorkspacesView {
|
||||||
|
constructor(width, height, x, y, workspaces) {
|
||||||
|
super(width, height, x, y, workspaces);
|
||||||
|
|
||||||
|
this._pickWorkspace = false;
|
||||||
|
this._pickWindow = false;
|
||||||
|
this._keyPressEventId =
|
||||||
|
global.stage.connect('key-press-event', this._onKeyPress.bind(this));
|
||||||
|
this._keyReleaseEventId =
|
||||||
|
global.stage.connect('key-release-event', this._onKeyRelease.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
_onDestroy() {
|
||||||
|
super._onDestroy();
|
||||||
|
|
||||||
|
global.stage.disconnect(this._keyPressEventId);
|
||||||
|
global.stage.disconnect(this._keyReleaseEventId);
|
||||||
|
}
|
||||||
|
|
||||||
|
_hideTooltips() {
|
||||||
if (global.stage.get_key_focus() == global.stage)
|
if (global.stage.get_key_focus() == global.stage)
|
||||||
global.stage.set_key_focus(this._prevFocusActor);
|
global.stage.set_key_focus(this._prevFocusActor);
|
||||||
this._pickWindow = false;
|
this._pickWindow = false;
|
||||||
for (let i = 0; i < this._workspaces.length; i++)
|
for (let i = 0; i < this._workspaces.length; i++)
|
||||||
this._workspaces[i].hideWindowsTooltips();
|
this._workspaces[i].hideWindowsTooltips();
|
||||||
};
|
}
|
||||||
workViewInjections['_hideTooltips'] = undefined;
|
|
||||||
|
|
||||||
WorkspacesView.WorkspacesView.prototype._hideWorkspacesTooltips = function() {
|
_hideWorkspacesTooltips() {
|
||||||
global.stage.set_key_focus(this._prevFocusActor);
|
global.stage.set_key_focus(this._prevFocusActor);
|
||||||
this._pickWorkspace = false;
|
this._pickWorkspace = false;
|
||||||
for (let i = 0; i < this._workspaces.length; i++)
|
for (let i = 0; i < this._workspaces.length; i++)
|
||||||
this._workspaces[i].hideTooltip();
|
this._workspaces[i].hideTooltip();
|
||||||
};
|
}
|
||||||
workViewInjections['_hideWorkspacesTooltips'] = undefined;
|
|
||||||
|
|
||||||
WorkspacesView.WorkspacesView.prototype._onKeyRelease = function(s, o) {
|
_onKeyRelease(s, o) {
|
||||||
if (this._pickWindow &&
|
if (this._pickWindow &&
|
||||||
(o.get_key_symbol() == Clutter.KEY_Alt_L ||
|
(o.get_key_symbol() == Clutter.KEY_Alt_L ||
|
||||||
o.get_key_symbol() == Clutter.KEY_Alt_R))
|
o.get_key_symbol() == Clutter.KEY_Alt_R))
|
||||||
@@ -127,11 +155,11 @@ function enable() {
|
|||||||
(o.get_key_symbol() == Clutter.KEY_Control_L ||
|
(o.get_key_symbol() == Clutter.KEY_Control_L ||
|
||||||
o.get_key_symbol() == Clutter.KEY_Control_R))
|
o.get_key_symbol() == Clutter.KEY_Control_R))
|
||||||
this._hideWorkspacesTooltips();
|
this._hideWorkspacesTooltips();
|
||||||
};
|
}
|
||||||
workViewInjections['_onKeyRelease'] = undefined;
|
|
||||||
|
|
||||||
WorkspacesView.WorkspacesView.prototype._onKeyPress = function(s, o) {
|
_onKeyPress(s, o) {
|
||||||
if (Main.overview.viewSelector._activePage != Main.overview.viewSelector._workspacesPage)
|
let viewSelector = Main.overview.viewSelector;
|
||||||
|
if (viewSelector._activePage != viewSelector._workspacesPage)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
let workspaceManager = global.workspace_manager;
|
||||||
@@ -208,81 +236,29 @@ function enable() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
workViewInjections['_onKeyPress'] = undefined;
|
};
|
||||||
|
|
||||||
winInjections['_init'] = injectToFunction(Workspace.WindowOverlay.prototype, '_init', function(windowClone, parentActor) {
|
class Extension {
|
||||||
this._id = null;
|
constructor() {
|
||||||
createdActors.push(this._text = new St.Label({ style_class: 'extension-windowsNavigator-window-tooltip' }));
|
this._origWindowOverlay = Workspace.WindowOverlay;
|
||||||
this._text.hide();
|
this._origWorkspace = Workspace.Workspace;
|
||||||
parentActor.add_actor(this._text);
|
this._origWorkspacesView = WorkspacesView.WorkspacesView;
|
||||||
});
|
}
|
||||||
|
|
||||||
winInjections['relayout'] = injectToFunction(Workspace.WindowOverlay.prototype, 'relayout', function(_animate) {
|
enable() {
|
||||||
let [cloneX, cloneY, cloneWidth_, cloneHeight_] = this._windowClone.slot;
|
Workspace.WindowOverlay = MyWindowOverlay;
|
||||||
|
Workspace.Workspace = MyWorkspace;
|
||||||
|
WorkspacesView.WorkspacesView = MyWorkspacesView;
|
||||||
|
}
|
||||||
|
|
||||||
let textX = cloneX - 2;
|
disable() {
|
||||||
let textY = cloneY - 2;
|
Workspace.WindowOverlay = this._origWindowOverlay;
|
||||||
this._text.set_position(Math.floor(textX) + 5, Math.floor(textY) + 5);
|
Workspace.Workspace = this._origWorkspace;
|
||||||
this._text.raise_top();
|
WorkspacesView.WorkspacesView = this._origWorkspacesView;
|
||||||
});
|
}
|
||||||
|
|
||||||
workspaceInjections['_init'] = injectToFunction(Workspace.Workspace.prototype, '_init', function(metaWorkspace) {
|
|
||||||
if (metaWorkspace && metaWorkspace.index() < 9) {
|
|
||||||
createdActors.push(this._tip = new St.Label({
|
|
||||||
style_class: 'extension-windowsNavigator-window-tooltip',
|
|
||||||
visible: false
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.actor.add_actor(this._tip);
|
|
||||||
let signalId = this.actor.connect('notify::scale-x', () => {
|
|
||||||
this._tip.set_scale(1 / this.actor.scale_x, 1 / this.actor.scale_x);
|
|
||||||
});
|
|
||||||
connectedSignals.push({ obj: this.actor, id: signalId });
|
|
||||||
} else
|
|
||||||
this._tip = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(_width, _height, _x, _y, _workspaces) {
|
|
||||||
this._pickWorkspace = false;
|
|
||||||
this._pickWindow = false;
|
|
||||||
this._keyPressEventId =
|
|
||||||
global.stage.connect('key-press-event', this._onKeyPress.bind(this));
|
|
||||||
this._keyReleaseEventId =
|
|
||||||
global.stage.connect('key-release-event', this._onKeyRelease.bind(this));
|
|
||||||
connectedSignals.push({ obj: global.stage, id: this._keyPressEventId });
|
|
||||||
connectedSignals.push({ obj: global.stage, id: this._keyReleaseEventId });
|
|
||||||
});
|
|
||||||
|
|
||||||
workViewInjections['_onDestroy'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_onDestroy', function() {
|
|
||||||
global.stage.disconnect(this._keyPressEventId);
|
|
||||||
global.stage.disconnect(this._keyReleaseEventId);
|
|
||||||
connectedSignals = [];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeInjection(object, injection, name) {
|
function init() {
|
||||||
if (injection[name] === undefined)
|
return new Extension();
|
||||||
delete object[name];
|
|
||||||
else
|
|
||||||
object[name] = injection[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
function disable() {
|
|
||||||
let i;
|
|
||||||
|
|
||||||
for (i in workspaceInjections)
|
|
||||||
removeInjection(Workspace.Workspace.prototype, workspaceInjections, i);
|
|
||||||
for (i in winInjections)
|
|
||||||
removeInjection(Workspace.WindowOverlay.prototype, winInjections, i);
|
|
||||||
for (i in workViewInjections)
|
|
||||||
removeInjection(WorkspacesView.WorkspacesView.prototype, workViewInjections, i);
|
|
||||||
|
|
||||||
for (i of connectedSignals)
|
|
||||||
i.obj.disconnect(i.id);
|
|
||||||
|
|
||||||
for (i of createdActors)
|
|
||||||
i.destroy();
|
|
||||||
|
|
||||||
resetState();
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
project('gnome-shell-extensions',
|
project('gnome-shell-extensions',
|
||||||
version: '3.32.0',
|
version: '3.32.1',
|
||||||
meson_version: '>= 0.44.0',
|
meson_version: '>= 0.44.0',
|
||||||
license: 'GPL2+'
|
license: 'GPL2+'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user