Commit Graph

7265 Commits

Author SHA1 Message Date
Ray Strode
6758746f25 screenShield: Fix pointer motion signal handler leak
The screen shield code listens for motion events on the stage
so that it can hide the pointer until the user moves the mouse.

Unfortunately, if the user never moves the mouse, the signal
handler connection gets leaked.

This commit makes sure the connection gets disconnected when the
shield goes away.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1459
2020-10-08 09:46:12 -04:00
Ray Strode
2b44fa893f screenShield: Use identity operator when matching for motion events
The screen shield watches for motion events to know to display
the pointer when the user wiggles their mouse.

It checks for motion events by looking at the event type and
seeing if it is of type `Clutter.EventType.MOTION`.  To do this
comparison it uses the equality operator (==).  Using the equality
operator isn't considered best practice, because it can returns true
when comparing disparate types, if those types happen to be equivalent
after coersion.

From a code resiliance point of view, it's better to use the
identity operator (===), which requires both sides of the comparison
to be of the same type.

As a policy, any legacy code that gets changed or moved should be
switched away from the equality operator to the identity operator, if
appropriate.

This commit makes that change as prep work for a fix to that part of
the code.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1459
2020-10-08 09:45:51 -04:00
Daniel van Vugt
6ba3ca5f95 windowManager: Avoid calling meta_window_actor_thaw when not frozen
Because that tends to crash in:
```
g_error ("Error in freeze/thaw accounting");
```

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1431

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1453
2020-10-08 14:27:58 +08:00
Andre Moreira Magalhaes
cc9f66d784 environment: Handle @content for property transitions
When using `Actor.ease_property` if the property starts with '@' and the
duration of the transition is zero (which may happen if the actor is not
mapped even if a non-zero duration was passed to `ease_property`), the
impl will try getting the actual target object where the property should
be set.

This works fine for most cases but it currently throws an error when
passing '@content.*' properties. Fix this by handling '@content' as
a property of `actor.content` (used by MetaBackgroundActor when
showing the overview).

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1461
2020-10-07 20:49:09 -03:00
Ray Strode
b41ef2f6e3 panel: Disconnect destroy signal handler when needed
The panel corners try to match their style to the buttons closest
to them. In order to make sure the corner styles stay in sync with
their neighboring buttons, they connect to the style-changed signals
of the buttons.

In order to make sure the style-changed signal handler isn't leaked,
it gets disconnected when the button is destroyed.

Unfortunately, the destroy signal handler connection itself gets leaked!

This commit ensures the destroy signal handler gets disconnected any
time the neighboring button is re-determined.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1460
2020-10-07 17:03:52 -04:00
Joonas Henriksson
9963f7ce84 unlockDialog: Use unique unlock-dialog style class
Allows styling the unlock dialog elements individually from the GDM
login dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1421
2020-10-07 16:16:57 +00:00
Florian Müllner
da36506ea5 workspacesView: Work around Clutter optimization
Clutter nowadays omits reallocations when only the stage position
changed, that is when the allocation relative to the parent changed.

As a result (apart from better performance of course), workspaces
in the overview may now end up with an outdated "actual geometry"
in case the overview moved to a new primary monitor (of equal size
as the previous one).

Work around that by emitting a signal from the overview on allocation
changes, and use that to update the cached geometry.

We can revert that change once workspaces become part of the regular
overview hierarchy.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3211
2020-10-05 14:11:55 +02:00
Georges Basile Stavracas Neto
d04daf6a1c appDisplay: Protect against source icon destruction
When dragging icons out of a folder dialog, there is a very peculiar
combination of steps that may break GNOME Shell:

 1. Open an app folder dialog
 2. Start dragging an icon to outside the grid
 3. Wait until the popdown animation starts
 4. Before it finishes, drop the icon
 5. See the warnings / crash

That's caused by the source icon being destroyed after the delayed
move timer starts, and before it finishes.

