Commit Graph

84 Commits

Author SHA1 Message Date
Florian Müllner
af87bd8c87 cleanup: Use consistent style for ternary operator
We are currently inconsistent whether to put the operators in front
of the corresponding line or at the end of the preceding one. The
most dominant style for now is to put condition and first branch on
the same line, and then align the second branch:

  let foo = condition ? fooValue
                      : notFooValue;

Unfortunately that's a style that eslint doesn't support, so to account
for it, our legacy configuration currently plainly ignores all indentation
in conditionals.

In order to drop that exception and not let messed up indentation slip
through, change all ternary operators to the non-legacy style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/725
2019-09-15 13:30:19 +00:00
Florian Müllner
0ee7f02f8e cleanup: Don't assume hasOwnProperty() method on objects
Since ES5, it is possible to create objects with no prototype at all:

    let foo = Object.create(null);

Those object won't have any builtin properties like hasOwnProperty(),
which is why eslint added a corresponding rule to its default rule set.

While this isn't an issue that affects our code, there's no harm in fol-
lowing the recommendation and call the method through Object.prototype.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/716
2019-09-12 23:18:27 +02:00
Florian Müllner
2fc4987c73 cleanup: Stop using Mainloop module
It is deprecated in favor of the regular GLib functions.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/718
2019-09-12 19:09:24 +02:00
Florian Müllner
e357559582 cleanup: Mark globals used from other modules as exported
eslint cannot figure out that those symbols are used from other modules
via imports, so they trigger unused-variable errors. To fix, explicitly
mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
71759a0769 cleanup: Mark unused (but useful) variables as ignored
While we aren't using those destructured variables, they are still useful
to document the meaning of those elements. We don't want eslint to keep
warning about them though, so mark them accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
11b116cb9d cleanup: Remove some unhelpful unused variables in destructuring
We aren't using them, and they don't add much in terms of clarity,
so drop them to fix a couple of eslint errors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
f250643385 style: Use space after catch
We are currently inconsistent with whether or not to put a space
after catch clauses. While the predominant style is to omit it,
that's inconsistent with the style we use for any other statement.
There's not really a good reason to stick with it, so switch to
the style gjs/eslint default to.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
2019-07-01 23:44:11 +02:00
Florian Müllner
f6b4b96737 cleanup: Use Array.includes() to check for element existence
We can use that newer method where we don't care about the actual position
of an element inside the array.

