Commit Graph

5993 Commits

Author SHA1 Message Date
Florian Müllner
1c9d821aa2 messageTray: Add source policy setter
Commit 8f15193b4 changed the `policy` property from a regular JS property to
a getter. This was necessary to avoid calling an overridden _createPolicy()
method before a subclass is properly initialized, but it broke the second
way of using notification sources:

Don't create a Source subclass, but use the base class directly and change
its `policy` property.

There's no good reason why we should no longer allow this, so add a setter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/431
2019-03-03 08:58:56 +00:00
Florian Müllner
26e33ff093 windowAttentionHandler: Don't destroy on open
The activateWindow() call is expected to focus the window, which
already destroys the source. If we then destroy it again explicitly,
we get another "invalid access" warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/430
2019-03-02 22:09:33 +01:00
Florian Müllner
5f2bd70690 network: Don't destroy wireless dialog twice
The dialog doesn't change the `destroyOnClose` property from its default,
so it is already destroyed automatically on close. So if we also destroy
it explicitly, we end up (rightfully) with one of gjs' infamous "invalid
access" warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/430
2019-03-02 22:09:20 +01:00
Florian Müllner
572d54981e appsMenu: Fix initial visibility of "Details" item
It is only supposed to be visible when Software is installed, but
we currently only update the visibility on changes.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/989
2019-03-02 18:13:38 +00:00
Marco Trevisan (Treviño)
4a4f752459 dateMenu: Relayout IndicatorPad when parent size changes
This happens often in resource-scaled world

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
8f1fff1374 background: Don't set background actor sizing and scaling
Mutter BackgroundActor is able do detect this at lower level

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
deead2af97 layout: Add scale property to Monitor
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
9e881ab637 animation: Reload sliced texture on global scale change
When the scale has changed we need to reload the texture at proper size.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
b6ec02cef2 animation: Load sliced image using resource scale, and reload on change
Also make sure that the textures size is matching the container size.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
19c60ff5c5 st-texture-cache: use StImageContent for cairo bound surface
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
d78b416e1a lookingGlass: Use symbolic icon for close button
As per commit 4d2dce2c, the actual close button is generated using custom css
and a symbolic icon.

Apply the same change to lookingGlass too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/425
2019-02-28 16:21:38 +01:00
Florian Müllner
70f4906ca5 aggregateLayout: Fix natural width computation
Ouch, this went unnoticed for a long time: As the minimum size of menu
items is generally small (because its label can be ellipsized), we are
requesting the unellipsized width of the last "size child" instead of
the widest one.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/996
2019-02-26 08:25:00 +00:00
Andrea Azzarone
f3168d22a6 shellDBus: Add grabFlags parameter
Add an grabFlags parameter to the GrabAccelerator and GrabAccelerators dbus
methods. This will allow e.g. Gnome Settings Daemon to create shortcuts that
should discard key-repeated events.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/156

Fixes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/68
2019-02-20 14:17:46 +01:00
Florian Müllner
bbd68626cc ctrlAltTab: Fix more fallout from ES6 classes
Since ShellGenericContainer was removed, switcher popups and lists
are StWidget subclasses rather than plain JS classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/411
2019-02-15 20:26:16 +01:00
Florian Müllner
23d233857e calendar: Load interface description from resource
Here's a template string with '/' that escaped commit 94423151b2,
resulting in an xgettext warning when generating the .pot file.

Simply move it into the resource like the other interface descriptions
to make xgettext happy again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/407
2019-02-13 17:58:36 +00:00
Arnaud Bonatti
9620bd0f22 Add a Taquin renamed desktop id.
Taquin is org.gnome.Taquin.
2019-02-13 13:37:07 +01:00
Arnaud Bonatti
ecfe56ca63 Add the 2048 renamed desktop id.
gnome-2048 id is now set to
org.gnome.TwentyFortyEight.
2019-02-13 13:37:04 +01:00
Arnaud Bonatti
eabb02d3da Change Iagno renamed desktop id.
Iagno is org.gnome.Reversi,
instead of org.gnome.Iagno.
2019-02-13 13:37:01 +01:00
Florian Müllner
33e05f5912 system: Always use default avatar in switch-user submenu
It is too small to be really useful, and sticks out being the
only color icon.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/957
2019-02-10 10:33:23 +00:00
Jonas Dreßler
c1d3e304cb windowManager: Only allow top-drag gesture if focus window is fullscreen
The top drag gesture is not of any use if the topmost window is not
a fullscreen window and will only block events near the important top
screen edge (i.e. the panel). To fix this, only enable this gesture if
the focus window is a fullscreen window.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/552
2019-02-10 10:06:11 +01:00
Florian Müllner
1b169655ac aggregateMenu: Don't use system menu for width computation
If the user's real name is too long to fit the menu comfortably, we are
supposed to use the username instead. However since commit f8e5e3e435,
we no longer set a max-width on the menu as a whole, but instead base
the width request on only "unellipsizable" children. For some reason
the system menu ended up there, so the name is now allowed to grow
indefinitely.