Protect against the source icon being destroyed before the delayed
move timeout triggers by connecting to the 'destroy' signal and
removing the timeout on the callback. Use a single field, called
'_delayedMoveData', to store all data related to delayed moves.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:48 +00:00
Georges Basile Stavracas Neto
aaff88a6bb appDisplay: Remove icon from folder when dragging out
When dragging an icon outside of a folder dialog, there's a small delay
before the dialog pops down. If the icon is dropped during this delay,
the drag is cancelled, and the icon continues to be in the folder.

However, this behavior turned out to be problematic, and it was a common
point of failure that throwing icons outside folders wouldn't work.

Remove the icon from the folder when dragging it to outside the dialog.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3092

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:48 +00:00
Georges Basile Stavracas Neto
1acbdcc9b3 appDisplay: Allow passing callback to AppFolderDialog.popdown()
Next commit will allow removing icons from the folder, and we want to
do that effectively after the dialog pops down.

Add an optional callback to AppFolderDialog.popdown().

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:48 +00:00
Georges Basile Stavracas Neto
33bd038af2 appDisplay: Don't change opacity on destruction
At the end of BaseAppView._clearAnimateLater(), the '_grid' actor's opacity is
set to 255. As it turns out, _clearAnimateLater() is called, among others, by
vfunc_unmap(). However, unmapping is part of the destruction process, and at
the time it is called, '_grid' is already destroying, which makes GJS complain
about accessing an invalid object.

Don't change opacity on BaseAppView._clearAnimateLater(), and instead move it
to the couple of places outside vfunc_unmap() that call it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:48 +00:00
Georges Basile Stavracas Neto
59549e0b13 appDisplay: Save pages when folder apps change
After dragging an icon to inside a folder, we do not save the grid layout,
leaving the icon's position stored when it actually isn't there anymore.

Fix that by saving pages whenever folder apps change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:48 +00:00
Georges Basile Stavracas Neto
7dafd25ef4 appDisplay: Don't emit 'apps-changed' when deleting folder
To delete a folder, FolderView needs to reset all keys under that particular
folder's GSettings path. That generates 5 'changed' signals, all of which
end up calling AppDisplay._redisplay(), which is costly.

Don't emit 'apps-changed' when deleting a folder.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
31591ff029 appDisplay: Only change excluded-apps when not deleting folder
It is useless to update the 'excluded-apps' list when we know we're going
to delete the folder entirely.

Only update 'excluded-apps' when not deleting the app folder.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
75a8697671 appDisplay: Trivial const-correctness fix
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
1709592811 appDisplay: Adjust folder position
If you try and drop an icon that's in the same page, but before the
drop target, it'll be one position ahead of where it should be -
because we just removed one icon before the target position.

Adjust the final position of the to-be-created folder.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
8d84e05a2a appDisplay: Reduce folder dialog popdown timeout
1500ms is too long of a delay, and it confuses people more than it
helps with accidental drops.

Reduce the timeout to 500ms as per design feedback.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3092

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
cc3519332c appDisplay: Lighten folder dialog background when dragging out
As per design feedback, make the app folder dialog background lighter when
hovering it with an icon. This gives the visual feedback to show that that
region is a target.

Use the new DIALOG_SHADE_NORMAL variable in the other places where its color
was hardcoded.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3092

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
062c014223 appDisplay: Use new moveItem API to move items
This uses the API added in the previous commit. The intent here
is to avoid removing and readding actors when moving them around.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3165

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
ffdff07eaf iconGrid: Add moveItem
This new public API moves items without removing and readding
them, which allows us to avoid some tricky behavior. Noticeably,
following the original design described at 3555550d5, the new
IconGridLayout.moveItem() method does not call `layout_changed`.
This is done by IconGrid itself, queueing a relayout.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Georges Basile Stavracas Neto
bfd4d0f7aa appDisplay: Factor out linear position calculation
When adding an item to the app grid, the item is added to
a sorted array. This is calculated by adding all visible
items in pages before the one being modified. Future commits
will need this to move items without reparenting them, so
factor this code into a separate function.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447
2020-10-05 12:06:47 +00:00
Florian Müllner
ab9aa5b1f2 workspacesView: Update workspace visibility when entering overview
This was missed in commit 96f63b08c2 when splitting the combined
layout+scrolling method into allocation and translation.