(Array.includes() and Array.indexOf() do behave differently in edge cases,
for example in the handling of NaN, but those don't matter to us)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/152
2019-07-01 21:28:52 +00:00
Olivier Fourdan
5ace4682bf accessibility: Add pointer accessibility support
Adds the UI part for the pointer accessibility features.

The various timeouts running are notified using a pie-timer showing
under the pointer.

For dwell-click type selection, we use a drop-down menu. Users can
use the dwell-click to select the next type of dwell click to be
emitted.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/474
2019-06-06 09:13:29 +02:00
Cosimo Cecchi
3b6fae582b sessionMode: add a property to disable window manager menus
We will use this to disable menus in the initial-setup session.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/569
2019-06-06 01:25:04 +00:00
Florian Müllner
a1534dab02 cleanup: Clean up unused imports
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 05:05:07 +01:00
Florian Müllner
bacfdbbb03 cleanup: Port non-GObject classes to JS6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Florian Müllner
7ca418a79a Explicitly convert raw data to strings
As strings are guaranteed to use UTF-8 in the GNOME platform, generic
file APIs like g_file_load_contents() return raw data instead. Since
gjs' recent update to mozjs60, this data is now returns as Uint8Array
which cannot simply be treated as string - its toString() method boils
down to arr.join(',') - so use gjs' new ByteArray module to explicitly
convert the data.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/179
2018-07-31 16:28:53 +00:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Florian Müllner
76f09b1e49 cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for an eventual port to
ES6 classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:54:58 +00:00
Florian Müllner
01d8811913 gdm: Remove separate greeter universal access icon
The idea behind always showing the icon on the login screen is that
the users' needs aren't known at that point. However we can achieve
the same behavior by including the 'always-show-universal-access-status'
key in GDM's presets, so drop the special-case.

https://bugzilla.gnome.org/show_bug.cgi?id=788943
2017-10-13 16:53:54 +02:00
Florian Müllner
2582d16ca7 Define classes with 'var' instead of 'const'
Any symbols (including class properties) that should be visible
outside the module it's defined in need to be defined as global.
For now gjs still allows the access for 'const', but get rid of
the warnings spill now by changing it.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
3d6fdc8ae2 sessionMode: Drop unused import 2017-06-15 15:52:37 +02:00
Florian Müllner
292f87caf7 sessionMode: Don't set overridesSchema
Unused since commit ae2751a68b.
2014-06-09 22:39:15 +02:00
Bastien Nocera
cd2bd7685a js: Name all the timeouts and idles
With very uninventive names. Names now, good names later.

https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 21:08:16 +02:00
Michael Biebl
9f3499a7c3 make NetworkManager optional
NetworkManager is only available on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=669495
2014-02-11 18:04:44 -05:00
Florian Müllner
8e668ca633 sessionMode: Add back external session modes
Since commit da4238ec68, external session modes are no longer
loaded during start-up; bring them back.

https://bugzilla.gnome.org/show_bug.cgi?id=720017
2013-12-07 10:10:06 +01:00
Florian Müllner
4d9a16f33b sessionMode: Fix listModes()
Commit da4238ec68 just broke that function completely by
calling array methods on objects and other funny stuff. Fix it.

https://bugzilla.gnome.org/show_bug.cgi?id=720017
2013-12-07 10:10:06 +01:00
Florian Müllner
c9f2a0f694 sessionMode: Rename _getModes()
Since commit da4238ec68, the function doesn't return anything,
so rename it to _loadModes() to reflect this.

https://bugzilla.gnome.org/show_bug.cgi?id=720017
2013-12-07 10:10:06 +01:00
Florian Müllner
46bac3069e sessionMode: Fix left-over variable in _loadMode()
Commit da4238ec68 dropped a variable, but didn't replace all
consumers.

https://bugzilla.gnome.org/show_bug.cgi?id=720017
2013-12-07 10:10:06 +01:00
Jasper St. Pierre
da4238ec68 Synchronize shell startup
The asynchronous nature of extension loading, session loading, and more,
makes the code racy as to what is initialized first, and hard to debug.
Additionally, since gjs is single-threaded, the only code we're running
in a thread anyway is readdir, which is going to be I/O bound, so the
code here is actually likely to be faster.

Drop this in favor of some good old fashioned synchronous loading.
2013-11-04 11:50:20 -05:00
Jasper St. Pierre
81bb7009ea components: Remove the built-in recorder keybinding and component
The keybinding is now part of gnome-settings-daemon
2013-08-14 20:39:07 -04:00
Jasper St. Pierre
5c8c4e0aad panel: Move statuses to the aggregate menu
Swap out the implementation of SystemIndicator with a dummy,
and build the aggregate menu. At the same time, remove the
poweroff and login screen menus, as those were fake aggregate
menus beforehand.

We lose some flexibility as we lose session-mode-based menu
layout, but as each component of the aggregate menu is supposed
to be "smart" in response to updating itself when session
state changes, I believe it's better than a declarative model.

https://bugzilla.gnome.org/show_bug.cgi?id=705845
2013-08-13 06:50:24 -04:00
Jasper St. Pierre
ca861d8ff9 status: Rebrand the user menu as the system menu
As the user menu no longer really shows anything about the user, and just
power menu and settings, it's not really deserving of the "user menu" name,
so rename it to the ever-blandly-named "system menu".

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:44 -04:00
Florian Müllner
91844e48e9 main: Pick up overridesSchema from sessionMode
This will allow the use of mode-specific defaults. For classic mode
we currently implement this with mini-extensions, but this may result
in confusing behavior when settings change due to extensions being
disabled during screen locks (not to mention that those mini-extensions
are hardly an elegant approach).

https://bugzilla.gnome.org/show_bug.cgi?id=701717
2013-06-07 19:52:10 +02:00
Florian Müllner
d44d00f0f4 sessionMode: Add 'allowScreencast' property
Our built-in screen recorder is implemented as a component, so it will
just be disabled when the session mode doesn't allow screencasting.
However we will expose screencasting functionality on DBus as well, and
while it makes sense to restrict its availablity to the same modes as
the existing recorder, exporting/unexporting the service depending on
the session mode is not very consumer friendly.
For that reason, add an additional 'allowScreencast' property that for now
mirrors the availability of the 'recorder' component.

https://bugzilla.gnome.org/show_bug.cgi?id=696247
2013-05-10 19:49:01 +02:00
Florian Müllner
22b6a25408 loginDialog: Remove logo in upper left corner
With optional branding now being shown below the user list, we can
remove the unloved instance in the upper left corner ...

https://bugzilla.gnome.org/show_bug.cgi?id=694912
2013-05-07 20:52:58 +02:00
Jasper St. Pierre
eab1ab0fac sessionMode: Remove initial-setup mode
Now that we have external session modes, we can simply
make gnome-initial-setup bundle its own mode.
2013-05-07 14:27:10 -04:00
Michael Wood
96b76709e9 session: Remove the clock from initial setup mode
If you're in the initial setup mode you're not likely to have the
correct time displayed.
2013-04-25 11:52:02 +01:00
Matthias Clasen
4a2cdc20f0 Add networkAgent to initial-setup mode
We want to be able to set up e.g. a WEP connection on the
network page of gnome-initial-setup, so we need a network
agent in the session.
2013-04-15 18:05:57 -04:00
Giovanni Campagna
b878f3fc4a Restore visibility of windows in initial-setup mode
gnome-initial-setup runs a regular X window, so we need to show it.

https://bugzilla.gnome.org/show_bug.cgi?id=696235
2013-03-25 18:22:48 -04:00
Adel Gadllah
9b3b419f7a initial-setup: Add battery icon
There is no reason why there shouldn't be a battery icon in initial-setup,
knowing how much battery you have left is useful in during setup as well.

This also fixes an exception in the lock screen caused by the combined icon
not finding the battery one.

https://bugzilla.gnome.org/show_bug.cgi?id=696212
2013-03-24 09:39:34 +01:00
Jasper St. Pierre
7cdb75e7ce Defer initializing UI until after the global session has loaded
https://bugzilla.gnome.org/show_bug.cgi?id=694321
2013-03-07 16:35:36 -05:00
Ray Strode
1dceae97c6 Revert "Defer initializing UI until after the global session has loaded"
This reverts commit 0bef925b51.

Just for now.  Jasper has plans to clean up start up eventually.

https://bugzilla.gnome.org/show_bug.cgi?id=694321
2013-03-06 17:26:15 -05:00
Jasper St. Pierre
0bef925b51 Defer initializing UI until after the global session has loaded
https://bugzilla.gnome.org/show_bug.cgi?id=694321
2013-03-06 14:55:58 -05:00
Giovanni Campagna
c4621119b3 AccessibilityMenu: hide when not needed
Tie the menu visibility to having at least one a11y feature enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=681528
2013-02-19 22:07:08 +01:00
Florian Müllner
fcc32fca7e sessionMode: Add stylesheetName property
This will allow to visually differentiate modes by providing
separate styling.

https://bugzilla.gnome.org/show_bug.cgi?id=693219
2013-02-05 19:54:17 +01:00
Florian Müllner
187dec2816 sessionMode: Add support for 'parentMode' property
Defining a mode that differs significantly from the default one
can get rather cumbersome. For convenience, allow mode definitions
to inherit from an existing mode.

https://bugzilla.gnome.org/show_bug.cgi?id=689308
2012-12-05 21:56:57 +01:00
Florian Müllner
31f75e4607 extensionSystem: Add support for mode-specific extensions
As currently envisioned, the fallback replacement in 3.8 should be
a separate session at the login screen. As we will use extensions
to implement this mode, we need a way to specify extensions per
session rather than per user, so add a session-mode property for
extensions that should be loaded in addition to the user-defined
ones.

https://bugzilla.gnome.org/show_bug.cgi?id=689305
2012-12-05 21:56:57 +01:00
Florian Müllner
92083eaf76 sessionMode: Make loading of external modes asynchronous
Blocking IO on startup is bad m'kay ...

https://bugzilla.gnome.org/show_bug.cgi?id=689304
2012-12-05 21:56:57 +01:00
Florian Müllner
8a17f512f4 sessionMode: Add support for external mode definitions
Currently adding a new session mode requires patching the sources.
As defining custom modes can be desirable in some circumstances
(for instance for administrators of kiosk setups), load additional
modes from JSON files.

https://bugzilla.gnome.org/show_bug.cgi?id=689304
2012-12-05 21:56:17 +01:00
Florian Müllner
2511f60d39 sessionMode: Add panelStyle property
The panel should change appearance according to the sessionMode,
so add a new panelStyle sessionMode property which allows to
specify a mode specific style class for the panel actors.

https://bugzilla.gnome.org/show_bug.cgi?id=684573
2012-11-21 13:10:46 +01:00
Florian Müllner
28b559e812 windowManager: Replace sessionMode.allowKeybindingsWhenModal
The original condition the property was based on was added to make
the a11y switcher available in the login screen, though it did never
work properly - after popping up the switcher, additional tab key
presses were ignored. As we are now able to filter bindings much more
selectively, we can simplify the check and drop the sessionMode property.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:52:51 +01:00
Florian Müllner
9efe5287e4 gdm: Move logo into the panel
GDM has a 'logo' key in its schema to allow distributors to add
some branding. It is currently placed above the user list, which
no longer works too well since the login screen lost its dialog
window. Display the logo in the top-left corner instead of the
Activities button instead.

https://bugzilla.gnome.org/show_bug.cgi?id=685852
2012-10-25 18:31:16 +02:00
Giovanni Campagna
0ff614ccd4 Don't show network dialogs in the lock screen
Remove the network agent component from the lock screen and unlock
dialog session modes.

https://bugzilla.gnome.org/show_bug.cgi?id=684384
2012-09-20 20:03:23 +02:00