Compare commits

...

18 Commits

Author SHA1 Message Date
Florian Müllner a36331522f Bump version to 3.33.2
Update NEWS.
2019-05-22 18:58:31 +00:00
Florian Müllner 25e43a5d08 lint: Remove legacy configuration
After the last batch of indentation changes, the whole code base
conforms to the new style now, so we can drop the legacy eslint
configuration.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner ad914441a2 window-list: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner 200d337769 apps-menu: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner e56f1a976e native-window-placement: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner 6a66cd4fa6 places-menu: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner 55c493389a auto-move-windows: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:18 +02:00
Florian Müllner 06f1303834 drive-menu: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:18 +02:00
Florian Müllner 3d5687ae3c workspace-indicator: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:18 +02:00
Florian Müllner cdd3fba593 screenshot-window-sizer: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:18 +02:00
Florian Müllner f11c101878 Bump version to 3.33.1
Update NEWS.
2019-05-14 17:53:56 +00:00
Florian Müllner 7c412ca7d9 window-list: Don't use anchor point
It is deprecated and we can easily replace it with a translation.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/64
2019-04-28 11:08:02 +00:00
Florian Müllner e3a6e8f82c Bump version to 3.32.1
Update NEWS.
2019-04-17 22:09:40 +02:00
Florian Müllner ce10ad64c4 Update sass submodule 2019-04-17 22:06:50 +02:00
Adrien Plazas 5b43d4733c screenshot-window-sizer: Add phone screenshot sizes
This is going to be convenient to take fake screenshots for phones like
the Librem 5.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/65
2019-04-12 14:31:53 +02:00
Florian Müllner 3671d5a299 cleanup: Use an extension object instead of globals
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/143
2019-04-08 06:00:29 +00:00
Florian Müllner a024d9f005 windowsNavigator: Use subclasses instead of injections
gnome-shell moved to ES6 classes, which means the constructor is
no longer a regular method that we can swap out with an injected
version.