Add it back to prevent windows from other windows leaking into view
during the transition.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3208
2020-10-02 19:56:01 +02:00
Florian Müllner
6ce4605c3a workspacesView: Always clip to allocation
We couldn't clip workspaces views during the overview transition
when we used the "porthole" approach, but as view's allocation
now always matches the expected visible area, we can just apply
the clip unconditionally.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3208
2020-10-02 19:49:40 +02:00
Florian Müllner
432c2863ab dash: Restore icon's expected DND behavior
Commit ff3d32dd18 added a custom DashIcon subclass that disables
all DND methods from ancestors, including canceling the context
menu timeout and emitting the overview's item-drag-begin signal.

All we want is opting out of the parent's scale-and-fade behavior,
so override those methods instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3209
2020-10-02 15:41:04 +00:00
Florian Müllner
494e628c38 dateMenu: Do not ellipsize date header
Currently the width of the calendar column is solely determined
by the calendar, while other elements are ellipsized as necessary.

While that is the desired behavior for the events-, world clocks-
and weather sections, we don't want to cut off the date in the
header. However switching to bold text made that more likely in
non-English locales or when using large text, so explicitly take
it into account for the width negotiation.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2230
2020-09-25 12:00:40 +02:00
Georges Basile Stavracas Neto
5014d7e9fc appDisplay: Disconnect from parental controls on destroy
BaseAppView not disconnecting from the 'app-filter-changed'
signal means parental controls may trigger callbacks on
a destroyed grid, which tries to access destroyed icons,
which spams the journal with stack traces.

Disconnect from parental controls when BaseAppView is destroyed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1441
2020-09-16 14:57:02 -03:00
Daniel García Moreno
92d3c6e051 appDisplay: Don't iterate over all pages in page manager
In getAppPosition it's not needed to continue looking for an app in the
page manager if the app is found in a page.

This patch breaks the search loop just after the first ocurrence is
found.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1434
2020-09-15 09:33:53 +00:00
Florian Müllner
8ddaa851a4 aggregateMenu: Move remote-access indicator to the front
It's best to not mix transient indicators with (probably) permanently
visible items, so move the remote-access indicator (which also handles
screencasts now) to the position of the old screen recorder icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1438
2020-09-14 17:13:27 +02:00
Florian Müllner
7f402c1c6b workspace: Cap scaled floating size to target layout size
A window preview's floating geometry is scaled down according to the
workspace's allocation, while the layout geometry is computed directly
for the available space.

For previews that maintain their real size in the layout geometry,
that scaling leads to a distracting size bounce when transitioning
between both layouts.

Address that by not allowing the scaled floating size to drop below
that layout size (which is at most equal to the unscaled floating size).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2968
2020-09-05 16:12:08 +00:00
Mitar
f7bcde6325 altTab: Support cycle-group cycling only over windows in the workspace
This is consistent with the filtering done for switch-group when
org.gnome.shell.app-switcher current-workspace-only is set to true.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3116
2020-09-04 19:48:33 +02:00
Daniel van Vugt
206d1fa650 dash: Hide the tooltip when an item is clicked
So that when the 'Show Applications' button is clicked the icons don't
fly *through* the tooltip.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1423
2020-09-03 15:25:19 +00:00
Florian Müllner
69e81e4511 Revert "appDisplay: Add drop shadow to icons"
The shadows are hardly visible in the darkened overview, but have
a noticeable impact on performance.

This reverts commit 4e195d789a.
2020-09-02 11:12:47 +02:00
Georges Basile Stavracas Neto
998e3e62ad appDisplay: Connect to GSettings after reading key
As per GSettings documentation, it is necessary to read a particular
key at least once before being able to connect to the corresponding
'changed::' signal.

