Commit Graph

7007 Commits

Author SHA1 Message Date
Robert Mader
0795d8df5f magnifier: Adapt to painting and picking API change
This was left out in 988a0e7314

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/891
2019-12-07 13:08:28 +00:00
Robert Mader
85bec783ee screenShield: Adapt to painting and picking API change
This was apparently forgotten in 988a0e7314, causing the warning:
`JS ERROR: Error: Too few arguments to method Clutter.Actor.paint`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/891
2019-12-07 13:08:28 +00:00
Florian Müllner
ccd8b47d30 popupMenu: Close when a system modal pops up
Just like switcher popups, popup menus don't play well together with
system modals, and generally have a lower priority. So just like
switcher popups, close popup menus when a system modal dialog pops
up.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1536
2019-12-06 20:26:01 +01:00
Florian Müllner
c0309d9732 switcherPopup: Dismiss when a system modal dialog opens
As system modal dialogs may open without user interaction (for instance
polkit or network agent requests), it is possible for them to pop up
while the app/window switcher is up.

The current result of having both up simultaneously is clearly broken,
so we can either dismiss the popup or prevent the modal dialog from
opening. Assume that the dialog indicates a more important action and
should therefore take precedence, so go with the former.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1536
2019-12-06 19:55:39 +01:00
Jonas Dreßler
2ba4108838 appDisplay: Rename _allItems array to _orderedItems
Since both the `_items` object and the `_allItems` array include the
same items, the difference between those variables seems unclear. The
real difference between them (except the different data type) is that
`_allItems` is ordered in the same order as the visible grid, so rename
`_allItems` to `_orderedItems` which makes that more obvious.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
2019-12-05 15:43:34 +00:00
Jonas Dreßler
203c3f9949 appDisplay: Make AllViews folderIcons property private
This property is not used anywhere outside the class, make it private.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
2019-12-05 15:43:34 +00:00
Jonas Dreßler
61b71998a0 appDisplay: Make _items object a Map
Use a Map instead of an Object here makes it easier to loop through
keys, which we're going to do in the next commit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
2019-12-05 15:43:34 +00:00
Jonas Dreßler
c4fa052b03 appDisplay: Use _getCategories function instead of duplicating the code
We already have a function which gets the categories of an app and
handles the null-return case, use it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
2019-12-05 15:43:34 +00:00
Jonas Dreßler
f3eeb94c90 checkBox: Fix expand and align properties
In f2bd39b20c, the expand property for
checkboxes was accidentally set to the grandchild (the StBin), instead
of the child (the StBoxLayout) of the StButton. Fix that and let the
BoxLayout expand instead of the Bin.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/885
2019-12-05 15:35:22 +00:00
Florian Müllner
a2044c61ae extensionPrefs: Always redefine getCurrentExtension() on prefsModule access
We have three interactions with an extension's prefs module:
 - we import the module
 - we call its init() hook
 - we call its buildPrefsWidget() hook

The first two are one-time actions where we expect most getCurrentExtension()
calls (local imports, initTranslations() etc.).

However it's still possible that the extension will use the utility function
in buildPrefsWidget() as well, either directly or via other functions like
getSettings(): Make sure getCurrentExtension() returns the correct extension
in that case, not the last one whose preferences were initialized.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/873
2019-12-05 15:24:34 +00:00
Florian Müllner
2703eed446 extensionPrefs: Simplify state change handling
The new `ExtensionStateChanged` signal already passes the changed
extension object, no need to request it again with `GetExtensionInfo`.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/873
2019-12-05 15:24:34 +00:00
Georges Basile Stavracas Neto
59a43f496d appDisplay: Move to rename folder location
Following the same reasoning of the previous commit, move to
the renamed folder location.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/883
2019-12-05 12:00:11 +00:00
Georges Basile Stavracas Neto
d28bc7afe6 appDisplay: Show newly created folder when creating
The icon grid currently sorts icons by their names. When creating new
folders, the folder may end up being in a different page, and that's
confusing since we don't actually move to where the new folder is.

