Compare commits

...

41 Commits

Author SHA1 Message Date
602cec9b8e workspace, workspaceThumbnail: Use window content (WIP) 2019-07-16 14:31:30 -03:00
08464eadff theme: make overview thumbnails rounder
- match gtk Adwaita

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1449
2019-07-16 05:29:23 +02:00
49e56776e8 theme: unbreak acrive states for icon tiles
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1446
2019-07-16 00:16:32 +02:00
043667dde5 theme: Provide icon helper classes
- to help present icons on light backgrounds, the new fullcolor
  icons need some help. Mimic gtk styles

Needed for https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/168
2019-07-16 00:07:51 +02:00
f583a7c6d8 Update Karbi translation 2019-07-16 02:39:07 +00:00
2d908e80fc search: Remove wrong additional argument for _createResultDisplay
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
8f0e9abe47 iconGrid: Make sure the style is updated before computing the layout
In some cases the style-changed signal hasn't been emitted when
_computeLayout() is called, resulting in the use of the default spacing
and item size values for the calculations.

One case where this happens is when starting a search. Right after the
initialization of GridSearchResults, _computeLayout() is called from
_getMaxDisplayedResults() and the style-changed signal hasn't been
emitted yet. The computed layout will be wrong and the maximum
number of results will also be wrong.

To prevent this from happening, make sure the style has been updated
before doing the calculations in _computeLayout().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
1a27ff6130 search: Fix calculation of max number of displayed results for grid
The calculation of how many results can be shown in GridSearchResults is
broken: The width of the parent container (resultsView.actor) we're
using as the maximum width right now is the width of the scrollView of
SearchResults (which always expands to the whole screen size). This
width will only be correct if the scrollView (ie. the whole screen) is
smaller than the max width of searchResultsContent, which only is the
case for screens smaller than 1000px.

To fix the calculation, use the width of our own actor and don't get it
using clutter_actor_get_width(), but using the last allocation of the
actor. This way we don't get the preferred width if the actor is not
allocated at this point (it's hidden by _ensureProviderDisplay() when
starting a new search).

Then, when the allocation of the actor changes, rebuild the grid search
results by calling updateSearch() with the old arguments to ensure the
number of visible results is correct. The fact that we're only listening
for allocation changes here is the reason why we never want to use the
preferred width of the actor inside _getMaxDisplayedResults(): While
the actor is hidden clutter_actor_get_width() would return the preferred
width, which we'd then use the as the maximum width. But if the actor
had a correct allocation before, no notify::allocation signal will be
emitted when the actor is shown again because the allocation is still
the same, and we'll end up using the preferred width as maximium width
forever.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
3f2cffc2e6 theme: Don't apply overlap-preventing padding to search results
Unlike the app grid, we show the search results while the dash is hidden
and with a small scrollbar instead of page indicator dots. This
means there's nothing the search results might horizontally overlap
with and the padding here is unneccessary.

The spacing between the search results and the screen edges is still
sufficient because of the paddings applied to searchResultsContent.

On very small screens (< 1000px), this allows the search results to
utilize a lot more of the horizontal screen space.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
a78527050a search: Remove unnecessary containers
The functionality the searchResultsBin container provides can easily be
moved into a subclass of St.BoxLayout, no need for an additional StBin.
The "searchResultsBin" css class isn't used in the stylesheets either.

Same with the scrollChild container.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
a823a213ba Update Karbi translation 2019-07-15 10:54:50 +00:00
2c8d380e67 shellDBus: Rename ShowMonitorLabels2 to ShowMonitorLabels
The original ShowMonitorLabels has been removed so we can change things
back to use ShowMonitorLabels again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/491
2019-07-15 11:18:29 +02:00
3996309f8a Add Karbi translation 2019-07-14 04:02:53 +00:00
bd18313d12 power: Use more fine-grained battery levels
Adwaita-icon-theme added new battery icons which represent battery levels
in 10% steps[0]. Use these if they are available, otherwise fall back to
the existing icon names for compatibility with older icon themes.