Read the 'app-picker-layout' key before connecting to the changed
signal.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1428
2020-09-01 17:12:56 -03:00
Georges Basile Stavracas Neto
95645e155e appDisplay: Only emit layout-changed when not updating pages
It is wasteful to emit layout-changed when updating pages, because
the caller (AppDisplay) already has an updated state by the time
this is called.

Only emit 'layout-changed' if the GSettings notification doesn't
come from AppDisplay updating the pages.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1428
2020-09-01 16:45:54 -03:00
Georges Basile Stavracas Neto
f1bc87bf6d appDisplay: Redisplay on layout changes
This was an overlook from e1ea1d2954.

We never connected to the 'layout-changed' signal, which means
changing the GSettings externally wouldn't trigger a redisplay.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1428
2020-09-01 16:45:54 -03:00
Florian Müllner
4e195d789a appDisplay: Add drop shadow to icons
The shadow is barely visible on dark backgrounds, but it's not
wrong to be consistent with Settings, Software and GNOME Classic.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3123
2020-08-31 21:04:39 +02:00
Florian Müllner
ba804de15e status/bluetooth: Fix label for >1 connected devices
Eeeks, we want two strings here, not one with embedded double quotes.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3073
2020-08-24 15:37:08 +00:00
Zephaniah E. Loss-Cutler-Hull
093603b35e unlockDialog: Defend against absence of blur effect
widget.get_effect(...) can return null while locking the screen, resulting
in a TypeError. In this situation the screen ends up black with a cursor
but never going to sleep, and moving the mouse brings the old screen
contents up but does not allow unlocking.

unlockDialog.js assumes that widget.get_effect will return non-null,
but other places such as getWindowDimmer in windowManager.js go out of
their way to be more careful.

[smcv: Add commit message, remove hard tabs, add missing semicolon]

Resolves: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3071
Bug-Debian: https://bugs.debian.org/968440
2020-08-24 17:27:14 +02:00
Joonas Henriksson
b1f4ac10da
calendar: Vertically center align week numbers
The labels were previously aligned by using top-padding, which was
relative to font-size, and therefore didn't always align the text
correctly when font scaling was enabled.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1415
2020-08-21 21:40:22 +03:00
Björn Daase
2fc6384bca *: Fix spelling mistakes found by codespell
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1416
2020-08-21 18:25:09 +00:00
Will Thompson
1c0be1a36b polkitAgent: Add missing space to log string
In my journal, I have:

> JS LOG: polkitAuthenticationAgent: Received 2identities that can be
> used for authentication. Only considering one.

There should be a space after the number.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1413
2020-08-18 13:58:20 +00:00
Georges Basile Stavracas Neto
7fcaf63291 appDisplay: Cache app ids in FolderView
Instead of reading a GSettings and building the app ids list
every single time FolderView needs to check for something,
cache it before redisplay and reuse this cached list everywhere.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1409
2020-08-13 23:28:51 +00:00
Florian Müllner
990c171bed networkAgent: Add missing Uint8Array => string conversion
When promisifying async operations in commit 764527c8c, the
finish function for read_line_async() was sneakily changed from
read_line_finish_utf8() to read_line_finish().

That is, the call returns a Uint8Array now that requires an
explicit conversion to string.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
2020-08-13 23:00:21 +00:00
Florian Müllner
112b139a9e cleanup: Remove old compatibility code
Since gjs moved to mozjs60, return values of int8_t arrays can
no longer be treated as strings. We originally made the conversion
conditional to keep working with the (then) stable gjs release.

That was two years ago and we require a more recent gjs nowadays,
so there's no good reason for keeping the old code path.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
2020-08-13 23:00:21 +00:00
Georges Basile Stavracas Neto
f541562acc iconGrid: Properly remove pages
When the last item of an IconGridLayout page is removed,
the page itself is removed too. However, the indexes of
items of next pages are not updated, which mess up the
layout manager state.