Remove it from the list of size children to get the intended behavior
back.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/400
2019-02-10 02:18:40 +00:00
Florian Müllner
a111bfb90a userWidget: Add back missing import
This was accidentally dropped in commit a1534dab02.
2019-02-09 18:51:14 +01:00
Florian Müllner
7dd326f090 keyboard: Make items in language menu unfocusable
The menu grabs the key focus when opened, which takes focus away from
whichever actor triggered the keyboard. And as the menu doesn't have
any text entries, the keyboard is popped down as a result.

Prevent this by making the menu items unfocusable, so the keyboard
focus just stays where it is. Considering that the menu is part
of the on-screen keyboard itself, not being keyboard-navigatable
isn't a big deal here.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/171
2019-02-09 14:48:27 +00:00
Florian Müllner
24a26e025b popupMenu: Respect items' :can-focus property
Menu items use a single 'active' state that follows both hover and
keyboard focus. It therefore makes sense for the active item to always
grab the focus, in particular as an item that is sensitive but not
focusable by keynav would be rather weird.

As it turns out, we do have a case that is weird enough where we want
exactly that, so only grab focus if the actor's :can-focus property
allows it.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/171
2019-02-09 14:48:27 +00:00
Florian Müllner
d17d99bd6d lookingGlass: Include St in default imports instead of Gtk
Until commit 467b7c1bca, the import used to leak into the
eval() environment, but not anymore. Add it back (and remove
Gtk, as it's not *that* useful).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/398
2019-02-09 12:22:14 +01:00
Florian Müllner
fd50b9a45e cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 07:39:20 +01: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
a87ab6d0fc panel: Restrict app menu width
Window titles aren't restricted in length, so the menu may end up unwieldily
width. Commit 0bec76b6ee therefore limited the app context menus, but that
got accidentally dropped in commit 0ded0dbfd5. Add back the limitation and
extend it to the new app menu as well.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
1c117c469a panel: Desaturate appmenu icon
Top bar icons are supposed to by symbolic, but not all applications
provide a symbolic icon. Make the stick out less by desaturating
the appmenu icon if a symbolic style is requested.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
7df93458d7 build: Remove remote menu support
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
62a3b9e6a3 windowMenu: Remove fallback app menu support
With the app menu being phased out entirely, there's no good reason to
keep support for the fallback app menu in decorations either - the number
of applications that set an app menu and haven't embraced client-side
decorations is extremely small, and they should already have alternative
fallbacks for non-GNOME environment in place.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Florian Müllner
dc79393b27 panel: Replace remote app menu
Since the plans to retire the app menu were announced, nobody objected to
the removal of the menu content, however some concerns were raised about
the menu's secondary role as indicator.

Account for that by not removing the existing app menu, but replacing it
with a built-in menu similar to the existing app icon context menu.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:12 +01:00
Florian Müllner
c334aa2a4c panel: Ignore shell-shows-app-menu setting
The GtkSettings was originally introduced to inform applications about
the desktop shell's capabilities, but users soon started to use it to
force GTK+ to show the app menu inside the application. We eventually
caved and also handled the setting ourselves to hide the in-shell app
menu to allow users to "move" it.

But now the remote app menu is in the process of being retired[0], and
will be replaced with a simple indicator that cannot be moved, so
stop following the GtkSetting.

[0] https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:26:56 +01:00
Florian Müllner
9f61a4f5fd panel: Remove unused import
https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:26:56 +01:00
Ray Strode
f0a7395b30 shellActionModes: disable POPUP keybindings in unlock screen
Certain keybindings should continue to work even when a popup
menu is on screen. For instance, the keybinding for showing
the app menu and the keyinding for showing the calendar are
examples.

This is achieved by putting in place a special "POPUP" action
mode, whenever a popup menu is active.  This mode replaces
the (e.g., "NORMAL" or "OVERVIEW") action mode that was in place
for as long as the popup menu is active.

But those keybindings should not work when the user is at the
unlock dialog (which uses an action mode of "UNLOCK").

Unfortunately, since commit c79d24b6 they do.

This commit addresses the problem by forcing the action mode
to NONE at the unlock screen when popups are visible.

CVE-2019-3820

Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/851
2019-02-05 11:09:40 -05:00
Florian Müllner
c1a6effea0 panel: Don't allow opening hidden menus via keybindings
We shouldn't allow toggling menus that aren't supported by the
current session mode, but as indicators are hidden rather than
destroyed on mode switches, it is not enough to check for an
indicator's existence.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/851
2019-02-05 11:08:45 -05:00
Carlos Garnacho
f78efc46e7 keyboard: Implement keypad OSK panel
This is pretty ad-hoc, the panel is hooked so it shows right away on the
right Clutter.InputContentPurpose.
2019-02-05 16:25:57 +01:00
Carlos Garnacho
42ae052da7 keyboard: Add Emoji keyboard
This keyboard works similar to GTK+'s emoji chooser (actually, both pull
from the same JSON file). Emojis are categorized in sections and variants
and kept in a "model".