Move the icon grid to the newly created folder.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/883
2019-12-05 12:00:11 +00:00
Jonas Dreßler
22cb0b002d closeDialog: Fix scale of dialog for x11 clients in Wayland sessions
We missed this case in b6e57a5ae8,
XWayland clients obviously don't use MetaWindowWayland and thus they
don't apply the double scaling that commit was meant to fix.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/884
2019-12-04 22:25:03 +00:00
Florian Müllner
021f3e49b5 keyboard: Update extended key size on parent size changes
Extended keys should have the same size as their parent key, so
make sure to update them when the parent size changes.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:48:37 +01:00
Florian Müllner
91bf7f1e44 keyboard: Use parent key's allocation for extended key size
An outdated allocation is likely still better in this case than the
preferred size, so use that instead of width/height which may fall
back.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:48:37 +01:00
Florian Müllner
7fbdaadce2 keyboard: Create extended keys before updating hover state
We want extended keys to have the same size as their parent key,
but this is currently broken and the keys end up with their
parent key's preferred size (which is smaller than its allocated
size).

This is due to the way ClutterActor's width/height properties work,
which only return the "real" (i.e. allocated) size when the allocation
is valid, and fall back to the preferred size otherwise.

As changing an StWidget's hover state involves adding or removing
the `:hover` pseudo class, this is currently always the case.
Creating the extended keys first means the keyButton's allocation
is probably valid, so do that.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:48:37 +01:00
Florian Müllner
ff7dfa9259 keyboard: Fix widget leak
We currently create an extended-keys popup every time it is requested,
but only destroy it (or rather: the last one) when the keyboard itself
is destroyed.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:48:37 +01:00
Florian Müllner
85f10f1f6a keyboard: Use camelCase
Those aren't GObject properties, so should follow the regular JS style.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:48:35 +01:00
Florian Müllner
9b4780fa1d keyboard: Reindent timeout handlers
We are going to touch some of the code, so take that opportunity
to move them to the new indentation style.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1976
2019-12-04 20:47:09 +01:00
Jonas Ådahl
632a643994 Use paint and pick context to get framebuffer
Mutter and Clutter was changed to pass around the current target
framebuffer via the paint context instead of via the deprecated Cogl
framebuffer stack.

The framebuffer stack has also been removed from Cogl so change to use
the one in the paint context instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/827
2019-12-03 19:07:15 +00:00
Jonas Ådahl
988a0e7314 Adapt to painting and picking API change
While still leaving them unused, pass around ClutterPaintContext and
ClutterPickContext when painting and picking.

The reason for splitting this change up in two is to make it possible to
bisect easier in between the API change and the change to using the
framebuffer passed around with the temporary contexts.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/827
2019-12-03 19:07:15 +00:00
Florian Müllner
867cffaf20 switcherPopup: Fix scrollable check
When commit c6cea277e replaced Shell.GenericContainer, the check
whether the required width exceeds the avilable width was changed
from using the minimum widths of items to the natural width of the
scroll view.

That doesn't work correctly, as the *natural* width may well exceed
the actually used width: SwitcherList bases its width request on
children's minimum sizes to force labels to ellipsize.

Fix this by using the minimum width of the scroll view's child instead.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1834
2019-11-29 16:47:48 +01:00
Joonas Henriksson
749a4c9f6c appIcon: Draw running dot above the overview icon
Prevent the app-well-app-running dot from getting unintentionally
hidden behind the overview-icon background by initializing the
running-dot after its sibling overview-icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/866
2019-11-27 02:59:13 +01:00
Florian Müllner
0a9e1b4173 fileUtils: Delete deleteGFile hack
It is true that delete is a javascript keyword, but that doesn't
prevent it from being used as method name - there are event built-in
types like Map or Set with delete() methods!

So if that hack was ever needed, this hasn't been the case for years
now; just removed the hack now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/862
2019-11-26 22:17:28 +00:00
Benjamin Berg
f742484795 extensionSystem: Create a file to flag that extensions are being loaded
When the extension system is loaded, create the
gnome-shell-disable-extensions file in the users runtime directory. This
file is automatically removed 60s later. The sole purpose of this file
is to be consumed by the systemd units. If the file exists, the systemd
units will disable extensions when the gnome-shell fails.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/858
2019-11-25 21:49:49 +00:00
Florian Müllner
eee1ab4890 introspect: Fix whitelist check
The whitelist is a list of well-known D-Bus names, which we then search
for the unique name we get from the method invocation - unsuccesfully.

