Commit Graph

7644 Commits

Author SHA1 Message Date
yun341
809f820cd4 gdm: Refactor oVirt to a generic CredentialManager interface
Commit 4cda61a1 added support for pre-authenticated logins in
    oVirt environments. This feature prevents a user from having
    to type their password twice (once to the oVirt management machine,
    and then immediately again in the provisioned guest running gnome-shell).
    That feature is currently oVirt specific, but a similar feature would
    be useful in non-oVirt based virt farm environments.

    Toward that end, this commit generalizes the various aspects of the
    oVirt integration code, so that it can be reused in a subsequent
    commit for adding single sign on support in vmware deployments, too.

    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1983
2020-07-04 08:11:49 +08:00
Daniel van Vugt
75235624b2 background: Use actor.content.background
Because actor.background no longer exists and emitted errors when
referenced.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2949

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1343
2020-07-03 14:41:48 +08:00
Jonas Ådahl
5ea54426b9 st/adjustment: Add ::actor property
Will be used by transitions to set the timeline actor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1299
2020-07-02 20:50:03 +00:00
Mariana Picolo
482c655590
messageTray: Remove SourceActorWithLabel class
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1346
2020-07-01 20:20:26 -03:00
Jonas Dreßler
d885486397 st/widget: Remove get_resource_scale function
ClutterActor provides the same function, but with a different return
value. So since we already switched to the ClutterActor implementation
in our C code, we can now safely remove st_widget_get_resource_scale()
and update the JS code that's still using the old API.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1287
2020-06-30 13:42:18 +00:00
Florian Müllner
140ab4dec1 unlockDialog: Fix scale-factor handling on multihead
The blur effect needs to take the scale-factor into account, so we
listen for scale changes. However we set up the signal handler when
creating a background, which is repeated for each monitor, and every
time the monitor configuration changes. But we only disconnect the
last handler that was connected, and only when we are destroyed,
not when recreating backgrounds.

Fix this by splitting out updating the effect parameters to a separate
method that iterates over all backgrounds, so we can simply set up the
handler from the constructor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1341
2020-06-30 13:12:08 +00:00
Sebastian Keller
845122497b altTab: Remove down arrow when removing an app from switcher
The arrow of the removed app was still left in the list with the
visibility of the arrow still depending on the original list order. This
could either lead to apps with just one window now suddenly having a
down arrow or apps with multiple windows not having one. If the last
window in the list had a down arrow, it would have been displayed
outside the window switcher.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1340
2020-06-29 22:51:41 +02:00
Florian Müllner
e90466347a cleanup: Use Meta.Workspace.active property
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1337
2020-06-29 17:09:38 +02:00
Jonas Dreßler
73f8c1c482 inhibitShortcutsDialog: Enable line wrapping for additional label
The inhibitShortcutsDialog can show an additional label which explains
how to restore shortcuts. This label is not managed by the
MessageDialogContent, so we need to enable line wrapping and disable
ellipsization ourselves.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1336
2020-06-29 10:17:07 +00:00
Jonas Dreßler
0ff75941ea dialog: Return GLib.SOURCE_REMOVE instead of false
This is more readable than just returning false.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1336
2020-06-29 10:17:07 +00:00
Jonas Dreßler
e4bb2037ca dialog: Check whether text changed when setting title or description
As usually with GObject setters, we should check whether the property
actually changed before setting the value and notifying the property. So
check whether the title or description text actually changed before
setting it.

This fixes a bug which makes the title flicker and change its size,
because when updating the title we remove the "leightweight" css class
and reapply it inside a later, which makes the title appear larger for
one frame.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1336
2020-06-29 10:17:07 +00:00
Georges Basile Stavracas Neto
0717f76362 Replace anchor point by translation and pivot point
Anchor point is deprecated and will eventually be removed from
Mutter's Clutter. Replace them by a combination of pivot point
and translation.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1334
2020-06-26 21:03:57 +00:00
Florian Müllner
da738988cd workspacesView: Small cleanup
scrollToActive() and friends are only used for handling the 'switch-workspace'
animation.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1333
2020-06-26 16:19:57 +02:00
Florian Müllner
e86e88ea47 workspacesView: Don't make reactive
Since commit a11f417cd0, scroll events are handled by the SwipeTracker.
There's no other reason for the view to be reactive, so don't make it so.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1333
2020-06-26 16:19:57 +02:00
Georges Basile Stavracas Neto
8f8ecdb983 appDisplay: Update folder dialog field before ungrabbing
Noticed while working on customizable folders. Calling GrabHelper.ungrab()
ends up calling FolderDialog.popdown(), but at this point the '_isOpen'
field isn't updated yet, so we end up calling popdown() twice.

