Commit Graph

13724 Commits

Author SHA1 Message Date
Florian Müllner
ac1f896107 environment: Reimplement Date.toLocaleFormat() override
Now that we no longer go through GTimeVal to convert from Date to
GDateTime, there is no more reason for using a C helper function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807
2019-11-06 20:19:57 +00:00
Florian Müllner
3913fa5044 environment: Stop adding child_set() to layout managers
We no longer use any layout managers that use custom child properties
instead of the generic Clutter.Actor properties, so this override
is completely unused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-06 09:42:57 +01:00
Florian Müllner
32185c17d0 environment: Stop monkey-patching Clutter.TableLayout
It's not used for anything anymore, and may well end up being removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-06 09:42:57 +01:00
Florian Müllner
d3d165243c cleanup: Use non-deprecated key symbols
Clutter originally cluttered its namespace with key symbols, before
prefixing all symbols with KEY. We still use the unprefixed symbols
occasionally, replace them so mutter can drop the deprecated symbols.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-06 09:42:57 +01:00
Florian Müllner
1e203f4631 cleanup: Replace deprecated lower/raise calls
Those methods have been deprecated for a long time, so
move to the drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-06 09:42:57 +01:00
Florian Müllner
0617be9fb9 windowManager: Stop using Clutter.Actor.prototype.reparent()
It has been deprecated for ages, and is about to be dropped from mutter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-06 09:42:57 +01:00
Florian Müllner
0749ac27ce calendar: Use Clutter.GridLayout
Clutter.TableLayout has been deprecated, so move to the recommended
replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
2019-11-05 23:50:06 +01:00
Jonas Dreßler
d5eafbad87 polkitAgent: Use a timeout for resetting the dialog
Since polkit takes a few milliseconds from initiating the session to
emitting the "request" signal, don't introduce visual distraction by
hiding the password entry and showing it again a few ms later.

So start a timeout of 200 ms when we destroy a session and if no session
request (i.e. a request for a password-authentication) happened during
this timeout, hide the password entry.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:33 +01:00
Jonas Dreßler
5c7a701a68 polkitAgent: Reset dialog to defaults after cancelling polkit session
Since we don't know if polkit/PAM will request a password (emitting the
"request" signal) or use another authentication method like a
fingerprint after the current authentication failed, hide the password
field and make the "Authenticate" button insensitive after cancelling
the session, just like we do when creating the dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:33 +01:00
Jonas Dreßler
cd36301d2b polkitAgent: Make authenticate button insensitive if password is empty
According to the mockups, make the polkit dialogs "Authenticate" button
insensitive and don't respond to pressing the enter key if no password
is supplied.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:33 +01:00
Jonas Dreßler
70203b58ca polkitAgent: Only set key focus to password entry after opening dialog
Set the key focus to the password field only after we got a request
(and therefore know that a password is requested) instead of using
`setInitialKeyFocus()`. This way we don't try to focus the password
field by default if we aren't showing it (e.g. in case the user has no
password or is using fingerprint login).

Also we have to move the call to `grab_key_focus()` to happen after
`_ensureOpen()`, because otherwise the ModalDialog will set the focus to
one of the buttons while opening itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:33 +01:00
Jonas Dreßler
c627d47019 polkitAgent: Also show user avatar for root user
Show the user avatar for all users, including the root user. The root
user will always have the generic avatar, but it looks more consistent
than showing no avatar at all.

This way we also don't have to worry about the spacing introduced by the
polkit-dialog-user-layout CSS class, which would give the
"Administrator" label a small offset to the left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:31 +01:00
Jonas Dreßler
f546715cc3 polkitAgent: Update user name on user changes
Right now we only update the user avatar on the user-changed signal, but
since we also display the users real name we should also update that if
the user changes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:52:15 +01:00
Jonas Dreßler
f5e179f03d polkitAgent: Fix a typo of a signal name
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788
2019-11-05 18:49:05 +01:00
Daniel Mustieles
35a265a183 Updated Spanish translation 2019-11-05 15:38:42 +01:00
Florian Müllner
147a743d8d system: Replace action icons with regular menu items
Besides making the menu a bit less special, it allows us to fit both
shutdown and suspend actions without any hidden alt-key Easter eggs.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/270
2019-11-05 13:05:59 +00:00
Florian Müllner
e4147f3611 altTab: Use correct actor in label height computation
Commit f2bd39b20 removed an intermediate bin, and now we use the
thumbnail bin instead of the label actor to compute the label
height, whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/804
2019-11-05 12:52:29 +00:00
Carlos Garnacho
6a42d77261 st: Track stylesheet changes on the StThemeContext
Instead of every individual StThemeNode. There are essentially two kinds
of theme nodes: Those we create for lookups, and those interned by the
theme context and used by StWidgets. Listening to the signal on the former
is pointless as they are short lived and not meant to be really used for
drawing. So it is only essential to track stylesheet changes in those we
intern for later use.

