Commit Graph

7347 Commits

Author SHA1 Message Date
Carlos Garnacho
72c4f148ef windowManager: Do not shutdown ibus/xsettings on X11 compositor restart
These paths are meant for Xwayland, not for X11 compositors being restarted
through alt-f2 + r. Maybe some signal analogous to init-xserver should be
added for Xwayland shutdown paths, but this signal we are currently
listening for is backend agnostic.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/2329
2020-03-11 11:31:45 +00:00
Alynx Zhou
94f6976ddd ibusManager: fix ibus launch error because of wrong method name
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1080
2020-03-11 09:30:15 +00:00
Florian Müllner
a5a6c699c3 fileUtils: Remove some compatibility code
The condition was added to keep working with the then-stable version
of gjs. We already require a more recent version now, so the compat
code is effectively dead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077
2020-03-09 13:18:48 +00:00
Florian Müllner
a0467bf875 js: Remove unused files from resources
fileUtils hasn't used Params since 2013, but was still importing it
until commit a1534dab02 ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077
2020-03-09 13:18:48 +00:00
Florian Müllner
3d443d5b17 extensionPrefs: Stop escaping extension name
The corresponding label no longer uses markup, so we can and should use
the unescaped name.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2305
2020-03-08 01:07:18 +00:00
Jonas Dreßler
3155d03d9e appDisplay: Reload folder views on installed app changes
Since the FolderViews are not connected to the "installed-changed"
signal, we need to reload their apps by calling _redisplay() when an app
is removed or installed. We can't connect to "installed-changed" inside
FolderView because we need to ensure _redisplay() of the FolderView is
called before AppView tries to access the apps of the folder inside
_refilterApps(). So reload the FolderViews inside AllViews _redisplay()
implementation to ensure everything is up to date before accessing the
apps of the folder.

Since the "apps-changed" signal of FolderIcon now indirectly triggers a
_redisplay() of the FolderViews, the 'changed' handler of FolderView is
now redundant and can be removed. Because of this, we also need to move
the emission of the "apps-changed" signal to the start of the signal
handler to make sure the view is updated before we try to access items
of the view.

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

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
989c0ee49e appDisplay: Disconnect folder "changed" signal when actors are destroyed
We should disconnect the folders "changed" signal from the folder in
case the FolderView or FolderIcon is destroyed. While at it, also remove
the unused this._spaceReadySignalId of FolderIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
69f6c43b60 appDisplay: Implement an addApp() method for FolderViews
Similar to removeApp(), implement addApp() in FolderView to make adding
folders to views a bit more obvious.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
bf2d012e40 appDisplay: Rename _redisplay() functions unrelated to BaseAppView
The _redisplay() function is usally used for subclasses of BaseAppView
which want to implement their own _redisplay() function, having that
function name in two classes which have nothing to do with BaseAppView
can be quite confusing. Make those names less confusing and call the
functions  _sync() and _rebuildMenu() instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
711d4ba65c appDisplay: Properly hide overlay scrollbar in folders
Use the scroll-view policy ST_POLICY_EXTERNAL to hide the scrollbar
instead of setting its css properties to hidden, where it can still be
clicked but isn't visible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
4490463513 appDisplay: Remove the top padding from folder app grid
There already is a bottom padding defined for the name container of the
folder, so remove the top padding of the appGrid and make sure we can
show a few more icons inside the folder.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
1ec5117715 appDisplay: Take the viewBox into account for the contentBox of folders
The viewBox has a border applied, so when we call adaptToSize using only
the content box of the container, the width of the border is not removed
from the content box and the grid will be allocated less space than what
we told it before using adaptToSize.

Fix that by adjusting the content box for the size of the viewBox, too.
This makes sure the correct amount of columns can be shown inside a
folder, since right now we only show 3 colums even though 4 would fit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
3ddae9d815 slider: Include handle border radius when calculating center offset
Since 38da479ee we correctly ceil the non-integer radius of the slider
handle when calculating the offset for drawing the circle. Since the
handle also has a border with a width of 1px by default, we should also
factor that in when calculating the offset.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569
2020-03-06 19:29:06 +00:00
Sebastian Keller
09a1e61c63 location: Update desktop file name for privacy settings
The location settings have been moved to their own panel with a
different desktop file:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/commit/f92f6f5c

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2316
2020-03-06 19:16:47 +00:00
Marco Trevisan (Treviño)
7345a6f276 main: Get the theme resource name from sessionMode
Along the lines of `styleSheetName`, a session mode may want to provide its
own gresource file, so make this possible via a `themeResourceName` session
mode parameter, defaulted to gnome-shell-theme.gresource

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1063
2020-03-06 19:09:25 +00:00
Florian Müllner
fda938175e shellDBus: Add new OpenExtensionPrefs method
Unlike any other methods in the Extensions API, LaunchExtensionPrefs()
opens what appears to be an application dialog, except that it is
really a separate application that the caller has no control over.