Update the '_isOpen' field before ungrabbing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1332
2020-06-24 18:06:21 -03:00
Georges Basile Stavracas Neto
8f547c9d5d iconGrid: Adjust animation delay
As per design feedback, adjust the animation delay to be shorter.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1332
2020-06-24 18:06:21 -03:00
Georges Basile Stavracas Neto
821f3e8ddf overview: Pass drag source on item-drag-* signals
Overview has signals to notify about starting, cancelling, and
finishing icon drags, but none of these signals pass the dragged
item to the callbacks.

Pass the dragged items to the 'item-drag-*' overview signals.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1332
2020-06-24 18:06:21 -03:00
Florian Müllner
26d27fdbf8 overview: Define ANIMATION_TIME earlier
Commit c7e597cf72 tried to improve the slide animations when entering
the overview by using the same time as the overall overview animation,
but in fact broke the animation most of the times.

That is because the Overview imports OverviewControls before defining
the ANIMATION_TIME variable, so any javascript code that is evaluated
during that import will see the value as "undefined" (which is converted
to 0 for the animation).

Fix this by moving the ANIMATION_TIME variable before the imports instead
of the usual placement.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1331
2020-06-24 15:41:12 +02:00
Daniel van Vugt
c7e597cf72 overviewControls: Animate sidebars the same duration as windows
When you tap Super and see the sidebars and windows slide, it looks more
cohesive if those animations complete at the same time.

Previously there were 0.09 seconds difference between the two animations
which was enough to make it look slightly buggy. Now it doesn't.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1289
2020-06-23 19:07:30 +00:00
Jonas Dreßler
e4db68a1da Revert "workspacesView: Work around spurious allocation changes"
We now found the underlying bug: The ControlsManager (which causes the
bad call to `_updateWorkspacesFullGeometry()`) is getting (re-)allocated
while we add the view to the overviewGroup actor because the
overviewGroup is already visible and the view is immediately getting
mapped by `clutter_actor_add_child_internal()`. That causes a
resource-scale calculation and that indirectly causes a call to
`_clutter_stage_maybe_relayout()` (explained more detailed in the last
commit).

So now that we got rid of the immediate relayout happening when mapping
the view, we can revert this fix.

This reverts commit 6cc19ee6f0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1315
2020-06-23 19:05:05 +00:00
MOZGIII
980a90f8fb dateMenu: Do not ellipsize clock
This addresses the issue with ellipsized clock that occurs when using
extensions that move the clock from the middle to the side of the top
bar.

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

Signed-off-by: MOZGIII <mike-n@narod.ru>
2020-06-23 16:14:24 +00:00
Jonas Dreßler
87e4bf52b7 windowPreview: Fix a division by zero
When the bounding box size is 0 during allocation (which happens right
after creating a window for example), we're doing a division by zero and
end up with a NaN scale. This ends up making the childBox NaN, which
triggers an error in Clutters allocation machinery.

So fix that and fall back to a scale of 1 in case the bounding box is
empty.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1320
2020-06-23 15:50:03 +00:00
fludixx
a368df61ac volume: Update indicator when microphone volume changes
The current microphone indicator only indicates if the microphone is in
use. Users might be also interested if their microphone is recording
or is muted, this commit enables that without opening the pop-up
menu. The microphone icon changes itself, depending on the sensitivity
of the microphone. It behaves similar to the already existing volume
indicator.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2902
2020-06-23 11:34:16 +02:00
Florian Müllner
08a5f41505 windowManager: Support prepending workspace with horizontal layouts
Commit ce35d523a2 implemented that behavior for vertical workspace layouts,
there is no reason to not allow the same for horizontal layouts.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2916
2020-06-20 08:15:44 +00:00
Georges Basile Stavracas Neto
aa70020bc8 appDisplay: Compare indicator and grid pages
In the past, the icon grid would update the number of pages
during the call to adaptToSize(). However, after the new grid
layout landed, the number of pages is updated by the time an
item is added or removed.

Instead of comparing the old and new number of pages in the
icon grid, compare the pages shown by the indicator, and the
grid pages.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:54:31 -03:00
Georges Basile Stavracas Neto
1e77e6fc79 pageIndicator: Add getter for current number of pages
Add a getter to PageIndicators to retrieve the number of pages
it currently displays.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:54:31 -03:00
Georges Basile Stavracas Neto
68203e7091 appDisplay: Allow a slighly bigger area for drag overshoot
Now that we don't have the Frequent tab anymore, and subsequently
the buttons to switch tabs, the app grid fill all the way to the
bottom, leaving no room for drag overshoot.

