Commit Graph

5991 Commits

Author SHA1 Message Date
verdre
5be61bbb68 barLevel: Don't show border radius if the value is 0
Work around a known regression from [1] that caused the volume bar in
the OSD window to never be hidden, even if the volume is set to 0. This
happened because the border radius of the barLevel is always drawn
without ensuring that the actual bar is visible.

So simply check if the value to draw is 0, and if it is, don't draw the
border radius of the bar at all. This will still result in incorrect
representation of values that have a width smaller than 2*border-radius,
but at least the bar looks right for a width of 0 now.

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

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/384
2019-04-17 18:38:13 +00:00
Ray Strode
8e51fee5c1 windowManager: ensure actor resize clone dies with actor
If a window gets destroyed right before it's resize
animation starts the user can get confronted with an undead
zombie clone that doesn't go away.

This commit makes sure said clones get reaped with their
actors.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1166
2019-04-17 18:31:22 +00:00
Florian Müllner
9d6fcfdc85 switch: Drop separate handling for US
The switches no longer use ON/OFF or o/|, so just use the
same class and artwork everywhere.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/496
2019-04-16 17:28:31 +00:00
Florian Müllner
4e5ca6d376 dash: Fix messed up icon height
When determining the biggest icon size that fits the available height,
we first subtract the additional space requirements of icons (spacing,
padding, running indicator etc.) and then divide the result by the
number of icons to get the maximum size available to each icon texture.

In the above, the additional space requirement of each icon is taken
from the first icon (as all icons are assumed to be the same), and
calculated as the difference between the icon button's preferred height
and the currently used icon size.

To make sure that the icon is actually using the dash's current icon
size (even while animating to a new icon size), we enforce its height
during the size request and restore its original height afterwards.

However after some recent changes, that step is causing troubles:
For some reason, the original height may be 0, and when we restore it,
we end up forcing a fixed non-height that bypasses the regular size
request machinery.

While it is unclear where exactly the zero height comes from (maybe
waiting for a valid resource scale?), it is clear that it's best
to avoid forcing a fixed height. So instead of making the icon
texture comply with the assumed icon size, adjust the calculations
to use its current height request.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1053
2019-04-13 14:17:07 +00:00
Florian Müllner
2fab75f448 dateMenu: Make clock offsets relative to local time
We recently added offsets to world clocks that represent the location's
timezone as UTC offset. However for most users, that representation is
overly technical and less helpful than the difference to their local time.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1157
2019-04-13 12:11:14 +00:00
Florian Müllner
22883f2fa2 dateMenu: Make sure we always display a clock name
We currently use the city name for all location except named timezones.
However locations only have a city name if they are of level CITY or
DETACHED, or if they are of level WEATHER_STATION with a parent of level
CITY.

So when libgweather commit d7682676ac9 moved weather station locations from
cities to countries, it broke their names in the world clocks section.

To fix this, stop making assumptions about when we can use the city name
and simply try it first for all locations and fall back to the plain name
if its not available.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1150
2019-04-12 03:17:35 +02:00
AsciiWolf
f7d117488b appFavorites: Update RENAMED_DESKTOP_IDS
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1160
2019-04-11 23:28:49 +02:00
Marco Trevisan (Treviño)
244a329ee7 boxpointer: Compute source allocation and work area just once
Compute the source actor workarea and allocation when repositioning and keep it
cached so that we've not to calculating it again in _calculateArrowSide.

Since _calculateArrowSide only is called inside _updateFlip that is always
called just after reposition, we can be sure that the computed values are still
correct.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/435
2019-04-11 19:38:17 +00:00
Marco Trevisan (Treviño)
044572cb60 boxpointer: Use X/Y actor positioning instead of an anchor point
Currently all the widgets using BoxPointer and so popup actors are always drawn
at screen origin and then shifted at paint time in the proper position.

This doesn't work when using resource scale, since the widgets need to know
in which monitor they currently are in order to use properly scaled resources.

So, basically revert commit 22c22e0d7 and go back using the actual actor
coordinates for positioning and the actor translation for animating it, as the
relayouting issues of the past seem to be gone now.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1008
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/435
2019-04-11 19:38:17 +00:00
Marco Trevisan (Treviño)
746875258d layout: Use an invisible but mapped actor as dummy cursor
Since this could be used as boxpointer source, it should be marked as mapped,
or it will be ignored.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/435
2019-04-11 19:38:17 +00:00
Marco Trevisan (Treviño)
4892a87dfe boxpointer: Compute arrowStride using sourceActor monitor as reference
I suppose this was also the goal of commit 96e14dc, but because it was checking
the value of the always-undefined this.sourceActor, it really never worked as
expected.