Fix this by watching the bus for any name in the whitelist in order
to maintain a map from wel-known to unique name that we can use for
matching.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1916
2019-11-25 20:00:10 +01:00
Joonas Henriksson
18421e8aed theme: Add message close button styling
Since the notification message close button had no border, or mouse
over effect, there was no way to determine whether the mouse cursor
were over the button.

Improve this by adding a message-close-button class for the close
button, and a styling for its hovered state, based on media control
button styling.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/855
2019-11-25 18:02:07 +02:00
Jonas Dreßler
5a287a4205 appDisplay: Add a timeout when switching pages during DnD
Currently when dragging an icon to the space above or below the appGrid
to switch pages, we do so very quickly without checking when the last
page-switch happened. This makes it hard to move icons to pages which
are not the first or the last one, since the other pages are skipped
very quickly.

To fix this, add a timeout of 1 second that blocks switching pages after
a page-switch using drag overshoot occured.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1693
2019-11-24 19:35:30 +01:00
Florian Müllner
b0c8192496 appDisplay: Add threshold after overshoot page switches
We currently always switch app pages when a dragged app icon
moves outside the grid boundaries, regardless of any previous
page switches. This makes it too easy to switch multiple pages
accidentally, so add a small threshold that the icon has to
move back towards the grid before allowing another page switch.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1693
2019-11-23 20:11:21 +01:00
Jonas Dreßler
0897915b05 appDisplay: Simplify event blocking while folder is opened
There's no need for a `inhibitEventBlocker` interface. Since we connect
to "open-state-changed" of our folders in the AllView anyway, we can
just make the event blocker visible while a folder is opened, and hide
the event blocker during DnD.

This allows keeping the eventBlocker reactive at all times and fixes an
issue where DnD to create a new folder is impossible if no folders are
present because the eventBlocker would not get inhibited.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1652
2019-11-23 18:31:46 +01:00
Florian Müllner
2894085c45 volume: Skip volume-change feedback while playing
The audio feedback for volume changes is useful when nothing is outputting
sound, but only then. Skip the sound notification in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
2019-11-23 15:16:51 +01:00
Florian Müllner
a8005e3c30 slider: Stop emulating drags in key handling
Emitting ::drag-end after changing the slider value via arrow keys
was a cheap way to make the sound feedback work for keyboard input.
But now that the volume indicator plays the sound on ::value-changed
as well, we can stop doing that - after all, key presses aren't drags.

Besides that, this will make the limiting of feedback to actual volume
changes from the previous commit work for key events as well.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
2019-11-23 15:08:54 +01:00
Florian Müllner
6c8eb1a18e volume: Only emit sound feedback after volume changes
gnome-settings-daemon doesn't play the volume change sound when
the volume stayed the same (that is, it is already at its maximum
or minimum). This looks like the right thing to do, so copy its
behavior.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
2019-11-23 15:08:54 +01:00
Florian Müllner
5af8bf2788 volume: Add back sound feedback on scroll
Commit 8d4855f100 accidentally removed the volume change feedback
for scroll events. Add it back to be consistent again with moving
the slider via arrow keys, slider drags/clicks and gsd's media keys
handling.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
2019-11-23 15:08:54 +01:00
Jonas Dreßler
7e9f30da0a appDisplay: Ensure we don't recreate existing AppIcons for folders
This was missed in 910037f014, make sure
we do the same thing for AppIcons that are created when reloading
folders.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/851
2019-11-23 22:01:09 +01:00
Florian Müllner
2842670082 cleanup: Remove another pair of unneeded parentheses
Eslint didn't spot this before version 6.5, so this fell through
the cracks.
2019-11-23 01:29:20 +01:00
Florian Müllner
95f388b9a7 dateMenu: Don't ellipsize forecast times and temps
While those should be concise enough to fit, they may not where
temperatures drop into double-digit negatives. It seems better
to accept some awkward horizontal scrolling in that case than
shorten relevant information.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1926
2019-11-23 01:13:08 +01:00
Florian Müllner
e72c38b5ab dateMenu: Move weather forecast validity check
Commit b779f6f728 added a check to filter out invalid weather forecasts.

