Commit Graph

7202 Commits

Author SHA1 Message Date
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