So, now since we assume that this._sourceActor is always defined just use it
as reference to compute the monitor menu position.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1029
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/435
2019-04-11 19:38:17 +00:00
Florian Müllner
8b9c8ddb1e windowManager: Don't move sticky windows when inserting workspace
Inserting a workspace is implemented by appending a new workspace, then
shifting all windows after the "new" workspace up. This has an unintended
side effect on sticky windows, as changing its workspace will unstick it.

Fix this by excluding sticky windows - there's little point in moving them
anyway, given that they should be on all workspaces (including the original
workspace and the target one).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1151
2019-04-11 19:00:52 +00:00
Benjamin Berg
eb9000576c shellDBus: Accept connector to restrict OSD to one monitor
The monitor index is not something that gnome-shell and
gnome-settings-daemon seem to be agreeing about. Using the connector
string is a much more reliable method of identifying a specific screen
and we are indeed using this already for monitor labling.

So switch over to use the connector rather than the monitor index. If a
user tries to use the old API, then the OSD will simply show up on all
monitors (which is the status quo currently anyway).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/489
2019-04-11 18:53:53 +00:00
Benjamin Berg
862aaf341e shellDBus: Remove ShowMonitorLabels API
This API has been broken for quite some time now as the corresponding
mutter function meta_monitor_manager_get_monitor_for_output was removed.
If anyone tries to use it, we would just run into a backtrace.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/490
2019-04-11 17:49:40 +00:00
Florian Müllner
a5c75ff58b screenshot: Don't pick up rubberband style from GTK
Selecting a screen area for a screenshot isn't the same as selecting
items in an icon view, so there's no strong rationale for picking
up the style from GTK. We stopped doing that for other elements like
tile previews long ago, so just use our own style here too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/481
2019-04-11 17:27:50 +00:00
Florian Müllner
9f8edd980c panel: Remove left-over Gtk.Settings
It has been unused since commit c334aa2a4c.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/481
2019-04-11 17:27:50 +00:00
Florian Müllner
e5b9043435 workspacesView: Support touch/touchpad gestures to switch workspaces
Now that the existing touch/touchpad gestures in windowManager only
handle normal mode, add corresponding gestures for the overview and
hook them up to the existing workspace scroll animations.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/516
2019-04-11 17:00:17 +00:00
Florian Müllner
c0012c2ea4 windowManager: Limit switch gestures to normal mode
The window group is hidden while in overview, so the stick-to-content
animation isn't visible either. Worse, the gestures messes up the
position of window actors in that case. Just limit the gesture to
normal mode for now, we will soon add it back in the overview with
its own animation handling.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/516
2019-04-11 17:00:17 +00:00
Florian Müllner
b77e4975f0 switchGestures: Do not hard-code allowed modes
The touch/touchpad gestures to switch workspace currently hard-code
the modes in which we want the gestures to work. While these modes
are correct, the existing switch animation only works in NORMAL mode,
not in the overview where the window group is hidden. The easiest way
to address this is to handle both cases completely separately, namely
use separate actions in- and outside the overview.

Make the existing usable in that way by making the list of allowed
modes a constructor parameter.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/516
2019-04-11 17:00:17 +00:00
Florian Müllner
e83f2344f6 windowManager: Allow disabling touchpad workspace switch action
Just like actual ClutterActions, it can make sense to temporarily
disable the touchpad action, so add an appropriate property.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/516
2019-04-11 17:00:17 +00:00
Marco Trevisan (Treviño)
5357e0a18c st/settings: Add magnifier activation property and bind to settings
The same code for reading the current magnifier state is repeated in both
shell-recorder, shell-screenshot and magnifier itself.
So to move this inside a property of st-settings so that we can refer to it
all over the places removing duplications.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/473
2019-04-02 20:28:54 +00:00
Marco Trevisan (Treviño)
727195c767 magnifier: Use actor scaling filters on content texture node
Reuse the same filter values of the attached actor, instead of hardcoding the
defaults.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/454
2019-04-01 16:34:44 -04:00
Marco Trevisan (Treviño)
9158f55360 magnifier: Track cursor sprite changes only when active
There's no point in keeping the cursor sprite texture around all the time,
and to listen for its changes, we just need this when the magnifier is active.