This change does precisely that, it lets the StThemeContext track the
stylesheet changes and let all known theme nodes reset their state for
it.

The internal array holding all connected handlers for this signal in glib
was about the biggest single allocation made in gnome-shell, as interned
theme nodes nodes are around the 4 to 5 digit numbers. This essentially
makes it disappear.

This however means that widgets that are explicitly set a theme through
st_widget_set_theme() don't get their theme node implicitly updated.
There's little reasons to use that API, so perhaps this is an acceptable
tradeoff.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/779
2019-11-05 12:36:28 +00:00
Carlos Garnacho
55867c40c4 st: Drop StWidget theme overriding API
A StWidget could get its style from a) a theme set in the StThemeContext,
and b) directly through it's ::theme property. Generally, overriding CSS
through the latter cannot be recommended as it loses any connection with
the global theme (eg. the ones you get through selector specificity).

It sounds a bit too powerful and pervasive, there's no use for it in
gnome-shell and doesn't look like something that could be recommended on
extensions. So, just drop this piece of API.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/779
2019-11-05 12:36:28 +00:00
Milan Crha
28c535e341 calendar-server: Uses wrong timezone for event times
The conversion to UTC/time_t time was not using correct timezone.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1714
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/806
2019-11-05 12:27:06 +01:00
Florian Müllner
f309d98bc8 cleanup: Use more template strings
xgettext got better at recognizing template strings, so we can
replace more string concatenations. Alas xgettext is still buggy
(surprise, regular expressions are hard), so there are still a
handful of holdouts that prevent us from making a complete switch.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/792
2019-11-05 01:51:29 +00:00
Florian Müllner
2c62e45168 st: Remove StBin's align properties
They are now completely unused, so remove them and stop the confusing
shadowing of ClutterActor's own x/y-align properties.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803
2019-11-04 21:27:56 +01:00
Florian Müllner
f2bd39b20c js: Use generic actor properties to align StBin children
StBin's fill/align properties are now no-ops; get back the intended
child allocation by setting the corresponding x/y-align on the child.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803
2019-11-04 21:27:56 +01:00
Florian Müllner
72af64d964 st: Remove st_get_align_factor() utility method
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803
2019-11-04 21:23:32 +01:00
Florian Müllner
2f39bd8ba4 st/bin: Use child's align properties
By now, all containers and layout managers except StBin (and its
subclasses) use the generic ClutterActor expand/align properties
to control how their children are laid out.

This is particularly confusing as two or the properties StBin uses
for layout - x-align and y-align - shadow the generic ClutterActor
ones, but work very differently: They use a different enum and
determine how the bin lays out its child, instead of how the bin
is laid out by its parent.

Address this by deprecating the StBin properties and using the same
generic ClutterActor properties as everyone else.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803
2019-11-04 21:23:32 +01:00
Florian Müllner
f0a5170473 st: Deprecate StBoxLayout child properties
We are no longer using them, and so shouldn't anyone else :-)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/780
2019-11-01 19:42:02 +00:00
Florian Müllner
104071acbd js: Replace child properties
Every since commit aa394754, StBoxLayout has supported ClutterActor's
expand/align properties in addition to the container-specific child
properties. Given that that's the only container left with a special
child meta, it's time to fully embrace the generic properties (and
eventually remove the child meta).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/780
2019-11-01 19:42:01 +00:00
Carlos Garnacho
4338ca5fd9 padOsd: Add missing 'closed' signal
This wasn't added on the GObject-ification in commit c4c5c4fd5c. This
introduced warnings and misbehaviors when closing the dialog. (Eg.
pressing the "show OSD" pad action would show stack different dialogs
on top each other).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/800
2019-11-01 19:23:14 +00:00
Carlos Garnacho
e06421b04b layout: Drop no-clear-hint code
Mutter is doing the right thing by default, we no longer need this.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/798
2019-11-01 12:29:00 +01:00
Jonas Dreßler
5687035c9b appDisplay: Check instanceof AppIcon using constructor inside the class
It seems like some recent change (maybe the move to a ClutterActor
subclass for AppIcon) broke the check whether the drag source is an
instance of AppIcon. While the drag source indeed is an AppIcon and
everything else works correctly, the check still returns false, which
breaks the creation of new folders using DnD.