The EmojiPager actor then uses this model to generate pages on-the-fly as
the user swipes around. This is an important optimization since the amount
of actors would rival with the rest of the shell otherwise.

The EmojiSelection object puts the EmojiPager, the page indicators and
a KeyContainer with the bottom row of emoji section shortcuts together to
implement the emoji panel as a whole.

The Keyboard object hooked this to an "emoji" key, which is just visible
on the Clutter.InputContentPurpose where showing an emoji would be
meaningful. Otherwise the surrounding buttons are made a bit wider to
cover up for it (i.e. as it was before).
2019-02-05 16:25:57 +01:00
Carlos Garnacho
fab390826e appDisplay: Separate PageIndicators to a separate file
In order to cater for emoji panel usage, we want something like PageIndicators
except:
- It should have horizontal disposition
- It should not be animatable (?)
- It should not be reactive

Separated PageIndicators into a base, non-animated widget, and an
AnimatedPageIndicators that can be used on appDisplay.js. Reactiveness is
set through an extra method, and layout is set as a construct argument.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
2a9923628b keyboard: Separate aspect ratio control to a container actor
This will be useful as we want other panels (eg. emoji) to preserve aspect
ratio with the rest of the OSK. Separate the aspect ratio management logic
into this container that will be the parent of them all.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
291aa0b053 keyboard: Remove unused code
This signal does not exist, the Suggestions.add() method allows to attach
per-element callbacks instead.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
83eb75ad7a keyboard: Fix JS warning
Iterate correctly through the array, instead of stepping on the possibly
non existent first element.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
bb215966e5 keyboard: Fix JS warning
The label field may be empty here (eg. buttons fully styled through css),
just resort to an empty string then.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
545d49c70d keyboard: Fix JS warning
The solution is pointed out by the warning itself.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
699e97559d windowManager: Disable bottom edge swipe gesture if OSK is enabled
It does not make sense then, plus it eats events close to the edge.
2019-02-05 16:25:54 +01:00
Carlos Garnacho
4aecf4c973 keyboard: Avoid sequence grabs on touch
We can do without these. Since grabs prevent gestures in parent containers
from happening, we actively don't want these for emoji scrolling/paging.
2019-02-05 16:25:54 +01:00
Florian Müllner
9cfb51c106 panel: Remove panel translucency
Since commit 447bf55e45 we turn the top bar translucent when
free-floating. While this looks fancy and reduces the appearance
of cutting into the available screen space, it has also had a
negative effect on legibility.

Nobody stepped up to address those issues in two years, so revert
back to the fully opaque top bar.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/408
2019-02-05 12:08:57 +00:00
Florian Müllner
40e624444c dateMenu: Refresh world clocks section
Update the section styling to accentuate the most relevant information,
and include the timezone.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/262
2019-02-05 11:36:38 +00:00
Florian Müllner
3cf67b1236 dateMenu: Show weather location in section header
It is useful information, in particular when the location is set
automatically via geoclue.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/262
2019-02-05 11:36:38 +00:00
Florian Müllner
5dedb97fcc dateMenu: Use graphical weather forecasts
While the current textual forecast is non-intrusive, it may be too
much so, making it less effective to spot the current conditions
at a glance.