Update the page index of the items at forward pages when
removing a page.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1406
2020-08-13 18:15:11 -03:00
Florian Müllner
cf1d09b482 environment: Mark transitions as "work"
global.run_at_leisure() is used from automated scripts to schedule
a callback when the shell is idle. However since we moved away from
Tweener, animations are no longer taken into account; fix this by
marking transitions as "work" if the convenience ease() functions
are used.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
Florian Müllner
a436226266 scripting: Switch to standard async/await pattern
The original scripting framework was based on SpiderMonkey's
pre-standard generators, and was simply translated to the
corresponding standard syntax when updating it to work with
recent JS versions.

We can do even better by using the standard async/await pattern
instead of generators/yield.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
Michael Catanzaro
6d38bc69ca endSessionDialog: default to not installing updates on low battery
If the user's battery power is low, we should not check the checkbox to
install updates by default. Rationale: if the user's battery is not low,
it's very unlikely to run out during a normal system upgrade. Low
battery is defined as any level below 30%, matching our battery status
indicator.

We'll also change the battery warning to only display when battery is
actually low. However, we will still always warn on battery for full
system upgrades, since these are expected to take a long time.

Future improvement: it would be nice to make the checkbox insensitive
when on low power. However, I don't think we currently have a proper
style for insensitive checkboxes. I was unable to make it look good.

Lastly, note that I did not test this on a laptop. I tested this by
mocking the return values of _isDischargingBattery() and
_isBatteryLow().

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2717
2020-08-10 23:55:14 +00:00
Florian Müllner
263320696e status/system: Add separate 'Restart' item
A side effect of removing the action buttons in favor of a regular
submenu is that we are a lot less constrained by size. So instead
of lumping "Restart" in with "Power Off", make it a separate menu
item.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Florian Müllner
e6153bb578 status/system: Swap power- and user-related items in session menu
Quoting Allan:
"It's been niggling me that log out is closest to hand,
as opposed to suspend"

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Florian Müllner
c723a1b72a status/system: Use new indentation style
... before moving stuff around.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Florian Müllner
1fa1333e13 endSessionDialog: Remove "Restart" option from shutdown dialog
Restart will be exposed as a separate action instead of being part
of the shutdown dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Florian Müllner
6edd3c4b93 endSessionDialog: Support updates in restart dialog
We will split off restart from the existing shutdown dialog, and
instead offer it as a separate menu item in the session submenu.
But before doing that, make sure that the existing restart dialog
exposes the same feature set as power off.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Florian Müllner
72a8522a10 endSessionDialog: Reindent dialog configs
We are about to make some changes, so make them conform to the
new indentation style first.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
Emre Uyguroglu
6b78f58a75 keyboard: Fix missing icons in Keypad
This is more fallout from commit 57669bca1b.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3007
2020-08-09 15:59:34 +02:00
Hans de Goede
c2b70101f2 endSessionDialog: Support rebooting into the bootloader menu aka ("Boot Options")
This implements the "Alt" behavior for the "Reboot" button as outlined in
the design here: https://wiki.gnome.org/Design/OS/BootOptions

Note I've tried implemeting this with the AltSwitcher class from
js/ui/status/system.js first, but that puts the button in a St.Bin()
which causes the button to think it is the only button on the dialog
and makes it have rounded corners on both of its bottom corners.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
2020-08-06 15:14:45 +02:00
Hans de Goede
9d4a3a614d endSessionDialog: Immediately add buttons to the dialog
Immediately add buttons to the dialog instead of first building an
array of button-info structs.