Theoretically it makes sense that this doesn't work, because we're
assigning AppIcon using `var AppIcon =` and that will only get set after
`GObject.register_class()` finished, so accessing `AppIcon` inside that
function seems risky and is probably wrong.

Fix this by comparing to `this.constructor` instead of `AppIcon`, which
works fine and we know for sure exists at this point.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/794
2019-10-31 19:35:37 +00:00
Will Thompson
8cb819926a po: Sort LINGUAS
In Endless, we add support for a number of additional languages. Keeping
this file sorted makes it easier to rebase the patch which does this. No
functional change.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/797
2019-10-31 09:46:15 +00:00
Florian Müllner
284ace5b5f cleanup: Use (un)block_signal_handler() convenience wrapper
We now depend on a gjs version that is guaranteed to provide those
more idiomatic wrappers, so use them instead of the clunkier static
methods.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/795
2019-10-30 19:40:15 +00:00
Florian Müllner
7bc39ba750 ci: Run tests through dbus-run-session
Something changed recently in the test initialization code, causing
the test-theme invocation to fail. Make sure there is a D-Bus session
by running the tests through dbus-run-session to get them going again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/796
2019-10-30 19:43:53 +01:00
Marco Trevisan (Treviño)
aa9031d8e7 st/scroll-view: Remove scrollbars references on dispose
As we're destroying the scrollbars on destruction, we should remove any
reference of it, not to cause multiple-calls to disposal to unreference them
again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/190
2019-10-30 01:08:27 +01:00
Philip Chimento
4dc44304df mpris: Hide notification when !CanPlay, instead of closing player
I have observed a client in the wild (Chromium again) set CanPlay to
false momentarily while it is loading the next song. Previously, the
code would close the player proxy in that case, meaning that after
playing one track, the MPRIS message would disappear and never come
back.

However, I think this use of CanPlay, while apparently not usual, is not
incorrect according to the spec. We should hide the message instead of
closing the player proxy.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1362
2019-10-29 19:25:16 +00:00
Philip Chimento
975280fc50 mpris: Validate received data against the expected types from the spec
In the wild we have buggy clients (notably Chromium 77 and earlier) that
send metadata with the wrong types. Previously, this would throw an
exception and prevent the MPRIS information from showing up in the
message list.

This changes the code to check if any incoming metadata is of the type
it is expected to be, and logs a warning if not, then continues on with
a default value.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1362
2019-10-29 19:25:16 +00:00
Marco Trevisan (Treviño)
39e6fc9e9d js: Use Gjs GTypeName computation for all classes
As per previous commit we can remove the explicit GTypeName definitions
and use gjs auto computation for all the GObject registered classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/790
2019-10-29 18:38:35 +00:00
Marco Trevisan (Treviño)
91707f4f82 environment: Use gjs smart GObject GTypeName computation
Make gjs to compute the GType name for registered GObject-derived
classes using the file basename and the first directory name, so that we
can avoid name clashing, and ensure that no extension will break the
shell by registering a name that is already used (by the shell or by any
other extension).

This requires gjs commit 02568304 [1] that will be part of release 3.35.2,
so bump the required version as gjs does post-release version bumps.

[1] https://gitlab.gnome.org/GNOME/gjs/merge_requests/337

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/790
2019-10-29 18:38:35 +00:00
Florian Müllner
b7bf9e09e9 ci: Switch to mutter's v3 docker image
As we start depending on newer stuff, switch to an image that is based
on a more recent base image to minimize the pain a bit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/792
2019-10-29 17:38:06 +00:00
Florian Müllner
db9249a1b7 padOsd: Work around xgettext confusion
Similar to the previous work-around, xgettext gets thrown off by
embedded quotes in template strings, in particular where a template
"breaks up" a pair of quotes.

Throw in some more comments to make xgettext happy, but whoever makes
the gettext toolchain not depend on fragile regular expressions will
be drowned in beverages of their choice ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/792
2019-10-29 17:38:06 +00:00
Florian Müllner
10b2083d3e extensionPrefs: Trick xgettext into accepting odd number of backticks
Xgettext learned about template strings now, which is good. However
it's still buggy, so instead of the "classic" xgettext issue with
backticks, we now have exciting new issues to find work-arounds for.