So, initialize the magnifier texture and monitor for the sprite changes on
activation, while disconnect from the signal and nullify the texture when
the magnifier is deactivated.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/443
2019-04-01 16:34:44 -04:00
Marco Trevisan (Treviño)
8146e9d527 magnifier: Invalidate content size when it changes
In case the content size changes we need to invalidate its size in order to
trigger a full actor relayout.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/443
2019-04-01 16:34:44 -04:00
Marco Trevisan (Treviño)
4247251020 magnifier: Use all color channels to paint content texture node
In order to paint all the color channels of the content texture we need to
set the color channels to 255, so instead of doing this manually we can just
reuse the static color definition for white.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
2019-04-01 22:13:50 +02:00
Marco Trevisan (Treviño)
7eee0e0ed6 magnifier: Return all parameters on sprite content preferred size
ClutterContent's get_preferred_size should return a boolean weather the
preferred size is valid, so in javascript we've to return this state value
before out width and height.

Since this was not happening, clutter was considering the width as the state
(converting the non-zero value to true), the height as the width, while ignoring
the returned height (that was then defaulted to 0)

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
2019-04-01 22:13:50 +02:00
Marco Trevisan (Treviño)
3e0915521a magnifier: Only connect to signals when ZoomRegion is active
There's no need to listen signals when the zoom region is inactive, so let's
just connect/disconnect them.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/472
2019-03-28 00:38:42 +01:00
Marco Trevisan (Treviño)
a298943fac magnifier: Update screen position on activation
The default ZoomRegion is created at startup and only updated if it is active
when the monitor setup changes. Thus when reactivating the magnifier after a
display change, the viewport used is still the one that been computed with the
old screen geometry values.

Move screen update code inside a function and call it both when activating
the zoom region and when the monitor changes during a zoom session.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1120
2019-03-28 00:38:42 +01:00
Florian Müllner
df9ddf96a5 iconGrid: Chain up in style-changed
Commit 81ec8215a0 moved the handling of style changes from a signal
handler to a vfunc without chaining up to the parent, losing propagating
the change to children and queueing a paint update.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1117
2019-03-27 18:10:52 +01:00
Florian Müllner
4fa5d701d5 network: Catch errors when reading devices
NetworkManager added support for a new device - NMDeviceWifiP2P - but
did not add the corresponding enum value in NMDeviceType. The return
value for nm_device_get_device_type() is therefore "illegal" for the
newly added device, and gjs throws an exception.

This should ultimately be fixed in libnm, but as errors when adding
one device shouldn't interfere with adding any other devices, catching
exception is a good idea anyway, so do just that.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1023
2019-03-27 15:06:49 +00:00
Andrea Azzarone
2f3f3fbcdb boxpointer: Calculate position using workarea
Take the workarea into consideration when calculating the position and the size
of box pointer and of its arrow.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1102
2019-03-22 12:31:48 +00:00
Florian Müllner
611605a67f scripting: Don't use legacy API
The current scripting module makes heavy use of pre-standardized
iterator/generator/promise APIs, at least for some of those support
was pulled in SpiderMonkey 58.

Port to the new standardized replacements to get the module back into
a working state.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/440
2019-03-21 10:18:02 +00:00
Florian Müllner
0427a782be main: Wait for startup completion before running perf script
The scripts generally assume a functional shell, so wait until
that is the case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/440
2019-03-21 10:18:02 +00:00
Florian Müllner
0089143d06 aggregateMenu: Include action buttons in width computation again
Commit 1b169655ac removed the system indicator from the list of children
that are considered for the overall menu width, because we do want the
log-out submenu to adapt to the available width.

However as a side effect, action buttons no longer contribute to the
width either, so if extensions add additional buttons, the menu is
likely to overflow.

Avoid this by only adding the button group to the list of size children.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1094
2019-03-21 10:08:29 +00:00
Florian Müllner
31e7f0340f windowCycler: Create settings before chaining up
It's used in _getWindows() which is called from the parent's _init().

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1064
2019-03-18 09:48:02 +00:00
Xiaoguang Wang
6e317a54fd screenShield: Handle signal 'StatusChanged' when lockscreen is active
When lockscreen is active, screen can't be dimed if signal
'StatusChanged' is ignored. We need to handle this signal.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/900
2019-03-18 08:32:54 +08:00
Carlos Garnacho
62233a4db4 dnd: Multiply drag threshold by output scale
So it comes out right on hidpi, and consistent with clients.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/455
2019-03-13 17:22:35 +00:00
Carlos Garnacho
4a7e2ddff5 dnd: Make startDrag() fail if there is a current grab
This call just went through stomping over previous drag operations if any,
_maybeStartDrag() accounted for this, but other callers (well, WindowClone
in workspace.js) don't. This must bail out early even if a drag operation is
requested, luckily all callers account for it already.

