Compare commits
61 Commits
wip/exalm/
...
gbsneto/dn
Author | SHA1 | Date | |
---|---|---|---|
![]() |
87de09a83e | ||
![]() |
b65b4e3cae | ||
![]() |
5880758709 | ||
![]() |
a05cb76e0d | ||
![]() |
60cab56f86 | ||
![]() |
70a5c3875c | ||
![]() |
0fdbde9101 | ||
![]() |
2156577333 | ||
![]() |
f3e09b2b2f | ||
![]() |
6180f59c13 | ||
![]() |
506b75fc7f | ||
![]() |
a0d0a17d68 | ||
![]() |
92e5713e29 | ||
![]() |
856c32db91 | ||
![]() |
7b45ffa511 | ||
![]() |
b6754d7db7 | ||
![]() |
2a9977a5b3 | ||
![]() |
dab60d5580 | ||
![]() |
8e3aac8ed7 | ||
![]() |
147cb53140 | ||
![]() |
54f369404a | ||
![]() |
af1aabff75 | ||
![]() |
d6ba6dc554 | ||
![]() |
42188b7698 | ||
![]() |
48adb2ef4b | ||
![]() |
f8e648b7e3 | ||
![]() |
daa5452af2 | ||
![]() |
259874d731 | ||
![]() |
23344701de | ||
![]() |
00e95de114 | ||
![]() |
942758bb30 | ||
![]() |
e0947b01bd | ||
![]() |
cf00231aa8 | ||
![]() |
5c3f4f5f8b | ||
![]() |
5f10047b58 | ||
![]() |
3094f86334 | ||
![]() |
8ffea9d5c5 | ||
![]() |
4f3c8b8d69 | ||
![]() |
edf6bd6909 | ||
![]() |
3e58af10ca | ||
![]() |
9e55d262f9 | ||
![]() |
252e694979 | ||
![]() |
efed695eca | ||
![]() |
b446667df6 | ||
![]() |
133a1e7bef | ||
![]() |
5b3935fa43 | ||
![]() |
471165ca9b | ||
![]() |
111f87a1b2 | ||
![]() |
93525539c2 | ||
![]() |
a77377efe7 | ||
![]() |
81ab2865f7 | ||
![]() |
e585f7d97b | ||
![]() |
1a32e3e74a | ||
![]() |
8d6820c4df | ||
![]() |
2546445884 | ||
![]() |
e44b7df078 | ||
![]() |
3a9eaa39ea | ||
![]() |
af87bd8c87 | ||
![]() |
4bfb4a0e3d | ||
![]() |
d1a6601e60 | ||
![]() |
817aec5466 |
@@ -610,13 +610,12 @@ StScrollBar {
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
|
||||
// Rename popup
|
||||
|
||||
.rename-folder-popup-box {
|
||||
spacing: 6px;
|
||||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
.rename-folder-popup {
|
||||
.rename-folder-popup-item {
|
||||
spacing: 6px;
|
||||
&:ltr, &:rtl { padding: 0, 12px; }
|
||||
}
|
||||
}
|
||||
|
||||
// Background menu
|
||||
@@ -750,7 +749,7 @@ StScrollBar {
|
||||
|
||||
.ws-switcher-active-up, .ws-switcher-active-down,
|
||||
.ws-switcher-active-left, .ws-switcher-active-right {
|
||||
height: 50px;
|
||||
height: 52px;
|
||||
background-color: $selected_bg_color;
|
||||
color: $selected_fg_color;
|
||||
background-size: 32px;
|
||||
|
@@ -285,8 +285,9 @@ var Application = GObject.registerClass({
|
||||
log(`Failed to connect to shell proxy: ${e}`);
|
||||
this._mainStack.add_named(new NoShellPlaceholder(), 'noshell');
|
||||
this._mainStack.visible_child_name = 'noshell';
|
||||
} else
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -202,7 +202,6 @@ var ConsecutiveBatch = class extends Batch {
|
||||
hold.disconnect(signalId);
|
||||
this.nextTask();
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
// This task finished, process the next one
|
||||
this.nextTask();
|
||||
|
@@ -921,7 +921,7 @@ var LoginDialog = GObject.registerClass({
|
||||
return;
|
||||
|
||||
this._bindOpacity();
|
||||
this.actor.ease({
|
||||
this.ease({
|
||||
opacity: 255,
|
||||
duration: _FADE_ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
@@ -944,7 +944,7 @@ var LoginDialog = GObject.registerClass({
|
||||
|
||||
_startSession(serviceName) {
|
||||
this._bindOpacity();
|
||||
this.actor.ease({
|
||||
this.ease({
|
||||
opacity: 0,
|
||||
duration: _FADE_ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
|
@@ -28,7 +28,7 @@ var HistoryManager = class {
|
||||
this._entry = params.entry;
|
||||
|
||||
if (this._entry) {
|
||||
this._entry.connect('key-press-event',
|
||||
this._entry.connect('key-press-event',
|
||||
this._onEntryKeyPress.bind(this));
|
||||
}
|
||||
}
|
||||
|
@@ -127,7 +127,8 @@ var IntrospectService = class {
|
||||
let apps = this._appSystem.get_running();
|
||||
let windowsList = {};
|
||||
|
||||
if (!this._isIntrospectEnabled()) {
|
||||
if (!this._isIntrospectEnabled() &&
|
||||
!this._isSenderWhitelisted(invocation.get_sender())) {
|
||||
invocation.return_error_literal(Gio.DBusError,
|
||||
Gio.DBusError.ACCESS_DENIED,
|
||||
'App introspection not allowed');
|
||||
|
@@ -172,7 +172,7 @@ function getPropertyNamesFromExpression(expr, commandHeader = '') {
|
||||
|
||||
// Make sure propsUnique contains one key for every
|
||||
// property so we end up with a unique list of properties
|
||||
allProps.map(p => propsUnique[p] = null);
|
||||
allProps.map(p => (propsUnique[p] = null));
|
||||
}
|
||||
return Object.keys(propsUnique).sort();
|
||||
}
|
||||
|
@@ -84,9 +84,9 @@ function _findProviderForSid(sid) {
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Support for the old ModemManager interface (MM < 0.7)
|
||||
//------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------- //
|
||||
// Support for the old ModemManager interface (MM < 0.7) //
|
||||
// ----------------------------------------------------- //
|
||||
|
||||
|
||||
// The following are not the complete interfaces, just the methods we need
|
||||
@@ -182,9 +182,9 @@ var ModemCdma = class {
|
||||
Signals.addSignalMethods(ModemCdma.prototype);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Support for the new ModemManager1 interface (MM >= 0.7)
|
||||
//------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------- //
|
||||
// Support for the new ModemManager1 interface (MM >= 0.7) //
|
||||
// ------------------------------------------------------- //
|
||||
|
||||
const BroadbandModemInterface = loadInterfaceXML('org.freedesktop.ModemManager1.Modem');
|
||||
const BroadbandModemProxy = Gio.DBusProxy.makeProxyWrapper(BroadbandModemInterface);
|
||||
|
@@ -244,8 +244,9 @@ const SystemActions = GObject.registerClass({
|
||||
|
||||
_updateOrientationLockIcon() {
|
||||
let locked = this._orientationSettings.get_boolean('orientation-lock');
|
||||
let iconName = locked ? 'rotation-locked-symbolic'
|
||||
: 'rotation-allowed-symbolic';
|
||||
let iconName = locked
|
||||
? 'rotation-locked-symbolic'
|
||||
: 'rotation-allowed-symbolic';
|
||||
this._actions.get(LOCK_ORIENTATION_ACTION_ID).iconName = iconName;
|
||||
|
||||
this.notify('orientation-lock-icon');
|
||||
@@ -268,7 +269,7 @@ const SystemActions = GObject.registerClass({
|
||||
|
||||
getMatchingActions(terms) {
|
||||
// terms is a list of strings
|
||||
terms = terms.map((term) => term.toLowerCase());
|
||||
terms = terms.map(term => term.toLowerCase());
|
||||
|
||||
let results = [];
|
||||
|
||||
|
@@ -14,7 +14,7 @@ var SCROLL_TIME = 100;
|
||||
// http://daringfireball.net/2010/07/improved_regex_for_matching_urls
|
||||
const _balancedParens = '\\([^\\s()<>]+\\)';
|
||||
const _leadingJunk = '[\\s`(\\[{\'\\"<\u00AB\u201C\u2018]';
|
||||
const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]';
|
||||
const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u200E\u200F\u201C\u201D\u2018\u2019\u202A\u202C]';
|
||||
|
||||
const _urlRegexp = new RegExp(
|
||||
`(^|${_leadingJunk})` +
|
||||
|
@@ -57,7 +57,7 @@ function waitAndDraw(milliseconds) {
|
||||
cb();
|
||||
});
|
||||
|
||||
return callback => cb = callback;
|
||||
return callback => (cb = callback);
|
||||
}
|
||||
|
||||
function waitSignal(object, signal) {
|
||||
@@ -69,7 +69,7 @@ function waitSignal(object, signal) {
|
||||
cb();
|
||||
});
|
||||
|
||||
return callback => cb = callback;
|
||||
return callback => (cb = callback);
|
||||
}
|
||||
|
||||
function extractBootTimestamp() {
|
||||
@@ -137,9 +137,9 @@ function *run() {
|
||||
Main.overview.hide();
|
||||
yield Scripting.waitLeisure();
|
||||
|
||||
////////////////////////////////////////
|
||||
// Tests of redraw speed
|
||||
////////////////////////////////////////
|
||||
// --------------------- //
|
||||
// Tests of redraw speed //
|
||||
// --------------------- //
|
||||
|
||||
global.frame_timestamps = true;
|
||||
global.frame_finish_timestamp = true;
|
||||
@@ -186,8 +186,6 @@ function *run() {
|
||||
|
||||
yield Scripting.sleep(1000);
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
let appSys = Shell.AppSystem.get_default();
|
||||
let app = appSys.lookup_app('org.gnome.gedit.desktop');
|
||||
|
||||
|
@@ -147,7 +147,7 @@ var AccessDialogDBus = class {
|
||||
subtitle, body, options);
|
||||
dialog.open();
|
||||
|
||||
dialog.connect('closed', () => this._accessDialog = null);
|
||||
dialog.connect('closed', () => (this._accessDialog = null));
|
||||
|
||||
this._accessDialog = dialog;
|
||||
}
|
||||
|
@@ -437,8 +437,8 @@ class CyclerHighlight {
|
||||
if (this._clone.source)
|
||||
this._clone.source.sync_visibility();
|
||||
|
||||
let windowActor = this._window ? this._window.get_compositor_private()
|
||||
: null;
|
||||
let windowActor = this._window
|
||||
? this._window.get_compositor_private() : null;
|
||||
|
||||
if (windowActor)
|
||||
windowActor.hide();
|
||||
@@ -877,9 +877,9 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
|
||||
_init(windows) {
|
||||
super._init(false);
|
||||
|
||||
this._labels = new Array();
|
||||
this._thumbnailBins = new Array();
|
||||
this._clones = new Array();
|
||||
this._labels = [];
|
||||
this._thumbnailBins = [];
|
||||
this._clones = [];
|
||||
this._windows = windows;
|
||||
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
@@ -940,7 +940,7 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
|
||||
}
|
||||
|
||||
// Make sure we only do this once
|
||||
this._thumbnailBins = new Array();
|
||||
this._thumbnailBins = [];
|
||||
}
|
||||
|
||||
_removeThumbnail(source, clone) {
|
||||
@@ -1014,9 +1014,9 @@ class WindowIcon extends St.BoxLayout {
|
||||
}
|
||||
|
||||
_createAppIcon(app, size) {
|
||||
let appIcon = app ? app.create_icon_texture(size)
|
||||
: new St.Icon({ icon_name: 'icon-missing',
|
||||
icon_size: size });
|
||||
let appIcon = app
|
||||
? app.create_icon_texture(size)
|
||||
: new St.Icon({ icon_name: 'icon-missing', icon_size: size });
|
||||
appIcon.x_expand = appIcon.y_expand = true;
|
||||
appIcon.x_align = appIcon.y_align = Clutter.ActorAlign.END;
|
||||
|
||||
@@ -1043,7 +1043,7 @@ class WindowList extends SwitcherPopup.SwitcherList {
|
||||
this.addItem(icon, icon.label);
|
||||
this.icons.push(icon);
|
||||
|
||||
icon._unmanagedSignalId = icon.window.connect('unmanaged', (window) => {
|
||||
icon._unmanagedSignalId = icon.window.connect('unmanaged', window => {
|
||||
this._removeWindow(window);
|
||||
});
|
||||
}
|
||||
|
@@ -505,7 +505,7 @@ var AllView = class AllView extends BaseAppView {
|
||||
opacity: 0,
|
||||
duration: VIEWS_SWITCH_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => this.opacity = 255
|
||||
onComplete: () => (this.opacity = 255)
|
||||
});
|
||||
|
||||
if (animationDirection == IconGrid.AnimationDirection.OUT)
|
||||
@@ -752,7 +752,6 @@ var AllView = class AllView extends BaseAppView {
|
||||
let maxY = this._adjustment.upper - this._adjustment.page_size;
|
||||
if (dragEvent.y >= gridBottom && currentY < maxY) {
|
||||
this.goToPage(this._grid.currentPage + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,8 +1106,9 @@ var AppDisplay = class AppDisplay {
|
||||
else
|
||||
this._views[i].control.remove_style_pseudo_class('checked');
|
||||
|
||||
let animationDirection = i == activeIndex ? IconGrid.AnimationDirection.IN :
|
||||
IconGrid.AnimationDirection.OUT;
|
||||
let animationDirection = i == activeIndex
|
||||
? IconGrid.AnimationDirection.IN
|
||||
: IconGrid.AnimationDirection.OUT;
|
||||
this._views[i].view.animateSwitch(animationDirection);
|
||||
}
|
||||
}
|
||||
@@ -1696,12 +1696,10 @@ var FolderIcon = class FolderIcon {
|
||||
this.actor.connect('destroy', () => {
|
||||
Main.overview.disconnect(id);
|
||||
});
|
||||
|
||||
this._menuManager.addMenu(this._menu);
|
||||
}
|
||||
|
||||
this.actor.set_hover(true);
|
||||
this._menu.popup();
|
||||
this._menu.open();
|
||||
this._menuManager.ignoreRelease();
|
||||
}
|
||||
|
||||
@@ -1715,30 +1713,28 @@ var FolderIcon = class FolderIcon {
|
||||
};
|
||||
Signals.addSignalMethods(FolderIcon.prototype);
|
||||
|
||||
var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
|
||||
constructor(source, folder) {
|
||||
super(source.actor, 0.5, St.Side.BOTTOM);
|
||||
var RenameFolderMenuItem = GObject.registerClass(
|
||||
class RenameFolderMenuItem extends PopupMenu.PopupBaseMenuItem {
|
||||
_init(folder) {
|
||||
super._init({
|
||||
style_class: 'rename-folder-popup-item',
|
||||
reactive: false,
|
||||
});
|
||||
this.setOrnament(PopupMenu.Ornament.HIDDEN);
|
||||
|
||||
this._source = source;
|
||||
this._folder = folder;
|
||||
|
||||
// We want to keep the item hovered while the menu is up
|
||||
this.blockSourceEvents = true;
|
||||
|
||||
let box = new St.BoxLayout({ style_class: 'rename-folder-popup-box' });
|
||||
this.box.add_child(box);
|
||||
|
||||
// Entry
|
||||
this._entry = new St.Entry({
|
||||
x_expand: true,
|
||||
width: 200,
|
||||
});
|
||||
box.add_child(this._entry);
|
||||
this.add_child(this._entry);
|
||||
|
||||
this._entry.clutter_text.connect('notify::text',
|
||||
this._validate.bind(this));
|
||||
this._entry.clutter_text.connect('activate',
|
||||
this._updateFolderName.bind(this));
|
||||
this._entry.clutter_text.connect(
|
||||
'notify::text', this._validate.bind(this));
|
||||
this._entry.clutter_text.connect(
|
||||
'activate', this._updateFolderName.bind(this));
|
||||
|
||||
// Rename button
|
||||
this._button = new St.Button({
|
||||
@@ -1746,32 +1742,22 @@ var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
|
||||
reactive: true,
|
||||
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
|
||||
can_focus: true,
|
||||
label: _("Rename"),
|
||||
label: _('Rename'),
|
||||
});
|
||||
box.add_child(this._button);
|
||||
this.add_child(this._button);
|
||||
|
||||
this._button.connect('clicked', this._updateFolderName.bind(this));
|
||||
|
||||
// Chain our visibility and lifecycle to that of the source
|
||||
this._sourceMappedId = source.actor.connect('notify::mapped', () => {
|
||||
if (!source.actor.mapped)
|
||||
this.close();
|
||||
});
|
||||
source.actor.connect('destroy', () => {
|
||||
source.actor.disconnect(this._sourceMappedId);
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
Main.uiGroup.add_actor(this.actor);
|
||||
}
|
||||
|
||||
popup() {
|
||||
let folderName = _getFolderName(this._folder);
|
||||
vfunc_map() {
|
||||
this._entry.text = _getFolderName(this._folder);
|
||||
this._entry.clutter_text.set_selection(0, -1);
|
||||
super.vfunc_map();
|
||||
}
|
||||
|
||||
this._entry.text = folderName;
|
||||
this._entry.clutter_text.set_selection(0, folderName.length);
|
||||
|
||||
this.open();
|
||||
vfunc_key_focus_in() {
|
||||
super.vfunc_key_focus_in();
|
||||
this._entry.clutter_text.grab_key_focus();
|
||||
}
|
||||
|
||||
_isValidFolderName() {
|
||||
@@ -1794,7 +1780,35 @@ var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
|
||||
let newFolderName = this._entry.text.trim();
|
||||
this._folder.set_string('name', newFolderName);
|
||||
this._folder.set_boolean('translate', false);
|
||||
this.close();
|
||||
this.activate(Clutter.get_current_event());
|
||||
}
|
||||
});
|
||||
|
||||
var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
|
||||
constructor(source, folder) {
|
||||
super(source.actor, 0.5, St.Side.BOTTOM);
|
||||
this.actor.add_style_class_name('rename-folder-popup');
|
||||
|
||||
// We want to keep the item hovered while the menu is up
|
||||
this.blockSourceEvents = true;
|
||||
|
||||
let menuItem = new RenameFolderMenuItem(folder);
|
||||
this.addMenuItem(menuItem);
|
||||
|
||||
// Focus the text entry on menu pop-up
|
||||
this.focusActor = menuItem;
|
||||
|
||||
// Chain our visibility and lifecycle to that of the source
|
||||
this._sourceMappedId = source.actor.connect('notify::mapped', () => {
|
||||
if (!source.actor.mapped)
|
||||
this.close();
|
||||
});
|
||||
source.actor.connect('destroy', () => {
|
||||
source.actor.disconnect(this._sourceMappedId);
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
Main.uiGroup.add_actor(this.actor);
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(RenameFolderMenu.prototype);
|
||||
@@ -1884,15 +1898,17 @@ var AppFolderPopup = class AppFolderPopup {
|
||||
direction = St.DirectionType.TAB_FORWARD;
|
||||
break;
|
||||
case Clutter.Right:
|
||||
direction = isLtr ? St.DirectionType.TAB_FORWARD :
|
||||
St.DirectionType.TAB_BACKWARD;
|
||||
direction = isLtr
|
||||
? St.DirectionType.TAB_FORWARD
|
||||
: St.DirectionType.TAB_BACKWARD;
|
||||
break;
|
||||
case Clutter.Up:
|
||||
direction = St.DirectionType.TAB_BACKWARD;
|
||||
break;
|
||||
case Clutter.Left:
|
||||
direction = isLtr ? St.DirectionType.TAB_BACKWARD :
|
||||
St.DirectionType.TAB_FORWARD;
|
||||
direction = isLtr
|
||||
? St.DirectionType.TAB_BACKWARD
|
||||
: St.DirectionType.TAB_FORWARD;
|
||||
break;
|
||||
default:
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
@@ -2206,6 +2222,10 @@ var AppIcon = class AppIcon {
|
||||
this.icon.animateZoomOut();
|
||||
}
|
||||
|
||||
animateLaunchAtPos(x, y) {
|
||||
this.icon.animateZoomOutAtPos(x, y);
|
||||
}
|
||||
|
||||
scaleIn() {
|
||||
this.actor.scale_x = 0;
|
||||
this.actor.scale_y = 0;
|
||||
@@ -2220,6 +2240,9 @@ var AppIcon = class AppIcon {
|
||||
}
|
||||
|
||||
shellWorkspaceLaunch(params) {
|
||||
let { stack } = new Error();
|
||||
log(`shellWorkspaceLaunch is deprecated, use app.open_new_window() instead\n${stack}`);
|
||||
|
||||
params = Params.parse(params, { workspace: -1,
|
||||
timestamp: 0 });
|
||||
|
||||
@@ -2396,8 +2419,8 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
||||
);
|
||||
|
||||
windows.forEach(window => {
|
||||
let title = window.title ? window.title
|
||||
: this._source.app.get_name();
|
||||
let title = window.title
|
||||
? window.title : this._source.app.get_name();
|
||||
let item = this._appendMenuItem(title);
|
||||
item.connect('activate', () => {
|
||||
this.emit('activate-window', window);
|
||||
|
@@ -161,7 +161,7 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
|
||||
|
||||
let [deviceNames] = params;
|
||||
let devices = 0;
|
||||
deviceNames.forEach(n => devices |= AudioDevice[n.toUpperCase()]);
|
||||
deviceNames.forEach(n => (devices |= AudioDevice[n.toUpperCase()]));
|
||||
|
||||
let dialog;
|
||||
try {
|
||||
|
@@ -172,8 +172,8 @@ var BoxPointer = GObject.registerClass({
|
||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||
minSize += borderWidth * 2;
|
||||
natSize += borderWidth * 2;
|
||||
if ((!isWidth && (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM))
|
||||
|| (isWidth && (this._arrowSide == St.Side.LEFT || this._arrowSide == St.Side.RIGHT))) {
|
||||
if ((!isWidth && (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM)) ||
|
||||
(isWidth && (this._arrowSide == St.Side.LEFT || this._arrowSide == St.Side.RIGHT))) {
|
||||
let rise = themeNode.get_length('-arrow-rise');
|
||||
minSize += rise;
|
||||
natSize += rise;
|
||||
|
@@ -581,8 +581,9 @@ var Calendar = class Calendar {
|
||||
if (row == 2)
|
||||
styleClass = `calendar-day-top ${styleClass}`;
|
||||
|
||||
let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
|
||||
: iter.getDay() == this._weekStart;
|
||||
let leftMost = rtl
|
||||
? iter.getDay() == (this._weekStart + 6) % 7
|
||||
: iter.getDay() == this._weekStart;
|
||||
if (leftMost)
|
||||
styleClass = `calendar-day-left ${styleClass}`;
|
||||
|
||||
@@ -680,8 +681,9 @@ var EventMessage = class EventMessage extends MessageList.Message {
|
||||
*/
|
||||
title = C_("event list time", "All Day");
|
||||
} else {
|
||||
let date = this._event.date >= periodBegin ? this._event.date
|
||||
: this._event.end;
|
||||
let date = this._event.date >= periodBegin
|
||||
? this._event.date
|
||||
: this._event.end;
|
||||
title = Util.formatTime(date, { timeOnly: true });
|
||||
}
|
||||
|
||||
@@ -1071,7 +1073,7 @@ var CalendarMessageList = class CalendarMessageList {
|
||||
this._clearButton.set_x_align(Clutter.ActorAlign.END);
|
||||
this._clearButton.connect('clicked', () => {
|
||||
let sections = [...this._sections.keys()];
|
||||
sections.forEach((s) => s.clear());
|
||||
sections.forEach(s => s.clear());
|
||||
});
|
||||
box.add_actor(this._clearButton);
|
||||
|
||||
|
@@ -156,7 +156,7 @@ var AutomountManager = class {
|
||||
!volume.should_automount() ||
|
||||
!volume.can_mount()) {
|
||||
// allow the autorun to run anyway; this can happen if the
|
||||
// mount gets added programmatically later, even if
|
||||
// mount gets added programmatically later, even if
|
||||
// should_automount() or can_mount() are false, like for
|
||||
// blank optical media.
|
||||
this._allowAutorun(volume);
|
||||
@@ -222,14 +222,14 @@ var AutomountManager = class {
|
||||
GLib.source_remove(volume._allowAutorunExpireId);
|
||||
delete volume._allowAutorunExpireId;
|
||||
}
|
||||
this._volumeQueue =
|
||||
this._volumeQueue =
|
||||
this._volumeQueue.filter(element => (element != volume));
|
||||
}
|
||||
|
||||
_reaskPassword(volume) {
|
||||
let prevOperation = this._activeOperations.get(volume);
|
||||
let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
|
||||
let operation =
|
||||
let operation =
|
||||
new ShellMountOperation.ShellMountOperation(volume,
|
||||
{ existingDialog: existingDialog });
|
||||
this._mountVolume(volume, operation);
|
||||
|
@@ -63,7 +63,7 @@ function startAppForMount(app, mount) {
|
||||
files.push(root);
|
||||
|
||||
try {
|
||||
retval = app.launch(files,
|
||||
retval = app.launch(files,
|
||||
global.create_app_launch_context(0, -1));
|
||||
} catch (e) {
|
||||
log(`Unable to launch the application ${app.get_name()}: ${e}`);
|
||||
@@ -72,8 +72,6 @@ function startAppForMount(app, mount) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
/******************************************/
|
||||
|
||||
const HotplugSnifferIface = loadInterfaceXML('org.gnome.Shell.HotplugSniffer');
|
||||
const HotplugSnifferProxy = Gio.DBusProxy.makeProxyWrapper(HotplugSnifferIface);
|
||||
function HotplugSniffer() {
|
||||
@@ -117,9 +115,9 @@ var ContentTypeDiscoverer = class {
|
||||
|
||||
let hotplugSniffer = new HotplugSniffer();
|
||||
hotplugSniffer.SniffURIRemote(root.get_uri(),
|
||||
([contentTypes]) => {
|
||||
this._emitCallback(mount, contentTypes);
|
||||
});
|
||||
([contentTypes]) => {
|
||||
this._emitCallback(mount, contentTypes);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,11 +213,11 @@ var AutorunDispatcher = class {
|
||||
}
|
||||
|
||||
_addSource(mount, apps) {
|
||||
// if we already have a source showing for this
|
||||
// if we already have a source showing for this
|
||||
// mount, return
|
||||
if (this._getSourceForMount(mount))
|
||||
return;
|
||||
|
||||
|
||||
// add a new source
|
||||
this._sources.push(new AutorunSource(this._manager, mount, apps));
|
||||
}
|
||||
@@ -264,7 +262,7 @@ var AutorunDispatcher = class {
|
||||
|
||||
removeMount(mount) {
|
||||
let source = this._getSourceForMount(mount);
|
||||
|
||||
|
||||
// if we aren't tracking this mount, don't do anything
|
||||
if (!source)
|
||||
return;
|
||||
|
@@ -232,8 +232,9 @@ var KeyringPrompter = class {
|
||||
constructor() {
|
||||
this._prompter = new Gcr.SystemPrompter();
|
||||
this._prompter.connect('new-prompt', () => {
|
||||
let dialog = this._enabled ? new KeyringDialog()
|
||||
: new KeyringDummyDialog();
|
||||
let dialog = this._enabled
|
||||
? new KeyringDialog()
|
||||
: new KeyringDummyDialog();
|
||||
this._currentPrompt = dialog.prompt;
|
||||
return this._currentPrompt;
|
||||
});
|
||||
|
@@ -164,9 +164,9 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
if (value.length == 64) {
|
||||
// must be composed of hexadecimal digits only
|
||||
for (let i = 0; i < 64; i++) {
|
||||
if (!((value[i] >= 'a' && value[i] <= 'f')
|
||||
|| (value[i] >= 'A' && value[i] <= 'F')
|
||||
|| (value[i] >= '0' && value[i] <= '9')))
|
||||
if (!((value[i] >= 'a' && value[i] <= 'f') ||
|
||||
(value[i] >= 'A' && value[i] <= 'F') ||
|
||||
(value[i] >= '0' && value[i] <= '9')))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -180,15 +180,15 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
if (secret.wep_key_type == NM.WepKeyType.KEY) {
|
||||
if (value.length == 10 || value.length == 26) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
if (!((value[i] >= 'a' && value[i] <= 'f')
|
||||
|| (value[i] >= 'A' && value[i] <= 'F')
|
||||
|| (value[i] >= '0' && value[i] <= '9')))
|
||||
if (!((value[i] >= 'a' && value[i] <= 'f') ||
|
||||
(value[i] >= 'A' && value[i] <= 'F') ||
|
||||
(value[i] >= '0' && value[i] <= '9')))
|
||||
return false;
|
||||
}
|
||||
} else if (value.length == 5 || value.length == 13) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
if (!((value[i] >= 'a' && value[i] <= 'z')
|
||||
|| (value[i] >= 'A' && value[i] <= 'Z')))
|
||||
if (!((value[i] >= 'a' && value[i] <= 'z') ||
|
||||
(value[i] >= 'A' && value[i] <= 'Z')))
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@@ -624,7 +624,7 @@ var NetworkAgent = class {
|
||||
this._pluginDir = Gio.file_new_for_path(Config.VPNDIR);
|
||||
try {
|
||||
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
|
||||
monitor.connect('changed', () => this._vpnCacheBuilt = false);
|
||||
monitor.connect('changed', () => (this._vpnCacheBuilt = false));
|
||||
} catch (e) {
|
||||
log(`Failed to create monitor for VPN plugin dir: ${e.message}`);
|
||||
}
|
||||
|
@@ -583,7 +583,7 @@ var ChatSource = class extends MessageTray.Source {
|
||||
|
||||
let msg = Tp.ClientMessage.new_text(type, text);
|
||||
this._channel.send_message_async(msg, 0, (src, result) => {
|
||||
this._channel.send_message_finish(result);
|
||||
this._channel.send_message_finish(result);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ var ChatNotification = class extends MessageTray.Notification {
|
||||
* sender: the name of the sender,
|
||||
* timestamp: the time the message was sent
|
||||
* direction: a #NotificationDirection
|
||||
*
|
||||
*
|
||||
* @noTimestamp: Whether to add a timestamp. If %true, no timestamp
|
||||
* will be added, regardless of the difference since the
|
||||
* last timestamp
|
||||
@@ -673,8 +673,8 @@ var ChatNotification = class extends MessageTray.Notification {
|
||||
{ datetime: GLib.DateTime.new_from_unix_local (message.timestamp),
|
||||
bannerMarkup: true });
|
||||
|
||||
let group = (message.direction == NotificationDirection.RECEIVED ?
|
||||
'received' : 'sent');
|
||||
let group = (message.direction == NotificationDirection.RECEIVED
|
||||
? 'received' : 'sent');
|
||||
|
||||
this._append({ body: messageBody,
|
||||
group: group,
|
||||
@@ -696,8 +696,8 @@ var ChatNotification = class extends MessageTray.Notification {
|
||||
// SCROLLBACK_RECENT_LENGTH previous messages. Otherwise
|
||||
// we'll keep SCROLLBACK_IDLE_LENGTH messages.
|
||||
|
||||
let maxLength = (lastMessageTime < currentTime - SCROLLBACK_RECENT_TIME) ?
|
||||
SCROLLBACK_IDLE_LENGTH : SCROLLBACK_RECENT_LENGTH;
|
||||
let maxLength = (lastMessageTime < currentTime - SCROLLBACK_RECENT_TIME)
|
||||
? SCROLLBACK_IDLE_LENGTH : SCROLLBACK_RECENT_LENGTH;
|
||||
|
||||
let filteredHistory = this.messages.filter(item => item.realMessage);
|
||||
if (filteredHistory.length > maxLength) {
|
||||
|
@@ -703,8 +703,8 @@ var Dash = class Dash {
|
||||
}
|
||||
|
||||
// App moved
|
||||
let nextApp = newApps.length > newIndex + 1 ? newApps[newIndex + 1]
|
||||
: null;
|
||||
let nextApp = newApps.length > newIndex + 1
|
||||
? newApps[newIndex + 1] : null;
|
||||
let insertHere = nextApp && nextApp == oldApp;
|
||||
let alreadyRemoved = removedActors.reduce((result, actor) => {
|
||||
let removedApp = actor.child._delegate.app;
|
||||
|
@@ -148,8 +148,9 @@ var WorldClocksSection = class WorldClocksSection {
|
||||
});
|
||||
|
||||
let layout = this._grid.layout_manager;
|
||||
let title = (this._locations.length == 0) ? _("Add world clocks…")
|
||||
: _("World Clocks");
|
||||
let title = (this._locations.length == 0)
|
||||
? _("Add world clocks…")
|
||||
: _("World Clocks");
|
||||
let header = new St.Label({ style_class: 'world-clocks-header',
|
||||
x_align: Clutter.ActorAlign.START,
|
||||
text: title });
|
||||
@@ -412,7 +413,7 @@ var MessagesIndicator = class MessagesIndicator {
|
||||
|
||||
_updateCount() {
|
||||
let count = 0;
|
||||
this._sources.forEach(source => count += source.unseenCount);
|
||||
this._sources.forEach(source => (count += source.unseenCount));
|
||||
count -= Main.messageTray.queueCount;
|
||||
|
||||
this.actor.visible = (count > 0);
|
||||
|
15
js/ui/dnd.js
15
js/ui/dnd.js
@@ -642,12 +642,13 @@ var _Draggable = class _Draggable {
|
||||
this._dragState = DragState.CANCELLED;
|
||||
|
||||
if (this._actorDestroyed || wasCancelled) {
|
||||
let dragActor = this._dragActor;
|
||||
global.display.set_cursor(Meta.Cursor.DEFAULT);
|
||||
if (!this._buttonDown)
|
||||
this._dragComplete();
|
||||
this.emit('drag-end', eventTime, false);
|
||||
if (!this._dragOrigParent && this._dragActor)
|
||||
this._dragActor.destroy();
|
||||
if (!this._dragOrigParent && dragActor)
|
||||
dragActor.destroy();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -702,17 +703,17 @@ var _Draggable = class _Draggable {
|
||||
}
|
||||
|
||||
_onAnimationComplete(dragActor, eventTime) {
|
||||
this.emit('drag-end', eventTime, false);
|
||||
this._finishAnimation();
|
||||
|
||||
if (this._dragOrigParent) {
|
||||
Main.uiGroup.remove_child(this._dragActor);
|
||||
this._dragOrigParent.add_actor(this._dragActor);
|
||||
Main.uiGroup.remove_child(dragActor);
|
||||
this._dragOrigParent.add_actor(dragActor);
|
||||
dragActor.set_scale(this._dragOrigScale, this._dragOrigScale);
|
||||
dragActor.set_position(this._dragOrigX, this._dragOrigY);
|
||||
} else {
|
||||
dragActor.destroy();
|
||||
}
|
||||
|
||||
this.emit('drag-end', eventTime, false);
|
||||
this._finishAnimation();
|
||||
}
|
||||
|
||||
_dragComplete() {
|
||||
|
@@ -121,7 +121,9 @@ function _easeActor(actor, params) {
|
||||
actor.set(params);
|
||||
actor.restore_easing_state();
|
||||
|
||||
let transition = actor.get_transition(animatedProps[0]);
|
||||
let transition = animatedProps.map(p => actor.get_transition(p))
|
||||
.find(t => t !== null);
|
||||
|
||||
if (transition)
|
||||
transition.connect('stopped', (t, finished) => callback(finished));
|
||||
else
|
||||
|
@@ -286,7 +286,7 @@ var ExtensionManager = class {
|
||||
reloadExtension(oldExtension) {
|
||||
// Grab the things we'll need to pass to createExtensionObject
|
||||
// to reload it.
|
||||
let { uuid: uuid, dir: dir, type: type } = oldExtension;
|
||||
let { uuid, dir, type } = oldExtension;
|
||||
|
||||
// Then unload the old extension.
|
||||
this.unloadExtension(oldExtension);
|
||||
|
@@ -142,6 +142,10 @@ class BaseIcon extends St.Bin {
|
||||
zoomOutActor(this.child);
|
||||
}
|
||||
|
||||
animateZoomOutAtPos(x, y) {
|
||||
zoomOutActorAtPos(this.child, x, y);
|
||||
}
|
||||
|
||||
update() {
|
||||
this._createIconTexture(this.iconSize);
|
||||
}
|
||||
@@ -152,10 +156,15 @@ function clamp(value, min, max) {
|
||||
}
|
||||
|
||||
function zoomOutActor(actor) {
|
||||
let [x, y] = actor.get_transformed_position();
|
||||
zoomOutActorAtPos(actor, x, y);
|
||||
}
|
||||
|
||||
function zoomOutActorAtPos(actor, x, y) {
|
||||
let actorClone = new Clutter.Clone({ source: actor,
|
||||
reactive: false });
|
||||
let [width, height] = actor.get_transformed_size();
|
||||
let [x, y] = actor.get_transformed_position();
|
||||
|
||||
actorClone.set_size(width, height);
|
||||
actorClone.set_position(x, y);
|
||||
actorClone.opacity = 255;
|
||||
@@ -273,9 +282,9 @@ var IconGrid = GObject.registerClass({
|
||||
return [0, 0];
|
||||
|
||||
let nChildren = this.get_n_children();
|
||||
let nColumns = this._colLimit ? Math.min(this._colLimit,
|
||||
nChildren)
|
||||
: nChildren;
|
||||
let nColumns = this._colLimit
|
||||
? Math.min(this._colLimit, nChildren)
|
||||
: nChildren;
|
||||
let totalSpacing = Math.max(0, nColumns - 1) * this._getSpacing();
|
||||
// Kind of a lie, but not really an issue right now. If
|
||||
// we wanted to support some sort of hidden/overflow that would
|
||||
@@ -787,8 +796,9 @@ var IconGrid = GObject.registerClass({
|
||||
let neededWidth = this.usedWidthForNColumns(this._minColumns) - availWidth;
|
||||
let neededHeight = this.usedHeightForNRows(this._minRows) - availHeight;
|
||||
|
||||
let neededSpacePerItem = (neededWidth > neededHeight) ? Math.ceil(neededWidth / this._minColumns)
|
||||
: Math.ceil(neededHeight / this._minRows);
|
||||
let neededSpacePerItem = (neededWidth > neededHeight)
|
||||
? Math.ceil(neededWidth / this._minColumns)
|
||||
: Math.ceil(neededHeight / this._minRows);
|
||||
this._fixedHItemSize = Math.max(this._hItemSize - neededSpacePerItem, MIN_ICON_SIZE);
|
||||
this._fixedVItemSize = Math.max(this._vItemSize - neededSpacePerItem, MIN_ICON_SIZE);
|
||||
|
||||
@@ -963,8 +973,7 @@ var PaginatedIconGrid = GObject.registerClass({
|
||||
let childrenPerRow = this._childrenPerPage / this._rowsPerPage;
|
||||
let sourceRow = Math.floor((index - pageOffset) / childrenPerRow);
|
||||
|
||||
let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1
|
||||
: sourceRow;
|
||||
let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1 : sourceRow;
|
||||
let nRowsBelow = this._rowsPerPage - nRowsAbove;
|
||||
|
||||
let nRowsUp, nRowsDown;
|
||||
|
@@ -76,8 +76,9 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
||||
let name = this._app ? this._app.get_name() : this._window.title;
|
||||
|
||||
/* Translators: %s is an application name like "Settings" */
|
||||
let title = name ? _("%s wants to inhibit shortcuts").format(name)
|
||||
: _("Application wants to inhibit shortcuts");
|
||||
let title = name
|
||||
? _("%s wants to inhibit shortcuts").format(name)
|
||||
: _("Application wants to inhibit shortcuts");
|
||||
let icon = new Gio.ThemedIcon({ name: 'dialog-warning-symbolic' });
|
||||
|
||||
let contentParams = { icon, title };
|
||||
|
@@ -28,23 +28,23 @@ class KbdA11yDialog extends GObject.Object {
|
||||
if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) {
|
||||
key = KEY_SLOW_KEYS_ENABLED;
|
||||
enabled = (newFlags & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) > 0;
|
||||
title = enabled ?
|
||||
_("Slow Keys Turned On") :
|
||||
_("Slow Keys Turned Off");
|
||||
title = enabled
|
||||
? _("Slow Keys Turned On")
|
||||
: _("Slow Keys Turned Off");
|
||||
body = _("You just held down the Shift key for 8 seconds. This is the shortcut " +
|
||||
"for the Slow Keys feature, which affects the way your keyboard works.");
|
||||
|
||||
} else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) {
|
||||
key = KEY_STICKY_KEYS_ENABLED;
|
||||
enabled = (newFlags & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) > 0;
|
||||
title = enabled ?
|
||||
_("Sticky Keys Turned On") :
|
||||
_("Sticky Keys Turned Off");
|
||||
body = enabled ?
|
||||
_("You just pressed the Shift key 5 times in a row. This is the shortcut " +
|
||||
"for the Sticky Keys feature, which affects the way your keyboard works.") :
|
||||
_("You just pressed two keys at once, or pressed the Shift key 5 times in a row. " +
|
||||
"This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
||||
title = enabled
|
||||
? _("Sticky Keys Turned On")
|
||||
: _("Sticky Keys Turned Off");
|
||||
body = enabled
|
||||
? _("You just pressed the Shift key 5 times in a row. This is the shortcut " +
|
||||
"for the Sticky Keys feature, which affects the way your keyboard works.")
|
||||
: _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. " +
|
||||
"This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@@ -104,9 +104,10 @@ class KeyContainer extends St.Widget {
|
||||
this._currentRow++;
|
||||
this._currentCol = 0;
|
||||
|
||||
let row = new Object();
|
||||
row.keys = [];
|
||||
row.width = 0;
|
||||
let row = {
|
||||
keys: [],
|
||||
width: 0,
|
||||
};
|
||||
this._rows.push(row);
|
||||
}
|
||||
|
||||
@@ -1080,7 +1081,7 @@ var Keyboard = class Keyboard {
|
||||
this.hide();
|
||||
});
|
||||
|
||||
Meta.get_backend().connect('last-device-changed',
|
||||
Meta.get_backend().connect('last-device-changed',
|
||||
(backend, deviceId) => {
|
||||
let manager = Clutter.DeviceManager.get_default();
|
||||
let device = manager.get_device(deviceId);
|
||||
|
@@ -771,8 +771,7 @@ var LayoutManager = GObject.registerClass({
|
||||
this.keyboardBox.ease({
|
||||
anchor_y: 0,
|
||||
opacity: 0,
|
||||
duration: immediate ? 0
|
||||
: KEYBOARD_ANIMATION_TIME,
|
||||
duration: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_IN_QUAD,
|
||||
onComplete: () => {
|
||||
this._hideKeyboardComplete();
|
||||
@@ -856,8 +855,9 @@ var LayoutManager = GObject.registerClass({
|
||||
index = this._findActor(ancestor);
|
||||
}
|
||||
|
||||
let ancestorData = ancestor ? this._trackedActors[index]
|
||||
: defaultParams;
|
||||
let ancestorData = ancestor
|
||||
? this._trackedActors[index]
|
||||
: defaultParams;
|
||||
// We can't use Params.parse here because we want to drop
|
||||
// the extra values like ancestorData.actor
|
||||
for (let prop in defaultParams) {
|
||||
@@ -1015,11 +1015,6 @@ var LayoutManager = GObject.registerClass({
|
||||
if (Main.modalCount > 0)
|
||||
return GLib.SOURCE_REMOVE;
|
||||
|
||||
// Bug workaround - get_transformed_position()/get_transformed_size() don't work after
|
||||
// a change in stage size until the first pick or paint.
|
||||
// https://bugzilla.gnome.org/show_bug.cgi?id=761565
|
||||
global.stage.get_actor_at_pos(Clutter.PickMode.ALL, 0, 0);
|
||||
|
||||
let rects = [], struts = [], i;
|
||||
let isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow);
|
||||
let wantsInputRegion = !isPopupMenuVisible;
|
||||
@@ -1075,16 +1070,17 @@ var LayoutManager = GObject.registerClass({
|
||||
side = Meta.Side.RIGHT;
|
||||
else
|
||||
continue;
|
||||
} else if (x1 <= monitor.x)
|
||||
} else if (x1 <= monitor.x) {
|
||||
side = Meta.Side.LEFT;
|
||||
else if (y1 <= monitor.y)
|
||||
} else if (y1 <= monitor.y) {
|
||||
side = Meta.Side.TOP;
|
||||
else if (x2 >= monitor.x + monitor.width)
|
||||
} else if (x2 >= monitor.x + monitor.width) {
|
||||
side = Meta.Side.RIGHT;
|
||||
else if (y2 >= monitor.y + monitor.height)
|
||||
} else if (y2 >= monitor.y + monitor.height) {
|
||||
side = Meta.Side.BOTTOM;
|
||||
else
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
|
||||
let strut = new Meta.Strut({ rect: strutRect, side: side });
|
||||
|
@@ -881,7 +881,7 @@ var LookingGlass = class LookingGlass {
|
||||
return true;
|
||||
});
|
||||
|
||||
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
|
||||
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
|
||||
entry: this._entry.clutter_text });
|
||||
|
||||
this._autoComplete = new AutoComplete(this._entry);
|
||||
|
@@ -264,7 +264,7 @@ var Magnifier = class Magnifier {
|
||||
zoomRegion.setViewPort(viewPort);
|
||||
|
||||
// We ignore the redundant width/height on the ROI
|
||||
let fixedROI = new Object(roi);
|
||||
let fixedROI = Object.create(roi);
|
||||
fixedROI.width = viewPort.width / xMagFactor;
|
||||
fixedROI.height = viewPort.height / yMagFactor;
|
||||
zoomRegion.setROI(fixedROI);
|
||||
@@ -451,15 +451,11 @@ var Magnifier = class Magnifier {
|
||||
* @clip: Flag to indicate whether to clip the crosshairs.
|
||||
*/
|
||||
setCrosshairsClip(clip) {
|
||||
if (clip) {
|
||||
if (this._crossHairs)
|
||||
this._crossHairs.setClip(CROSSHAIRS_CLIP_SIZE);
|
||||
} else {
|
||||
// Setting no clipping on crosshairs means a zero sized clip
|
||||
// rectangle.
|
||||
if (this._crossHairs)
|
||||
this._crossHairs.setClip([0, 0]);
|
||||
}
|
||||
if (!this._crossHairs)
|
||||
return;
|
||||
|
||||
// Setting no clipping on crosshairs means a zero sized clip rectangle.
|
||||
this._crossHairs.setClip(clip ? CROSSHAIRS_CLIP_SIZE : [0, 0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -705,7 +705,6 @@ function queueDeferredWork(workId) {
|
||||
_deferredWorkQueue.push(workId);
|
||||
if (data.actor.mapped) {
|
||||
_queueBeforeRedraw(workId);
|
||||
return;
|
||||
} else if (_deferredTimeoutId == 0) {
|
||||
_deferredTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, DEFERRED_TIMEOUT_SECONDS, () => {
|
||||
_runAllDeferredWork();
|
||||
|
@@ -335,7 +335,7 @@ class NotificationApplicationPolicy extends NotificationPolicy {
|
||||
// event sound is played when the notification is shown (if the policy for
|
||||
// @source allows playing sounds).
|
||||
//
|
||||
// [1] https://developer.gnome.org/notification-spec/#markup
|
||||
// [1] https://developer.gnome.org/notification-spec/#markup
|
||||
var Notification = class Notification {
|
||||
constructor(source, title, banner, params) {
|
||||
this.source = source;
|
||||
@@ -735,8 +735,9 @@ var Source = class Source {
|
||||
}
|
||||
|
||||
get narrowestPrivacyScope() {
|
||||
return this.notifications.every(n => n.privacyScope == PrivacyScope.SYSTEM) ? PrivacyScope.SYSTEM
|
||||
: PrivacyScope.USER;
|
||||
return this.notifications.every(n => n.privacyScope == PrivacyScope.SYSTEM)
|
||||
? PrivacyScope.SYSTEM
|
||||
: PrivacyScope.USER;
|
||||
}
|
||||
|
||||
setTitle(newTitle) {
|
||||
|
@@ -253,7 +253,7 @@ var ModalDialog = GObject.registerClass({
|
||||
opacity: 0,
|
||||
duration: FADE_OUT_DIALOG_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => this.state = State.FADED_OUT
|
||||
onComplete: () => (this.state = State.FADED_OUT)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -71,8 +71,9 @@ var MediaMessage = class MediaMessage extends MessageList.Message {
|
||||
}
|
||||
|
||||
let isPlaying = this._player.status == 'Playing';
|
||||
let iconName = isPlaying ? 'media-playback-pause-symbolic'
|
||||
: 'media-playback-start-symbolic';
|
||||
let iconName = isPlaying
|
||||
? 'media-playback-pause-symbolic'
|
||||
: 'media-playback-start-symbolic';
|
||||
this._playPauseButton.child.icon_name = iconName;
|
||||
|
||||
this._updateNavButton(this._prevButton, this._player.canGoPrevious);
|
||||
|
@@ -346,8 +346,9 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
||||
notification.setTransient(!!hints['transient']);
|
||||
|
||||
let privacyScope = (hints['x-gnome-privacy-scope'] || 'user');
|
||||
notification.setPrivacyScope(privacyScope == 'system' ? MessageTray.PrivacyScope.SYSTEM
|
||||
: MessageTray.PrivacyScope.USER);
|
||||
notification.setPrivacyScope(privacyScope == 'system'
|
||||
? MessageTray.PrivacyScope.SYSTEM
|
||||
: MessageTray.PrivacyScope.USER);
|
||||
|
||||
let sourceGIcon = source.useNotificationIcon ? gicon : null;
|
||||
source.processNotification(notification, sourceGIcon);
|
||||
@@ -540,22 +541,23 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
|
||||
super(source);
|
||||
this._serialized = GLib.Variant.new('a{sv}', notification);
|
||||
|
||||
let { "title": title,
|
||||
"body": body,
|
||||
"icon": gicon,
|
||||
"urgent": urgent,
|
||||
"priority": priority,
|
||||
"buttons": buttons,
|
||||
let { title,
|
||||
body,
|
||||
icon: gicon,
|
||||
urgent,
|
||||
priority,
|
||||
buttons,
|
||||
"default-action": defaultAction,
|
||||
"default-action-target": defaultActionTarget,
|
||||
"timestamp": time } = notification;
|
||||
timestamp: time } = notification;
|
||||
|
||||
if (priority) {
|
||||
let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
|
||||
this.setUrgency(urgency != undefined ? urgency : MessageTray.Urgency.NORMAL);
|
||||
} else if (urgent) {
|
||||
this.setUrgency(urgent.unpack() ? MessageTray.Urgency.CRITICAL
|
||||
: MessageTray.Urgency.NORMAL);
|
||||
this.setUrgency(urgent.unpack()
|
||||
? MessageTray.Urgency.CRITICAL
|
||||
: MessageTray.Urgency.NORMAL);
|
||||
} else {
|
||||
this.setUrgency(MessageTray.Urgency.NORMAL);
|
||||
}
|
||||
@@ -588,8 +590,8 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
|
||||
}
|
||||
|
||||
_onButtonClicked(button) {
|
||||
let { 'action': action, 'target': actionTarget } = button;
|
||||
this._activateAction(action.unpack(), actionTarget);
|
||||
let { action, target } = button;
|
||||
this._activateAction(action.unpack(), target);
|
||||
}
|
||||
|
||||
activate() {
|
||||
@@ -616,7 +618,7 @@ function getPlatformData() {
|
||||
|
||||
function InvalidAppError() {}
|
||||
|
||||
var GtkNotificationDaemonAppSource =
|
||||
var GtkNotificationDaemonAppSource =
|
||||
class GtkNotificationDaemonAppSource extends MessageTray.Source {
|
||||
constructor(appId) {
|
||||
let objectPath = objectPathFromAppId(appId);
|
||||
|
@@ -452,7 +452,7 @@ var Overview = class {
|
||||
this._desktopFade.show();
|
||||
this._desktopFade.ease({
|
||||
opacity: 0,
|
||||
mode: Clutter.Animates.EASE_OUT_QUAD,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
duration: ANIMATION_TIME
|
||||
});
|
||||
}
|
||||
|
@@ -14,8 +14,8 @@ var SIDE_CONTROLS_ANIMATION_TIME = 160;
|
||||
function getRtlSlideDirection(direction, actor) {
|
||||
let rtl = (actor.text_direction == Clutter.TextDirection.RTL);
|
||||
if (rtl)
|
||||
direction = (direction == SlideDirection.LEFT) ?
|
||||
SlideDirection.RIGHT : SlideDirection.LEFT;
|
||||
direction = (direction == SlideDirection.LEFT)
|
||||
? SlideDirection.RIGHT : SlideDirection.LEFT;
|
||||
|
||||
return direction;
|
||||
}
|
||||
@@ -67,8 +67,9 @@ var SlideLayout = GObject.registerClass({
|
||||
// flags only determine what to do if the allocated box is bigger
|
||||
// than the actor's box.
|
||||
let realDirection = getRtlSlideDirection(this._direction, child);
|
||||
let alignX = (realDirection == SlideDirection.LEFT) ? (availWidth - natWidth)
|
||||
: (availWidth - natWidth * this._slideX);
|
||||
let alignX = (realDirection == SlideDirection.LEFT)
|
||||
? availWidth - natWidth
|
||||
: availWidth - natWidth * this._slideX;
|
||||
|
||||
let actorBox = new Clutter.ActorBox();
|
||||
actorBox.x1 = box.x1 + alignX + this._translationX;
|
||||
|
@@ -126,12 +126,14 @@ class AnimatedPageIndicators extends PageIndicators {
|
||||
offset = children[0].width;
|
||||
|
||||
let isAnimationIn = animationDirection == AnimationDirection.IN;
|
||||
let delay = isAnimationIn ? INDICATORS_ANIMATION_DELAY :
|
||||
INDICATORS_ANIMATION_DELAY_OUT;
|
||||
let delay = isAnimationIn
|
||||
? INDICATORS_ANIMATION_DELAY
|
||||
: INDICATORS_ANIMATION_DELAY_OUT;
|
||||
let baseTime = isAnimationIn ? INDICATORS_BASE_TIME : INDICATORS_BASE_TIME_OUT;
|
||||
let totalAnimationTime = baseTime + delay * this._nPages;
|
||||
let maxTime = isAnimationIn ? INDICATORS_ANIMATION_MAX_TIME :
|
||||
INDICATORS_ANIMATION_MAX_TIME_OUT;
|
||||
let maxTime = isAnimationIn
|
||||
? INDICATORS_ANIMATION_MAX_TIME
|
||||
: INDICATORS_ANIMATION_MAX_TIME_OUT;
|
||||
if (totalAnimationTime > maxTime)
|
||||
delay -= (totalAnimationTime - maxTime) / this._nPages;
|
||||
|
||||
|
@@ -15,6 +15,7 @@ var Ornament = {
|
||||
NONE: 0,
|
||||
DOT: 1,
|
||||
CHECK: 2,
|
||||
HIDDEN: 3,
|
||||
};
|
||||
|
||||
function isPopupMenuItemVisible(child) {
|
||||
@@ -248,10 +249,12 @@ var PopupBaseMenuItem = GObject.registerClass({
|
||||
} else if (ornament == Ornament.CHECK) {
|
||||
this._ornamentLabel.text = '\u2713';
|
||||
this.add_accessible_state(Atk.StateType.CHECKED);
|
||||
} else if (ornament == Ornament.NONE) {
|
||||
} else if (ornament == Ornament.NONE || ornament == Ornament.HIDDEN) {
|
||||
this._ornamentLabel.text = '';
|
||||
this.remove_accessible_state(Atk.StateType.CHECKED);
|
||||
}
|
||||
|
||||
this._ornamentLabel.visible = ornament != Ornament.HIDDEN;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -425,6 +428,7 @@ var PopupMenuBase = class {
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
this.sourceActor = sourceActor;
|
||||
this.focusActor = sourceActor;
|
||||
this._parent = null;
|
||||
|
||||
if (styleClass !== undefined) {
|
||||
@@ -549,7 +553,7 @@ var PopupMenuBase = class {
|
||||
}
|
||||
|
||||
_connectItemSignals(menuItem) {
|
||||
menuItem._activeChangeId = menuItem.connect('notify::active', (menuItem) => {
|
||||
menuItem._activeChangeId = menuItem.connect('notify::active', menuItem => {
|
||||
let active = menuItem.active;
|
||||
if (active && this._activeMenuItem != menuItem) {
|
||||
if (this._activeMenuItem)
|
||||
@@ -613,8 +617,8 @@ var PopupMenuBase = class {
|
||||
while (childBeforeIndex >= 0 && !isPopupMenuItemVisible(children[childBeforeIndex]))
|
||||
childBeforeIndex--;
|
||||
|
||||
if (childBeforeIndex < 0
|
||||
|| children[childBeforeIndex]._delegate instanceof PopupSeparatorMenuItem) {
|
||||
if (childBeforeIndex < 0 ||
|
||||
children[childBeforeIndex]._delegate instanceof PopupSeparatorMenuItem) {
|
||||
menuItem.actor.hide();
|
||||
return;
|
||||
}
|
||||
@@ -624,8 +628,8 @@ var PopupMenuBase = class {
|
||||
while (childAfterIndex < children.length && !isPopupMenuItemVisible(children[childAfterIndex]))
|
||||
childAfterIndex++;
|
||||
|
||||
if (childAfterIndex >= children.length
|
||||
|| children[childAfterIndex]._delegate instanceof PopupSeparatorMenuItem) {
|
||||
if (childAfterIndex >= children.length ||
|
||||
children[childAfterIndex]._delegate instanceof PopupSeparatorMenuItem) {
|
||||
menuItem.actor.hide();
|
||||
return;
|
||||
}
|
||||
@@ -718,10 +722,11 @@ var PopupMenuBase = class {
|
||||
this.disconnect(openStateChangeId);
|
||||
menuItem.disconnect(destroyId);
|
||||
});
|
||||
} else if (menuItem instanceof PopupBaseMenuItem)
|
||||
} else if (menuItem instanceof PopupBaseMenuItem) {
|
||||
this._connectItemSignals(menuItem);
|
||||
else
|
||||
} else {
|
||||
throw TypeError("Invalid argument to PopupMenuBase.addMenuItem()");
|
||||
}
|
||||
|
||||
menuItem._setParent(this);
|
||||
|
||||
@@ -1296,18 +1301,20 @@ var PopupMenuManager = class {
|
||||
if (open) {
|
||||
if (this.activeMenu)
|
||||
this.activeMenu.close(BoxPointer.PopupAnimation.FADE);
|
||||
this._grabHelper.grab({ actor: menu.actor, focus: menu.sourceActor,
|
||||
onUngrab: isUser => {
|
||||
this._closeMenu(isUser, menu);
|
||||
} });
|
||||
this._grabHelper.grab({
|
||||
actor: menu.actor,
|
||||
focus: menu.focusActor,
|
||||
onUngrab: isUser => this._closeMenu(isUser, menu),
|
||||
});
|
||||
} else {
|
||||
this._grabHelper.ungrab({ actor: menu.actor });
|
||||
}
|
||||
}
|
||||
|
||||
_changeMenu(newMenu) {
|
||||
newMenu.open(this.activeMenu ? BoxPointer.PopupAnimation.FADE
|
||||
: BoxPointer.PopupAnimation.FULL);
|
||||
newMenu.open(this.activeMenu
|
||||
? BoxPointer.PopupAnimation.FADE
|
||||
: BoxPointer.PopupAnimation.FULL);
|
||||
}
|
||||
|
||||
_onMenuSourceEnter(menu) {
|
||||
|
@@ -67,7 +67,7 @@ var Ripples = class Ripples {
|
||||
delay,
|
||||
duration,
|
||||
mode: Clutter.AnimationMode.LINEAR,
|
||||
onComplete: () => ripple.visible = false
|
||||
onComplete: () => (ripple.visible = false)
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -104,7 +104,7 @@ class RunDialog extends ModalDialog.ModalDialog {
|
||||
|
||||
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
|
||||
entry: this._entryText });
|
||||
this._entryText.connect('activate', (o) => {
|
||||
this._entryText.connect('activate', o => {
|
||||
this.popModal();
|
||||
this._run(o.get_text(),
|
||||
Clutter.get_current_event().get_state() & Clutter.ModifierType.CONTROL_MASK);
|
||||
|
@@ -173,8 +173,9 @@ var NotificationsBox = class {
|
||||
|
||||
let body = '';
|
||||
if (n.bannerBodyText) {
|
||||
body = n.bannerBodyMarkup ? n.bannerBodyText
|
||||
: GLib.markup_escape_text(n.bannerBodyText, -1);
|
||||
body = n.bannerBodyMarkup
|
||||
? n.bannerBodyText
|
||||
: GLib.markup_escape_text(n.bannerBodyText, -1);
|
||||
}
|
||||
|
||||
let label = new St.Label({ style_class: 'screen-shield-notification-count-text' });
|
||||
@@ -915,8 +916,8 @@ var ScreenShield = class {
|
||||
this._lockScreenGroup.hide();
|
||||
|
||||
if (this._dialog) {
|
||||
this._dialog.actor.grab_key_focus();
|
||||
this._dialog.actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
|
||||
this._dialog.grab_key_focus();
|
||||
this._dialog.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -116,8 +116,8 @@ var ScreenshotService = class {
|
||||
try {
|
||||
let [result, area, filenameUsed] =
|
||||
screenshot.screenshot_area_finish(res);
|
||||
this._onScreenshotComplete(result, area, filenameUsed,
|
||||
flash, invocation);
|
||||
this._onScreenshotComplete(
|
||||
result, area, filenameUsed, flash, invocation);
|
||||
} catch (e) {
|
||||
invocation.return_gerror (e);
|
||||
}
|
||||
@@ -134,8 +134,8 @@ var ScreenshotService = class {
|
||||
try {
|
||||
let [result, area, filenameUsed] =
|
||||
screenshot.screenshot_window_finish(res);
|
||||
this._onScreenshotComplete(result, area, filenameUsed,
|
||||
flash, invocation);
|
||||
this._onScreenshotComplete(
|
||||
result, area, filenameUsed, flash, invocation);
|
||||
} catch (e) {
|
||||
invocation.return_gerror (e);
|
||||
}
|
||||
@@ -152,8 +152,8 @@ var ScreenshotService = class {
|
||||
try {
|
||||
let [result, area, filenameUsed] =
|
||||
screenshot.screenshot_finish(res);
|
||||
this._onScreenshotComplete(result, area, filenameUsed,
|
||||
flash, invocation);
|
||||
this._onScreenshotComplete(
|
||||
result, area, filenameUsed, flash, invocation);
|
||||
} catch (e) {
|
||||
invocation.return_gerror (e);
|
||||
}
|
||||
|
@@ -317,7 +317,7 @@ async function runPerfScript(scriptModule, outputFile) {
|
||||
|
||||
for (let step of scriptModule.run()) {
|
||||
try {
|
||||
await step;
|
||||
await step; // eslint-disable-line no-await-in-loop
|
||||
} catch (err) {
|
||||
log(`Script failed: ${err}\n${err.stack}`);
|
||||
Meta.exit(Meta.ExitCode.ERROR);
|
||||
|
@@ -710,8 +710,9 @@ var SearchResults = class {
|
||||
navigateFocus(direction) {
|
||||
let rtl = this.actor.get_text_direction() == Clutter.TextDirection.RTL;
|
||||
if (direction == St.DirectionType.TAB_BACKWARD ||
|
||||
direction == (rtl ? St.DirectionType.RIGHT
|
||||
: St.DirectionType.LEFT) ||
|
||||
direction == (rtl
|
||||
? St.DirectionType.RIGHT
|
||||
: St.DirectionType.LEFT) ||
|
||||
direction == St.DirectionType.UP) {
|
||||
this.actor.navigate_focus(null, direction, false);
|
||||
return;
|
||||
|
@@ -92,11 +92,11 @@ const _modes = {
|
||||
isLocked: false,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
|
||||
components: Config.HAVE_NETWORKMANAGER ?
|
||||
['networkAgent', 'polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager'] :
|
||||
['polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager'],
|
||||
components: Config.HAVE_NETWORKMANAGER
|
||||
? ['networkAgent', 'polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager']
|
||||
: ['polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager'],
|
||||
|
||||
panel: {
|
||||
left: ['activities', 'appMenu'],
|
||||
|
@@ -202,7 +202,7 @@ var ShellMountOperation = class {
|
||||
_onShowUnmountProgress(op, message, timeLeft, bytesLeft) {
|
||||
if (!this._notifier)
|
||||
this._notifier = new ShellUnmountNotifier();
|
||||
|
||||
|
||||
if (bytesLeft == 0)
|
||||
this._notifier.done(message);
|
||||
else
|
||||
|
@@ -100,10 +100,15 @@ var Slider = GObject.registerClass({
|
||||
|
||||
_endDragging() {
|
||||
if (this._dragging) {
|
||||
if (this._releaseId)
|
||||
if (this._releaseId) {
|
||||
this.disconnect(this._releaseId);
|
||||
if (this._motionId)
|
||||
this._releaseId = 0;
|
||||
}
|
||||
|
||||
if (this._motionId) {
|
||||
this.disconnect(this._motionId);
|
||||
this._motionId = 0;
|
||||
}
|
||||
|
||||
if (this._grabbedSequence != null)
|
||||
this._grabbedDevice.sequence_ungrab(this._grabbedSequence);
|
||||
|
@@ -179,8 +179,8 @@ class ATIndicator extends PanelMenu.Button {
|
||||
settings.is_writable(KEY_TEXT_SCALING_FACTOR),
|
||||
enabled => {
|
||||
if (enabled)
|
||||
settings.set_double(KEY_TEXT_SCALING_FACTOR,
|
||||
DPI_FACTOR_LARGE);
|
||||
settings.set_double(
|
||||
KEY_TEXT_SCALING_FACTOR, DPI_FACTOR_LARGE);
|
||||
else
|
||||
settings.reset(KEY_TEXT_SCALING_FACTOR);
|
||||
});
|
||||
|
@@ -976,8 +976,8 @@ class InputSourceIndicator extends PanelMenu.Button {
|
||||
item.prop = prop;
|
||||
radioGroup.push(item);
|
||||
item.radioGroup = radioGroup;
|
||||
item.setOrnament(prop.get_state() == IBus.PropState.CHECKED ?
|
||||
PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
|
||||
item.setOrnament(prop.get_state() == IBus.PropState.CHECKED
|
||||
? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
|
||||
item.connect('activate', () => {
|
||||
if (item.prop.get_state() == IBus.PropState.CHECKED)
|
||||
return;
|
||||
|
@@ -168,8 +168,9 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
||||
|
||||
_updateMenuLabels() {
|
||||
if (this._settings.get_boolean(ENABLED)) {
|
||||
this._item.label.text = this._indicator.visible ? _("Location In Use")
|
||||
: _("Location Enabled");
|
||||
this._item.label.text = this._indicator.visible
|
||||
? _("Location In Use")
|
||||
: _("Location Enabled");
|
||||
this._onOffAction.label.text = _("Disable");
|
||||
} else {
|
||||
this._item.label.text = _("Location Disabled");
|
||||
|
@@ -909,8 +909,8 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
||||
this._client.activate_connection_async(connection, this._device, null, null, null);
|
||||
} else {
|
||||
let accessPoints = network.accessPoints;
|
||||
if ((accessPoints[0]._secType == NMAccessPointSecurity.WPA2_ENT)
|
||||
|| (accessPoints[0]._secType == NMAccessPointSecurity.WPA_ENT)) {
|
||||
if ((accessPoints[0]._secType == NMAccessPointSecurity.WPA2_ENT) ||
|
||||
(accessPoints[0]._secType == NMAccessPointSecurity.WPA_ENT)) {
|
||||
// 802.1x-enabled APs require further configuration, so they're
|
||||
// handled in gnome-control-center
|
||||
Util.spawn(['gnome-control-center', 'wifi', 'connect-8021x-wifi',
|
||||
@@ -1676,7 +1676,7 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
|
||||
'network-transmit-receive');
|
||||
this._source.policy = new MessageTray.NotificationApplicationPolicy('gnome-network-panel');
|
||||
|
||||
this._source.connect('destroy', () => this._source = null);
|
||||
this._source.connect('destroy', () => (this._source = null));
|
||||
Main.messageTray.add(this._source);
|
||||
}
|
||||
}
|
||||
@@ -1976,7 +1976,6 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
|
||||
// or we get to full connectivity through other means
|
||||
} else if (result == PortalHelperResult.COMPLETED) {
|
||||
this._closeConnectivityCheck(path);
|
||||
return;
|
||||
} else if (result == PortalHelperResult.RECHECK) {
|
||||
this._client.check_connectivity_async(null, (client, result) => {
|
||||
try {
|
||||
|
@@ -58,10 +58,12 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
||||
let visible = this._proxy.NightLightActive;
|
||||
let disabled = this._proxy.DisabledUntilTomorrow;
|
||||
|
||||
this._item.label.text = disabled ? _("Night Light Disabled")
|
||||
: _("Night Light On");
|
||||
this._disableItem.label.text = disabled ? _("Resume")
|
||||
: _("Disable Until Tomorrow");
|
||||
this._item.label.text = disabled
|
||||
? _("Night Light Disabled")
|
||||
: _("Night Light On");
|
||||
this._disableItem.label.text = disabled
|
||||
? _("Resume")
|
||||
: _("Disable Until Tomorrow");
|
||||
this._item.visible = this._indicator.visible = visible;
|
||||
}
|
||||
};
|
||||
|
@@ -33,7 +33,7 @@ var AltSwitcher = class {
|
||||
|
||||
this.actor = new St.Bin();
|
||||
this.actor.connect('destroy', this._onDestroy.bind(this));
|
||||
this.actor.connect('notify::mapped', () => this._flipped = false);
|
||||
this.actor.connect('notify::mapped', () => (this._flipped = false));
|
||||
}
|
||||
|
||||
_sync() {
|
||||
|
@@ -156,12 +156,12 @@ var AuthRobot = class {
|
||||
|
||||
/* check if authorization is enabled in the daemon. if not
|
||||
* we won't even bother authorizing, because we will only
|
||||
* get an error back. The exact contents of AuthMode might
|
||||
* get an error back. The exact contents of AuthMode might
|
||||
* change in the future, but must contain AuthMode.ENABLED
|
||||
* if it is enabled. */
|
||||
if (!cli.authMode.split('|').includes(AuthMode.ENABLED))
|
||||
return;
|
||||
|
||||
|
||||
/* check if we should enroll the device */
|
||||
let res = [false];
|
||||
this.emit('enroll-device', dev, res);
|
||||
@@ -260,7 +260,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
||||
if (!this._source) {
|
||||
this._source = new MessageTray.Source(_("Thunderbolt"),
|
||||
'thunderbolt-symbolic');
|
||||
this._source.connect('destroy', () => this._source = null);
|
||||
this._source.connect('destroy', () => (this._source = null));
|
||||
|
||||
Main.messageTray.add(this._source);
|
||||
}
|
||||
|
@@ -228,9 +228,9 @@ var OutputStreamSlider = class extends StreamSlider {
|
||||
}
|
||||
|
||||
_updateSliderIcon() {
|
||||
this._icon.icon_name = (this._hasHeadphones ?
|
||||
'audio-headphones-symbolic' :
|
||||
'audio-speakers-symbolic');
|
||||
this._icon.icon_name = (this._hasHeadphones
|
||||
? 'audio-headphones-symbolic'
|
||||
: 'audio-speakers-symbolic');
|
||||
}
|
||||
|
||||
_portChanged() {
|
||||
@@ -259,18 +259,17 @@ var InputStreamSlider = class extends StreamSlider {
|
||||
_maybeShowInput() {
|
||||
// only show input widgets if any application is recording audio
|
||||
let showInput = false;
|
||||
let recordingApps = this._control.get_source_outputs();
|
||||
if (this._stream && recordingApps) {
|
||||
for (let i = 0; i < recordingApps.length; i++) {
|
||||
let outputStream = recordingApps[i];
|
||||
let id = outputStream.get_application_id();
|
||||
// but skip gnome-volume-control and pavucontrol
|
||||
// (that appear as recording because they show the input level)
|
||||
if (!id || (id != 'org.gnome.VolumeControl' && id != 'org.PulseAudio.pavucontrol')) {
|
||||
showInput = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this._stream) {
|
||||
// skip gnome-volume-control and pavucontrol which appear
|
||||
// as recording because they show the input level
|
||||
let skippedApps = [
|
||||
'org.gnome.VolumeControl',
|
||||
'org.PulseAudio.pavucontrol'
|
||||
];
|
||||
|
||||
showInput = this._control.get_source_outputs().some(output => {
|
||||
return !skippedApps.includes(output.get_application_id());
|
||||
});
|
||||
}
|
||||
|
||||
this._showInput = showInput;
|
||||
|
@@ -2,8 +2,7 @@
|
||||
/* exported UnlockDialog */
|
||||
|
||||
const { AccountsService, Atk, Clutter,
|
||||
Gdm, Gio, GLib, Meta, Shell, St } = imports.gi;
|
||||
const Signals = imports.signals;
|
||||
Gdm, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||
|
||||
const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
@@ -13,15 +12,19 @@ const AuthPrompt = imports.gdm.authPrompt;
|
||||
// The timeout before going back automatically to the lock screen (in seconds)
|
||||
const IDLE_TIMEOUT = 2 * 60;
|
||||
|
||||
var UnlockDialog = class {
|
||||
constructor(parentActor) {
|
||||
this.actor = new St.Widget({ accessible_role: Atk.Role.WINDOW,
|
||||
style_class: 'login-dialog',
|
||||
layout_manager: new Clutter.BoxLayout(),
|
||||
visible: false });
|
||||
var UnlockDialog = GObject.registerClass({
|
||||
Signals: { 'failed': {} },
|
||||
}, class UnlockDialog extends St.Widget {
|
||||
_init(parentActor) {
|
||||
super._init({
|
||||
accessible_role: Atk.Role.WINDOW,
|
||||
style_class: 'login-dialog',
|
||||
layout_manager: new Clutter.BoxLayout(),
|
||||
visible: false,
|
||||
});
|
||||
|
||||
this.actor.add_constraint(new Layout.MonitorConstraint({ primary: true }));
|
||||
parentActor.add_child(this.actor);
|
||||
this.add_constraint(new Layout.MonitorConstraint({ primary: true }));
|
||||
parentActor.add_child(this);
|
||||
|
||||
this._userManager = AccountsService.UserManager.get_default();
|
||||
this._userName = GLib.get_user_name();
|
||||
@@ -32,7 +35,7 @@ var UnlockDialog = class {
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
x_expand: true,
|
||||
y_expand: true });
|
||||
this.actor.add_child(this._promptBox);
|
||||
this.add_child(this._promptBox);
|
||||
|
||||
this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
|
||||
this._authPrompt.connect('failed', this._fail.bind(this));
|
||||
@@ -64,10 +67,12 @@ var UnlockDialog = class {
|
||||
this._authPrompt.reset();
|
||||
this._updateSensitivity(true);
|
||||
|
||||
Main.ctrlAltTabManager.addGroup(this.actor, _("Unlock Window"), 'dialog-password-symbolic');
|
||||
Main.ctrlAltTabManager.addGroup(this, _("Unlock Window"), 'dialog-password-symbolic');
|
||||
|
||||
this._idleMonitor = Meta.IdleMonitor.get_core();
|
||||
this._idleWatchId = this._idleMonitor.add_idle_watch(IDLE_TIMEOUT * 1000, this._escape.bind(this));
|
||||
|
||||
this.connect('destroy', this._onDestroy.bind(this));
|
||||
}
|
||||
|
||||
_updateSensitivity(sensitive) {
|
||||
@@ -106,9 +111,8 @@ var UnlockDialog = class {
|
||||
this._authPrompt.cancel();
|
||||
}
|
||||
|
||||
destroy() {
|
||||
_onDestroy() {
|
||||
this.popModal();
|
||||
this.actor.destroy();
|
||||
|
||||
if (this._idleWatchId) {
|
||||
this._idleMonitor.remove_watch(this._idleWatchId);
|
||||
@@ -131,13 +135,16 @@ var UnlockDialog = class {
|
||||
}
|
||||
|
||||
open(timestamp) {
|
||||
this.actor.show();
|
||||
this.show();
|
||||
|
||||
if (this._isModal)
|
||||
return true;
|
||||
|
||||
if (!Main.pushModal(this.actor, { timestamp: timestamp,
|
||||
actionMode: Shell.ActionMode.UNLOCK_SCREEN }))
|
||||
let modalParams = {
|
||||
timestamp,
|
||||
actionMode: Shell.ActionMode.UNLOCK_SCREEN,
|
||||
};
|
||||
if (!Main.pushModal(this, modalParams))
|
||||
return false;
|
||||
|
||||
this._isModal = true;
|
||||
@@ -147,9 +154,8 @@ var UnlockDialog = class {
|
||||
|
||||
popModal(timestamp) {
|
||||
if (this._isModal) {
|
||||
Main.popModal(this.actor, timestamp);
|
||||
Main.popModal(this, timestamp);
|
||||
this._isModal = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(UnlockDialog.prototype);
|
||||
});
|
||||
|
@@ -389,8 +389,8 @@ var ViewSelector = class {
|
||||
}
|
||||
|
||||
_onShowAppsButtonToggled() {
|
||||
this._showPage(this._showAppsButton.checked ?
|
||||
this._appsPage : this._workspacesPage);
|
||||
this._showPage(this._showAppsButton.checked
|
||||
? this._appsPage : this._workspacesPage);
|
||||
}
|
||||
|
||||
_onStageKeyPress(actor, event) {
|
||||
@@ -424,8 +424,9 @@ var ViewSelector = class {
|
||||
}
|
||||
|
||||
_searchCancelled() {
|
||||
this._showPage(this._showAppsButton.checked ? this._appsPage
|
||||
: this._workspacesPage);
|
||||
this._showPage(this._showAppsButton.checked
|
||||
? this._appsPage
|
||||
: this._workspacesPage);
|
||||
|
||||
// Leave the entry focused when it doesn't have any text;
|
||||
// when replacing a selected search term, Clutter emits
|
||||
@@ -576,6 +577,7 @@ var ViewSelector = class {
|
||||
if (event.type() == Clutter.EventType.BUTTON_PRESS) {
|
||||
let source = event.get_source();
|
||||
if (source != this._text &&
|
||||
this._text.has_key_focus() &&
|
||||
this._text.text == '' &&
|
||||
!this._text.has_preedit () &&
|
||||
!Main.layoutManager.keyboardBox.contains(source)) {
|
||||
|
@@ -630,9 +630,9 @@ var AppSwitchAction = GObject.registerClass({
|
||||
let nPoints = this.get_n_current_points();
|
||||
let event = this.get_last_event (nPoints - 1);
|
||||
|
||||
if (nPoints == 3)
|
||||
if (nPoints == 3) {
|
||||
this._longPressStartTime = event.get_time();
|
||||
else if (nPoints == 4) {
|
||||
} else if (nPoints == 4) {
|
||||
// Check whether the 4th finger press happens after a 3-finger long press,
|
||||
// this only needs to be checked on the first 4th finger press
|
||||
if (this._longPressStartTime != null &&
|
||||
@@ -713,7 +713,7 @@ var WindowManager = class {
|
||||
this._isWorkspacePrepended = false;
|
||||
|
||||
this._switchData = null;
|
||||
this._shellwm.connect('kill-switch-workspace', (shellwm) => {
|
||||
this._shellwm.connect('kill-switch-workspace', shellwm => {
|
||||
if (this._switchData) {
|
||||
if (this._switchData.inProgress)
|
||||
this._switchWorkspaceDone(shellwm);
|
||||
@@ -1022,7 +1022,6 @@ var WindowManager = class {
|
||||
(proxy, error) => {
|
||||
if (error) {
|
||||
log(error.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1115,7 +1114,7 @@ var WindowManager = class {
|
||||
|
||||
_showPadOsd(display, device, settings, imagePath, editionMode, monitorIndex) {
|
||||
this._currentPadOsd = new PadOsd.PadOsd(device, settings, imagePath, editionMode, monitorIndex);
|
||||
this._currentPadOsd.connect('closed', () => this._currentPadOsd = null);
|
||||
this._currentPadOsd.connect('closed', () => (this._currentPadOsd = null));
|
||||
|
||||
return this._currentPadOsd.actor;
|
||||
}
|
||||
@@ -1682,7 +1681,6 @@ var WindowManager = class {
|
||||
break;
|
||||
default:
|
||||
shellwm.completed_map(actor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,7 +1761,6 @@ var WindowManager = class {
|
||||
break;
|
||||
default:
|
||||
shellwm.completed_destroy(actor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -178,7 +178,7 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
|
||||
}
|
||||
|
||||
let waitId = 0;
|
||||
let id = global.display.connect('grab-op-end', (display) => {
|
||||
let id = global.display.connect('grab-op-end', display => {
|
||||
display.disconnect(id);
|
||||
GLib.source_remove(waitId);
|
||||
|
||||
|
@@ -412,8 +412,6 @@ var WindowClone = GObject.registerClass({
|
||||
|
||||
_onDragBegin(_draggable, _time) {
|
||||
this._dragSlot = this._slot;
|
||||
[this.dragOrigX, this.dragOrigY] = this.get_position();
|
||||
this.dragOrigScale = this.scale_x;
|
||||
this.inDrag = true;
|
||||
this.emit('drag-begin');
|
||||
}
|
||||
@@ -423,7 +421,7 @@ var WindowClone = GObject.registerClass({
|
||||
}
|
||||
|
||||
acceptDrop(source, actor, x, y, time) {
|
||||
this._workspace.acceptDrop(source, actor, x, y, time);
|
||||
return this._workspace.acceptDrop(source, actor, x, y, time);
|
||||
}
|
||||
|
||||
_onDragCancelled(_draggable, _time) {
|
||||
@@ -468,7 +466,8 @@ var WindowOverlay = class {
|
||||
this.border = new St.Bin({ style_class: 'window-clone-border' });
|
||||
|
||||
this.title = new St.Label({ style_class: 'window-caption',
|
||||
text: this._getCaption() });
|
||||
text: this._getCaption(),
|
||||
reactive: true });
|
||||
this.title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
|
||||
windowClone.label_actor = this.title;
|
||||
|
||||
@@ -493,7 +492,6 @@ var WindowOverlay = class {
|
||||
this.closeButton.hide();
|
||||
|
||||
// Don't block drop targets
|
||||
Shell.util_set_hidden_from_pick(this.title, true);
|
||||
Shell.util_set_hidden_from_pick(this.border, true);
|
||||
|
||||
parentActor.add_actor(this.border);
|
||||
@@ -686,19 +684,22 @@ var WindowOverlay = class {
|
||||
}
|
||||
|
||||
_onHideChrome() {
|
||||
if (this._idleHideOverlayId == 0) {
|
||||
this._idleHideOverlayId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT, this._idleHideOverlay.bind(this));
|
||||
GLib.Source.set_name_by_id(this._idleHideOverlayId, '[gnome-shell] this._idleHideOverlay');
|
||||
}
|
||||
if (this._idleHideOverlayId > 0)
|
||||
GLib.source_remove(this._idleHideOverlayId);
|
||||
|
||||
this._idleHideOverlayId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT, this._idleHideOverlay.bind(this));
|
||||
GLib.Source.set_name_by_id(this._idleHideOverlayId, '[gnome-shell] this._idleHideOverlay');
|
||||
}
|
||||
|
||||
_idleHideOverlay() {
|
||||
this._idleHideOverlayId = 0;
|
||||
if (this.closeButton['has-pointer'] ||
|
||||
this.title['has-pointer'])
|
||||
return GLib.SOURCE_CONTINUE;
|
||||
|
||||
if (!this._windowClone['has-pointer'] &&
|
||||
!this.closeButton['has-pointer'])
|
||||
if (!this._windowClone['has-pointer'])
|
||||
this._animateInvisible();
|
||||
|
||||
this._idleHideOverlayId = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -903,7 +904,7 @@ var LayoutStrategy = class {
|
||||
computeWindowSlots(layout, area) {
|
||||
this._computeRowSizes(layout);
|
||||
|
||||
let { rows: rows, scale: scale } = layout;
|
||||
let { rows, scale } = layout;
|
||||
|
||||
let slots = [];
|
||||
|
||||
@@ -978,7 +979,7 @@ var LayoutStrategy = class {
|
||||
|
||||
var UnalignedLayoutStrategy = class extends LayoutStrategy {
|
||||
_computeRowSizes(layout) {
|
||||
let { rows: rows, scale: scale } = layout;
|
||||
let { rows, scale } = layout;
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
let row = rows[i];
|
||||
row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;
|
||||
@@ -1993,13 +1994,20 @@ var Workspace = class {
|
||||
handleDragOver(source, _actor, _x, _y, _time) {
|
||||
if (source.realWindow && !this._isMyWindow(source.realWindow))
|
||||
return DND.DragMotionResult.MOVE_DROP;
|
||||
if (source.shellWorkspaceLaunch)
|
||||
if (source.app && source.app.can_open_new_window())
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
if (!source.app && source.shellWorkspaceLaunch)
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
}
|
||||
|
||||
acceptDrop(source, actor, x, y, time) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
let workspaceIndex = this.metaWorkspace
|
||||
? this.metaWorkspace.index()
|
||||
: workspaceManager.get_active_workspace_index();
|
||||
|
||||
if (source.realWindow) {
|
||||
let win = source.realWindow;
|
||||
if (this._isMyWindow(win))
|
||||
@@ -2021,12 +2029,18 @@ var Workspace = class {
|
||||
if (metaWindow.get_monitor() != this.monitorIndex)
|
||||
metaWindow.move_to_monitor(this.monitorIndex);
|
||||
|
||||
let workspaceManager = global.workspace_manager;
|
||||
let index = this.metaWorkspace ? this.metaWorkspace.index() : workspaceManager.get_active_workspace_index();
|
||||
metaWindow.change_workspace_by_index(index, false);
|
||||
metaWindow.change_workspace_by_index(workspaceIndex, false);
|
||||
return true;
|
||||
} else if (source.shellWorkspaceLaunch) {
|
||||
source.shellWorkspaceLaunch({ workspace: this.metaWorkspace ? this.metaWorkspace.index() : -1,
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
if (source.animateLaunchAtPos)
|
||||
source.animateLaunchAtPos(actor.x, actor.y);
|
||||
|
||||
source.app.open_new_window(workspaceIndex);
|
||||
return true;
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||
// extensions to define custom actions for their drag sources.
|
||||
source.shellWorkspaceLaunch({ workspace: workspaceIndex,
|
||||
timestamp: time });
|
||||
return true;
|
||||
}
|
||||
|
@@ -561,7 +561,7 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
}
|
||||
|
||||
// Draggable target interface used only by ThumbnailsBox
|
||||
handleDragOverInternal(source, time) {
|
||||
handleDragOverInternal(source, actor, time) {
|
||||
if (source == Main.xdndHandler) {
|
||||
this.metaWorkspace.activate(time);
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
@@ -572,13 +572,15 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
|
||||
if (source.realWindow && !this._isMyWindow(source.realWindow))
|
||||
return DND.DragMotionResult.MOVE_DROP;
|
||||
if (source.shellWorkspaceLaunch)
|
||||
if (source.app && source.app.can_open_new_window())
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
if (!source.app && source.shellWorkspaceLaunch)
|
||||
return DND.DragMotionResult.COPY_DROP;
|
||||
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
}
|
||||
|
||||
acceptDropInternal(source, time) {
|
||||
acceptDropInternal(source, actor, time) {
|
||||
if (this.state > ThumbnailState.NORMAL)
|
||||
return false;
|
||||
|
||||
@@ -597,8 +599,16 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
|
||||
metaWindow.change_workspace_by_index(this.metaWorkspace.index(), false);
|
||||
return true;
|
||||
} else if (source.shellWorkspaceLaunch) {
|
||||
source.shellWorkspaceLaunch({ workspace: this.metaWorkspace ? this.metaWorkspace.index() : -1,
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
if (source.animateLaunchAtPos)
|
||||
source.animateLaunchAtPos(actor.x, actor.y);
|
||||
|
||||
source.app.open_new_window(this.metaWorkspace.index());
|
||||
return true;
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||
// extensions to define custom actions for their drag sources.
|
||||
source.shellWorkspaceLaunch({ workspace: this.metaWorkspace.index(),
|
||||
timestamp: time });
|
||||
return true;
|
||||
}
|
||||
@@ -779,7 +789,10 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
|
||||
// Draggable target interface
|
||||
handleDragOver(source, actor, x, y, time) {
|
||||
if (!source.realWindow && !source.shellWorkspaceLaunch && source != Main.xdndHandler)
|
||||
if (!source.realWindow &&
|
||||
(!source.app || !source.app.can_open_new_window()) &&
|
||||
(source.app || !source.shellWorkspaceLaunch) &&
|
||||
source != Main.xdndHandler)
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
|
||||
let canCreateWorkspaces = Meta.prefs_get_dynamic_workspaces();
|
||||
@@ -825,7 +838,7 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
}
|
||||
|
||||
if (this._dropWorkspace != -1)
|
||||
return this._thumbnails[this._dropWorkspace].handleDragOverInternal(source, time);
|
||||
return this._thumbnails[this._dropWorkspace].handleDragOverInternal(source, actor, time);
|
||||
else if (this._dropPlaceholderPos != -1)
|
||||
return source.realWindow ? DND.DragMotionResult.MOVE_DROP : DND.DragMotionResult.COPY_DROP;
|
||||
else
|
||||
@@ -834,9 +847,11 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
|
||||
acceptDrop(source, actor, x, y, time) {
|
||||
if (this._dropWorkspace != -1) {
|
||||
return this._thumbnails[this._dropWorkspace].acceptDropInternal(source, time);
|
||||
return this._thumbnails[this._dropWorkspace].acceptDropInternal(source, actor, time);
|
||||
} else if (this._dropPlaceholderPos != -1) {
|
||||
if (!source.realWindow && !source.shellWorkspaceLaunch)
|
||||
if (!source.realWindow &&
|
||||
(!source.app || !source.app.can_open_new_window()) &&
|
||||
(source.app || !source.shellWorkspaceLaunch))
|
||||
return false;
|
||||
|
||||
let isWindow = !!source.realWindow;
|
||||
@@ -853,9 +868,19 @@ var ThumbnailsBox = GObject.registerClass({
|
||||
if (source.metaWindow.get_monitor() != thumbMonitor)
|
||||
source.metaWindow.move_to_monitor(thumbMonitor);
|
||||
source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true);
|
||||
} else if (source.shellWorkspaceLaunch) {
|
||||
} else if (source.app && source.app.can_open_new_window()) {
|
||||
if (source.animateLaunchAtPos)
|
||||
source.animateLaunchAtPos(actor.x, actor.y);
|
||||
|
||||
source.app.open_new_window(newWorkspaceIndex);
|
||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||
// extensions to define custom actions for their drag sources.
|
||||
source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex,
|
||||
timestamp: time });
|
||||
}
|
||||
|
||||
if (source.app || (!source.app && source.shellWorkspaceLaunch)) {
|
||||
// This new workspace will be automatically removed if the application fails
|
||||
// to open its first window within some time, as tracked by Shell.WindowTracker.
|
||||
// Here, we only add a very brief timeout to avoid the _immediate_ removal of the
|
||||
|
@@ -247,7 +247,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
||||
this.scrollAdjustment.ease(index, {
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
duration: WORKSPACE_SWITCH_TIME,
|
||||
onComplete: () => this._animatingScroll = false
|
||||
onComplete: () => (this._animatingScroll = false)
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,6 @@
|
||||
4,
|
||||
{
|
||||
"ignoredNodes": [
|
||||
"ConditionalExpression",
|
||||
"CallExpression > ArrowFunctionExpression",
|
||||
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
|
||||
],
|
||||
"CallExpression": { "arguments": "first" },
|
||||
|
@@ -532,7 +532,9 @@ main (int argc, char **argv)
|
||||
shell_init_debug (g_getenv ("SHELL_DEBUG"));
|
||||
|
||||
shell_dbus_init (meta_get_replace_current_wm ());
|
||||
sd_notify (0, "READY=1");
|
||||
/* We only use NOTIFY_SOCKET exactly once; unset it so it doesn't remain in
|
||||
* our environment. */
|
||||
sd_notify (1, "READY=1");
|
||||
shell_a11y_init ();
|
||||
shell_perf_log_init ();
|
||||
shell_introspection_init ();
|
||||
|
@@ -604,10 +604,12 @@ shell_app_can_open_new_window (ShellApp *app)
|
||||
GDesktopAppInfo *desktop_info;
|
||||
const char * const *desktop_actions;
|
||||
|
||||
/* Apps that are not running can always open new windows, because
|
||||
activating them would open the first one */
|
||||
if (!app->running_state)
|
||||
return TRUE;
|
||||
/* Apps that are stopped can always open new windows, because
|
||||
* activating them would open the first one; if they are starting,
|
||||
* we cannot tell whether they can open additional windows until
|
||||
* they are running */
|
||||
if (app->state != SHELL_APP_STATE_RUNNING)
|
||||
return app->state == SHELL_APP_STATE_STOPPED;
|
||||
|
||||
state = app->running_state;
|
||||
|
||||
|
@@ -419,7 +419,7 @@ canvas_draw_cb (ClutterContent *content,
|
||||
* @window_actor: a #MetaWindowActor
|
||||
* @window_rect: a #MetaRectangle
|
||||
*
|
||||
* Returns: (transfer full): a new #ClutterContent
|
||||
* Returns: (transfer full) (nullable): a new #ClutterContent
|
||||
*/
|
||||
ClutterContent *
|
||||
shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
|
||||
@@ -429,28 +429,23 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
|
||||
cairo_surface_t *surface;
|
||||
cairo_rectangle_int_t clip;
|
||||
gfloat actor_x, actor_y;
|
||||
gfloat resource_scale;
|
||||
|
||||
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
|
||||
|
||||
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
|
||||
&resource_scale))
|
||||
{
|
||||
resource_scale = 1.0;
|
||||
g_warning ("Actor resource scale is not know at this point, "
|
||||
"falling back to default 1.0");
|
||||
}
|
||||
|
||||
clip.x = window_rect->x - (gint) actor_x;
|
||||
clip.y = window_rect->y - (gint) actor_y;
|
||||
clip.width = ceilf (window_rect->width * resource_scale);
|
||||
clip.height = ceilf (window_rect->height * resource_scale);
|
||||
clip.width = window_rect->width;
|
||||
clip.height = window_rect->height;
|
||||
|
||||
surface = meta_window_actor_get_image (window_actor, &clip);
|
||||
|
||||
if (!surface)
|
||||
return NULL;
|
||||
|
||||
content = clutter_canvas_new ();
|
||||
clutter_canvas_set_size (CLUTTER_CANVAS (content),
|
||||
clip.width, clip.height);
|
||||
cairo_image_surface_get_width (surface),
|
||||
cairo_image_surface_get_height (surface));
|
||||
g_signal_connect (content, "draw",
|
||||
G_CALLBACK (canvas_draw_cb), surface);
|
||||
clutter_content_invalidate (content);
|
||||
|
@@ -1472,6 +1472,7 @@ st_theme_node_invalidate_resources_for_file (StThemeNode *node,
|
||||
return changed;
|
||||
}
|
||||
|
||||
static void st_theme_node_compute_maximum_borders (StThemeNodePaintState *state);
|
||||
static void st_theme_node_prerender_shadow (StThemeNodePaintState *state);
|
||||
|
||||
static void
|
||||
@@ -1575,6 +1576,8 @@ st_theme_node_render_resources (StThemeNodePaintState *state,
|
||||
|
||||
if (box_shadow_spec && !has_inset_box_shadow)
|
||||
{
|
||||
st_theme_node_compute_maximum_borders (state);
|
||||
|
||||
if (st_theme_node_load_border_image (node, resource_scale))
|
||||
state->box_shadow_pipeline = _st_create_shadow_pipeline (box_shadow_spec,
|
||||
node->border_slices_texture,
|
||||
@@ -2282,9 +2285,6 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
|
||||
{
|
||||
StThemeNode *node = state->node;
|
||||
CoglContext *ctx;
|
||||
guint border_radius[4];
|
||||
int max_borders[4];
|
||||
int center_radius, corner_id;
|
||||
int fb_width, fb_height;
|
||||
CoglTexture *buffer;
|
||||
CoglFramebuffer *offscreen = NULL;
|
||||
@@ -2292,40 +2292,6 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
|
||||
|
||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
/* Get infos from the node */
|
||||
if (state->alloc_width < node->box_shadow_min_width ||
|
||||
state->alloc_height < node->box_shadow_min_height)
|
||||
st_theme_node_reduce_border_radius (node, state->alloc_width, state->alloc_height, border_radius);
|
||||
else
|
||||
for (corner_id = 0; corner_id < 4; corner_id++)
|
||||
border_radius[corner_id] = node->border_radius[corner_id];
|
||||
|
||||
/* Compute maximum borders sizes */
|
||||
max_borders[ST_SIDE_TOP] = MAX (node->border_radius[ST_CORNER_TOPLEFT],
|
||||
node->border_radius[ST_CORNER_TOPRIGHT]);
|
||||
max_borders[ST_SIDE_BOTTOM] = MAX (node->border_radius[ST_CORNER_BOTTOMLEFT],
|
||||
node->border_radius[ST_CORNER_BOTTOMRIGHT]);
|
||||
max_borders[ST_SIDE_LEFT] = MAX (node->border_radius[ST_CORNER_TOPLEFT],
|
||||
node->border_radius[ST_CORNER_BOTTOMLEFT]);
|
||||
max_borders[ST_SIDE_RIGHT] = MAX (node->border_radius[ST_CORNER_TOPRIGHT],
|
||||
node->border_radius[ST_CORNER_BOTTOMRIGHT]);
|
||||
|
||||
center_radius = (node->box_shadow->blur > 0) ? (2 * node->box_shadow->blur + 1) : 1;
|
||||
node->box_shadow_min_width = max_borders[ST_SIDE_LEFT] + max_borders[ST_SIDE_RIGHT] + center_radius;
|
||||
node->box_shadow_min_height = max_borders[ST_SIDE_TOP] + max_borders[ST_SIDE_BOTTOM] + center_radius;
|
||||
|
||||
if (state->alloc_width < node->box_shadow_min_width ||
|
||||
state->alloc_height < node->box_shadow_min_height)
|
||||
{
|
||||
state->box_shadow_width = state->alloc_width;
|
||||
state->box_shadow_height = state->alloc_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->box_shadow_width = node->box_shadow_min_width;
|
||||
state->box_shadow_height = node->box_shadow_min_height;
|
||||
}
|
||||
|
||||
/* Render offscreen */
|
||||
fb_width = ceilf (state->box_shadow_width * state->resource_scale);
|
||||
fb_height = ceilf (state->box_shadow_height * state->resource_scale);
|
||||
@@ -2357,6 +2323,39 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
|
||||
cogl_clear_object (&buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
st_theme_node_compute_maximum_borders (StThemeNodePaintState *state)
|
||||
{
|
||||
int max_borders[4], center_radius;
|
||||
StThemeNode * node = state->node;
|
||||
|
||||
/* Compute maximum borders sizes */
|
||||
max_borders[ST_SIDE_TOP] = MAX (node->border_radius[ST_CORNER_TOPLEFT],
|
||||
node->border_radius[ST_CORNER_TOPRIGHT]);
|
||||
max_borders[ST_SIDE_BOTTOM] = MAX (node->border_radius[ST_CORNER_BOTTOMLEFT],
|
||||
node->border_radius[ST_CORNER_BOTTOMRIGHT]);
|
||||
max_borders[ST_SIDE_LEFT] = MAX (node->border_radius[ST_CORNER_TOPLEFT],
|
||||
node->border_radius[ST_CORNER_BOTTOMLEFT]);
|
||||
max_borders[ST_SIDE_RIGHT] = MAX (node->border_radius[ST_CORNER_TOPRIGHT],
|
||||
node->border_radius[ST_CORNER_BOTTOMRIGHT]);
|
||||
|
||||
center_radius = (node->box_shadow->blur > 0) ? (2 * node->box_shadow->blur + 1) : 1;
|
||||
|
||||
node->box_shadow_min_width = max_borders[ST_SIDE_LEFT] + max_borders[ST_SIDE_RIGHT] + center_radius;
|
||||
node->box_shadow_min_height = max_borders[ST_SIDE_TOP] + max_borders[ST_SIDE_BOTTOM] + center_radius;
|
||||
if (state->alloc_width < node->box_shadow_min_width ||
|
||||
state->alloc_height < node->box_shadow_min_height)
|
||||
{
|
||||
state->box_shadow_width = state->alloc_width;
|
||||
state->box_shadow_height = state->alloc_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->box_shadow_width = node->box_shadow_min_width;
|
||||
state->box_shadow_height = node->box_shadow_min_height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_theme_node_paint_sliced_border_image (StThemeNode *node,
|
||||
CoglFramebuffer *framebuffer,
|
||||
|
@@ -42,6 +42,8 @@ const tests = [
|
||||
output: [ { url: 'https://www.gnome.org/(some_url,_with_very_unusual_characters)', pos: 0 } ] },
|
||||
{ input: 'https://www.gnome.org/(some_url_with_unbalanced_parenthesis',
|
||||
output: [ { url: 'https://www.gnome.org/', pos: 0 } ] },
|
||||
{ input: 'https://www.gnome.org/ plus trailing junk',
|
||||
output: [ { url: 'https://www.gnome.org/', pos: 0 } ] },
|
||||
|
||||
{ input: 'Visit http://www.gnome.org/ and http://developer.gnome.org',
|
||||
output: [ { url: 'http://www.gnome.org/', pos: 6 },
|
||||
|
Reference in New Issue
Block a user