Refresh the section to use a more conventional graphical representation,
similar to the one used by gnome-weather itself.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/262
2019-02-05 11:36:38 +00:00
Florian Müllner
4590094605 windowManager: Add switch-to-application-n keybindings
Having Unity-like shortcuts for activating the first nine applications
in the dash has been a long requested feature, but somehow nobody got
around to implement it.

As the shortcut is most useful outside the overview where the dash is
not visible, only consider favorite apps as they have a predictable
order.

https://bugzilla.gnome.org/show_bug.cgi?id=648000
2019-02-05 11:33:30 +00:00
Florian Müllner
15e7625c80 cleanup: Remove erroneous vfunc parameters
Unlike in C or signal handlers, vfuncs don't include the this-object
in their arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/388
2019-02-05 02:21:40 +00:00
Florian Müllner
cdd2803498 Don't mistake GObject.registerClass() for a constructor
Those slipped through when porting from Lang.Class to ES6 classes.

Very indirectly spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/388
2019-02-05 02:21:40 +00:00
Florian Müllner
43fb2b38b1 screenshot: Remove bogus parameter
Expecting a callback argument over D-Bus doesn't make any sense at
all, whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/388
2019-02-05 02:21:40 +00:00
Christian Kellner
345a8fe748 thunderbolt: ensure failure msg is translatable
Swap the gettext() and format() calls to ensure that the message
is translatable.
2019-02-04 18:53:42 +00:00
verdre
a7d974481c workspace: Update a wrong comment
We showed the app icon there back then, nowadays it's a close button and
the title of the window.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
3730314dd5 workspace: Use ES6 findIndex() method for getting window index
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
6b0c8c9fe0 workspace: Rename show-close-button signal to chrome-visible
Since we no longer only show the close button but the whole window
chrome on hover, change the name of the signal.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
28a56d24ad workspace: Some style changes to match guidelines
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
5e6629e1a7 workspace: Remove some unnecessary variables and functions
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
a00b967df0 workspace: Rename some variables for clarity
Since the overlays we show on hover above the window clones are no
longer only a close button, but the window title, a border and a close
button, rename a few variables so it's easier to understand what they're
for.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
verdre
193e4ae31e workspace: Use globals for delays and animation times
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
2019-01-31 17:36:25 +00:00
Christopher Davis
409a27c3b8 weather: Change Weather app ID
As of 9f7f5a68d4 Weather uses
org.gnome.Weather everywhere instead of org.gnome.Weather.Application.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/379
2019-01-31 12:33:10 -05:00
Florian Müllner
ba97e8da7a magnifier: Add missing import
This was missing from commit a7bb8ee639.
2019-01-31 14:10:30 +01:00
Florian Müllner
c47e672eea a11y: Don't set WM theme
We've been using GTK to draw server-side decorations according to the
GTK theme for a long time, so no need to configure the HighContrast
theme for a setting we don't use.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/377
2019-01-31 08:29:15 +01:00
Carlos Garnacho
036e67049b st-texture-cache: Use GtkIconTheme separate from GTK+
Using the default icon theme just has automatic theme updates as an added
value. We can do that ourselves, and stop relying on XSettings internally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
f02033acb7 main: Use StSettings instead of GtkSettings
Cut a middle man by listening to dconf settings directly, and stop relying
on XSettings for it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
91d73d65c3 tweener: Use StSettings instead of GtkSettings
Cut a middle man by listening to dconf settings directly, and stop relying
on XSettings for it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
81c4c23016 dnd: Use StSettings instead of GtkSettings
Cut a middle man by listening to dconf settings directly, and stop relying
on XSettings for it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 23:18:53 +01:00
Carlos Garnacho
c59c5eb893 st: Add StDirectionType enum
In order to replace GTK+'s GtkDirectionType. It's bit-compatible with it,
too. All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
a977c1388a st: Add StPolicyType enum
In order to replace GTK+'s GtkPolicyType. It's bit-compatible with it, too.
All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
0f799ae313 environment: No need to set Gdk version
The Gdk module is no longer used.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
23c3f3fdea overview: Do not warp pointer to fake crossing event
This is actually papering over bugs in toolkits. On X11 the Xserver will
send crossing events when the stage input shape changes. As those go
end up ignored in GTK+, this warp call aims (and randomly manages) to send
a motion event that wouldn't go unlistened by the drag source window (the
one holding the grab).