Add a 20px (i.e. OVERSHOOT_THRESHOLD) area at the bottom of the
grid where dragging actually scrolls to the next page.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:54:31 -03:00
Georges Basile Stavracas Neto
cff0752bcc appDisplay: Factor out shared code into BaseAppView
The two BaseAppView subclasses now share a lot in terms of
widgetry: they both have a scroll view, pagination dots, swipe
management, etc.

Move this shared code into BaseAppView. Notice, however, that
BaseAppView only creates the widgetry, but it doesn't add them
to any specific layout. FolderView arranges the widgetry in a
vertical box, while AppDisplay arranges it in a ShellStack.

Add a new 'orientation' parameter to BaseAppView and use it
to determine the orientation of the pagination dots, the swipe
tracker direction, and the scroll event handling.

It is worth noticing that the scroll event is a bit more
sophisticated now: when the orientation is horizontal, it
handles all directions since mice wheels usually only generate
up/down events.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:54:31 -03:00
Georges Basile Stavracas Neto
45d8e11123 Add pagination to the folder dialog
Make the folder dialog's app grid horizontal, and add
paginators to it as well. Add a new _createGrid() method
to BaseAppView that created an IconGrid.IconGrid by
default, and make FolderView override it to return the
new FolderGrid class.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:54:22 -03:00
Georges Basile Stavracas Neto
3c3c3b7c69 appDisplay: Don't destroy FolderView directly
When FolderIcon is destroyed, it destroyed the FolderView and, if
there's a folder dialog present, it destroys the dialog as well.

Turns out, the folder dialog adds the icon's FolderView to itself.
The view becomes part of the dialog's actor tree. When the dialog
is destroyed, it also tries to destroy the view - but the folder
view was already destroyed by FolderIcon!

Fix that by letting the dialog destroy the folder view if it exists,
otherwise destroy the folder view directly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:32:01 -03:00
Georges Basile Stavracas Neto
6ba2913075 appDisplay: Add items in order
Add app icons to the exact page and position they're located
instead of always appending. This will be useful later when
custom icon positions are in place.

For now, it assumes pages are always filled, which is true,
but this will also change with custom icon positions.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:31:57 -03:00
Georges Basile Stavracas Neto
75c4e1cd63 appDisplay: Actually destroy icons
AppDisplay currently adds all icons, and hides the ones inside
a folder. Change that to only add the icons that are not inside
folders. Adding an icon to a folder removes the icon from the
main grid.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Georges Basile Stavracas Neto
fb4a4ca4a2 appDisplay: Redisplay folders before AppDisplay
When filtering out the app icons, AppDisplay calls FolderIcon.getAppIds(),
which then calls FolderView.getAllItems(). This last function reads the
already added app icons inside the given folder, and return their app ids.

So far, so good.

When the GSettings backing a folder changes, FolderIcon emits 'apps-changed'
to notify AppDisplay that the folder changed.

Cool.

When AppDisplay receives this signal, it first recreates its own icons, then
updates the folders, and finally hides the icons that are inside folders.

This series of events is unfortunate. Future patches will need the folder
to be updated *before* AppDisplay updates its own icons.

Update folder icons before chaining up to BaseAppView._redisplay().

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Georges Basile Stavracas Neto
4c2c1297be appDisplay: Move child focus handling to IconGrid
The icon grid is always paginated, so the app grid code doesn't need
to behave differently in the FolderView and AppDisplay.

Move the keyboard handling to IconGrid itself, and remove the now dead
code from AppDisplay.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Georges Basile Stavracas Neto
c5dbdad5fc iconGrid: Adapt grid layout according to available size
The new icon grid layout operates based on rows and columns, and
doesn't try to dynamically adapt it to fit to the container. In
this case, it is better to have a pre-defined set of well-known,
well-tested rows and columns, and switch between them based on
the aspect ratio of the screen.

Introduce a set of modes to the icon grid, and select the mode
that is closest to the aspect ratio.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Georges Basile Stavracas Neto
4e05bcd3b6 iconGrid: Use IconGridLayout
Replace the current grid code with IconGridLayout.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Georges Basile Stavracas Neto
3555550d5e iconGrid: Introduce IconGridLayout
IconGridLayout is a new layout manager that aims to replace the
current paginated layout algorithm implemented by the icon grid.

There are a few outstanding aspects of this new layout manager
that are worth highlighting. IconGridLayout implements all the
mechanisms necessary for a paginated icon grid, but doesn't
implement any policies around it. The reason behind this decision
is that this layout manager will be used by other places (e.g.
the login dialog) that demand different policies to how the
grid should look like.

