Compare commits

...

20 Commits

Author SHA1 Message Date
Florian Müllner 48ea80d391 Bump version to 3.33.3
Update NEWS.
2019-06-24 20:34:02 +02:00
Jakub Steiner b138e218bb classic: fix a broken build
- redesign of the default theme nuked some local variables
  breaking the build.
2019-06-24 20:28:03 +02:00
Florian Müllner 829440f546 Update sass submodule 2019-06-24 20:02:18 +02:00
Marco Trevisan (Treviño) 14859b4009 window-list: Pass the actor as PopupMenuManager owner
PopupMenuManager's grabHelper starting from gnome-shell@7bb84da must be
an actor, so pass it explicitly instead of expecting the shell to do it
for us.

This fixes an error during pushModal that was causing a grab not to be
released.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/68
2019-05-29 14:45:43 -05:00
Florian Müllner 3a596054ad places-menu: Adjust to GObject-ification of menu items
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67
2019-05-29 09:38:21 +00:00
Florian Müllner 65191d83b4 drive-menu: Adjust to GObject-ification of menu items
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67
2019-05-29 09:38:21 +00:00
Florian Müllner 8499b0e254 apps-menu: Adjust to GObject-ification of menu items
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67
2019-05-29 09:38:21 +00:00
Florian Müllner f166ca501f window-list: Stop using deprecated actor property
Since PanelMenu.Button was changed to inherit from St.Widget, its actor
property is deprecated and points to itself. Stop using it to avoid the
corresponding warning.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67
2019-05-29 09:38:21 +00:00
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
17 changed files with 281 additions and 344 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:
+21
View File
@@ -1,3 +1,24 @@
3.33.3
======
* Misc. bug fixes [Florian, Marco; !67, !68]
Contributors:
Florian Müllner, Marco Trevisan (Treviño)
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 3.32.1
====== ======
* Fix windowsNavigator extension after ES6 port [Florian; #143] * Fix windowsNavigator extension after ES6 port [Florian; #143]
+3 -3
View File
@@ -60,9 +60,9 @@ $variant: 'light';
&.lock-screen, &.lock-screen,
&.unlock-screen, &.unlock-screen,
&.login-screen { &.login-screen {
background-color: transparentize($_bubble_bg_color, 0.5); background-color: transparentize($bg_color, 0.5);
background-gradient-start: transparentize($_bubble_bg_color, 0.5); background-gradient-start: transparentize($bg_color, 0.5);
background-gradient-end: transparentize($_bubble_bg_color, 0.5); background-gradient-end: transparentize($bg_color, 0.5);
border-bottom: none; border-bottom: none;
.panel-button { color: $osd_fg_color; } .panel-button { color: $osd_fg_color; }
} }
+57 -55
View File
@@ -25,11 +25,12 @@ const NAVIGATION_REGION_OVERSHOOT = 50;
Gio._promisify(Gio._LocalFilePrototype, 'query_info_async', 'query_info_finish'); Gio._promisify(Gio._LocalFilePrototype, 'query_info_async', 'query_info_finish');
Gio._promisify(Gio._LocalFilePrototype, 'set_attributes_async', 'set_attributes_finish'); Gio._promisify(Gio._LocalFilePrototype, 'set_attributes_async', 'set_attributes_finish');
var ActivitiesMenuItem = GObject.registerClass(
class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem { class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem {
constructor(button) { _init(button) {
super(); super._init();
this._button = button; this._button = button;
this.actor.add_child(new St.Label({ text: _('Activities Overview') })); this.add_child(new St.Label({ text: _('Activities Overview') }));
} }
activate(event) { activate(event) {
@@ -37,35 +38,36 @@ class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem {
Main.overview.toggle(); Main.overview.toggle();
super.activate(event); super.activate(event);
} }
} });
var ApplicationMenuItem = GObject.registerClass(
class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
constructor(button, app) { _init(button, app) {
super(); super._init();
this._app = app; this._app = app;
this._button = button; this._button = button;
this._iconBin = new St.Bin(); this._iconBin = new St.Bin();
this.actor.add_child(this._iconBin); this.add_child(this._iconBin);
let appLabel = new St.Label({ let appLabel = new St.Label({
text: app.get_name(), text: app.get_name(),
y_expand: true, y_expand: true,
y_align: Clutter.ActorAlign.CENTER y_align: Clutter.ActorAlign.CENTER
}); });
this.actor.add_child(appLabel); this.add_child(appLabel);
this.actor.label_actor = appLabel; this.label_actor = appLabel;
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.connect('destroy', () => {
textureCache.disconnect(iconThemeChangedId); textureCache.disconnect(iconThemeChangedId);
}); });
this._updateIcon(); this._updateIcon();
this.actor._delegate = this; this._delegate = this;
let draggable = DND.makeDraggable(this.actor); let draggable = DND.makeDraggable(this);
let maybeStartDrag = draggable._maybeStartDrag; let maybeStartDrag = draggable._maybeStartDrag;
draggable._maybeStartDrag = (event) => { draggable._maybeStartDrag = (event) => {
@@ -103,11 +105,12 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
_updateIcon() { _updateIcon() {
this._iconBin.set_child(this.getDragActor()); this._iconBin.set_child(this.getDragActor());
} }
} });
var CategoryMenuItem = GObject.registerClass(
class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
constructor(button, category) { _init(button, category) {
super(); super._init();
this._category = category; this._category = category;
this._button = button; this._button = button;
@@ -120,8 +123,9 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
else else
name = _('Favorites'); name = _('Favorites');
this.actor.add_child(new St.Label({ text: name })); this.add_child(new St.Label({ text: name }));
this.actor.connect('motion-event', this._onMotionEvent.bind(this)); this.connect('motion-event', this._onMotionEvent.bind(this));
this.connect('notify::active', this._onActiveChanged.bind(this));
} }
activate(event) { activate(event) {
@@ -131,7 +135,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
} }
_isNavigatingSubmenu([x, y]) { _isNavigatingSubmenu([x, y]) {
let [posX, posY] = this.actor.get_transformed_position(); let [posX, posY] = this.get_transformed_position();
if (this._oldX == -1) { if (this._oldX == -1) {
this._oldX = x; this._oldX = x;
@@ -146,11 +150,11 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
this._oldY = y; this._oldY = y;
// If it lies outside the x-coordinates then it is definitely outside. // If it lies outside the x-coordinates then it is definitely outside.
if (posX > x || posX + this.actor.width < x) if (posX > x || posX + this.width < x)
return false; return false;
// If it lies inside the menu item then it is definitely inside. // If it lies inside the menu item then it is definitely inside.
if (posY <= y && posY + this.actor.height >= y) if (posY <= y && posY + this.height >= y)
return true; return true;
// We want the keep-up triangle only if the movement is more // We want the keep-up triangle only if the movement is more
@@ -171,17 +175,17 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
// only check for triangle ABC. // only check for triangle ABC.
if (posY > y) { if (posY > y) {
let offset = posY - y; let offset = posY - y;
y = posY + this.actor.height + offset; y = posY + this.height + offset;
} }
// Ensure that A is (0, 0). // Ensure that A is (0, 0).
x -= posX; x -= posX;
y -= posY + this.actor.height; y -= posY + this.height;
// Check which side of line AB the point P lies on by taking the // Check which side of line AB the point P lies on by taking the
// cross-product of AB and AP. See: // cross-product of AB and AP. See:
// http://stackoverflow.com/questions/3461453/determine-which-side-of-a-line-a-point-lies // http://stackoverflow.com/questions/3461453/determine-which-side-of-a-line-a-point-lies
if (((this.actor.width * y) - (NAVIGATION_REGION_OVERSHOOT * x)) <= 0) if (((this.width * y) - (NAVIGATION_REGION_OVERSHOOT * x)) <= 0)
return true; return true;
return false; return false;
@@ -191,16 +195,16 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
if (!Clutter.get_pointer_grab()) { if (!Clutter.get_pointer_grab()) {
this._oldX = -1; this._oldX = -1;
this._oldY = -1; this._oldY = -1;
Clutter.grab_pointer(this.actor); Clutter.grab_pointer(this);
} }
this.actor.hover = true; this.hover = true;
if (this._isNavigatingSubmenu(event.get_coords())) if (this._isNavigatingSubmenu(event.get_coords()))
return true; return true;
this._oldX = -1; this._oldX = -1;
this._oldY = -1; this._oldY = -1;
this.actor.hover = false; this.hover = false;
Clutter.ungrab_pointer(); Clutter.ungrab_pointer();
let source = event.get_source(); let source = event.get_source();
@@ -210,14 +214,14 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
return false; return false;
} }
setActive(active, params) { _onActiveChanged() {
if (active) { if (!this.active)
this._button.selectCategory(this._category); return;
this._button.scrollToCatButton(this);
} this._button.selectCategory(this._category);
super.setActive(active, params); this._button.scrollToCatButton(this);
} }
} });
class ApplicationsMenu extends PopupMenu.PopupMenu { class ApplicationsMenu extends PopupMenu.PopupMenu {
constructor(sourceActor, arrowAlignment, arrowSide, button) { constructor(sourceActor, arrowAlignment, arrowSide, button) {
@@ -262,7 +266,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 +326,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 +415,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 +430,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 +469,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 +525,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() {
@@ -565,7 +567,7 @@ class ApplicationsButton extends PanelMenu.Button {
let appsScrollBoxAlloc = this.applicationsScrollBox.get_allocation_box(); let appsScrollBoxAlloc = this.applicationsScrollBox.get_allocation_box();
let currentScrollValue = appsScrollBoxAdj.get_value(); let currentScrollValue = appsScrollBoxAdj.get_value();
let boxHeight = appsScrollBoxAlloc.y2 - appsScrollBoxAlloc.y1; let boxHeight = appsScrollBoxAlloc.y2 - appsScrollBoxAlloc.y1;
let buttonAlloc = button.actor.get_allocation_box(); let buttonAlloc = button.get_allocation_box();
let newScrollValue = currentScrollValue; let newScrollValue = currentScrollValue;
if (currentScrollValue > buttonAlloc.y1 - 10) if (currentScrollValue > buttonAlloc.y1 - 10)
newScrollValue = buttonAlloc.y1 - 10; newScrollValue = buttonAlloc.y1 - 10;
@@ -580,7 +582,7 @@ class ApplicationsButton extends PanelMenu.Button {
let catsScrollBoxAlloc = this.categoriesScrollBox.get_allocation_box(); let catsScrollBoxAlloc = this.categoriesScrollBox.get_allocation_box();
let currentScrollValue = catsScrollBoxAdj.get_value(); let currentScrollValue = catsScrollBoxAdj.get_value();
let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1; let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
let buttonAlloc = button.actor.get_allocation_box(); let buttonAlloc = button.get_allocation_box();
let newScrollValue = currentScrollValue; let newScrollValue = currentScrollValue;
if (currentScrollValue > buttonAlloc.y1 - 10) if (currentScrollValue > buttonAlloc.y1 - 10)
newScrollValue = buttonAlloc.y1 - 10; newScrollValue = buttonAlloc.y1 - 10;
@@ -627,7 +629,7 @@ class ApplicationsButton extends PanelMenu.Button {
}); });
let activities = new ActivitiesMenuItem(this); let activities = new ActivitiesMenuItem(this);
this.leftBox.add(activities.actor, { this.leftBox.add(activities, {
expand: false, expand: false,
x_fill: true, x_fill: true,
y_fill: false, y_fill: false,
@@ -663,7 +665,7 @@ class ApplicationsButton extends PanelMenu.Button {
this._tree.load_sync(); this._tree.load_sync();
let root = this._tree.get_root_directory(); let root = this._tree.get_root_directory();
let categoryMenuItem = new CategoryMenuItem(this, null); let categoryMenuItem = new CategoryMenuItem(this, null);
this.categoriesBox.add_actor(categoryMenuItem.actor); this.categoriesBox.add_actor(categoryMenuItem);
let iter = root.iter(); let iter = root.iter();
let nextType; let nextType;
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) { while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
@@ -679,7 +681,7 @@ class ApplicationsButton extends PanelMenu.Button {
this._loadCategory(categoryId, dir); this._loadCategory(categoryId, dir);
if (this.applicationsByCategory[categoryId].length > 0) { if (this.applicationsByCategory[categoryId].length > 0) {
let categoryMenuItem = new CategoryMenuItem(this, dir); let categoryMenuItem = new CategoryMenuItem(this, dir);
this.categoriesBox.add_actor(categoryMenuItem.actor); this.categoriesBox.add_actor(categoryMenuItem);
} }
} }
@@ -720,8 +722,8 @@ class ApplicationsButton extends PanelMenu.Button {
item.setDragEnabled(this._desktopTarget.hasDesktop); item.setDragEnabled(this._desktopTarget.hasDesktop);
this._applicationsButtons.set(app, item); this._applicationsButtons.set(app, item);
} }
if (!item.actor.get_parent()) if (!item.get_parent())
this.applicationsBox.add_actor(item.actor); this.applicationsBox.add_actor(item);
} }
} }
+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) {
+15 -12
View File
@@ -12,29 +12,32 @@ const ShellMountOperation = imports.ui.shellMountOperation;
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
var MountMenuItem = GObject.registerClass(
class MountMenuItem extends PopupMenu.PopupBaseMenuItem { class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
constructor(mount) { _init(mount) {
super(); super._init();
this.label = new St.Label({ text: mount.get_name() }); this.label = new St.Label({ text: mount.get_name() });
this.actor.add(this.label, { expand: true }); this.add(this.label, { expand: true });
this.actor.label_actor = this.label; this.label_actor = this.label;
this.mount = mount; this.mount = mount;
this.connect('destroy', this._onDestroy.bind(this));
let ejectIcon = new St.Icon({ let ejectIcon = new St.Icon({
icon_name: 'media-eject-symbolic', icon_name: 'media-eject-symbolic',
style_class: 'popup-menu-icon' style_class: 'popup-menu-icon'
}); });
let ejectButton = new St.Button({ child: ejectIcon }); let ejectButton = new St.Button({ child: ejectIcon });
ejectButton.connect('clicked', this._eject.bind(this)); ejectButton.connect('clicked', this._eject.bind(this));
this.actor.add(ejectButton); this.add(ejectButton);
this._changedId = mount.connect('changed', this._syncVisibility.bind(this)); this._changedId = mount.connect('changed', this._syncVisibility.bind(this));
this._syncVisibility(); this._syncVisibility();
} }
destroy() { _onDestroy() {
if (this._changedId) { if (this._changedId) {
this.mount.disconnect(this._changedId); this.mount.disconnect(this._changedId);
this._changedId = 0; this._changedId = 0;
@@ -61,7 +64,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
} }
_syncVisibility() { _syncVisibility() {
this.actor.visible = this._isInteresting(); this.visible = this._isInteresting();
} }
_eject() { _eject() {
@@ -73,10 +76,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,13 +105,13 @@ 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);
} }
} });
let DriveMenu = GObject.registerClass( let DriveMenu = GObject.registerClass(
class DriveMenu extends PanelMenu.Button { class DriveMenu extends PanelMenu.Button {
@@ -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;
+8 -7
View File
@@ -17,19 +17,20 @@ const PlaceDisplay = Me.imports.placeDisplay;
const PLACE_ICON_SIZE = 16; const PLACE_ICON_SIZE = 16;
var PlaceMenuItem = GObject.registerClass(
class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
constructor(info) { _init(info) {
super(); super._init();
this._info = info; this._info = info;
this._icon = new St.Icon({ this._icon = new St.Icon({
gicon: info.icon, gicon: info.icon,
icon_size: PLACE_ICON_SIZE icon_size: PLACE_ICON_SIZE
}); });
this.actor.add_child(this._icon); this.add_child(this._icon);
this._label = new St.Label({ text: info.name, x_expand: true }); this._label = new St.Label({ text: info.name, x_expand: true });
this.actor.add_child(this._label); this.add_child(this._label);
if (info.isRemovable()) { if (info.isRemovable()) {
this._ejectIcon = new St.Icon({ this._ejectIcon = new St.Icon({
@@ -38,11 +39,11 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
}); });
this._ejectButton = new St.Button({ child: this._ejectIcon }); this._ejectButton = new St.Button({ child: this._ejectIcon });
this._ejectButton.connect('clicked', info.eject.bind(info)); this._ejectButton.connect('clicked', info.eject.bind(info));
this.actor.add_child(this._ejectButton); this.add_child(this._ejectButton);
} }
this._changedId = info.connect('changed', this._changedId = info.connect('changed',
this._propertiesChanged.bind(this)); this._propertiesChanged.bind(this));
} }
destroy() { destroy() {
@@ -64,7 +65,7 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem {
this._icon.gicon = info.icon; this._icon.gicon = info.icon;
this._label.text = info.name; this._label.text = info.name;
} }
} });
const SECTIONS = [ const SECTIONS = [
'special', 'special',
+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();
+15 -13
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,
@@ -137,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() {
+111 -132
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.actor);
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();
} }
@@ -490,7 +481,7 @@ class AppButton extends BaseButton {
this._multiWindowTitle.add(label); this._multiWindowTitle.add(label);
this._multiWindowTitle.label_actor = label; this._multiWindowTitle.label_actor = label;
this._menuManager = new PopupMenu.PopupMenuManager(this); this._menuManager = new PopupMenu.PopupMenuManager(this.actor);
this._menu = new PopupMenu.PopupMenu(this.actor, 0.5, St.Side.BOTTOM); this._menu = new PopupMenu.PopupMenu(this.actor, 0.5, St.Side.BOTTOM);
this._menu.connect('open-state-changed', _onMenuStateChanged); this._menu.connect('open-state-changed', _onMenuStateChanged);
this._menu.actor.hide(); this._menu.actor.hide();
@@ -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,15 +801,15 @@ 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.actor);
this._menuManager.addMenu(this._workspaceIndicator.menu); this._menuManager.addMenu(this._workspaceIndicator.menu);
Main.layoutManager.addChrome(this.actor, { Main.layoutManager.addChrome(this.actor, {
@@ -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() {
@@ -933,7 +917,7 @@ class WindowList {
let workspacesOnMonitor = this._monitor == Main.layoutManager.primaryMonitor || let workspacesOnMonitor = this._monitor == Main.layoutManager.primaryMonitor ||
!this._mutterSettings.get_boolean('workspaces-only-on-primary'); !this._mutterSettings.get_boolean('workspaces-only-on-primary');
this._workspaceIndicator.actor.visible = hasWorkspaces && workspacesOnMonitor; this._workspaceIndicator.visible = hasWorkspaces && workspacesOnMonitor;
} }
_getPreferredUngroupedWindowListWidth() { _getPreferredUngroupedWindowListWidth() {
@@ -956,7 +940,7 @@ class WindowList {
} }
_getMaxWindowListWidth() { _getMaxWindowListWidth() {
let indicatorsBox = this._workspaceIndicator.actor.get_parent(); let indicatorsBox = this._workspaceIndicator.get_parent();
return this.actor.width - indicatorsBox.get_preferred_width(-1)[1]; return this.actor.width - indicatorsBox.get_preferred_width(-1)[1];
} }
@@ -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();
} }
+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.1', version: '3.33.3',
meson_version: '>= 0.44.0', meson_version: '>= 0.44.0',
license: 'GPL2+' license: 'GPL2+'
) )