This bug actually manifests in other ways, eg. by changing the window
beneath the pointer with alt-tab while DnDing. This should be fixed
altogether in the client side.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
82c7090e9e modalDialog: Do not sync display here
This gdk_display_sync() call was added in commit a40daa3c22 so the alt-f2
dialog is able to spawn commands that trigger grabs on startup (eg. xmag/
xkill).

This seems worthwhile to do only on the X11 backend, and handling it in
mutter backend code seems cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
208c551787 js: Drop unused Gdk/Gtk imports
There's nothing from those modules used in those JS files.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Carlos Garnacho
b10606e884 keyboard: Drop GDK API usage
Use the misnamed but equivalent Clutter function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Philip Withnall
e92477a752 screenShield: Show detailed notification data if notifications hint it
Allow notifications to set a x-gnome-privacy-scope hint, with values in
['system', 'user']. If all the notifications in a particular source hint
that their privacy scope is ‘system’, don’t hide the notification
details on the lock screen.

This is aimed at fixing the particular case of power notifications: they
contain information which is not private to the user (it relates to the
system: battery state or AC state, which is obvious to anyone who can
see the machine), so hiding the details of a power management
notification when the screen is locked is pointless.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/gnome-shell/issues/726
2019-01-30 19:14:40 +00:00
Florian Müllner
37e0a73c8f iconGrid: Remove unreachable code
Throwing an exception already aborts a function, so there's no need
for a return statement in that case.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:17 +00:00
Florian Müllner
4f76e05058 keyboard: Fix undefined variable in fall-through message
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:17 +00:00
Florian Müllner
3134222d27 keyboard: Add back constructor parameter
This was accidentally dropped in commit bacfdbbb03.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:17 +00:00
Florian Müllner
a9ed128dce ibusCandidatePopup: Clarify assignment in condition
Most often it is a bug if the condition part of a for-loop contains the
assignment operator rather than the comparison one, so tools rightfully
emit a warning.

Clarify that the assignment is intentional in this case by adding
parentheses.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:16 +00:00
Florian Müllner
a7943ff934 iconGrid: Fix nonsense condition
Just like the "in" operator in the previous patch, "instanceof" has
a lower precedence than negation, resulting in the nonsense condition
of "true instanceof BaseIcon".

Add parentheses to get the intended behavior.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:16 +00:00
Florian Müllner
c353914dd0 appFavorites: Fix nonsense condition
The "in" operator has a lower precedence than negation, so we are
actually testing whether the favorites map contains "false".

Add parentheses to get the intended behavior.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:16 +00:00
Florian Müllner
91319e3963 networkAgent: Fix mobile broadband notifications
Currently their body message is assigned to an undefined variable
that isn't used for anything later.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:16 +00:00
Florian Müllner
dc4ff941bd networkAgent: Fix showing the WPS message
The message was introduced in commit dfa0750ffd, but added to a
non-existent container, whoops.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
2019-01-30 16:13:16 +00:00
verdre
f6da36ad3a workspaceThumbnail: Clean up porthole/workarea setting and updating
Instead of unnecessarily updating the porthole on every call to the
layout vfuncs and returning widths and heights of 0 when the overview is
hidden, only update it on actual workarea changes.

Also use the stage size for the porthole in case no monitor is available
to make sure we don't try to allocate a 0-sized box.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/892, https://gitlab.gnome.org/GNOME/gnome-shell/issues/517

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/343
2019-01-30 10:07:14 +01:00
verdre
5f4e2749a2 overview: Remove unneeded check if primary monitor exists
This check is no longer needed because we're using the stage size
instead of the monitor size here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/374
2019-01-30 00:33:46 +00:00
Georges Basile Stavracas Neto
a7bb8ee639
magnifier: Use a ClutterContent to render mouse sprite
The Magnifier class uses a small subtree of actors to track the
current cursor's position and sprite. Specifically, it uses the
deprecated ClutterTexture to paint the cursor sprites.