This broke shell state by preserving connected captured-event handlers if
one tried to drag multiple windows simultaneously through multitouch. We
of course don't support that, now more elegantly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/455
2019-03-13 17:22:35 +00:00
Florian Müllner
ede0fd8660 magnifier: Fix color argument
Clutter.TextureNode takes a Clutter.Color, not a Cogl.Color.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
2019-03-12 01:52:22 +00:00
Florian Müllner
6b924c00c5 layout: Use custom actor for uiGroup
The bind constraint that replaced the Shell.GenericContainer in commit
f4682748fa is subtly different from the previous code:
It forces the actor to have the same size as the stage, rather than just
requesting that size.

This breaks the magnifier which relies on the UI being able to be bigger
than the display size. Fix by going back to using a custom actor.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/646
2019-03-12 00:39:40 +00:00
Florian Müllner
b90f4d29a4 userWidget: Fix avatar size
The texture cache now returns an actor with an appropriate ClutterContent
rather than a ClutterTexture. That actor uses the CONTENT_SIZE request
mode, which means that it will unconditionally request the preferred size
of the content. That is, setting an explicit size no longer has an effect.

Fix this by making sure the image is already loaded with the desired
dimensions.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1024
2019-03-12 00:34:04 +00:00
Carlos Garnacho
b117826ada keyboard: Add bottom emoji panel row to separate aspect container
So we ensure the row has the right aspect ratio, and buttons neatly aligned
with the bottom row in the alphanumeric view.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439
2019-03-05 21:11:47 +00:00
Carlos Garnacho
26b44b48ab keyboard: align AspectContainer to bottom if restricting vertically
It is convenient for the OSK so it eg. doesn't appear centered in the
available space (eg. on very narrow portrait layouts), plus it will also
be convenient to align other AspectContainers to the same baseline.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439
2019-03-05 21:11:47 +00:00
Florian Müllner
2ae17cfb50 userWidget: Remove frame around avatar
There's a push for round user images, for which the existing square
frame is a bad match. So remove the frame and enforce the shape.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/811
2019-03-04 22:50:29 +00:00
Benjamin Berg
561cecf383 shellDBus: Add UngrabAccelerators
While it is possible to register accelerators in-bulk, there is no
proper way to unregister them again. This adds the corresponding call
for UngrabAccelerator to allow ungrabbing multiple accelerators at the
same time.

The idea is that g-s-d can use this in the future to simplify the
keybinding reload logic.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/429
2019-03-04 16:45:16 +00:00
Andrea Azzarone
60ccdc2deb dnd: Only handle touch events in wayland
There are serveral issues around touch passive grab and touch/pointer doubly
handling to use these on X11, so we stick to single-touch/pointer there.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1015
2019-03-04 16:21:28 +00:00
Florian Müllner
d7d996b1d3 automountManager: Fix playing disconnected sound
A typo sneaked in in commit 9a35c990 ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/432
2019-03-04 14:39:40 +01:00
Olivier Fourdan
32b8bc39ac inhibitShortcuts: Save choice in permission store
Use the permission store to remember the user's decision as to whether
or not grant the shortcuts request when the application is known.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/382
2019-03-04 10:12:58 +01:00
Florian Müllner
1c9d821aa2 messageTray: Add source policy setter
Commit 8f15193b4 changed the `policy` property from a regular JS property to
a getter. This was necessary to avoid calling an overridden _createPolicy()
method before a subclass is properly initialized, but it broke the second
way of using notification sources:

Don't create a Source subclass, but use the base class directly and change
its `policy` property.

There's no good reason why we should no longer allow this, so add a setter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/431
2019-03-03 08:58:56 +00:00
Florian Müllner
26e33ff093 windowAttentionHandler: Don't destroy on open
The activateWindow() call is expected to focus the window, which
already destroys the source. If we then destroy it again explicitly,
we get another "invalid access" warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/430
2019-03-02 22:09:33 +01:00