In order to address that, add a new OpenExtensionPrefs() method that
takes additional parameters (modelled after the desktop portal APIs)
that will make it possible to improve the behavior in the future.

The new parameters are ignored for now, but pushing the API out now
will allow us to fill in the functionality post the .0 release.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1074
2020-03-06 19:03:02 +00:00
Florian Müllner
3a39fb5ab8 shellDBus: Add UserExtensionsEnabled property
The 'disable-user-extensions' GSettings key is the last extensions-related
setting that isn't exposed over D-Bus, and therefore requires consumers
to access the GSettings directly.

Expose the setting as UserExtensionsEnabled readwrite property in the
org.gnome.Shell.Extensions interface to allow consumers to manage
extensions purely via D-Bus.

The 'disable-user-extensions' setting is the last extension-related
bit from the org.gnome.shell GSettings schema that is not exposed
via D-Bus.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1074
2020-03-06 19:03:02 +00:00
Carlos Garnacho
1a0ec782b5 ibusManager: Ensure to spawn --xim on non-wayland sessions
This (mistakenly) now only depends on signals triggered on Wayland
sessions. Hardcoding the XIM support on X11 sessions will make input
in some clients work again.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1690
2020-03-06 18:57:23 +00:00
Olivier Fourdan
a96753f085 windowManager: X11 can work without gsd-xsettings
Currently, a failure to start the Systemd unit `gsd-xsettings.target`
would be considered a failure to start Xwayland.

That means that if `gsd-xsettings.target` fails to start for whatever
reason, no X11 client can be used on Wayland.

However, XSettings is by no mean mandatory for X11 clients and many
legacy X11 clients do not implement XSettings. Those who do always have
a fallback path and therefore can still work without XSettings.

Make a failure to start the Systemd unit `gsd-xsettings.target` non
blocking for Xwayland, and just log a warning message.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1065
2020-03-06 18:50:52 +00:00
Florian Müllner
0dd171a7c8 environment: Fix date conversion
This is a regression from commit 06b690ff21:

GLib.DateTime.new() expects the full four-digit year, so passing
the abbreviated year from Date() will result in a bogus datetime.

Today is *not* Saturday March 2nd, 120 ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1061
2020-03-02 13:54:23 +01:00
Florian Müllner
ff2a736193 unlockDialog: Transition switch-user button with prompt
We ended up always showing the switch-user button on the lock screen,
as showing and hiding it with the prompt was too visually distracting.

But now that we have a fancy transition in place, we can easily extend
it to the switch-user button as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1029
2020-03-01 01:21:04 +00:00
Florian Müllner
c6cf81f28b unlockDialog: Simplify sensitivity handling
We only call _updateSensitivity() to make elements sensitive, and
nothing ever touches the sensitivity of the switch-user button; so
just call the corresponding authPrompt method directly, which is the
only bit that has an actual effect.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1029
2020-03-01 01:21:04 +00:00
Carlos Garnacho
104d1ae151 windowManager: Fix shutdown signal connection
This signal relied on mutter changes that were withdrawn
and it was unintended to use here. Restore the usage of
good old MetaDisplay::x11-display-closing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1056
2020-02-29 23:47:46 +01:00
Carlos Garnacho
12e14884ef windowManager: Implement MetaDisplay::init-xserver hook
We do spawn gsd-xsettings, and watch its name before notifying on the
given task, so the mutter bits can proceed with X11 startup.

One notable change is that we only start gsd-xsettings, instead of the
generic gnome-session-x11-services target. We do so as we have to wait
on a dbus name to appear in order to deem the initialization done, and
making it all depend on gsd-xsettings seems tidier.

Less notably, we also use ::shutdown-xserver to shutdown the related
services. Its major benefit is that it'd allow us to ensure the olderly
shutdown of those services, but it's unused at the moment.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/836
2020-02-29 18:58:55 +01:00
Carlos Garnacho
3c4a5a67e2 ibusManager: Use setup X11 display for ibus-x11
(re)spawning ibus to get ibus-x11 will be part atm of Xwayland
initialization process. For it to be set up before the client
it needs using the GNOME_SETUP_DISPLAY.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/836
2020-02-29 18:58:47 +01:00
Daniel van Vugt
bd197789c1 js/ui: Subscribe touchpad gesture handlers to only touchpad events
The touchpad gesture handlers were receiving all events, all the time.
This meant that even mouse movements were getting translated into
JavaScript calls and then discarded by the handlers, which wasted CPU.