Another important aspect of this grid is that it does not queue
any relayouts when changing its properties. If a relayout is
required, the actor should manually queue it. This is necessary
to avoid layout loops.

Add the IconGridLayout class. Next commits will do the surgery
to IconGrid and any related code to use this new layout manager.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
2020-06-18 10:30:12 -03:00
Jonas Dreßler
89ba8562c3 dnd: Set drag actor position immediately after reparenting
For drag actors which get reparented to the uiGroup, we currently wait
until the next input event to set the fixed position of the actor, until
that they will just be allocated their old fixed position, which is 0,
0.

So avoid drag actors flickering at the top left for one frame and
position them correctly right after reparenting.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310
2020-06-17 10:47:50 +02:00
Jonas Dreßler
82da73baff dnd: Fix size of actors which don't get allocated their preferred size
Properly adjust for drag actors which were allocated using a custom
vfunc_allocate() and might not have gotten allocated their preferred
size. When DND reparents the actor to the uiGroup, the drag actor will
get allocated its preferred size, so we also need to take the difference
between the old allocation size and the preferred size into account
before reparenting to the uiGroup.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310
2020-06-17 10:47:47 +02:00
Jonas Dreßler
b2eeda9b46 dnd: Don't override fixed position if actor had no fixed position before
Properly handle drag actors which are not allocated using a fixed
position and disable the fixed position we were using to move the actor
around before we reparent it again to its original parent.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310
2020-06-17 10:46:46 +02:00
Jonas Dreßler
e4cbe5126a workspace: Split WindowPreview into a separate file
The workspace.js file is quite large and is a bit confusing when it
comes to the term "window" in there, because it can either refer to a
WindowPreview of a complete window or to an individual window like an
attached dialog.

So try to avoid that confusion and split the new WindowPreview class and
its WindowPreviewLayout layout manager out into a new windowPreview.js
file.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:13:02 +02:00
Jonas Dreßler
8357739ef8 workspace: Stop exporting window actor in the WindowPreview
Having a public property exporting the MetaWindow is enough to get the
window actor, too, so remove the public realWindow property and while at
it, rename that property to _windowActor, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
6bef9334b7 workspace: Initialize WindowPreview using a MetaWindow
MetaWindow is Mutters representation of a window and provides all the
APIs about it, MetaWindowActor is just the ClutterActor that's drawing
that window. So use a MetaWindow to create a WindowPreview instead of
the window actor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
8c49f45ac8 workspace: Set overviewHint on MetaWindow
We want to stop using the MetaWindowActor for things which are actually
related to the MetaWindow, one more thing where we can change that is
the overviewHint, which is currently added to the MetaWindowActor.

So move that hint to the MetaWindow and stop calling
get_compositor_private() in a few more places.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
46600740fe workspace: Stop using WindowPreview.realWindow in the overview
We can simply get the MetaWindowActor by calling
MetaWindow.get_compositor_private(), so stop accessing the realWindow
property of WindowPreview. For this we also have to make _isMyWindow()
and _isOverviewWindow() take a MetaWindow as an argument instead of a
MetaWindowActor.

Since the WorkspacesThumbnails are also drop targets for WindowPreviews
and their WindowClones also have the public metaWindow property, switch
to using the metaWindow property there, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
c281e868a0 workspace: Only pass MetaWindow to WindowPreviewLayout
Since the WindowPreview class rarely needs to handle the actual actor
painting the window preview, refactor the WindowPreviewLayout a bit to
only pass a MetaWindow to its addWindow() and removeWindow() functions.

Also make the getWindows() function return an array of MetaWindows,
which makes the getMetaWindow() function obsolete, so remove that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:09:54 +02:00
Jonas Dreßler
039431a73f workspace: Stop using clone terminology in WindowPreviewLayout
We're going to remove ClutterClones, so call the parameters to
addWindow() and removeWindow() "actor" instead of "clone". Also make the
destroyIds less confusing and rename the actual actor destroy id to
"destroyId", and rename the window actors destroy id to
"windowActorDestroyId".

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:04:10 +02:00
Jonas Dreßler
d4f8ea1c53 workspace: Make some functions in WindowPreview private
Now that the WindowPreview also shows the overlays itself, we can make
some functions private.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
96f5e2b33e workspace: Call _activate() directly when clicking the window preview
We can remove the simply callback function in favour of an anonymous
function here.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
93a542d52c workspace: Set WindowPreview offscreen redirect inside constructor
This can also be moved to constructor, so do it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00