This is a preparation patch for adding support changing the "Reboot"
button into a "Boot Options" button when Alt is pressed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
2020-08-06 15:14:45 +02:00
Olivier Fourdan
3541a57570 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow" and "deny" in variable
naming, which better represents the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1393
2020-08-04 13:24:50 +02:00
Jonas Dreßler
b83c93ad62 appDisplay: Return false in acceptDrop when not accepting the drop
Fix what is probably a copy-paste error and return false instead of a
CONTINUE DragMotionResult which is only meant for dragMotion events, not
drop events. This makes sure we don't create a folder when dropping an
app over the drag leeways of another icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1389
2020-08-03 21:48:44 +00:00
Florian Müllner
c9708b140c status/network: Use D-Bus to launch Settings panels
For more obscure network configurations, we need to launch the
corresponding Settings panel with additional parameters, so we
cannot simply launch the .desktop file.

However we can do better than spawning a command line: Control center
exposes an application action we can use instead, so the process is
launched with the appropriate activation environment and startup
notification support.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1385
2020-08-03 16:17:40 +00:00
Andre Moreira Magalhaes
dd846f1ba2 rfkill: Always sync state on construction
This fixes an issue where the indicator can be out of sync until the
RfkillManager (used by it) properties change.

The problem is that multiple instances of the indicator will use
the same RfkillManager instance (getRfkillManager() returns a singleton)
that only guarantees to emit the changed signal in two scenarios:
when the D-Bus proxy connects and when the proxy properties change.

If by the time an indicator is instantiated the RfkillManager's D-Bus
proxy is already connected, that indicator would only sync its state
when the RfkillManager properties change.

Let's fix that by always syncing the state on construction - in the worst
case scenario the RfkillManager's D-Bus proxy won't have connected yet
and the indicator state will be temporarily out of sync but once it gets
connected the indicator will sync again with the correct state.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1386
2020-08-02 19:57:11 +00:00
Benjamin Berg
01a927f388 windowManager: Wait for X11 services using systemd
To do this, we now wait for the start/stop job to complete. We also have
two targets in gnome-session to ensure that everything is working as
expected.

In order to start the services, we simply request the
gnome-session-x11-services-ready.target unit, and wait for it to become
available. To stop, we use the gnome-session-x11-services.target unit
which should stop all services in a way that is entirely race free.

This requires both gnome-session and gnome-settings-daemon changes to
work (which are in the corresponding merge requests).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
Jonas Ådahl
2b0731ab81 Move screencasting into a separate service process
Move the screencasting into a separate D-Bus service process, using
PipeWire instead of Clutter API. The service is implemented in
Javascript using the dbusService.js helper, and implements the same API
as was done by screencast.js and the corresponding C code.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
Jonas Ådahl
20dcc8aa87 status/remote-access: Visualize recordings as screen recording
If a remote access is marked as a recording, visualize it the same way
as a built in recording. Also don't stop it if there is an actual screen
sharing going on, so that one can use a plain "recording" while still
disabling what is an actual screen sharing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
Carlos Garnacho
fdac0602db background: Mark pattern backgrounds as loaded
Otherwise we don't let GNOME Shell startup to proceed. Noticed
by accidentally running on the memory GSettings backend.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1381
2020-07-30 11:48:13 +02:00
Florian Müllner
1812db7aa8 panelMenu: Destroy menu before chaining up
This avoid some (harmless but annoying) warnings, and is closer to
the original code prior to commit fc342fe8c5 and 557b232c89.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3022
2020-07-29 19:40:54 +00:00
Florian Müllner
260405a49e popupMenu: Ungrab when removing active menu
While we do have some handling for removing the active menu, it has
been a no-op for years. The bit that we really care about from the
PopupMenuManager's point of view is the existing grab though. Drop
that instead of calling _closeMenu() directly; ungrabbing will still
call the method indirectly, and it will still be a no-op :-)

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3022
2020-07-29 19:40:54 +00:00
Daniel García Moreno
71d37bffdf util: Remove shell_util_get_transformed_allocation
This helper function could be replaced with the new
clutter_actor_get_transformed_extents, that does the same.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1386

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1380
2020-07-29 18:09:53 +02:00
Florian Müllner
71f55643b2 layout: Only show ripple animation when overview was toggled
On X11, clients can grab keyboard on pointer (for example for popup
menus), and as a result the pushModal() call when opening the overview
fails.