Now we subscribe the touchpad gesture handlers to only touchpad events.

Prequisite: https://gitlab.gnome.org/GNOME/mutter/merge_requests/1000

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/283

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/925
2020-02-29 13:39:17 +00:00
Jonas Dreßler
da05c85f3c windowManager: Show window resizing clone on "size-changed"
When a window is being resized by the compositor, with Wayland the
compositor first asks the window to change its size and emits the
"size-change" signal, and then emits the "size-changed" signal after
the window acknowledges the new size. To show a fancy resize animation,
gnome-shell creates a "screenshot" of the resizing window on the
"size-change" signal, and later animates that "screenshot" to the new
window size on the "size-changed" signal.

Now if a client is not responding to our requests asking it to change
its size, we get a "size-change" signal and start showing the
window-clone, but never a "size-changed" signal, animating and hiding
the clone again. This causes a so called "ghost window" that is shown
above everything else and never disappears again.

To fix that, start showing the window clone once we get the
"size-changed" signal instead of the "size-change" signal. This makes
sure the window actually updates its size and the clone is going to be
hidden again.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/1078

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1055
2020-02-28 18:08:24 +00:00
Florian Müllner
06b690ff21 environment: reduce calls to g_time_zone_new_local()
Creating a new GTimeZone for the local timezone can be quite expensive if
done repeatedly. It requires an open(), mmap(), and parsing of
/etc/localtime.

This patch was provided by Florian, and I've tested it as far back as
3.28.4 to ensure that we are really reducing the number of open() calls
on the compositor thread.

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

Signed-off-by: Christian Hergert <chergert@redhat.com>
2020-02-27 13:48:26 -08:00
Jonas Dreßler
51b7eb7a2b altTab: Don't fade out thumbnails on destroy
The thumbnails actor `this._thumbnails` has already been destroyed when
calling `_destroyThumbnails()` from the `destroy` signal handler because
it is a child actor of the AppSwitcherPopup. So stop destroying the
thumbnails separately (fading them out inside a destroy handler wouldn't
make sense anyway).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
023859ee4b switcherPopup: Use correct scroll-direction property
The correct property for the scroll-direction with scrolling events is
`direction`, no `scroll_direction`. This fixes scrolling in the alt-tab
popup, which broke with the actorization changes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
09acd0a3db switcherPopup: Always return true when the popup finished early
When the switcherPopup was initiated successfully, we return true,
otherwise the WindowManager will try to destroy it. Since an early
release of the keystroke will also switch to another application and
close the switcher just fine, we should return true to indicate success
here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
bf213af362 switcherPopup: Lookup index of items when hovering or clicking
Right now the index that gets selected on click and motion events is set
when connecting the event inside the addItem function. If items are
added or removed (for example when an application is closed by pressing
"q"), this index isn't valid anymore and has to be updated.

To fix this, use the items themselves instead of the index as arguments
for the event handlers and lookup the index of the item inside the event
handler.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
bfb0bc7a29 switcherPopup: Implement functions to add and remove accessible states
Set the accessible states of the switcherList items by calling a
function instead of manipulating class-internal variables from outside
the class, which is considered bad practice.

The check whether the item at `_selectedIndex` exists can also be
removed since we always select a new index after an item was removed
(i.e. an app was closed) and destroy the alt-tab switcher right away if
no more items exist (see `SwitcherPopup._itemRemovedHandler`).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
c00f1d040b switcherPopup: Select correct item after removal of item
If an item was removed, make sure the selected item is still selected or
select the last one if the selected item was removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
ba7cfff90c switcherPopup: Disable hover on scrolling events
Just like with keyboard events, disable hover on scrolling events. Mouse
movements should not mess up the selection while scrolling.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
548c41d164 switcherPopup: Swap Math.max and Math.min in _scrollToLeft
Limit the minimum and maximum value to scroll to inside the box to 0 and
the upper limit, for some reason this was done right in _scrollToRight,
but not in _scrollToLeft.

This fixes the behavior of scrolling to the left: Before, scrolling one
item to the left moved the view to the first element of the list (this
can make the selected element invisible in large lists). Instead, scroll
one item to the left, just like scrolling to the right works.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
172d21cf50 switcherPopup: Use local variable for index in scrolling functions
Make sure the index that's being scrolled to doesn't change while the
scrolling animation is running by using an argument instead of the
this._highlighed class scope variable.