However the check is currently done when creating UI for the forecasts,
which means we end up with fewer forecasts than we could display if any
forecasts are invalid.

We can avoid that issue by checking the validity while collecting the
forecasts, so do that instead.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:08 +01:00
Florian Müllner
f6f373b0c2 dateMenu: Only show forecasts
We currently always start with the current weather info, then append
forecasts. This is slightly confusing, as the only hint that the
first item is special is the past (and potentially "odd") time.

Stop doing that and base all items on forecasts.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
b757f5c655 dateMenu: Don't limit weather forecasts to the same day
As we get closer to midnight, we show fewer forecasts than we could
fit, or none at all. It makes more sense to continue the forecasts
into the wee hours in that case, so only exclude past forecasts,
but not ones from following days.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
784c0b7e4b dateMenu: Try harder finding a reasonable weather location name
Weather stations can have unwieldy long names, which don't fit the
limited space we have available. City names are usually more suitable,
so use the name of the nearest city instead if possible.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
f2df9f1ae4 dateMenu: Add some spacing between weather header and location
In case of a very long location name, the label may take up all
available space. Make sure there is at least some spacing between
header and location in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
18a1435c25 dateMenu: Bottom-align weather title/location
The two labels use different font sizes, so they don't align properly.
Unfortunately we don't have BASELINE alignment in Clutter, but at least
END comes closer than the default FILL.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
669d12f957 dateMenu: Re-indent weather section
Before making code changes, make sure the class confirms to the
new coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1927
2019-11-23 01:13:05 +01:00
Florian Müllner
d52b23dec3 switcherPopup: Improve modifier-less keybinding navigation
Commit c899453800 lifted the requirement of switcher keybindings
to contain a modifier, however it is currently only possible to
finish it by letting it time out.

Improve that by also accepting space/enter key presses to confirm the
selection immediately.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1883
2019-11-22 23:46:31 +00:00
Jonas Dreßler
998fe58482 switcherPopup: Use roundtrip time when the popup is modifier-less
The noModsTimeout obviously finishes inside a timeout callback, which
means `global.get_current_time()` might return Clutter.CURRENT_TIME (ie.
0) when called inside it, because it's not called while handling an
event. This means when switching apps or activating a window, the
timestamp passed to `activate_window` may be 0, which is the reason why
the altTab switcher is currently broken when using modifier-less
keybindings.

Fix that by using `meta_display_get_current_time_roundtrip`, which
always return a valid timestamp, instead of
`shell_global_get_current_time`.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/847
2019-11-22 22:09:47 +00:00
Alexander Mikhaylenko
109f39afa5 pageIndicators: Redesign and add position-based animation
Remove setCurrentPage() function, introduce setCurrentPosition() instead,
which allows to have fractional positions.

Make inactive dots smaller, filled and partially transparent, as opposed to
larger and fully opaque active dot. Make dots smaller overall, remove
borders. Interpolate each dot between active and inactive state based on
scroll position.

Make it impossible to "uncheck" the active dot.

Thanks Florian Müllner for parts of the code.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1932

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/843
2019-11-23 03:01:51 +05:00
Florian Müllner
9132063b87 switcherPopup: Show immediately on second key press
We slightly delay showing the switcher popup to avoid flashing it
briefly in the common case of quickly switching back-and-forth
between two windows.

However some users perceive this delay as slowness. Address this by
showing the popup immediately when another key press is consumed
(that is, a key like Tab is pressed).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1928
2019-11-22 00:20:29 +01:00
Jonas Dreßler
d5e8f8cdf7 mpris: Use a scope specific message instead of a global one
Since the mpris implementation of the notification tray supports showing
multiple notification (one for each player), it doesn't make sense to
have only one global property to store the message, since that only
allows referencing one message at a time.

Instead, handle the MediaMessages completely inside the scope of
`_addPlayer()`, this should allow showing more than one message again,
which broke with commit 4dc44304df [1].

[1] https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/791

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/833
2019-11-21 22:54:07 +00:00