However when the hot corner was used to toggle the overview, we still
show the ripple animation in that case, which is confusing as the action
did not actually happen.

Fix this by only showing the ripples if the overview is animating after
calling toggle(), as that should be a reliable indication of whether
the call was successful.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3005
2020-07-27 13:13:14 +00:00
Florian Müllner
5c550daecb backgroundManager: Always emit 'loaded' signal
As backgrounds are cached, it is possible that we never emit the
'loaded' signal added in commit f386103bc1. We are relying on the
signal though, so do the same as Background and emit the signal
from an idle if the background was already loaded.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1371
2020-07-22 11:02:24 +00:00
Michael Catanzaro
f386103bc1 Delay login animation until after wallpaper has loaded
Currently, the login animation can occur before the user's wallpaper has
been loaded. When this happens, we wind up displaying a solid blue
background for half a second or so before the proper background is
displayed. This looks jarring and bad. It's great that we can start
GNOME quickly, but starting up before the wallpaper is ready is *too*
quickly.

I've been meaning to fix this since 2014. Better late than never! We can
just have BackgroundManager emit a loaded signal the first time it loads
its first background, and have the startup animation code wait for that
before proceeding.

Some of this code is by Florian, who helped with promisifying. Thanks!

https://bugzilla.gnome.org/show_bug.cgi?id=734996
2020-07-21 20:25:31 -05:00
Olivier Fourdan
26e66aa4fd popupMenu: Handle keypress if numlock is enabled
On Wayland, navigating menus with the keyboard would not open drop-down
menus when NumLock is enabled.

That's old issue (gnome-shell#550) that was not completely fixed with
commit 88556226 because the lock mask needs to be filtered out in
_onKeyPress() as well.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/550
2020-07-21 16:38:15 +02:00
Georges Basile Stavracas Neto
bde974087a appDisplay: Append new icons at the first available page after first
As per design discussion, the first page is a somewhat of a special
page where we really don't want to change anything unless necessary.

Append new icons at the first available slot after the first page.
Make the placeholder icon be appended to the first available page
as well, since it's always used when dragging from folder dialogs.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
d93b51e135 appDisplay: Use a drag monitor to check for out-of-dialog drags
When the app folder dialog handles a drag hover, it starts a timeout
to popdown if dragging outside the "real" dialog area. However, when
dragging inside it, BaseAppView handles all drag hover events which
would disarm the popdown timeout. In cases like this, it's almost
impossible to prevent the timeout from triggering, which always pops
down the dialog.