[0] https://gitlab.gnome.org/GNOME/adwaita-icon-theme/issues/6

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/561
2019-07-12 23:24:35 +02:00
2ff7a78b56 calendar: Simplify code a bit
Just make the error case the same as the no-appointments one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
c765082f72 calendar: Avoid a warning
We will always get a results array from gjs' proxy wrapper, but it
will be empty in the error case; that is, `results` is always defined,
but `results[0]` may not be.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
7d2c5c1ac9 dialog: Use Object.assign() for default property value
Either Params.parse() or Object.assign() are more concise for providing
default values in object literals (sadly default parameters won't work
here).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
404bc34089 cleanup: Use default parameters where appropriate
Since ES6 it is possible to set an explicit default value for optional
parameters (overriding the implicit value of 'undefined'). Use them
for a nice small cleanup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
16ca7a21a7 panel: Relax check for existing signal handler
Object.prototype.hasOwnProperty() is more precise than checking for
falsiness, for instance the following is true:

  { foo: undefined }.hasOwnProperty('foo');

However when checking for a handler ID, a more relaxed check is more
appropriate, as particularly 0 is not a valid handler ID.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
1b31fd5afe cleanup: Don't call method via a parent's prototype
We cannot disconnect a signal handler via the usual disconnect() as
nm_device_disconnect() shadows the GObject method, but we can use
g_signal_handler_disconnect().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
2019-07-12 18:54:49 +00:00
e0457b6dc4 lint: Add "legacy" configuration
Regarding coding style, gjs is moving in a direction that departs quite
significantly from the established style, in particular when indenting
multi-line array/object literals or method arguments:

Currently we are keeping those elements aligned, while the gjs rules now
expect them to use the regular 4-space indentation.

There are certainly good arguments that can be made for that move - it's
much less prone to leading to overly-long lines, and matches popluar JS
styles elsewhere. But switching coding style implies large diffs which
interfere with git-blame and friends, so in order to allow for a more
gradual change, add a separate set of "legacy" rules that match more
closely the style we would expect up to now.

It also disables the rules for quotes and template strings - the former
because we cannot match the current style to use double-quotes for
translatable strings and single-quotes otherwise, the latter because
template strings are still relatively new, so we haven't adopted them
yet.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
42b77e7ba5 lint: Allow multiple spaces before key values
This is useful for imitating namespaced flags/enums:

```
const FooFlags = {
    NONE:    0,
    SMEAGLY: 1 << 0,
    SMOGLEY: 1 << 1,
    MUGGLY:  1 << 2
};
```

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
f6bed08993 lint: Enforce camelCase
All variables should be in camelCase, so configure the corresponding
rule to enforce this. Exempt properties for now, to accommodate the
existing practice of using C-style underscore names for construct
properties of introspected objects.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
5f77cdb0b9 lint: Enforce arrow notation
We replaced all Lang.bind() calls with arrow functions or the standardized
Function.prototype.bind(), at least for the former eslint has some options
to ensure that the old custom doesn't sneak back in.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
109b8e8f38 lint: Require spaces inside braces in object literals
Prohibiting spaces where the established GNOME style has required
them for a decade would be a harsh change for no good reason.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
4c0bd88a2c lint: Tweak the whitelist of globals
gjs doesn't include any gettext wrappers, and obviously can't know
about the shell's global object, so include those in the list of
globals for all sources in the gnome-shell context.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
3731be9947 lint: Import eslint rules from gjs
gjs started to run eslint during its CI a while ago, so there is an
existing rules set we can use as a starting point for our own setup.