Instead, do our modifications in subclasses and use them to replace
the original classes.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/143
2019-04-08 06:00:29 +00:00
Fabian P. Schmidt d94a3500f6 README: Re-add extension alternate-tab with obsolescence notice
This commit adds a short notice about the former extension
alternate-tab to the README. This notice should be removed once
the traffic of users searching for this obsolete extension settled
down.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/62
2019-03-20 12:00:08 +01:00
18 changed files with 327 additions and 411 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ eslint:
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1 image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
stage: source_check stage: source_check
script: script:
- sh lint/generate-report.sh -o $LINT_LOG || { cat $LINT_LOG; false; } - eslint -o $LINT_LOG --no-color || { cat $LINT_LOG; false; }
<<: *only_default <<: *only_default
artifacts: artifacts:
paths: paths:
+23
View File
@@ -1,3 +1,26 @@
3.33.2
======
* Misc. bug fixes and cleanups [Florian; !66]
Contributors:
Florian Müllner
3.33.1
======
* Misc. bug fixes [Florian; !64]
Contributors:
Florian Müllner
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
====== ======
+7
View File
@@ -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/
+13 -15
View File
@@ -58,7 +58,7 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
let textureCache = St.TextureCache.get_default(); let textureCache = St.TextureCache.get_default();
let iconThemeChangedId = textureCache.connect('icon-theme-changed', let iconThemeChangedId = textureCache.connect('icon-theme-changed',
this._updateIcon.bind(this)); this._updateIcon.bind(this));
this.actor.connect('destroy', () => { this.actor.connect('destroy', () => {
textureCache.disconnect(iconThemeChangedId); textureCache.disconnect(iconThemeChangedId);
}); });
@@ -262,7 +262,7 @@ class DesktopTarget {
this._windowAddedId = this._windowAddedId =
global.window_group.connect('actor-added', global.window_group.connect('actor-added',
this._onWindowAdded.bind(this)); this._onWindowAdded.bind(this));
global.get_window_actors().forEach(a => { global.get_window_actors().forEach(a => {
this._onWindowAdded(a.get_parent(), a); this._onWindowAdded(a.get_parent(), a);
@@ -322,8 +322,8 @@ class DesktopTarget {
// Hack: force nautilus to reload file info // Hack: force nautilus to reload file info
info = new Gio.FileInfo(); info = new Gio.FileInfo();
info.set_attribute_uint64(Gio.FILE_ATTRIBUTE_TIME_ACCESS, info.set_attribute_uint64(
GLib.get_real_time()); Gio.FILE_ATTRIBUTE_TIME_ACCESS, GLib.get_real_time());
try { try {
await file.set_attributes_async(info, queryFlags, ioPriority, null); await file.set_attributes_async(info, queryFlags, ioPriority, null);
} catch (e) { } catch (e) {
@@ -411,7 +411,7 @@ class ApplicationsButton extends PanelMenu.Button {
this.remove_accessible_state (Atk.StateType.CHECKED); this.remove_accessible_state (Atk.StateType.CHECKED);
}); });
Main.layoutManager.connect('startup-complete', Main.layoutManager.connect('startup-complete',
this._setKeybinding.bind(this)); this._setKeybinding.bind(this));
this._setKeybinding(); this._setKeybinding();
this._desktopTarget = new DesktopTarget(); this._desktopTarget = new DesktopTarget();
@@ -426,14 +426,14 @@ class ApplicationsButton extends PanelMenu.Button {
this._tree = new GMenu.Tree({ menu_basename: 'applications.menu' }); this._tree = new GMenu.Tree({ menu_basename: 'applications.menu' });
this._treeChangedId = this._tree.connect('changed', this._treeChangedId = this._tree.connect('changed',
this._onTreeChanged.bind(this)); this._onTreeChanged.bind(this));
this._applicationsButtons = new Map(); this._applicationsButtons = new Map();
this.reloadFlag = false; this.reloadFlag = false;
this._createLayout(); this._createLayout();
this._display(); this._display();
this._installedChangedId = appSys.connect('installed-changed', this._installedChangedId = appSys.connect('installed-changed',
this._onTreeChanged.bind(this)); this._onTreeChanged.bind(this));
} }
_onTreeChanged() { _onTreeChanged() {
@@ -465,12 +465,11 @@ class ApplicationsButton extends PanelMenu.Button {
this._tree.disconnect(this._treeChangedId); this._tree.disconnect(this._treeChangedId);
this._tree = null; this._tree = null;
let handler = Main.sessionMode.hasOverview ?
Main.overview.toggle.bind(Main.overview) : null;
Main.wm.setCustomKeybindingHandler('panel-main-menu', Main.wm.setCustomKeybindingHandler('panel-main-menu',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW, Main.sessionMode.hasOverview
handler); ? Main.overview.toggle.bind(Main.overview)
: null);
this._desktopTarget.destroy(); this._desktopTarget.destroy();
} }
@@ -522,9 +521,8 @@ class ApplicationsButton extends PanelMenu.Button {
_setKeybinding() { _setKeybinding() {
Main.wm.setCustomKeybindingHandler('panel-main-menu', Main.wm.setCustomKeybindingHandler('panel-main-menu',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW, () => this.menu.toggle());
() => this.menu.toggle());
} }
_redisplay() { _redisplay() {
+2 -2
View File
@@ -17,7 +17,7 @@ class WindowMover {
this._appsChangedId = this._appsChangedId =
this._appSystem.connect('installed-changed', this._appSystem.connect('installed-changed',
this._updateAppData.bind(this)); this._updateAppData.bind(this));
this._settings.connect('changed', this._updateAppConfigs.bind(this)); this._settings.connect('changed', this._updateAppConfigs.bind(this));
this._updateAppConfigs(); this._updateAppConfigs();
@@ -50,7 +50,7 @@ class WindowMover {
addedApps.forEach(app => { addedApps.forEach(app => {
let data = { let data = {
windowsChangedId: app.connect('windows-changed', windowsChangedId: app.connect('windows-changed',
this._appWindowsChanged.bind(this)), this._appWindowsChanged.bind(this)),
moveWindowsId: 0, moveWindowsId: 0,
windows: app.get_windows() windows: app.get_windows()
}; };
+2 -2
View File
@@ -233,8 +233,8 @@ const Widget = GObject.registerClass({
}); });
let { APPINFO, ICON, DISPLAY_NAME, WORKSPACE, ADJUSTMENT } = Columns; let { APPINFO, ICON, DISPLAY_NAME, WORKSPACE, ADJUSTMENT } = Columns;
this._store.set(iter, this._store.set(iter,
[APPINFO, ICON, DISPLAY_NAME, WORKSPACE, ADJUSTMENT], [APPINFO, ICON, DISPLAY_NAME, WORKSPACE, ADJUSTMENT],
[appInfo, icon, displayName, workspace, adj]); [appInfo, icon, displayName, workspace, adj]);
} }
_checkId(id) { _checkId(id) {
+4 -4
View File
@@ -73,10 +73,10 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
if (this.mount.can_eject()) if (this.mount.can_eject())
this.mount.eject_with_operation(...unmountArgs, this.mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this)); this._ejectFinish.bind(this));
else else
this.mount.unmount_with_operation(...unmountArgs, this.mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this)); this._unmountFinish.bind(this));
} }
_unmountFinish(mount, result) { _unmountFinish(mount, result) {
@@ -102,9 +102,9 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
} }
activate(event) { activate(event) {
let uri = this.mount.get_root().get_uri();
let context = global.create_app_launch_context(event.get_time(), -1); let context = global.create_app_launch_context(event.get_time(), -1);
Gio.AppInfo.launch_default_for_uri(this.mount.get_root().get_uri(), Gio.AppInfo.launch_default_for_uri(uri, context);
context);
super.activate(event); super.activate(event);
} }
@@ -203,9 +203,10 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
// Work out scaling by getting the most top-left and most bottom-right window coords. // Work out scaling by getting the most top-left and most bottom-right window coords.
let scale; let scale;
scale = Math.min(areaRect.width / bounds.width, scale = Math.min(
areaRect.height / bounds.height, areaRect.width / bounds.width,
1.0); areaRect.height / bounds.height,
1.0);
// Make bounding rect fill the screen size for later steps // Make bounding rect fill the screen size for later steps
bounds.x = bounds.x - (areaRect.width - bounds.width * scale) / 2; bounds.x = bounds.x - (areaRect.width - bounds.width * scale) / 2;
+1 -1
View File
@@ -42,7 +42,7 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
} }
this._changedId = info.connect('changed', this._changedId = info.connect('changed',
this._propertiesChanged.bind(this)); this._propertiesChanged.bind(this));
} }
destroy() { destroy() {
+29 -25
View File
@@ -71,18 +71,21 @@ class PlaceInfo {
} }
getIcon() { getIcon() {
this.file.query_info_async('standard::symbolic-icon', 0, 0, null, this.file.query_info_async('standard::symbolic-icon',
(file, result) => { Gio.FileQueryInfoFlags.NONE,
try { 0,
let info = file.query_info_finish(result); null,
this.icon = info.get_symbolic_icon(); (file, result) => {
this.emit('changed'); try {
} catch (e) { let info = file.query_info_finish(result);
if (e instanceof Gio.IOErrorEnum) this.icon = info.get_symbolic_icon();
return; this.emit('changed');
throw e; } catch (e) {
} if (e instanceof Gio.IOErrorEnum)
}); return;
throw e;
}
});
// return a generic icon for this kind for now, until we have the // return a generic icon for this kind for now, until we have the
// icon from the query info above // icon from the query info above
@@ -152,7 +155,7 @@ class RootInfo extends PlaceInfo {
this._proxy = obj; this._proxy = obj;
this._proxy.connect('g-properties-changed', this._proxy.connect('g-properties-changed',
this._propertiesChanged.bind(this)); this._propertiesChanged.bind(this));
this._propertiesChanged(obj); this._propertiesChanged(obj);
}); });
} }
@@ -203,10 +206,10 @@ class PlaceDeviceInfo extends PlaceInfo {
if (this._mount.can_eject()) if (this._mount.can_eject())
this._mount.eject_with_operation(...unmountArgs, this._mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this)); this._ejectFinish.bind(this));
else else
this._mount.unmount_with_operation(...unmountArgs, this._mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this)); this._unmountFinish.bind(this));
} }
_ejectFinish(mount, result) { _ejectFinish(mount, result) {
@@ -275,9 +278,8 @@ var PlacesManager = class {
}; };
this._settings = new Gio.Settings({ schema_id: BACKGROUND_SCHEMA }); this._settings = new Gio.Settings({ schema_id: BACKGROUND_SCHEMA });
this._showDesktopIconsChangedId = this._showDesktopIconsChangedId = this._settings.connect(
this._settings.connect('changed::show-desktop-icons', 'changed::show-desktop-icons', this._updateSpecials.bind(this));
this._updateSpecials.bind(this));
this._updateSpecials(); this._updateSpecials();
/* /*
@@ -350,9 +352,10 @@ var PlacesManager = class {
let homePath = GLib.get_home_dir(); let homePath = GLib.get_home_dir();
this._places.special.push(new PlaceInfo('special', this._places.special.push(new PlaceInfo(
Gio.File.new_for_path(homePath), 'special',
_('Home'))); Gio.File.new_for_path(homePath),
_('Home')));
let specials = []; let specials = [];
let dirs = DEFAULT_DIRECTORIES.slice(); let dirs = DEFAULT_DIRECTORIES.slice();
@@ -394,10 +397,11 @@ var PlacesManager = class {
/* Add standard places */ /* Add standard places */
this._places.devices.push(new RootInfo()); this._places.devices.push(new RootInfo());
this._places.network.push(new PlaceInfo('network', this._places.network.push(new PlaceInfo(
Gio.File.new_for_uri('network:///'), 'network',
_('Browse Network'), Gio.File.new_for_uri('network:///'),
'network-workgroup-symbolic')); _('Browse Network'),
'network-workgroup-symbolic'));
/* first go through all connected drives */ /* first go through all connected drives */
let drives = this._volumeMonitor.get_connected_drives(); let drives = this._volumeMonitor.get_connected_drives();
+18 -14
View File
@@ -47,8 +47,9 @@ function flashMessage(message) {
text.opacity = 255; text.opacity = 255;
let monitor = Main.layoutManager.primaryMonitor; let monitor = Main.layoutManager.primaryMonitor;
text.set_position(monitor.x + Math.floor(monitor.width / 2 - text.width / 2), text.set_position(
monitor.y + Math.floor(monitor.height / 2 - text.height / 2)); monitor.x + Math.floor(monitor.width / 2 - text.width / 2),
monitor.y + Math.floor(monitor.height / 2 - text.height / 2));
Tweener.addTween(text, { Tweener.addTween(text, {
opacity: 0, opacity: 0,
@@ -63,7 +64,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) {
@@ -135,17 +138,18 @@ function cycleScreenshotSizes(display, window, binding) {
} }
function enable() { function enable() {
Main.wm.addKeybinding('cycle-screenshot-sizes', Main.wm.addKeybinding(
ExtensionUtils.getSettings(), 'cycle-screenshot-sizes',
Meta.KeyBindingFlags.PER_WINDOW, ExtensionUtils.getSettings(),
Shell.ActionMode.NORMAL, Meta.KeyBindingFlags.PER_WINDOW,
cycleScreenshotSizes); Shell.ActionMode.NORMAL,
Main.wm.addKeybinding('cycle-screenshot-sizes-backward', cycleScreenshotSizes);
ExtensionUtils.getSettings(), Main.wm.addKeybinding(
Meta.KeyBindingFlags.PER_WINDOW | 'cycle-screenshot-sizes-backward',
Meta.KeyBindingFlags.IS_REVERSED, ExtensionUtils.getSettings(),
Shell.ActionMode.NORMAL, Meta.KeyBindingFlags.PER_WINDOW | Meta.KeyBindingFlags.IS_REVERSED,
cycleScreenshotSizes); Shell.ActionMode.NORMAL,
cycleScreenshotSizes);
} }
function disable() { function disable() {
+106 -127
View File
@@ -72,9 +72,8 @@ class WindowContextMenu extends PopupMenu.PopupMenu {
}); });
this.addMenuItem(this._minimizeItem); this.addMenuItem(this._minimizeItem);
this._notifyMinimizedId = this._notifyMinimizedId = this._metaWindow.connect(
this._metaWindow.connect('notify::minimized', 'notify::minimized', this._updateMinimizeItem.bind(this));
this._updateMinimizeItem.bind(this));
this._updateMinimizeItem(); this._updateMinimizeItem();
this._maximizeItem = new PopupMenu.PopupMenuItem(''); this._maximizeItem = new PopupMenu.PopupMenuItem('');
@@ -86,12 +85,12 @@ class WindowContextMenu extends PopupMenu.PopupMenu {
}); });
this.addMenuItem(this._maximizeItem); this.addMenuItem(this._maximizeItem);
this._notifyMaximizedHId = this._notifyMaximizedHId = this._metaWindow.connect(
this._metaWindow.connect('notify::maximized-horizontally', 'notify::maximized-horizontally',
this._updateMaximizeItem.bind(this)); this._updateMaximizeItem.bind(this));
this._notifyMaximizedVId = this._notifyMaximizedVId = this._metaWindow.connect(
this._metaWindow.connect('notify::maximized-vertically', 'notify::maximized-vertically',
this._updateMaximizeItem.bind(this)); this._updateMaximizeItem.bind(this));
this._updateMaximizeItem(); this._updateMaximizeItem();
this._closeItem = new PopupMenu.PopupMenuItem(_('Close')); this._closeItem = new PopupMenu.PopupMenuItem(_('Close'));
@@ -146,25 +145,20 @@ class WindowTitle {
this.actor.add(this.label_actor); this.actor.add(this.label_actor);
this._textureCache = St.TextureCache.get_default(); this._textureCache = St.TextureCache.get_default();
this._iconThemeChangedId = this._iconThemeChangedId = this._textureCache.connect(
this._textureCache.connect('icon-theme-changed', 'icon-theme-changed', this._updateIcon.bind(this));
this._updateIcon.bind(this)); this._notifyWmClass = this._metaWindow.connect_after(
this._notifyWmClass = 'notify::wm-class', this._updateIcon.bind(this));
this._metaWindow.connect_after('notify::wm-class', this._notifyAppId = this._metaWindow.connect_after(
this._updateIcon.bind(this)); 'notify::gtk-application-id', this._updateIcon.bind(this));
this._notifyAppId =
this._metaWindow.connect_after('notify::gtk-application-id',
this._updateIcon.bind(this));
this._updateIcon(); this._updateIcon();
this.actor.connect('destroy', this._onDestroy.bind(this)); this.actor.connect('destroy', this._onDestroy.bind(this));
this._notifyTitleId = this._notifyTitleId = this._metaWindow.connect(
this._metaWindow.connect('notify::title', 'notify::title', this._updateTitle.bind(this));
this._updateTitle.bind(this)); this._notifyMinimizedId = this._metaWindow.connect(
this._notifyMinimizedId = 'notify::minimized', this._minimizedChanged.bind(this));
this._metaWindow.connect('notify::minimized',
this._minimizedChanged.bind(this));
this._minimizedChanged(); this._minimizedChanged();
} }
@@ -222,24 +216,23 @@ class BaseButton {
this.actor._delegate = this; this.actor._delegate = this;
this.actor.connect('allocation-changed', this.actor.connect('allocation-changed',
this._updateIconGeometry.bind(this)); this._updateIconGeometry.bind(this));
this.actor.connect('clicked', this._onClicked.bind(this)); this.actor.connect('clicked', this._onClicked.bind(this));
this.actor.connect('destroy', this._onDestroy.bind(this)); this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('popup-menu', this._onPopupMenu.bind(this)); this.actor.connect('popup-menu', this._onPopupMenu.bind(this));
this._contextMenuManager = new PopupMenu.PopupMenuManager(this); this._contextMenuManager = new PopupMenu.PopupMenuManager(this);
this._switchWorkspaceId = this._switchWorkspaceId = global.window_manager.connect(
global.window_manager.connect('switch-workspace', 'switch-workspace', this._updateVisibility.bind(this));
this._updateVisibility.bind(this));
if (this._perMonitor) { if (this._perMonitor) {
this._windowEnteredMonitorId = this._windowEnteredMonitorId = global.display.connect(
global.display.connect('window-entered-monitor', 'window-entered-monitor',
this._windowEnteredOrLeftMonitor.bind(this)); this._windowEnteredOrLeftMonitor.bind(this));
this._windowLeftMonitorId = this._windowLeftMonitorId = global.display.connect(
global.display.connect('window-left-monitor', 'window-left-monitor',
this._windowEnteredOrLeftMonitor.bind(this)); this._windowEnteredOrLeftMonitor.bind(this));
} }
} }
@@ -339,13 +332,11 @@ class WindowButton extends BaseButton {
this._contextMenuManager.addMenu(this._contextMenu); this._contextMenuManager.addMenu(this._contextMenu);
Main.uiGroup.add_actor(this._contextMenu.actor); Main.uiGroup.add_actor(this._contextMenu.actor);
this._workspaceChangedId = this._workspaceChangedId = this.metaWindow.connect(
this.metaWindow.connect('workspace-changed', 'workspace-changed', this._updateVisibility.bind(this));
this._updateVisibility.bind(this));
this._notifyFocusId = this._notifyFocusId = global.display.connect(
global.display.connect('notify::focus-window', 'notify::focus-window', this._updateStyle.bind(this));
this._updateStyle.bind(this));
this._updateStyle(); this._updateStyle();
} }
@@ -509,15 +500,13 @@ class AppButton extends BaseButton {
this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE); this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE);
}); });
this._windowsChangedId = this._windowsChangedId = this.app.connect(
this.app.connect('windows-changed', 'windows-changed', this._windowsChanged.bind(this));
this._windowsChanged.bind(this));
this._windowsChanged(); this._windowsChanged();
this._windowTracker = Shell.WindowTracker.get_default(); this._windowTracker = Shell.WindowTracker.get_default();
this._notifyFocusId = this._notifyFocusId = this._windowTracker.connect(
this._windowTracker.connect('notify::focus-app', 'notify::focus-app', this._updateStyle.bind(this));
this._updateStyle.bind(this));
this._updateStyle(); this._updateStyle();
} }
@@ -565,8 +554,8 @@ class AppButton extends BaseButton {
this._windowTitle = new WindowTitle(this.metaWindow); this._windowTitle = new WindowTitle(this.metaWindow);
this._singleWindowTitle.child = this._windowTitle.actor; this._singleWindowTitle.child = this._windowTitle.actor;
this._windowContextMenu = new WindowContextMenu(this.actor, this.metaWindow); this._windowContextMenu = new WindowContextMenu(this.actor, this.metaWindow);
this._windowContextMenu.connect('open-state-changed', this._windowContextMenu.connect(
_onMenuStateChanged); 'open-state-changed', _onMenuStateChanged);
Main.uiGroup.add_actor(this._windowContextMenu.actor); Main.uiGroup.add_actor(this._windowContextMenu.actor);
this._windowContextMenu.actor.hide(); this._windowContextMenu.actor.hide();
this._contextMenuManager.addMenu(this._windowContextMenu); this._contextMenuManager.addMenu(this._windowContextMenu);
@@ -671,19 +660,19 @@ class WorkspaceIndicator extends PanelMenu.Button {
this.workspacesItems = []; this.workspacesItems = [];
this._workspaceManagerSignals = []; this._workspaceManagerSignals = [
this._workspaceManagerSignals.push(workspaceManager.connect('notify::n-workspaces', workspaceManager.connect('notify::n-workspaces',
this._updateMenu.bind(this))); this._updateMenu.bind(this)),
this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-switched', workspaceManager.connect_after('workspace-switched',
this._updateIndicator.bind(this))); this._updateIndicator.bind(this))
];
this.connect('scroll-event', this._onScrollEvent.bind(this)); this.connect('scroll-event', this._onScrollEvent.bind(this));
this._updateMenu(); this._updateMenu();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' }); this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' });
this._settingsChangedId = this._settingsChangedId = this._settings.connect(
this._settings.connect('changed::workspace-names', 'changed::workspace-names', this._updateMenu.bind(this));
this._updateMenu.bind(this));
} }
_onDestroy() { _onDestroy() {
@@ -812,12 +801,12 @@ class WindowList {
indicatorsBox.add(this._workspaceIndicator.container, { expand: false, y_fill: true }); indicatorsBox.add(this._workspaceIndicator.container, { expand: false, y_fill: true });
this._mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' }); this._mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
this._workspacesOnlyOnPrimaryChangedId = this._workspacesOnlyOnPrimaryChangedId = this._mutterSettings.connect(
this._mutterSettings.connect('changed::workspaces-only-on-primary', 'changed::workspaces-only-on-primary',
this._updateWorkspaceIndicatorVisibility.bind(this)); this._updateWorkspaceIndicatorVisibility.bind(this));
this._dynamicWorkspacesChangedId = this._dynamicWorkspacesChangedId = this._mutterSettings.connect(
this._mutterSettings.connect('changed::dynamic-workspaces', 'changed::dynamic-workspaces',
this._updateWorkspaceIndicatorVisibility.bind(this)); this._updateWorkspaceIndicatorVisibility.bind(this));
this._updateWorkspaceIndicatorVisibility(); this._updateWorkspaceIndicatorVisibility();
this._menuManager = new PopupMenu.PopupMenuManager(this); this._menuManager = new PopupMenu.PopupMenuManager(this);
@@ -835,59 +824,54 @@ class WindowList {
this._updatePosition(); this._updatePosition();
this._appSystem = Shell.AppSystem.get_default(); this._appSystem = Shell.AppSystem.get_default();
this._appStateChangedId = this._appStateChangedId = this._appSystem.connect(
this._appSystem.connect('app-state-changed', 'app-state-changed', this._onAppStateChanged.bind(this));
this._onAppStateChanged.bind(this));
this._keyboardVisiblechangedId = this._keyboardVisiblechangedId = Main.layoutManager.connect(
Main.layoutManager.connect('keyboard-visible-changed', 'keyboard-visible-changed',
(o, state) => { (o, state) => {
Main.layoutManager.keyboardBox.visible = state; Main.layoutManager.keyboardBox.visible = state;
let keyboardBox = Main.layoutManager.keyboardBox; let keyboardBox = Main.layoutManager.keyboardBox;
keyboardBox.visible = state; keyboardBox.visible = state;
if (state) if (state) {
Main.uiGroup.set_child_above_sibling(this.actor, keyboardBox); Main.uiGroup.set_child_above_sibling(
else this.actor, keyboardBox);
Main.uiGroup.set_child_above_sibling(this.actor, } else {
Main.layoutManager.panelBox); Main.uiGroup.set_child_above_sibling(
this._updateKeyboardAnchor(); this.actor, Main.layoutManager.panelBox);
}); }
this._updateKeyboardAnchor();
});
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
this._workspaceSignals = new Map(); this._workspaceSignals = new Map();
this._nWorkspacesChangedId = this._nWorkspacesChangedId = workspaceManager.connect(
workspaceManager.connect('notify::n-workspaces', 'notify::n-workspaces', this._onWorkspacesChanged.bind(this));
this._onWorkspacesChanged.bind(this));
this._onWorkspacesChanged(); this._onWorkspacesChanged();
this._switchWorkspaceId = this._switchWorkspaceId = global.window_manager.connect(
global.window_manager.connect('switch-workspace', 'switch-workspace', this._checkGrouping.bind(this));
this._checkGrouping.bind(this));
this._overviewShowingId = this._overviewShowingId = Main.overview.connect('showing', () => {
Main.overview.connect('showing', () => { this.actor.hide();
this.actor.hide(); this._updateKeyboardAnchor();
this._updateKeyboardAnchor(); });
});
this._overviewHidingId = this._overviewHidingId = Main.overview.connect('hiding', () => {
Main.overview.connect('hiding', () => { this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen; this._updateKeyboardAnchor();
this._updateKeyboardAnchor(); });
});
this._fullscreenChangedId = this._fullscreenChangedId =
global.display.connect('in-fullscreen-changed', () => { global.display.connect('in-fullscreen-changed', () => {
this._updateKeyboardAnchor(); this._updateKeyboardAnchor();
}); });
this._dragBeginId = this._dragBeginId = Main.xdndHandler.connect('drag-begin',
Main.xdndHandler.connect('drag-begin', this._onDragBegin.bind(this));
this._onDragBegin.bind(this)); this._dragEndId = Main.xdndHandler.connect('drag-end',
this._dragEndId = this._onDragEnd.bind(this));
Main.xdndHandler.connect('drag-end',
this._onDragEnd.bind(this));
this._dragMonitor = { this._dragMonitor = {
dragMotion: this._onDragMotion.bind(this) dragMotion: this._onDragMotion.bind(this)
}; };
@@ -896,9 +880,8 @@ class WindowList {
this._dndWindow = null; this._dndWindow = null;
this._settings = ExtensionUtils.getSettings(); this._settings = ExtensionUtils.getSettings();
this._groupingModeChangedId = this._groupingModeChangedId = this._settings.connect(
this._settings.connect('changed::grouping-mode', 'changed::grouping-mode', this._groupingModeChanged.bind(this));
this._groupingModeChanged.bind(this));
this._grouped = undefined; this._grouped = undefined;
this._groupingModeChanged(); this._groupingModeChanged();
} }
@@ -922,8 +905,9 @@ class WindowList {
} }
_updatePosition() { _updatePosition() {
this.actor.set_position(this._monitor.x, this.actor.set_position(
this._monitor.y + this._monitor.height - this.actor.height); this._monitor.x,
this._monitor.y + this._monitor.height - this.actor.height);
} }
_updateWorkspaceIndicatorVisibility() { _updateWorkspaceIndicatorVisibility() {
@@ -1009,8 +993,8 @@ class WindowList {
if (!Main.keyboard.actor) if (!Main.keyboard.actor)
return; return;
let anchorY = Main.overview.visible ? 0 : this.actor.height; let translationY = Main.overview.visible ? 0 : this.actor.height;
Main.keyboard.actor.anchor_y = anchorY; Main.keyboard.actor.translation_y = -translationY;
} }
_onAppStateChanged(appSys, app) { _onAppStateChanged(appSys, app) {
@@ -1026,9 +1010,9 @@ class WindowList {
_addApp(app) { _addApp(app) {
let button = new AppButton(app, this._perMonitor, this._monitor.index); let button = new AppButton(app, this._perMonitor, this._monitor.index);
this._windowList.layout_manager.pack(button.actor, this._windowList.layout_manager.pack(button.actor,
true, true, true, true, true, true,
Clutter.BoxAlignment.START, Clutter.BoxAlignment.START,
Clutter.BoxAlignment.START); Clutter.BoxAlignment.START);
} }
_removeApp(app) { _removeApp(app) {
@@ -1054,9 +1038,9 @@ class WindowList {
let button = new WindowButton(win, this._perMonitor, this._monitor.index); let button = new WindowButton(win, this._perMonitor, this._monitor.index);
this._windowList.layout_manager.pack(button.actor, this._windowList.layout_manager.pack(button.actor,
true, true, true, true, true, true,
Clutter.BoxAlignment.START, Clutter.BoxAlignment.START,
Clutter.BoxAlignment.START); Clutter.BoxAlignment.START);
} }
_onWindowRemoved(ws, win) { _onWindowRemoved(ws, win) {
@@ -1085,12 +1069,10 @@ class WindowList {
continue; continue;
let signals = { windowAddedId: 0, windowRemovedId: 0 }; let signals = { windowAddedId: 0, windowRemovedId: 0 };
signals._windowAddedId = signals._windowAddedId = workspace.connect_after(
workspace.connect_after('window-added', 'window-added', this._onWindowAdded.bind(this));
this._onWindowAdded.bind(this)); signals._windowRemovedId = workspace.connect(
signals._windowRemovedId = 'window-removed', this._onWindowRemoved.bind(this));
workspace.connect('window-removed',
this._onWindowRemoved.bind(this));
this._workspaceSignals.set(workspace, signals); this._workspaceSignals.set(workspace, signals);
} }
@@ -1138,8 +1120,7 @@ class WindowList {
this._dndWindow = hoveredWindow; this._dndWindow = hoveredWindow;
this._dndTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._dndTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
DND_ACTIVATE_TIMEOUT, DND_ACTIVATE_TIMEOUT, this._activateWindow.bind(this));
this._activateWindow.bind(this));
return DND.DragMotionResult.CONTINUE; return DND.DragMotionResult.CONTINUE;
} }
@@ -1213,13 +1194,11 @@ class Extension {
this._windowLists = []; this._windowLists = [];
this._settings = ExtensionUtils.getSettings(); this._settings = ExtensionUtils.getSettings();
this._showOnAllMonitorsChangedId = this._showOnAllMonitorsChangedId = this._settings.connect(
this._settings.connect('changed::show-on-all-monitors', 'changed::show-on-all-monitors', this._buildWindowLists.bind(this));
this._buildWindowLists.bind(this));
this._monitorsChangedId = this._monitorsChangedId = Main.layoutManager.connect(
Main.layoutManager.connect('monitors-changed', 'monitors-changed', this._buildWindowLists.bind(this));
this._buildWindowLists.bind(this));
this._buildWindowLists(); this._buildWindowLists();
} }
+104 -128
View File
@@ -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();
} }
+11 -10
View File
@@ -34,13 +34,14 @@ class WorkspaceIndicator extends PanelMenu.Button {
this._workspaceSection = new PopupMenu.PopupMenuSection(); this._workspaceSection = new PopupMenu.PopupMenuSection();
this.menu.addMenuItem(this._workspaceSection); this.menu.addMenuItem(this._workspaceSection);
this._workspaceManagerSignals = []; this._workspaceManagerSignals = [
this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-added', workspaceManager.connect_after('workspace-added',
this._createWorkspacesSection.bind(this))); this._createWorkspacesSection.bind(this)),
this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-removed', workspaceManager.connect_after('workspace-removed',
this._createWorkspacesSection.bind(this))); this._createWorkspacesSection.bind(this)),
this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-switched', workspaceManager.connect_after('workspace-switched',
this._updateIndicator.bind(this))); this._updateIndicator.bind(this))
];
this.connect('scroll-event', this._onScrollEvent.bind(this)); this.connect('scroll-event', this._onScrollEvent.bind(this));
this._createWorkspacesSection(); this._createWorkspacesSection();
@@ -49,9 +50,9 @@ class WorkspaceIndicator extends PanelMenu.Button {
this.statusLabel.add_style_class_name('panel-workspace-indicator'); this.statusLabel.add_style_class_name('panel-workspace-indicator');
this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA });
this._settingsChangedId = this._settingsChangedId = this._settings.connect(
this._settings.connect(`changed::${WORKSPACE_KEY}`, `changed::${WORKSPACE_KEY}`,
this._createWorkspacesSection.bind(this)); this._createWorkspacesSection.bind(this));
} }
_onDestroy() { _onDestroy() {
-16
View File
@@ -1,16 +0,0 @@
{
"rules": {
"indent": [
"error",
4,
{
"ignoredNodes": [
"CallExpression > ArrowFunctionExpression",
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
],
"CallExpression": { "arguments": "first" },
"MemberExpression": "off"
}
]
}
}
-61
View File
@@ -1,61 +0,0 @@
#!/bin/sh
SEP=`printf '\t'`
OUTPUT=/dev/stderr
CWD=`pwd`
SRCDIR=`dirname $0`
run_lint() {
eslint -f unix "$@" .
}
parse_opts() {
tmp=`getopt -l output: o: "$@"`
[ $? -ne 0 ] && exit 1
eval set -- $tmp
while true
do
case $1 in
--output|-o)
OUTPUT=`realpath $2`; shift 2; continue ;;
--)
shift; break ;;
esac
done
}
# delete lines that don't start with '/',
# replace the first space with tab, sort
process_for_join() {
sed -E "/\//!d; s|(\S+)\s|\1$SEP|" | sort -k 1b,1
}
# re-replace tab with space
process_post_join() {
sed -E "s|$SEP| |"
}
create_report() {
tmp1=`mktemp --tmpdir lint-XXXX`
run_lint | process_for_join > $tmp1
tmp2=`mktemp --tmpdir lint-XXXX`
run_lint -c lint/eslintrc-legacy.json | process_for_join > $tmp2
join -t"$SEP" -o '0,1.2' $tmp1 $tmp2 | process_post_join
rm $tmp1 $tmp2
}
parse_opts "$@"
cd $SRCDIR/..
create_report | tee $OUTPUT | grep -q .
rv=$(( $? == 0 ))
cd $CWD
[ $rv -eq 0 -a -f $OUTPUT ] && rm $OUTPUT
exit $rv
+1 -1
View File
@@ -1,5 +1,5 @@
project('gnome-shell-extensions', project('gnome-shell-extensions',
version: '3.32.0', version: '3.33.2',
meson_version: '>= 0.44.0', meson_version: '>= 0.44.0',
license: 'GPL2+' license: 'GPL2+'
) )