Add a drag monitor when handling any drag hover (which only happens
when dragging outside the folder's icon grid); and eventually disarm
the popdown timeout from the monitor's motion event. Remove the drag
monitor when dragging over the folder dialog again.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
730a68dffc appDisplay: Increase folder dialog popdown timeout
App folders are now customizable, and the way to move icons to
another page is by throwing the cursor to either the left or
the right of the grid.

However, doing that triggers the popdown timeout, wich is 600ms
as of now, which is considerably short for such interaction.

Increase this timeout to 1.5 seconds.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
f06c257952 appDisplay: Allow reordering folders
Implement the methods to sort and query item positions
using the index in the GSettings key, and store the
updated positions when accepting the drop.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
7afab2c28c appDisplay: Factor out folder loading code
We'll reuse this code to implement custom positioning in
folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
16a18f2ae7 appDisplay: Only handle DnD when mapped
Now that the DnD code is shared between AppDisplay and
FolderView, we hit an unexpected problem: FolderView is
handling drag events even when the folder dialog is hidden.
As a side effect, this spams the journal with warnings.

Only handle drag events when mapped. On unmap, disable
the view's drag monitor, and disconnect from all drag
events.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
704e08dc08 appDisplay: Move DnD code to BaseAppView
This code will be shared with FolderView in the next commit, so
avoid duplication already and move the to-be-shared code into the
base class.

Because BaseAppView can handle vertical and horizontal orientations,
adapt the drag overshoot code to also handle horizontal overshoot.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
60311aa4d1 appDisplay: Fully hide icon when dragging
The partially visible icon causes more problems than
it solves, visually speaking. Fade it out completely
while dragging.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
cceb74706a appDisplay: Ensure icons always are at the correct position
When redisplaying, we currently only remove and add icons, but
never adjust the position of already added icons. If the icon
position changed, it wouldn't be reflected on the icon grid.

Make sure to move already added icons.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
578ae29ed2 appDisplay: Add placeholder when moving from folder dialog
When moving an icon from a folder dialog, the app grid doesn't
really have an icon to move around.

Add a placeholder icon and hijack it in the various places.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
701d110493 appDisplay: Restore dragged item's position on drag cancel
Otherwise we end up with the grid in an inconsistent state.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
d1cbf6c7a9 appDisplay: Allow overshooting any icon
Now that the icon being dragged can come from AppDisplay and also
a folder dialog, the check for when to overshoot is broken. Check
if the icon is a BaseAppView icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
b64ce217e4 appDisplay: Create app folder where the drop happened
Create the app folder where the icon we drop at is located. This
ensures the folder icon doesn't go into the last page, hidden and
solitary.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
783dbe2aa9 appDisplay: Don't resort folders when name changes
With a customizable app grid, we don't want folders to move
after renaming. Their position is fixed.

Remove the sort-after-rename code from AppDisplay.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
f4ce1cf462 appDisplay: Make FolderIcon draggable
By making it a subclass of AppViewItem, it automagically inherits
the DnD code.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
d04d6e069d appDisplay: Check 'app-picker-layout' to make icons draggable
Now we drag not only to the Dash, but also to the icon grid itself,
so make the app icon draggable only when either one or the other is
writable.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
40de201056 appDisplay: Factor out draggable code into AppViewItem
This will be shared by the FolderIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
18234ea91a appDisplay: Use custom function to retrieve item page and position
It is important that '_loadApps()' return a sorted list -- adding the
same icons at the same positions but in different orders results in
a wrong icon grid.

Add support for using a custom positioning function, and implement it
in AppDisplay. Because FolderView doesn't implement a custom sorting
function, the items are still sorted alphabetically.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
e3f3297cba appDisplay: Save pages after dropping
Save the icon grid layout after dropping, and only in
that moment.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
e1ea1d2954 appDisplay: Introduce PageManager
The PageManager does the heavy lifting between reading the
'app-picker-layout' GSettings key, and saving the new pages.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
Georges Basile Stavracas Neto
8a50a8e64c appDisplay: Allow incomplete pages
Allow incomplete pages in the main grid, but not on folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
fae207811a appDisplay: Move icons when hovering the grid
Implement a minimal version of the reflow-on-hover behavior,
which gives a better sense of physicality to the grid.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
1d86424942 appDisplay: Factor out item addition and removal methods
It'll be useful later.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
2bc8175219 appDisplay: Accept dropping any kind of icon over it
The grid will be able to handle them. As of now, it doesn't
do anything with folder icons, or icons in folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
1e31caf0b8 appDisplay: Introduce moveItem API
This is a simplistic API that basically removes the
icon from it's old location, and adds it to its new
location.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
8e24ac6b26 appDisplay: Ignore dragging over leeways
The leeways are parts of the icon that ignore incoming drag
events. This is how IconGrid and IconGridLayout treat it, and
this is how the icons should treat themselves too.

Make AppIcon ignore dragging over the left and right leeways.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Georges Basile Stavracas Neto
427b9ac75f iconGrid: Add drop target API
Add a new drop target API. The bulk of it is implemented by
IconGridLayout, since it's the layout manager that knows where
each icon is placed at.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
Emre Uyguroglu
168cfdd86b keyboard: Fix missing key icons in numeric level
Those were missed in commit 57669bca1b.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2631
2020-07-20 01:24:16 +02:00