This fixes wrongly shown arrows when selecting new elements faster than
the scrolling animation takes for one index. The check run to disable
the arrow might be checking against a newer index than the one at the
start of the animation which results in the arrow not getting hidden
even if no more scrolling is possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
5c8f3a65f7 switcherPopup: Use this._highlighted to check for reentrancy
Since this._highlighted is always set to the currently highlighted
index, there's no need to save the index to a separate variable. This
obviously depends on getting the new item highlighted as a result of the
item-entered event.

This fixes bugs in situations where the highlighted element changes
after an event that is not calling _onItemEnter, for example after
scrolling or pressing a key. In those cases the _currentItemEntered
variable wouldn't be updated and the old item couldn't be entered
anymore without entering another one before.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Florian Müllner
19fc7c4d31 loginDialog: Do not expand "Not listed" button
Visually the button is just an interactive label, so having the
interactive area extend to the empty space next to the label
is surprising.

Instead, left-align the whole button rather than just the label
inside, so the clickable area corresponds to the visible one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1046
2020-02-26 19:46:50 +00:00
Florian Müllner
d66f5ab3c6 mpris: Disallow media section on login screen
The 'gdm' user is not going to run a media player, so there is no
point in allowing the corresponding section on the login screen.

All other sections are already disabled, so this is the only reason why
we end up with the message list instead of only showing the calendar.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2241
2020-02-26 17:45:33 +00:00
Daniel van Vugt
c773c8c162 Revert "js/ui: Use Clutter.OffscreenRedirect.ON_IDLE"
This reverts commit c0c027c608. Because for
some reason animating external opacity and position is still incurring
internal repaints, which disables offscreening and makes fading of
overlapping actors look wrong. `ON_IDLE` should be fixed in mutter before
it is used (in boxpointer at least) again.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2270
2020-02-26 11:54:54 +08:00
Jonas Dreßler
b3999e4078 overview: Hide the overview on session mode hasOverview changes
If the sessionMode does not allow to show the overview, we should also
hide an already visible overview.

This fixes a bug where, if the lockscreen was shown while the overview
was visible, the Ctrl+Alt+Tab popup would allow navigating inside the
overview because the overview actor is still mapped.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1043
2020-02-25 20:10:22 +01:00
Philippe Troin
d0a587d42f panel: Only consider St.Widgets for corner buttons
We cannot syncronize styles with plain Clutter.Actors, so don't return
them when looking for corner buttons.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1047
2020-02-25 18:32:30 +00:00
Florian Müllner
2bb8e1be9b environment: Handle reversed transition with 0 duration
If a transition is reversed, the final property values will be the
same as before the transition. However this currently only works
correctly when we actually use a transition; to fix this with a
duration of 0, simply skip the set() call when the transition is
reversed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1042
2020-02-25 18:08:47 +00:00
Jonas Dreßler
4c4d23ed83 dateMenu: Sync initial state of the message indicator
While the unread messages indicator is updated when starting a new
session because we call _onSourceAdded() on existing sources, we should
also update the do-not-disturb setting which might still be enabled.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1037
2020-02-25 16:47:29 +01:00
Jonas Dreßler
7173ec1df7 dateMenu: Remove an unnecessary change for RTL layouts
Calculating 1 - 0.5 is rather useless if the value was 0.5 before...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1037
2020-02-25 16:47:24 +01:00
Jonas Dreßler
bc465ab006 theme: Hide panel underline under the do not disturb icon
Hide the focused/active indicator of the panel underneath the
do-not-disturb icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1037
2020-02-25 16:47:17 +01:00
Florian Müllner
d62391c8f1 unlockDialog: Set accessible name of icon-only buttons
We turned both the auth prompt's cancel button and the switch user
button into icon buttons now, which means they are completely cryptic
when using a screen reader.

Just use the previously used labels as accessible names, which has the
nice side effect of lowering the impact of the string freeze break.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2210
2020-02-24 12:29:44 +00:00
Florian Müllner
ab24ee7a7e authPrompt: Don't focus hidden cancelButton
The button is hidden on the lock screen, so it shouldn't be allowed to
activate it, be it via click or keyboard. The latter is still possible
by keynaving to the button and hitting space/enter. Fix that by making
the button unfocusable when we make it unreactive.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2210
2020-02-24 12:29:44 +00:00
Florian Müllner
c52fd9373c unlockDialog: Turn mainBox into an St.Widget
This is the container that contains the elements that are interesting
for keynav, so it must be aware of focus-chain and -navigation.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2210
2020-02-24 12:29:44 +00:00