Compare commits
41 Commits
issue369
...
gbsneto/mo
Author | SHA1 | Date | |
---|---|---|---|
602cec9b8e | |||
08464eadff | |||
49e56776e8 | |||
043667dde5 | |||
f583a7c6d8 | |||
2d908e80fc | |||
8f0e9abe47 | |||
1a27ff6130 | |||
3f2cffc2e6 | |||
a78527050a | |||
a823a213ba | |||
2c8d380e67 | |||
3996309f8a | |||
bd18313d12 | |||
2ff7a78b56 | |||
c765082f72 | |||
7d2c5c1ac9 | |||
404bc34089 | |||
16ca7a21a7 | |||
1b31fd5afe | |||
e0457b6dc4 | |||
42b77e7ba5 | |||
f6bed08993 | |||
5f77cdb0b9 | |||
109b8e8f38 | |||
4c0bd88a2c | |||
3731be9947 | |||
6cc19ee6f0 | |||
1570f838f3 | |||
74feb110b5 | |||
6ba03ac2a6 | |||
55c717c2dc | |||
355b5eebec | |||
51938c398a | |||
dbb71f0dfc | |||
1cac7b2218 | |||
ff9bb5399b | |||
68e45eb051 | |||
d0da96ad29 | |||
55b036170b | |||
5473637736 |
6
.eslintrc.json
Normal file
6
.eslintrc.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": [
|
||||
"./lint/eslintrc-gjs.json",
|
||||
"./lint/eslintrc-shell.json"
|
||||
]
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
<method name="ShowOSD">
|
||||
<arg type="a{sv}" direction="in" name="params"/>
|
||||
</method>
|
||||
<method name="ShowMonitorLabels2">
|
||||
<method name="ShowMonitorLabels">
|
||||
<arg type="a{sv}" direction="in" name="params"/>
|
||||
</method>
|
||||
<method name="HideMonitorLabels"/>
|
||||
|
@ -619,6 +619,22 @@ StScrollBar {
|
||||
app menu inside the main app window itself rather than the top bar
|
||||
*/
|
||||
|
||||
/*************
|
||||
* App Icons *
|
||||
*************/
|
||||
/* Outline for low res icons */
|
||||
.lowres-icon {
|
||||
icon-shadow: 0 -1px rgba(0,0,0,0.05),
|
||||
1px 0 rgba(0,0,0,0.1),
|
||||
0 1px rgba(0,0,0,0.3),
|
||||
-1px 0 rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
/* Drapshadow for large icons */
|
||||
.icon-dropshadow {
|
||||
icon-shadow: 0 2px 12px rgba(0,0,0,0.1),
|
||||
0 1px 2px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
/* OSD */
|
||||
.osd-window {
|
||||
@ -1326,8 +1342,8 @@ StScrollBar {
|
||||
|
||||
.window-clone-border {
|
||||
$_bg: transparentize(white, 0.65);
|
||||
border: 5px solid $_bg;
|
||||
border-radius: 6px;
|
||||
border: 7px solid $_bg;
|
||||
border-radius: $modal_radius;
|
||||
// For window decorations with round corners we can't match
|
||||
// the exact shape when the window is scaled. So apply a shadow
|
||||
// to fix that case
|
||||
@ -1364,11 +1380,8 @@ StScrollBar {
|
||||
|
||||
//search results
|
||||
|
||||
#searchResultsBin {
|
||||
max-width: 1000px;
|
||||
}
|
||||
|
||||
#searchResultsContent {
|
||||
max-width: 1000px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
spacing: 16px;
|
||||
@ -1484,11 +1497,11 @@ StScrollBar {
|
||||
.search-provider-icon,
|
||||
.list-search-result {
|
||||
@extend %icon_tile;
|
||||
&:active, &:checked { background-color: transparentize(darken($osd_bg_color,10%),.1); }
|
||||
&:focus, &:selected, &:hover {
|
||||
background-color: transparentize($osd_fg_color,.9);
|
||||
transition-duration: 200ms;
|
||||
}
|
||||
&:active, &:checked { background-color: transparentize(darken($osd_bg_color,10%),.1); }
|
||||
}
|
||||
.app-well-app,
|
||||
.app-well-app.app-folder,
|
||||
@ -1497,10 +1510,6 @@ StScrollBar {
|
||||
& .overview-icon {
|
||||
@extend %icon_tile;
|
||||
}
|
||||
&:active .overview-icon,
|
||||
&:checked .overview-icon {
|
||||
background-color: transparentize(darken($osd_bg_color,10%), 0.5);
|
||||
}
|
||||
&:hover .overview-icon,
|
||||
&:focus .overview-icon,
|
||||
&:selected .overview-icon {
|
||||
@ -1509,7 +1518,10 @@ StScrollBar {
|
||||
border-image: none;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
&:active .overview-icon,
|
||||
&:checked .overview-icon {
|
||||
background-color: transparentize(darken($osd_bg_color,10%), 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.app-well-app-running-dot { //running apps indicator
|
||||
@ -1599,7 +1611,6 @@ StScrollBar {
|
||||
}
|
||||
|
||||
//Some hacks I don't even
|
||||
.search-display > StBoxLayout,
|
||||
.all-apps,
|
||||
.frequent-apps > StBoxLayout {
|
||||
// horizontal padding to make sure scrollbars or dash don't overlap content
|
||||
|
@ -151,11 +151,7 @@ function getAllProps(obj) {
|
||||
// e.g., expr="({ foo: null, bar: null, 4: null })" will
|
||||
// return ["foo", "bar", ...] but the list will not include "4",
|
||||
// since methods accessed with '.' notation must star with a letter or _.
|
||||
function getPropertyNamesFromExpression(expr, commandHeader) {
|
||||
if (commandHeader == null) {
|
||||
commandHeader = '';
|
||||
}
|
||||
|
||||
function getPropertyNamesFromExpression(expr, commandHeader = '') {
|
||||
let obj = {};
|
||||
if (!isUnsafeExpression(expr)) {
|
||||
try {
|
||||
|
@ -1,7 +1,5 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
const Lang = imports.lang;
|
||||
|
||||
// parse:
|
||||
// @params: caller-provided parameter object, or %null
|
||||
// @defaults-provided defaults object
|
||||
@ -23,7 +21,6 @@ function parse(params = {}, defaults, allowExtras) {
|
||||
throw new Error(`Unrecognized parameter "${prop}"`);
|
||||
}
|
||||
|
||||
let defaultsCopy = {};
|
||||
Lang.copyProperties(defaults, defaultsCopy);
|
||||
let defaultsCopy = Object.assign({}, defaults);
|
||||
return Object.assign(defaultsCopy, params);
|
||||
}
|
||||
|
@ -1416,7 +1416,7 @@ var AppFolderPopup = class AppFolderPopup {
|
||||
Signals.addSignalMethods(AppFolderPopup.prototype);
|
||||
|
||||
var AppIcon = class AppIcon {
|
||||
constructor(app, iconParams) {
|
||||
constructor(app, iconParams = {}) {
|
||||
this.app = app;
|
||||
this.id = app.get_id();
|
||||
this.name = app.get_name();
|
||||
@ -1442,9 +1442,6 @@ var AppIcon = class AppIcon {
|
||||
|
||||
this.actor._delegate = this;
|
||||
|
||||
if (!iconParams)
|
||||
iconParams = {};
|
||||
|
||||
// Get the isDraggable property without passing it on to the BaseIcon:
|
||||
let appIconParams = Params.parse(iconParams, { isDraggable: true }, true);
|
||||
let isDraggable = appIconParams['isDraggable'];
|
||||
@ -1713,7 +1710,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
||||
let appInfo = this._source.app.get_app_info();
|
||||
let actions = appInfo.list_actions();
|
||||
if (this._source.app.can_open_new_window() &&
|
||||
actions.includes('new-window')) {
|
||||
!actions.includes('new-window')) {
|
||||
this._newWindowMenuItem = this._appendMenuItem(_("New Window"));
|
||||
this._newWindowMenuItem.connect('activate', () => {
|
||||
if (this._source.app.state == Shell.AppState.STOPPED)
|
||||
@ -1727,7 +1724,7 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
||||
|
||||
if (discreteGpuAvailable &&
|
||||
this._source.app.state == Shell.AppState.STOPPED &&
|
||||
actions.includes('activate-discrete-gpu')) {
|
||||
!actions.includes('activate-discrete-gpu')) {
|
||||
this._onDiscreteGpuMenuItem = this._appendMenuItem(_("Launch using Dedicated Graphics Card"));
|
||||
this._onDiscreteGpuMenuItem.connect('activate', () => {
|
||||
if (this._source.app.state == Shell.AppState.STOPPED)
|
||||
|
@ -4,7 +4,7 @@ const { Atk, Clutter, St } = imports.gi;
|
||||
const Signals = imports.signals;
|
||||
|
||||
var BarLevel = class {
|
||||
constructor(value, params) {
|
||||
constructor(value, params = {}) {
|
||||
if (isNaN(value))
|
||||
// Avoid spreading NaNs around
|
||||
throw TypeError('The bar level value must be a number');
|
||||
@ -13,9 +13,6 @@ var BarLevel = class {
|
||||
this._overdriveStart = 1;
|
||||
this._barLevelWidth = 0;
|
||||
|
||||
if (params == undefined)
|
||||
params = {};
|
||||
|
||||
this.actor = new St.DrawingArea({ styleClass: params['styleClass'] || 'barlevel',
|
||||
can_focus: params['canFocus'] || false,
|
||||
reactive: params['reactive'] || false,
|
||||
|
@ -237,8 +237,7 @@ var DBusEventSource = class DBusEventSource {
|
||||
|
||||
_onEventsReceived(results, error) {
|
||||
let newEvents = [];
|
||||
let appointments = results ? results[0] : null;
|
||||
if (appointments != null) {
|
||||
let appointments = results[0] || [];
|
||||
for (let n = 0; n < appointments.length; n++) {
|
||||
let a = appointments[n];
|
||||
let date = new Date(a[4] * 1000);
|
||||
@ -250,7 +249,6 @@ var DBusEventSource = class DBusEventSource {
|
||||
newEvents.push(event);
|
||||
}
|
||||
newEvents.sort((ev1, ev2) => ev1.date.getTime() - ev2.date.getTime());
|
||||
}
|
||||
|
||||
this._events = newEvents;
|
||||
this.isLoading = false;
|
||||
|
@ -122,10 +122,7 @@ var ContentTypeDiscoverer = class {
|
||||
}
|
||||
}
|
||||
|
||||
_emitCallback(mount, contentTypes) {
|
||||
if (!contentTypes)
|
||||
contentTypes = [];
|
||||
|
||||
_emitCallback(mount, contentTypes = []) {
|
||||
// we're not interested in win32 software content types here
|
||||
contentTypes = contentTypes.filter(
|
||||
type => (type != 'x-content/win32-software')
|
||||
|
@ -180,10 +180,8 @@ var MessageDialogContent = GObject.registerClass({
|
||||
this._subtitle.clutter_text.set(textProps);
|
||||
this._body.clutter_text.set(textProps);
|
||||
|
||||
if (!params.hasOwnProperty('style_class'))
|
||||
params.style_class = 'message-dialog-main-layout';
|
||||
|
||||
super._init(params);
|
||||
let defaultParams = { style_class: 'message-dialog-main-layout' };
|
||||
super._init(Object.assign(defaultParams, params));
|
||||
|
||||
this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content',
|
||||
x_expand: true,
|
||||
|
@ -353,7 +353,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
||||
// It only makes sense to check for this permission if PackageKit is available.
|
||||
try {
|
||||
this._updatesPermission = Polkit.Permission.new_sync(
|
||||
"org.freedesktop.packagekit.trigger-offline-update", null, null);
|
||||
'org.freedesktop.packagekit.trigger-offline-update', null, null);
|
||||
} catch (e) {
|
||||
log('No permission to trigger offline updates: %s'.format(e.toString()));
|
||||
}
|
||||
|
@ -602,6 +602,8 @@ var IconGrid = GObject.registerClass({
|
||||
}
|
||||
|
||||
_computeLayout(forWidth) {
|
||||
this.ensure_style();
|
||||
|
||||
let nColumns = 0;
|
||||
let usedWidth = this.leftPadding + this.rightPadding;
|
||||
let spacing = this._getSpacing();
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||
const Signals = imports.signals;
|
||||
|
||||
const Background = imports.ui.background;
|
||||
@ -274,6 +274,13 @@ var LayoutManager = GObject.registerClass({
|
||||
this._backgroundGroup.lower_bottom();
|
||||
this._bgManagers = [];
|
||||
|
||||
this._interfaceSettings = new Gio.Settings({
|
||||
schema_id: 'org.gnome.desktop.interface'
|
||||
});
|
||||
|
||||
this._interfaceSettings.connect('changed::enable-hot-corners',
|
||||
this._updateHotCorners.bind(this));
|
||||
|
||||
// Need to update struts on new workspaces when they are added
|
||||
let workspaceManager = global.workspace_manager;
|
||||
workspaceManager.connect('notify::n-workspaces',
|
||||
@ -377,6 +384,11 @@ var LayoutManager = GObject.registerClass({
|
||||
});
|
||||
this.hotCorners = [];
|
||||
|
||||
if (!this._interfaceSettings.get_boolean('enable-hot-corners')) {
|
||||
this.emit('hot-corners-changed');
|
||||
return;
|
||||
}
|
||||
|
||||
let size = this.panelBox.height;
|
||||
|
||||
// build new hot corners
|
||||
@ -829,7 +841,7 @@ var LayoutManager = GObject.registerClass({
|
||||
// @params can have any of the same values as in addChrome(),
|
||||
// though some possibilities don't make sense. By default, @actor has
|
||||
// the same params as its chrome ancestor.
|
||||
trackChrome(actor, params) {
|
||||
trackChrome(actor, params = {}) {
|
||||
let ancestor = actor.get_parent();
|
||||
let index = this._findActor(ancestor);
|
||||
while (ancestor && index == -1) {
|
||||
@ -839,8 +851,6 @@ var LayoutManager = GObject.registerClass({
|
||||
|
||||
let ancestorData = ancestor ? this._trackedActors[index]
|
||||
: defaultParams;
|
||||
if (!params)
|
||||
params = {};
|
||||
// We can't use Params.parse here because we want to drop
|
||||
// the extra values like ancestorData.actor
|
||||
for (let prop in defaultParams) {
|
||||
|
@ -33,9 +33,7 @@ function _fixMarkup(text, allowMarkup) {
|
||||
}
|
||||
|
||||
var URLHighlighter = class URLHighlighter {
|
||||
constructor(text, lineWrap, allowMarkup) {
|
||||
if (!text)
|
||||
text = '';
|
||||
constructor(text = '', lineWrap, allowMarkup) {
|
||||
this.actor = new St.Label({ reactive: true, style_class: 'url-highlighter',
|
||||
x_expand: true, x_align: Clutter.ActorAlign.START });
|
||||
this._linkColor = '#ccccff';
|
||||
|
@ -473,9 +473,7 @@ var Notification = class Notification {
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
destroy(reason) {
|
||||
if (!reason)
|
||||
reason = NotificationDestroyedReason.DISMISSED;
|
||||
destroy(reason = NotificationDestroyedReason.DISMISSED) {
|
||||
this.emit('destroy', reason);
|
||||
}
|
||||
};
|
||||
|
@ -151,9 +151,7 @@ var OsdWindow = class {
|
||||
}
|
||||
}
|
||||
|
||||
setMaxLevel(maxLevel) {
|
||||
if (maxLevel === undefined)
|
||||
maxLevel = 100;
|
||||
setMaxLevel(maxLevel = 100) {
|
||||
this._level.maxLevel = maxLevel;
|
||||
}
|
||||
|
||||
|
@ -706,9 +706,7 @@ var PanelCorner = class {
|
||||
|
||||
var AggregateLayout = GObject.registerClass(
|
||||
class AggregateLayout extends Clutter.BoxLayout {
|
||||
_init(params) {
|
||||
if (!params)
|
||||
params = {};
|
||||
_init(params = {}) {
|
||||
params['orientation'] = Clutter.Orientation.VERTICAL;
|
||||
super._init(params);
|
||||
|
||||
@ -1167,7 +1165,7 @@ class Panel extends St.Widget {
|
||||
}
|
||||
|
||||
_onMenuSet(indicator) {
|
||||
if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId'))
|
||||
if (!indicator.menu || indicator.menu._openChangedId)
|
||||
return;
|
||||
|
||||
indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',
|
||||
|
@ -14,8 +14,8 @@ const SEARCH_PROVIDERS_SCHEMA = 'org.gnome.desktop.search-providers';
|
||||
var MAX_LIST_SEARCH_RESULTS_ROWS = 5;
|
||||
var MAX_GRID_SEARCH_RESULTS_ROWS = 1;
|
||||
|
||||
var MaxWidthBin = GObject.registerClass(
|
||||
class MaxWidthBin extends St.Bin {
|
||||
var MaxWidthBox = GObject.registerClass(
|
||||
class MaxWidthBox extends St.BoxLayout {
|
||||
vfunc_allocate(box, flags) {
|
||||
let themeNode = this.get_theme_node();
|
||||
let maxWidth = themeNode.get_max_width();
|
||||
@ -309,7 +309,7 @@ var ListSearchResults = class extends SearchResultsBase {
|
||||
}
|
||||
|
||||
_createResultDisplay(meta) {
|
||||
return super._createResultDisplay(meta, this._resultsView) ||
|
||||
return super._createResultDisplay(meta) ||
|
||||
new ListSearchResult(this.provider, meta, this._resultsView);
|
||||
}
|
||||
|
||||
@ -329,12 +329,6 @@ Signals.addSignalMethods(ListSearchResults.prototype);
|
||||
var GridSearchResults = class extends SearchResultsBase {
|
||||
constructor(provider, resultsView) {
|
||||
super(provider, resultsView);
|
||||
// We need to use the parent container to know how much results we can show.
|
||||
// None of the actors in this class can be used for that, since the main actor
|
||||
// goes hidden when no results are displayed, and then it lost its allocation.
|
||||
// Then on the next use of _getMaxDisplayedResults allocation is 0, en therefore
|
||||
// it doesn't show any result although we have some.
|
||||
this._parentContainer = resultsView.actor;
|
||||
|
||||
this._grid = new IconGrid.IconGrid({ rowLimit: MAX_GRID_SEARCH_RESULTS_ROWS,
|
||||
xAlign: St.Align.START });
|
||||
@ -345,10 +339,23 @@ var GridSearchResults = class extends SearchResultsBase {
|
||||
this._resultDisplayBin.set_child(this._bin);
|
||||
}
|
||||
|
||||
updateSearch(...args) {
|
||||
if (this._notifyAllocationId)
|
||||
this.actor.disconnect(this._notifyAllocationId);
|
||||
|
||||
// Make sure the maximum number of results calculated by
|
||||
// _getMaxDisplayedResults() is updated after width changes.
|
||||
this._notifyAllocationId = this.actor.connect('notify::allocation', () => {
|
||||
super.updateSearch(...args);
|
||||
});
|
||||
|
||||
super.updateSearch(...args);
|
||||
}
|
||||
|
||||
_getMaxDisplayedResults() {
|
||||
let parentThemeNode = this._parentContainer.get_theme_node();
|
||||
let availableWidth = parentThemeNode.adjust_for_width(this._parentContainer.width);
|
||||
return this._grid.columnsForWidth(availableWidth) * this._grid.getRowLimit();
|
||||
let allocation = this.actor.allocation;
|
||||
let nCols = this._grid.columnsForWidth(allocation.x2 - allocation.x1);
|
||||
return nCols * this._grid.getRowLimit();
|
||||
}
|
||||
|
||||
_clearResultDisplay() {
|
||||
@ -356,7 +363,7 @@ var GridSearchResults = class extends SearchResultsBase {
|
||||
}
|
||||
|
||||
_createResultDisplay(meta) {
|
||||
return super._createResultDisplay(meta, this._resultsView) ||
|
||||
return super._createResultDisplay(meta) ||
|
||||
new GridSearchResult(this.provider, meta, this._resultsView);
|
||||
}
|
||||
|
||||
@ -378,22 +385,16 @@ var SearchResults = class {
|
||||
this.actor = new St.BoxLayout({ name: 'searchResults',
|
||||
vertical: true });
|
||||
|
||||
this._content = new St.BoxLayout({ name: 'searchResultsContent',
|
||||
this._content = new MaxWidthBox({ name: 'searchResultsContent',
|
||||
vertical: true });
|
||||
this._contentBin = new MaxWidthBin({ name: 'searchResultsBin',
|
||||
x_fill: true,
|
||||
y_fill: true,
|
||||
child: this._content });
|
||||
|
||||
let scrollChild = new St.BoxLayout();
|
||||
scrollChild.add(this._contentBin, { expand: true });
|
||||
|
||||
this._scrollView = new St.ScrollView({ x_fill: true,
|
||||
y_fill: false,
|
||||
overlay_scrollbars: true,
|
||||
style_class: 'search-display vfade' });
|
||||
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
||||
this._scrollView.add_actor(scrollChild);
|
||||
this._scrollView.add_actor(this._content);
|
||||
|
||||
let action = new Clutter.PanAction({ interpolate: true });
|
||||
action.connect('pan', this._onPan.bind(this));
|
||||
this._scrollView.add_action(action);
|
||||
|
@ -207,7 +207,7 @@ var GnomeShell = class {
|
||||
this._grabbers.delete(name);
|
||||
}
|
||||
|
||||
ShowMonitorLabels2Async(params, invocation) {
|
||||
ShowMonitorLabelsAsync(params, invocation) {
|
||||
let sender = invocation.get_sender();
|
||||
let [dict] = params;
|
||||
Main.osdMonitorLabeler.show(sender, dict);
|
||||
|
@ -331,11 +331,11 @@ var NMConnectionDevice = class NMConnectionDevice extends NMConnectionSection {
|
||||
|
||||
destroy() {
|
||||
if (this._stateChangedId) {
|
||||
GObject.Object.prototype.disconnect.call(this._device, this._stateChangedId);
|
||||
GObject.signal_handler_disconnect(this._device, this._stateChangedId);
|
||||
this._stateChangedId = 0;
|
||||
}
|
||||
if (this._activeConnectionChangedId) {
|
||||
GObject.Object.prototype.disconnect.call(this._device, this._activeConnectionChangedId);
|
||||
GObject.signal_handler_disconnect(this._device, this._activeConnectionChangedId);
|
||||
this._activeConnectionChangedId = 0;
|
||||
}
|
||||
|
||||
@ -1187,11 +1187,11 @@ var NMDeviceWireless = class {
|
||||
|
||||
destroy() {
|
||||
if (this._activeApChangedId) {
|
||||
GObject.Object.prototype.disconnect.call(this._device, this._activeApChangedId);
|
||||
GObject.signal_handler_disconnect(this._device, this._activeApChangedId);
|
||||
this._activeApChangedId = 0;
|
||||
}
|
||||
if (this._stateChangedId) {
|
||||
GObject.Object.prototype.disconnect.call(this._device, this._stateChangedId);
|
||||
GObject.signal_handler_disconnect(this._device, this._stateChangedId);
|
||||
this._stateChangedId = 0;
|
||||
}
|
||||
if (this._strengthChangedId > 0) {
|
||||
|
@ -107,10 +107,20 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
||||
}
|
||||
|
||||
// The icons
|
||||
let icon = this._proxy.IconName;
|
||||
let chargingState = this._proxy.State == UPower.DeviceState.CHARGING
|
||||
? '-charging' : '';
|
||||
let fillLevel = 10 * Math.floor(this._proxy.Percentage / 10);
|
||||
let icon = this._proxy.State == UPower.DeviceState.FULLY_CHARGED
|
||||
? 'battery-level-100-charged-symbolic'
|
||||
: `battery-level-${fillLevel}${chargingState}-symbolic`;
|
||||
|
||||
this._indicator.icon_name = icon;
|
||||
this._item.icon.icon_name = icon;
|
||||
|
||||
let fallbackIcon = this._proxy.IconName;
|
||||
this._indicator.fallback_icon_name = fallbackIcon;
|
||||
this._item.icon.fallback_icon_name = fallbackIcon;
|
||||
|
||||
// The icon label
|
||||
let label;
|
||||
if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED)
|
||||
|
@ -1203,41 +1203,9 @@ var WindowManager = class {
|
||||
if (!Meta.prefs_get_dynamic_workspaces())
|
||||
return;
|
||||
|
||||
workspaceManager.append_new_workspace(false, global.get_current_time());
|
||||
|
||||
let windows = global.get_window_actors().map(a => a.meta_window);
|
||||
|
||||
// To create a new workspace, we slide all the windows on workspaces
|
||||
// below us to the next workspace, leaving a blank workspace for us
|
||||
// to recycle.
|
||||
windows.forEach(window => {
|
||||
// If the window is attached to an ancestor, we don't need/want
|
||||
// to move it
|
||||
if (window.get_transient_for() != null)
|
||||
return;
|
||||
// Same for OR windows
|
||||
if (window.is_override_redirect())
|
||||
return;
|
||||
// Sticky windows don't need moving, in fact moving would
|
||||
// unstick them
|
||||
if (window.on_all_workspaces)
|
||||
return;
|
||||
// Windows on workspaces below pos don't need moving
|
||||
let index = window.get_workspace().index();
|
||||
if (index < pos)
|
||||
return;
|
||||
window.change_workspace_by_index(index + 1, true);
|
||||
});
|
||||
|
||||
// If the new workspace was inserted before the active workspace,
|
||||
// activate the workspace to which its windows went
|
||||
let activeIndex = workspaceManager.get_active_workspace_index();
|
||||
if (activeIndex >= pos) {
|
||||
let newWs = workspaceManager.get_workspace_by_index(activeIndex + 1);
|
||||
this._blockAnimations = true;
|
||||
newWs.activate(global.get_current_time());
|
||||
this._blockAnimations = false;
|
||||
}
|
||||
let newWs = workspaceManager.append_new_workspace(
|
||||
false, global.get_current_time());
|
||||
workspaceManager.reorder_workspace(newWs, pos);
|
||||
}
|
||||
|
||||
keepWorkspaceAlive(workspace, duration) {
|
||||
@ -1273,7 +1241,7 @@ var WindowManager = class {
|
||||
}
|
||||
|
||||
_shouldAnimate() {
|
||||
return !(Main.overview.visible || this._blockAnimations);
|
||||
return !Main.overview.visible;
|
||||
}
|
||||
|
||||
_shouldAnimateActor(actor, types) {
|
||||
|
@ -86,7 +86,7 @@ class WindowCloneLayout extends Clutter.LayoutManager {
|
||||
if (child == container._delegate._windowClone)
|
||||
realWindow = container._delegate.realWindow;
|
||||
else
|
||||
realWindow = child.source;
|
||||
realWindow = child.content.window_actor;
|
||||
|
||||
child.allocate(this._makeBoxForWindow(realWindow.meta_window),
|
||||
flags);
|
||||
@ -94,15 +94,25 @@ class WindowCloneLayout extends Clutter.LayoutManager {
|
||||
}
|
||||
});
|
||||
|
||||
var WindowClone = class {
|
||||
constructor(realWindow, workspace) {
|
||||
var WindowClone = GObject.registerClass({
|
||||
Signals: {
|
||||
'drag-begin': {},
|
||||
'drag-cancelled': {},
|
||||
'drag-end': {},
|
||||
'hide-chrome': {},
|
||||
'selected': { param_types: [GObject.TYPE_UINT] },
|
||||
'show-chrome': {},
|
||||
'size-changed': {}
|
||||
},
|
||||
}, class WindowClone extends St.Widget {
|
||||
_init(realWindow, workspace) {
|
||||
this.realWindow = realWindow;
|
||||
this.metaWindow = realWindow.meta_window;
|
||||
this.metaWindow._delegate = this;
|
||||
this._workspace = workspace;
|
||||
|
||||
this._windowClone = new Clutter.Clone({ source: realWindow });
|
||||
// We expect this.actor to be used for all interaction rather than
|
||||
this._windowClone = new Clutter.Actor({ content: realWindow.content });
|
||||
// We expect this to be used for all interaction rather than
|
||||
// this._windowClone; as the former is reactive and the latter
|
||||
// is not, this just works for most cases. However, for DND all
|
||||
// actors are picked, so DND operations would operate on the clone.
|
||||
@ -113,14 +123,18 @@ var WindowClone = class {
|
||||
// the invisible border; this is inconvenient; rather than trying
|
||||
// to compensate all over the place we insert a ClutterActor into
|
||||
// the hierarchy that is sized to only the visible portion.
|
||||
this.actor = new St.Widget({ reactive: true,
|
||||
super._init({
|
||||
reactive: true,
|
||||
can_focus: true,
|
||||
accessible_role: Atk.Role.PUSH_BUTTON,
|
||||
layout_manager: new WindowCloneLayout() });
|
||||
layout_manager: new WindowCloneLayout()
|
||||
});
|
||||
|
||||
this.actor.add_child(this._windowClone);
|
||||
this.set_offscreen_redirect(Clutter.OffscreenRedirect.AUTOMATIC_FOR_OPACITY);
|
||||
|
||||
this.actor._delegate = this;
|
||||
this.add_child(this._windowClone);
|
||||
|
||||
this._delegate = this;
|
||||
|
||||
this.slotId = 0;
|
||||
this._slot = [0, 0, 0, 0];
|
||||
@ -142,23 +156,23 @@ var WindowClone = class {
|
||||
|
||||
this._updateAttachedDialogs();
|
||||
this._computeBoundingBox();
|
||||
this.actor.x = this._boundingBox.x;
|
||||
this.actor.y = this._boundingBox.y;
|
||||
this.x = this._boundingBox.x;
|
||||
this.y = this._boundingBox.y;
|
||||
|
||||
let clickAction = new Clutter.ClickAction();
|
||||
clickAction.connect('clicked', this._onClicked.bind(this));
|
||||
clickAction.connect('long-press', this._onLongPress.bind(this));
|
||||
this.actor.add_action(clickAction);
|
||||
this.actor.connect('destroy', this._onDestroy.bind(this));
|
||||
this.actor.connect('key-press-event', this._onKeyPress.bind(this));
|
||||
this.add_action(clickAction);
|
||||
this.connect('destroy', this._onDestroy.bind(this));
|
||||
this.connect('key-press-event', this._onKeyPress.bind(this));
|
||||
|
||||
this.actor.connect('enter-event', () => this.emit('show-chrome'));
|
||||
this.actor.connect('key-focus-in', () => this.emit('show-chrome'));
|
||||
this.connect('enter-event', () => this.emit('show-chrome'));
|
||||
this.connect('key-focus-in', () => this.emit('show-chrome'));
|
||||
|
||||
this.actor.connect('leave-event', () => this.emit('hide-chrome'));
|
||||
this.actor.connect('key-focus-out', () => this.emit('hide-chrome'));
|
||||
this.connect('leave-event', () => this.emit('hide-chrome'));
|
||||
this.connect('key-focus-out', () => this.emit('hide-chrome'));
|
||||
|
||||
this._draggable = DND.makeDraggable(this.actor,
|
||||
this._draggable = DND.makeDraggable(this,
|
||||
{ restoreOnSuccess: true,
|
||||
manualMode: true,
|
||||
dragActorMaxSize: WINDOW_DND_SIZE,
|
||||
@ -172,6 +186,10 @@ var WindowClone = class {
|
||||
this._closeRequested = false;
|
||||
}
|
||||
|
||||
vfunc_has_overlaps() {
|
||||
return this.hasAttachedDialogs();
|
||||
}
|
||||
|
||||
set slot(slot) {
|
||||
this._slot = slot;
|
||||
}
|
||||
@ -185,9 +203,9 @@ var WindowClone = class {
|
||||
|
||||
deleteAll() {
|
||||
// Delete all windows, starting from the bottom-most (most-modal) one
|
||||
let windows = this.actor.get_children();
|
||||
let windows = this.get_children();
|
||||
for (let i = windows.length - 1; i >= 1; i--) {
|
||||
let realWindow = windows[i].source;
|
||||
let realWindow = windows[i].content.window_actor;
|
||||
let metaWindow = realWindow.meta_window;
|
||||
|
||||
metaWindow.delete(global.get_current_time());
|
||||
@ -215,11 +233,11 @@ var WindowClone = class {
|
||||
}
|
||||
|
||||
hasAttachedDialogs() {
|
||||
return this.actor.get_n_children() > 1;
|
||||
return this.get_n_children() > 1;
|
||||
}
|
||||
|
||||
_doAddAttachedDialog(metaWin, realWin) {
|
||||
let clone = new Clutter.Clone({ source: realWin });
|
||||
let clone = new Clutter.Actor({ content: realWin.content });
|
||||
clone._sizeChangedId = metaWin.connect('size-changed',
|
||||
this._onMetaWindowSizeChanged.bind(this));
|
||||
clone._posChangedId = metaWin.connect('position-changed',
|
||||
@ -229,7 +247,7 @@ var WindowClone = class {
|
||||
|
||||
this._onMetaWindowSizeChanged();
|
||||
});
|
||||
this.actor.add_child(clone);
|
||||
this.add_child(clone);
|
||||
}
|
||||
|
||||
_updateAttachedDialogs() {
|
||||
@ -267,12 +285,12 @@ var WindowClone = class {
|
||||
_computeBoundingBox() {
|
||||
let rect = this.metaWindow.get_frame_rect();
|
||||
|
||||
this.actor.get_children().forEach(child => {
|
||||
this.get_children().forEach(child => {
|
||||
let realWindow;
|
||||
if (child == this._windowClone)
|
||||
realWindow = this.realWindow;
|
||||
else
|
||||
realWindow = child.source;
|
||||
realWindow = child.content.window_actor;
|
||||
|
||||
let metaWindow = realWindow.meta_window;
|
||||
rect = rect.union(metaWindow.get_frame_rect());
|
||||
@ -280,7 +298,7 @@ var WindowClone = class {
|
||||
|
||||
// Convert from a MetaRectangle to a native JS object
|
||||
this._boundingBox = { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
|
||||
this.actor.layout_manager.boundingBox = rect;
|
||||
this.layout_manager.boundingBox = rect;
|
||||
}
|
||||
|
||||
// Find the actor just below us, respecting reparenting done by DND code
|
||||
@ -306,22 +324,18 @@ var WindowClone = class {
|
||||
|
||||
let actualAbove = this.getActualStackAbove();
|
||||
if (actualAbove == null)
|
||||
this.actor.lower_bottom();
|
||||
this.lower_bottom();
|
||||
else
|
||||
this.actor.raise(actualAbove);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.actor.destroy();
|
||||
this.raise(actualAbove);
|
||||
}
|
||||
|
||||
_disconnectSignals() {
|
||||
this.actor.get_children().forEach(child => {
|
||||
this.get_children().forEach(child => {
|
||||
let realWindow;
|
||||
if (child == this._windowClone)
|
||||
realWindow = this.realWindow;
|
||||
else
|
||||
realWindow = child.source;
|
||||
realWindow = child.content.window_actor;
|
||||
|
||||
realWindow.meta_window.disconnect(child._sizeChangedId);
|
||||
realWindow.meta_window.disconnect(child._posChangedId);
|
||||
@ -338,14 +352,12 @@ var WindowClone = class {
|
||||
this._disconnectSignals();
|
||||
|
||||
this.metaWindow._delegate = null;
|
||||
this.actor._delegate = null;
|
||||
this._delegate = null;
|
||||
|
||||
if (this.inDrag) {
|
||||
this.emit('drag-end');
|
||||
this.inDrag = false;
|
||||
}
|
||||
|
||||
this.disconnectAll();
|
||||
}
|
||||
|
||||
_activate() {
|
||||
@ -393,8 +405,8 @@ var WindowClone = class {
|
||||
|
||||
_onDragBegin(draggable, time) {
|
||||
this._dragSlot = this._slot;
|
||||
[this.dragOrigX, this.dragOrigY] = this.actor.get_position();
|
||||
this.dragOrigScale = this.actor.scale_x;
|
||||
[this.dragOrigX, this.dragOrigY] = this.get_position();
|
||||
this.dragOrigScale = this.scale_x;
|
||||
this.inDrag = true;
|
||||
this.emit('drag-begin');
|
||||
}
|
||||
@ -417,18 +429,17 @@ var WindowClone = class {
|
||||
// We may not have a parent if DnD completed successfully, in
|
||||
// which case our clone will shortly be destroyed and replaced
|
||||
// with a new one on the target workspace.
|
||||
if (this.actor.get_parent() != null) {
|
||||
if (this.get_parent() != null) {
|
||||
if (this._stackAbove == null)
|
||||
this.actor.lower_bottom();
|
||||
this.lower_bottom();
|
||||
else
|
||||
this.actor.raise(this._stackAbove);
|
||||
this.raise(this._stackAbove);
|
||||
}
|
||||
|
||||
|
||||
this.emit('drag-end');
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(WindowClone.prototype);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
@ -452,7 +463,7 @@ var WindowOverlay = class {
|
||||
this.title = new St.Label({ style_class: 'window-caption',
|
||||
text: this._getCaption() });
|
||||
this.title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
|
||||
windowClone.actor.label_actor = this.title;
|
||||
windowClone.label_actor = this.title;
|
||||
|
||||
this._maxTitleWidth = -1;
|
||||
|
||||
@ -467,7 +478,7 @@ var WindowOverlay = class {
|
||||
|
||||
this.closeButton.connect('clicked', () => this._windowClone.deleteAll());
|
||||
|
||||
windowClone.actor.connect('destroy', this._onDestroy.bind(this));
|
||||
windowClone.connect('destroy', this._onDestroy.bind(this));
|
||||
windowClone.connect('show-chrome', this._onShowChrome.bind(this));
|
||||
windowClone.connect('hide-chrome', this._onHideChrome.bind(this));
|
||||
|
||||
@ -503,7 +514,7 @@ var WindowOverlay = class {
|
||||
show() {
|
||||
this._hidden = false;
|
||||
|
||||
if (this._windowClone.actor['has-pointer'])
|
||||
if (this._windowClone['has-pointer'])
|
||||
this._animateVisible();
|
||||
}
|
||||
|
||||
@ -675,7 +686,7 @@ var WindowOverlay = class {
|
||||
_idleHideOverlay() {
|
||||
this._idleHideOverlayId = 0;
|
||||
|
||||
if (!this._windowClone.actor['has-pointer'] &&
|
||||
if (!this._windowClone['has-pointer'] &&
|
||||
!this.closeButton['has-pointer'])
|
||||
this._animateInvisible();
|
||||
|
||||
@ -1296,8 +1307,8 @@ var Workspace = class {
|
||||
if (clone.inDrag)
|
||||
continue;
|
||||
|
||||
let cloneWidth = clone.actor.width * scale;
|
||||
let cloneHeight = clone.actor.height * scale;
|
||||
let cloneWidth = clone.width * scale;
|
||||
let cloneHeight = clone.height * scale;
|
||||
clone.slot = [x, y, cloneWidth, cloneHeight];
|
||||
|
||||
let cloneCenter = x + cloneWidth / 2;
|
||||
@ -1312,10 +1323,10 @@ var Workspace = class {
|
||||
if (!clone.positioned) {
|
||||
// This window appeared after the overview was already up
|
||||
// Grow the clone from the center of the slot
|
||||
clone.actor.x = x + cloneWidth / 2;
|
||||
clone.actor.y = y + cloneHeight / 2;
|
||||
clone.actor.scale_x = 0;
|
||||
clone.actor.scale_y = 0;
|
||||
clone.x = x + cloneWidth / 2;
|
||||
clone.y = y + cloneHeight / 2;
|
||||
clone.scale_x = 0;
|
||||
clone.scale_y = 0;
|
||||
clone.positioned = true;
|
||||
}
|
||||
|
||||
@ -1325,14 +1336,14 @@ var Workspace = class {
|
||||
* therefore we need to resize them now so they
|
||||
* can be scaled up later */
|
||||
if (initialPositioning) {
|
||||
clone.actor.opacity = 0;
|
||||
clone.actor.scale_x = 0;
|
||||
clone.actor.scale_y = 0;
|
||||
clone.actor.x = x;
|
||||
clone.actor.y = y;
|
||||
clone.opacity = 0;
|
||||
clone.scale_x = 0;
|
||||
clone.scale_y = 0;
|
||||
clone.x = x;
|
||||
clone.y = y;
|
||||
}
|
||||
|
||||
Tweener.addTween(clone.actor,
|
||||
Tweener.addTween(clone,
|
||||
{ opacity: 255,
|
||||
time: Overview.ANIMATION_TIME,
|
||||
transition: 'easeInQuad'
|
||||
@ -1342,10 +1353,10 @@ var Workspace = class {
|
||||
this._animateClone(clone, clone.overlay, x, y, scale);
|
||||
} else {
|
||||
// cancel any active tweens (otherwise they might override our changes)
|
||||
Tweener.removeTweens(clone.actor);
|
||||
clone.actor.set_position(x, y);
|
||||
clone.actor.set_scale(scale, scale);
|
||||
clone.actor.set_opacity(255);
|
||||
Tweener.removeTweens(clone);
|
||||
clone.set_position(x, y);
|
||||
clone.set_scale(scale, scale);
|
||||
clone.set_opacity(255);
|
||||
clone.overlay.relayout(false);
|
||||
this._showWindowOverlay(clone, clone.overlay);
|
||||
}
|
||||
@ -1366,13 +1377,13 @@ var Workspace = class {
|
||||
clone.setStackAbove(this._dropRect);
|
||||
} else {
|
||||
let previousClone = clones[i - 1];
|
||||
clone.setStackAbove(previousClone.actor);
|
||||
clone.setStackAbove(previousClone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_animateClone(clone, overlay, x, y, scale) {
|
||||
Tweener.addTween(clone.actor,
|
||||
Tweener.addTween(clone,
|
||||
{ x: x,
|
||||
y: y,
|
||||
scale_x: scale,
|
||||
@ -1411,7 +1422,7 @@ var Workspace = class {
|
||||
|
||||
let actorUnderPointer = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y);
|
||||
for (let i = 0; i < this._windows.length; i++) {
|
||||
if (this._windows[i].actor == actorUnderPointer)
|
||||
if (this._windows[i] == actorUnderPointer)
|
||||
return GLib.SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
@ -1433,12 +1444,12 @@ var Workspace = class {
|
||||
// destroyed; we'd like to animate this, but it's too late at
|
||||
// this point.)
|
||||
if (win) {
|
||||
let [stageX, stageY] = clone.actor.get_transformed_position();
|
||||
let [stageWidth, stageHeight] = clone.actor.get_transformed_size();
|
||||
let [stageX, stageY] = clone.get_transformed_position();
|
||||
let [stageWidth, stageHeight] = clone.get_transformed_size();
|
||||
win._overviewHint = {
|
||||
x: stageX,
|
||||
y: stageY,
|
||||
scale: stageWidth / clone.actor.width
|
||||
scale: stageWidth / clone.width
|
||||
};
|
||||
}
|
||||
clone.destroy();
|
||||
@ -1518,11 +1529,11 @@ var Workspace = class {
|
||||
let scale = win._overviewHint.scale;
|
||||
delete win._overviewHint;
|
||||
|
||||
clone.slot = [x, y, clone.actor.width * scale, clone.actor.height * scale];
|
||||
clone.slot = [x, y, clone.width * scale, clone.height * scale];
|
||||
clone.positioned = true;
|
||||
|
||||
clone.actor.set_position(x, y);
|
||||
clone.actor.set_scale(scale, scale);
|
||||
clone.set_position(x, y);
|
||||
clone.set_scale(scale, scale);
|
||||
clone.overlay.relayout(false);
|
||||
}
|
||||
|
||||
@ -1596,7 +1607,7 @@ var Workspace = class {
|
||||
let overlay = this._windowOverlays[i];
|
||||
if (overlay)
|
||||
overlay.hide();
|
||||
this._windows[i].actor.opacity = 0;
|
||||
this._windows[i].opacity = 0;
|
||||
} else {
|
||||
let fromTop = topIndex - i;
|
||||
let time;
|
||||
@ -1605,7 +1616,7 @@ var Workspace = class {
|
||||
else
|
||||
time = windowBaseTime;
|
||||
|
||||
this._windows[i].actor.opacity = 255;
|
||||
this._windows[i].opacity = 255;
|
||||
this._fadeWindow(i, time, 0);
|
||||
}
|
||||
}
|
||||
@ -1619,7 +1630,7 @@ var Workspace = class {
|
||||
|
||||
for (let i = 0; i < this._windows.length; i++) {
|
||||
let clone = this._windows[i];
|
||||
Tweener.removeTweens(clone.actor);
|
||||
Tweener.removeTweens(clone);
|
||||
}
|
||||
|
||||
if (this._repositionWindowsId > 0) {
|
||||
@ -1654,7 +1665,7 @@ var Workspace = class {
|
||||
let overlay = this._windowOverlays[i];
|
||||
if (overlay)
|
||||
overlay.hide();
|
||||
this._windows[i].actor.opacity = 0;
|
||||
this._windows[i].opacity = 0;
|
||||
} else {
|
||||
let fromTop = topIndex - i;
|
||||
let time;
|
||||
@ -1663,7 +1674,7 @@ var Workspace = class {
|
||||
else
|
||||
time = windowBaseTime * nTimeSlots;
|
||||
|
||||
this._windows[i].actor.opacity = 0;
|
||||
this._windows[i].opacity = 0;
|
||||
this._fadeWindow(i, time, 255);
|
||||
}
|
||||
}
|
||||
@ -1678,18 +1689,18 @@ var Workspace = class {
|
||||
|
||||
if (clone.metaWindow.showing_on_its_workspace()) {
|
||||
let [origX, origY] = clone.getOriginalPosition();
|
||||
clone.actor.scale_x = 1;
|
||||
clone.actor.scale_y = 1;
|
||||
clone.actor.x = origX;
|
||||
clone.actor.y = origY;
|
||||
Tweener.addTween(clone.actor,
|
||||
clone.scale_x = 1;
|
||||
clone.scale_y = 1;
|
||||
clone.x = origX;
|
||||
clone.y = origY;
|
||||
Tweener.addTween(clone,
|
||||
{ time: time,
|
||||
opacity: opacity,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
} else {
|
||||
// The window is hidden
|
||||
clone.actor.opacity = 0;
|
||||
clone.opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1706,7 +1717,7 @@ var Workspace = class {
|
||||
|
||||
for (let i = 0; i < this._windows.length; i++) {
|
||||
let clone = this._windows[i];
|
||||
Tweener.removeTweens(clone.actor);
|
||||
Tweener.removeTweens(clone);
|
||||
}
|
||||
|
||||
if (this._repositionWindowsId > 0) {
|
||||
@ -1732,7 +1743,7 @@ var Workspace = class {
|
||||
|
||||
if (clone.metaWindow.showing_on_its_workspace()) {
|
||||
let [origX, origY] = clone.getOriginalPosition();
|
||||
Tweener.addTween(clone.actor,
|
||||
Tweener.addTween(clone,
|
||||
{ x: origX,
|
||||
y: origY,
|
||||
scale_x: 1.0,
|
||||
@ -1743,7 +1754,7 @@ var Workspace = class {
|
||||
});
|
||||
} else {
|
||||
// The window is hidden, make it shrink and fade it out
|
||||
Tweener.addTween(clone.actor,
|
||||
Tweener.addTween(clone,
|
||||
{ scale_x: 0,
|
||||
scale_y: 0,
|
||||
opacity: 0,
|
||||
@ -1834,16 +1845,16 @@ var Workspace = class {
|
||||
clone.connect('size-changed', () => {
|
||||
this._recalculateWindowPositions(WindowPositionFlags.NONE);
|
||||
});
|
||||
clone.actor.connect('destroy', () => {
|
||||
clone.connect('destroy', () => {
|
||||
this._removeWindowClone(clone.metaWindow);
|
||||
});
|
||||
|
||||
this.actor.add_actor(clone.actor);
|
||||
this.actor.add_actor(clone);
|
||||
|
||||
overlay.connect('chrome-visible', () => {
|
||||
let focus = global.stage.key_focus;
|
||||
if (focus == null || this.actor.contains(focus))
|
||||
clone.actor.grab_key_focus();
|
||||
clone.grab_key_focus();
|
||||
|
||||
this._windowOverlays.forEach(o => {
|
||||
if (o != overlay)
|
||||
@ -1854,7 +1865,7 @@ var Workspace = class {
|
||||
if (this._windows.length == 0)
|
||||
clone.setStackAbove(null);
|
||||
else
|
||||
clone.setStackAbove(this._windows[this._windows.length - 1].actor);
|
||||
clone.setStackAbove(this._windows[this._windows.length - 1]);
|
||||
|
||||
this._windows.push(clone);
|
||||
this._windowOverlays.push(overlay);
|
||||
|
@ -47,7 +47,8 @@ class PrimaryActorLayout extends Clutter.FixedLayout {
|
||||
|
||||
var WindowClone = class {
|
||||
constructor(realWindow) {
|
||||
this.clone = new Clutter.Clone({ source: realWindow });
|
||||
this.clone = new Clutter.Actor({ content: realWindow.content,
|
||||
request_mode: Clutter.RequestMode.CONTENT_SIZE });
|
||||
|
||||
/* Can't use a Shell.GenericContainer because of DND and reparenting... */
|
||||
this.actor = new Clutter.Actor({ layout_manager: new PrimaryActorLayout(this.clone),
|
||||
@ -139,7 +140,8 @@ var WindowClone = class {
|
||||
}
|
||||
|
||||
_doAddAttachedDialog(metaDialog, realDialog) {
|
||||
let clone = new Clutter.Clone({ source: realDialog });
|
||||
let clone = new Clutter.Actor({ content: realDialog.content,
|
||||
request_mode: Clutter.RequestMode.CONTENT_SIZE });
|
||||
this._updateDialogPosition(realDialog, clone);
|
||||
|
||||
clone._updateId = realDialog.connect('notify::position', dialog => {
|
||||
@ -165,7 +167,7 @@ var WindowClone = class {
|
||||
|
||||
_disconnectSignals() {
|
||||
this.actor.get_children().forEach(child => {
|
||||
let realWindow = child.source;
|
||||
let realWindow = child.content.window_actor;
|
||||
|
||||
realWindow.disconnect(child._updateId);
|
||||
realWindow.disconnect(child._destroyId);
|
||||
@ -865,6 +867,13 @@ class ThumbnailsBox extends St.Widget {
|
||||
this._nWorkspacesNotifyId =
|
||||
workspaceManager.connect('notify::n-workspaces',
|
||||
this._workspacesChanged.bind(this));
|
||||
this._workspacesReorderedId =
|
||||
workspaceManager.connect('workspaces-reordered', () => {
|
||||
this._thumbnails.sort((a, b) => {
|
||||
return a.metaWorkspace.index() - b.metaWorkspace.index();
|
||||
});
|
||||
this.queue_relayout();
|
||||
});
|
||||
this._syncStackingId =
|
||||
Main.overview.connect('windows-restacked',
|
||||
this._syncStacking.bind(this));
|
||||
@ -896,6 +905,11 @@ class ThumbnailsBox extends St.Widget {
|
||||
workspaceManager.disconnect(this._nWorkspacesNotifyId);
|
||||
this._nWorkspacesNotifyId = 0;
|
||||
}
|
||||
if (this._workspacesReorderedId > 0) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
workspaceManager.disconnect(this._workspacesReorderedId);
|
||||
this._workspacesReorderedId = 0;
|
||||
}
|
||||
|
||||
if (this._syncStackingId > 0) {
|
||||
Main.overview.disconnect(this._syncStackingId);
|
||||
|
@ -101,6 +101,14 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
||||
this._updateWorkspacesId =
|
||||
workspaceManager.connect('notify::n-workspaces',
|
||||
this._updateWorkspaces.bind(this));
|
||||
this._reorderWorkspacesId =
|
||||
workspaceManager.connect('workspaces-reordered', () => {
|
||||
this._workspaces.sort((a, b) => {
|
||||
return a.metaWorkspace.index() - b.metaWorkspace.index();
|
||||
});
|
||||
this._updateWorkspaceActors(false);
|
||||
});
|
||||
|
||||
|
||||
this._overviewShownId =
|
||||
Main.overview.connect('shown', () => {
|
||||
@ -287,6 +295,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
||||
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
|
||||
let workspaceManager = global.workspace_manager;
|
||||
workspaceManager.disconnect(this._updateWorkspacesId);
|
||||
workspaceManager.disconnect(this._reorderWorkspacesId);
|
||||
}
|
||||
|
||||
startSwipeScroll() {
|
||||
@ -629,10 +638,15 @@ var WorkspacesDisplay = class {
|
||||
this._scrollValueChanged.bind(this));
|
||||
}
|
||||
|
||||
// HACK: Avoid spurious allocation changes while updating views
|
||||
view.actor.hide();
|
||||
|
||||
this._workspacesViews.push(view);
|
||||
Main.layoutManager.overviewGroup.add_actor(view.actor);
|
||||
}
|
||||
|
||||
this._workspacesViews.forEach(v => v.actor.show());
|
||||
|
||||
this._updateWorkspacesFullGeometry();
|
||||
this._updateWorkspacesActualGeometry();
|
||||
}
|
||||
|
130
lint/eslintrc-gjs.json
Normal file
130
lint/eslintrc-gjs.json
Normal file
@ -0,0 +1,130 @@
|
||||
{
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"array-bracket-newline": [
|
||||
"error",
|
||||
"consistent"
|
||||
],
|
||||
"array-bracket-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"arrow-spacing": "error",
|
||||
"brace-style": "error",
|
||||
"comma-spacing": [
|
||||
"error",
|
||||
{
|
||||
"before": false,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"indent": [
|
||||
"error",
|
||||
4,
|
||||
{
|
||||
"ignoredNodes": [
|
||||
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
|
||||
],
|
||||
"MemberExpression": "off"
|
||||
}
|
||||
],
|
||||
"key-spacing": [
|
||||
"error",
|
||||
{
|
||||
"beforeColon": false,
|
||||
"afterColon": true
|
||||
}
|
||||
],
|
||||
"keyword-spacing": [
|
||||
"error",
|
||||
{
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-implicit-coercion": [
|
||||
"error",
|
||||
{
|
||||
"allow": ["!!"]
|
||||
}
|
||||
],
|
||||
"no-restricted-properties": [
|
||||
"error",
|
||||
{
|
||||
"object": "Lang",
|
||||
"property": "bind",
|
||||
"message": "Use arrow notation or Function.prototype.bind()"
|
||||
},
|
||||
{
|
||||
"object": "Lang",
|
||||
"property": "Class",
|
||||
"message": "Use ES6 classes"
|
||||
}
|
||||
],
|
||||
"nonblock-statement-body-position": [
|
||||
"error",
|
||||
"below"
|
||||
],
|
||||
"object-curly-newline": [
|
||||
"error",
|
||||
{
|
||||
"consistent": true
|
||||
}
|
||||
],
|
||||
"object-curly-spacing": "error",
|
||||
"prefer-template": "error",
|
||||
"quotes": [
|
||||
"error",
|
||||
"single",
|
||||
{
|
||||
"avoidEscape": true
|
||||
}
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"semi-spacing": [
|
||||
"error",
|
||||
{
|
||||
"before": false,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"space-before-blocks": "error",
|
||||
"space-infix-ops": [
|
||||
"error",
|
||||
{
|
||||
"int32Hint": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"globals": {
|
||||
"ARGV": false,
|
||||
"Debugger": false,
|
||||
"GIRepositoryGType": false,
|
||||
"imports": false,
|
||||
"Intl": false,
|
||||
"log": false,
|
||||
"logError": false,
|
||||
"print": false,
|
||||
"printerr": false,
|
||||
"window": false
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017
|
||||
}
|
||||
}
|
21
lint/eslintrc-legacy.json
Normal file
21
lint/eslintrc-legacy.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
4,
|
||||
{
|
||||
"ignoredNodes": [
|
||||
"ConditionalExpression",
|
||||
"CallExpression > ArrowFunctionExpression",
|
||||
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
|
||||
],
|
||||
"CallExpression": { "arguments": "first" },
|
||||
"ArrayExpression": "first",
|
||||
"ObjectExpression": "first",
|
||||
"MemberExpression": "off"
|
||||
}
|
||||
],
|
||||
"prefer-template": "off",
|
||||
"quotes": "off"
|
||||
}
|
||||
}
|
38
lint/eslintrc-shell.json
Normal file
38
lint/eslintrc-shell.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"rules": {
|
||||
"camelcase": [
|
||||
"error",
|
||||
{
|
||||
"properties": "never",
|
||||
"allow": ["^vfunc_", "^on_"]
|
||||
}
|
||||
],
|
||||
"key-spacing": [
|
||||
"error",
|
||||
{
|
||||
"mode": "minimum",
|
||||
"beforeColon": false,
|
||||
"afterColon": true
|
||||
}
|
||||
],
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"prefer-arrow-callback": "error"
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "js/**",
|
||||
"excludedFiles": ["js/extensionPrefs/*", "js/portalHelper/*"],
|
||||
"globals": {
|
||||
"global": false,
|
||||
"_": false,
|
||||
"C_": false,
|
||||
"N_": false,
|
||||
"ngettext": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -44,6 +44,7 @@ ku
|
||||
ky
|
||||
lt
|
||||
lv
|
||||
mjw
|
||||
ml
|
||||
mk
|
||||
mr
|
||||
|
@ -465,7 +465,7 @@ recorder_record_frame (ShellRecorder *recorder,
|
||||
|
||||
g_object_get (settings, "magnifier-active", &magnifier_active, NULL);
|
||||
|
||||
if (magnifier_active)
|
||||
if (!magnifier_active)
|
||||
recorder_draw_cursor (recorder, buffer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user