One issue is that it doesn't detect backticks inside string constants
as regular characters, so having an odd number of backticks throws off
its regex.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/792
2019-10-29 17:38:06 +00:00
Daniel van Vugt
fa1b7a9ef5 overview: Set searchEntry offscreen-redirected always
This corrects weird-looking blending visible as it fades out when the
overview closes. Previously the entry's dark background would drown out
the text as it fades out, but now they maintain a consistent contrast ratio
during the fade.

There's no noticeable change in performance, but in theory it should be
faster as text entries don't change at full frame rate. So stage redraws
will usually have a cached searchEntry drawn and require less effort.
Though the main purpose here is to correct the appearance.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/778
2019-10-29 15:41:06 +00:00
Jonas Dreßler
b6e57a5ae8 closeDialog: Fix dialog size when using geometry scaling
The close dialog is added as a child to MetaWindowActor, and, in Wayland
sessions, since commit [1] MetaWindowActor applies a transformation
matrix which scales all it's children using the geometry scale factor.
Now because the dialog actor is not a window (i.e. a MetaSurfaceActor),
but a subclass of StWidget, the scale factor is also applied to the
properties of the dialog by StThemeNode, so we end up applying the
geometry scale twice to the close dialog.

Fix this by applying the inverted scale to the dialog, which leaves the
scaling only to MetaWindowActor. This means we also can't apply a pivot
point other than 0 to the dialog actor, so apply the 0.5-pivot point to
the `_dialog` child of the Dialog class (the actual visible dialog box)
and also perform scaling animations on this child.

[1] https://gitlab.gnome.org/GNOME/mutter/commit/fb9e8768

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/783
2019-10-28 17:30:50 +00:00
Jonas Dreßler
b6d47c18c3 windowManager: Always reset window actors when animations are cancelled
Remove all transformations from window actors after a window animation
was either cancelled or finished. Right now we only do that if the
transition finished successfully, which seems kind of pointless (it can
probably be historically explained because the callbacks inside the
"kill-window-effects" signal handler are connected to those
`*WindowDone()` functions though and the `*WindowOverwritten()`
functions were only added later in [1]).

This fixes a recent regression where a window animation would get
cancelled and remain stuck by switching workspaces. The regression
probably happened due to different behaviour of the `onOverwritten`
callback of Tweener and the `onStopped` callback of Clutter transitions:
For the workspace-switching animation the window actors get reparented
to a temporary container, which makes Clutter transititons emit
"stopped" (`clutter_actor_remove_child_internal()` stops transitions on
its children), while Tweener would continue the animation.

[1] 6dd302e5ce

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/784
2019-10-28 14:28:49 +00:00
Jonas Dreßler
c35b4cede5 popupMenu: Don't chain up vfuncs if the parent doesn't implement them
Some vfuncs like `button_press_event`, `button_release_event` and
`touch_event` don't have handlers in the parent classes of
PopupBaseMenuItem. So don't call those handlers and return the default
Clutter.EVENT_PROPAGATE there.

This fixes a crash of the shell that happens when pressing a mouse
button inside the system popup menu and releasing it above a slider like
the volume slider again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/787
2019-10-28 13:43:55 +00:00
Florian Müllner
6cfcfc72cc panel: Update window section items on title changes
We currently only update the windows section when either the focus app changes,
or when the app's windows change (that is, a window is opened or closed). This
allows the menu item labels to become stale if the window title changes after
one of those events (for example when switching tabs).

Fix this by updating menu items when the corresponding window title changes.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1830
2019-10-28 12:42:28 +01:00
Philip Chimento
0732e1426a appDisplay: Don't crash if app is missing categories
g_desktop_app_info_get_categories() may return null. In that case, the
previous code would fail to create a folder when dragging an app with
no categories onto another app. Instead, simply continue with the next
app info.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/782
2019-10-25 15:48:52 -07:00
Philip Chimento
055c007ac2 dnd: Skip drag target when its acceptDrop() throws an exception
In the case of bugs in a drag target's acceptDrop() function, it may
throw an exception. In the previous code, this would break out of the
loop entirely and never cancel the drag, so the mouse button release
event would be ignored and you would have to press Esc to get out of the
drag.

In this change, if acceptDrop() throws an exception, we log it and move
on to the next parent target instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/777
2019-10-22 18:08:10 -07:00
Florian Müllner
43cf466d09 js: Replace Clutter.Actor.get_allocation_geometry()
The function was deprecated and has now been dropped from mutter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/776
2019-10-21 18:41:35 +02:00
Georges Basile Stavracas Neto
6965781d59 st: Use clutter_actor_pick() in pick
Use the new function to perform picking and avoid
going through any painting-related code paths.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/773
2019-10-21 13:53:56 +00:00