As we will adapt those rules to our code base, we don't want those
changes to make it harder to synchronize the copy with future gjs
changes, so include the rules from a separate file rather than using
the configuration directly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609
2019-07-12 16:01:07 +00:00
6cc19ee6f0 workspacesView: Work around spurious allocation changes
For some reason, people are still seeing those after commit d5ebd8c8.
While this is something we really should figure out, we can work around
the issue by keeping the view actors hidden until the update is complete.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1065
2019-07-12 16:48:03 +02:00
1570f838f3 cleanup: Remove bogus file
This was accidentally added in commit 14d7897a9.
2019-07-12 10:36:37 +00:00
74feb110b5 layout: Fix off-by-one indent
This sneaked into commit dbb71f0d :-(
2019-07-11 03:02:20 +02:00
6ba03ac2a6 params: Don't use Lang module
To copy the passed in default parameters, we can just as well use
another Object.assign() call.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/616
2019-07-10 22:09:09 +00:00
55c717c2dc appDisplay: Fix logic error
Commit f6b4b96737 accidentally swapped the conditions here from
!includes() to includes().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/621
2019-07-10 21:50:17 +00:00
355b5eebec workspace: Set offscreen redirect on window previews
Window previews are sometimes shown translucent, for example during
drags or animations. They can also have attached dialogs, in which
case the opacity should affect the combination of all windows instead
of being applied to each window individually, blended together, so
make sure they are redirected as a whole when necessary.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/774
2019-07-10 21:41:58 +00:00
51938c398a workspace: Let WindowClone inherit from StWidget
Using inheritance over delegation will give us more control over
the actor drawing.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/774
2019-07-10 21:41:58 +00:00
dbb71f0dfc layout: Make the hot corner optional
Whether people love or hate the hot corner depends in large extents
on hardware sensitivity and habits, which is hard to get right
universally. So bite the bullet and support an option to enable or
disable hot corners ...

https://bugzilla.gnome.org/show_bug.cgi?id=688320
2019-07-10 17:29:24 +02:00
1cac7b2218 windowManager: Remove unused property
The last commit removed the only code that set _blockAnimations,
so stop reading it as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620
2019-07-09 14:46:36 +02:00
ff9bb5399b windowManager: Use new reorder_workspace() API
With the new Mutter API, inserting a workspace at a particular position
becomes as easy as creating the workspace and moving it to the desired
index.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620
2019-07-09 14:41:35 +02:00
68e45eb051 workspaceThumbnails: Handle reordering of workspaces
MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620
2019-07-09 14:41:35 +02:00
d0da96ad29 workspacesView: Handle reordering of workspaces
MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620
2019-07-09 14:41:35 +02:00
55b036170b shell-recorder: Restore cursor recording
Due to changes introduced in 5357e0a1 cursor recording interaction with
magnifier was reversed. This fix restores original correct behavior
Related issue: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1208
2019-07-08 21:08:51 +00:00
5473637736 cleanup: Fix style nits in last commit
Missing space after catch and wrong double quotes.
2019-07-08 20:15:15 +02:00
32 changed files with 2684 additions and 236 deletions

6
.eslintrc.json Normal file
View File

@ -0,0 +1,6 @@
{
"extends": [
"./lint/eslintrc-gjs.json",
"./lint/eslintrc-shell.json"
]
}

View File

@ -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"/>

View File

@ -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

View File

@ -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 {

View File

@ -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);
}

View File

@ -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)

View File

@ -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,

View File

@ -237,20 +237,18 @@ var DBusEventSource = class DBusEventSource {
_onEventsReceived(results, error) {
let newEvents = [];
let appointments = results ? results[0] : null;
if (appointments != null) {
for (let n = 0; n < appointments.length; n++) {
let a = appointments[n];
let date = new Date(a[4] * 1000);
let end = new Date(a[5] * 1000);
let id = a[0];
let summary = a[1];
let allDay = a[3];
let event = new CalendarEvent(id, date, end, summary, allDay);
newEvents.push(event);
}
newEvents.sort((ev1, ev2) => ev1.date.getTime() - ev2.date.getTime());
let appointments = results[0] || [];
for (let n = 0; n < appointments.length; n++) {
let a = appointments[n];
let date = new Date(a[4] * 1000);
let end = new Date(a[5] * 1000);
let id = a[0];
let summary = a[1];
let allDay = a[3];
let event = new CalendarEvent(id, date, end, summary, allDay);
newEvents.push(event);
}
newEvents.sort((ev1, ev2) => ev1.date.getTime() - ev2.date.getTime());
this._events = newEvents;
this.isLoading = false;

View File

@ -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')

View File

@ -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,

View File

@ -353,8 +353,8 @@ 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);
} catch(e) {
'org.freedesktop.packagekit.trigger-offline-update', null, null);
} catch (e) {
log('No permission to trigger offline updates: %s'.format(e.toString()));
}
}

View File

@ -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();

View File

@ -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) {

View File

@ -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';

View File

@ -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);
}
};

View File

@ -151,9 +151,7 @@ var OsdWindow = class {
}
}
setMaxLevel(maxLevel) {
if (maxLevel === undefined)
maxLevel = 100;
setMaxLevel(maxLevel = 100) {
this._level.maxLevel = maxLevel;
}

View File

@ -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',

View File

View File

@ -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',
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._content = new MaxWidthBox({ name: 'searchResultsContent',
vertical: 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);

View File

@ -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);

View File

@ -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) {

View File

@ -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)

View File

@ -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) {

View File

@ -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,
can_focus: true,
accessible_role: Atk.Role.PUSH_BUTTON,
layout_manager: new WindowCloneLayout() });
super._init({
reactive: true,
can_focus: true,
accessible_role: Atk.Role.PUSH_BUTTON,
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);

View File

@ -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);

View File

@ -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
View 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
View 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
View 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
}
}
]
}

View File

@ -44,6 +44,7 @@ ku
ky
lt
lv
mjw
ml
mk
mr

2239
po/mjw.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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);
}