Add a new, very simple ClutterContent implementation to track the
cursor sprite, and replace the ClutterTexture by a ClutterActor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/371
2019-01-29 16:31:57 -02:00
Florian Müllner
8f732e4f45 messageTray: Disconnect signals when resetting notification
Just like we did for the parent class in commit b57832716a, we should
disconnect any notification signals when the notification is reset
to null to avoid warnings later.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/942
2019-01-29 16:49:48 +00:00
Georges Basile Stavracas Neto
23d6d13d80
st-shadow: Add a CoglFramebuffer argument
The last patch in the series, this one adapts StShadowHelper
to received a CoglFramebuffer. This is where we first touch
JavaScript with Cogl types, and as such, it depends on the
latest Mutter. Earlier versions of Mutter didn't have its
Mutter-Clutter GIR to generate types for various Cogl types.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
2019-01-28 12:35:54 -02:00
Pascal Nowack
582b3aacf4 dnd: Fix syntax error which led into g-s not starting anymore
With the recent port to JS6 classes, the trailing
comma after functions in the syntax of classes has
been removed.
However commit c2961f21 accidentally reintroduces
one trailing comma after a newly created function,
leading into g-s throwing an exception and not
starting anymore.

Therefore, remove this trailing comma to solve
this problem.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/366
2019-01-28 01:44:07 +01:00
Carlos Garnacho
78608a5080 dnd: Prevent simultaneous DnD operations from happening
Besides the device grab on the drag device, also set up a captured-event
handler to catch other devices (except the keyboard) while the DnD
operation is ongoing. This makes DnD operations exclusive to others.

Also, disallow it in less aggressive ways if maybeStartDrag() gets called
while there is a current draggable.

This might definitely be nicer (eg. having other grabbed devices emit
leave/end events), but can't be done without major surgery to Clutter.
2019-01-26 23:38:50 +00:00
Carlos Garnacho
7a86637f8d dnd: Avoid breaking drag state on cancellation
In the case where the draggable has an actor of its own, state could be
left broken when dragging on a place that would not accept the DnD op.
After button release, drag state is set to "cancelled" and the animation
begins. After the animation is finished, the drag actor would be destroyed
before disconnecting from its destroy handler.

Within the destroy handler, the grab would be undone but drag state would
be left on "cancelled" state for subsequent operations. This results in
DnD oddities and stuck grabs.

In order to fix this, double check in the actor destroy handler that we
are actually dragging before setting the "cancelled" state.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/540
2019-01-26 23:38:50 +00:00
Carlos Garnacho
c2961f2152 dnd: Get dragging device from the triggering events
Instead of fetching the CLUTTER_POINTER_DEVICE device. It will
be wrong if drags get initiated from tablet pointers. This allows
for DnD operations to be started, moved, and more importantly
finished through tablet devices.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/540
2019-01-26 23:38:50 +00:00
Carlos Garnacho
794a056819 appDisplay: Use GAppInfo list from ShellAppSystem
It is now cached there, so the number of g_app_info_get_all() calls
is reduced to one per change.
2019-01-26 22:55:31 +01:00
Carlos Garnacho
3db52155dd appDisplay: Reduce g_app_info_get_all() calls
Whenever the AllView needs (re)populating, we used to do one general
g_app_info_get_all() to get all GAppInfo, plus one per app folder in order
to check the ones that fall within that category. This calls results in a
fair amount of I/O blocking the main loop.

In order to ease this, keep the GAppInfo list around in AllView, and make
the AppFolders use it when figuring out the contained apps. Since reloading
the AllView results in AppFolders regenerated from scratch, the app info
list is ensured to be up-to-date for any later change within the AppFolder
(eg. through the GSettings key changing).

As the list was already filtered in the first place, we can also remove
the try{}catch() in AppFolder in order to discard desktop files with
invalid encoding.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/832
2019-01-26 16:40:48 +01:00
Lubomir Rintel
dfa0750ffd networkAgent: Advise the user to push a WPS button on their router
When connecting to a Wi-Fi router that supports the WPS button method
(PBC, push button connection) the user can simply press the button on
the router. Show an explanation in the PSK prompt when this is
possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/329
2019-01-25 15:25:26 +01:00
Florian Müllner
d80e7e0118 lookingGlass: Don't import Lang by default
With arrow functions, Function.prototype.bind() and ES6 classes, the
Lang module is rarely needed nowadays.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Florian Müllner
e68dfed1f7 cleanup: Port GObject classes to JS6 classes
GJS added API for defining GObject classes with ES6 class syntax
last cycle, use it to port the remaining Lang.Class classes to
the new syntax.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00: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