Compare commits

...

186 Commits

Author SHA1 Message Date
Jakub Steiner
6393e90a5a theme: sync OSD colors with gtk 2019-04-16 16:47:59 +02: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
Florian Müllner
5d9f80bc73 extensionPrefs: Fix pref button appearance
After the Adwaita refresh, the button shows up oval rather than
circular. To address this, make sure that the "image-button" class
is applied as well by using the dedicated setter function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/482
2019-04-12 00:51:44 +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
4541fb9819 perf: Stop using GTK
Instead of going through GtkSettings, we can just as well use the
underlying GSettings directly.

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
Florian Müllner
de6512be1a st: Add missing include
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/485
2019-04-08 18:17:46 +02:00
Florian Müllner
0b72ff1896 st: Add missing END_DECLS marker
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/485
2019-04-08 18:17:33 +02:00
Florian Müllner
fea0192772 weather: Handle missing permission store
Our weather integration is supposed to follow GNOME Weather's settings,
including its permission to use location services. However there's a
discrepancy in case xdg-desktop-portal is unavailable:

While our geoclue agent grants all applications access to location
services in that case, the weather integration treats it as if
access was denied.

Fix this by handling this case explicitly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1130
2019-04-03 13:27:42 +00:00
Florian Müllner
f81ac498fb ci: Use custom image for commit log check
We can speed up the check a little bit by using an image that
already contains git, so do that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/480
2019-04-03 13:50:35 +02: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
Phil Wyett
d7632bbd3d Ignore '.vscode' folder for users of that editor
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/476
2019-04-02 17:37:31 +00:00
Carlos Garnacho
1b5e91e4b3 shell: Fallback on ISO 8601 datetime string for screenshot date info
If the locale doesn't honor strftime()'s %c argument, we would end up
feeding NULLs into GdkPixbuf tagging. Fallback to a sensible (although
not nicely localized) datetime string.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1017
2019-04-02 00:25:39 +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
Dušan Kazik
4f0851ca77 Update Slovak translation 2019-04-01 15:09:41 +00:00
Daniel Mustieles
911ae49767 Updated Spanish translation 2019-04-01 10:29:36 +02:00
Carmen Bianca BAKKER
5af81d4057 Update Esperanto translation 2019-04-01 06:04:01 +00:00
Cheng-Chia Tseng
c435889baa Update Chinese (Taiwan) translation 2019-03-31 15:34:17 +00:00
Cheng-Chia Tseng
49f79d9d5d Update Chinese (Taiwan) translation 2019-03-31 15:12:01 +00:00
Florian Müllner
1767cd0f6c app: Consider "quit" action for quit
Just like we take a remote "new-window" action into account for
opening new windows, we should call an explicit "quit" action
before falling back to closing all the app's windows on quit.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-03-28 00:02:20 +00: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
Goran Vidović
b05683d586 Update Croatian translation 2019-03-26 11:34:00 +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
32baff5906 perf: Use var for METRICS
Each perf module exposes it to the scripting module to report metrics
after all tests have been run. The symbol's scope should allow that,
so declare it as var.

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
Khaled Hosny
05e55cee23 Update Arabic translation 2019-03-18 14:37:34 +02: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
Charles Monzat
9c1f62c38c Update French translation 2019-03-17 18:59:32 +00:00
Piotr Drąg
1341d5557f Fix Icon in Tajik translation 2019-03-16 18:21:38 +01:00
Bruce Cowan
b7d79a5f06 Update British English translation 2019-03-16 11:19:57 +00: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
Victor Ibragimov
fb737ebde0 Update Tajik Translation 2019-03-13 21:45:05 +05:00
Victor Ibragimov
bf77cb44e7 Merge branch 'master' of gitlab.gnome.org:GNOME/gnome-shell 2019-03-13 21:40:31 +05:00
Victor Ibragimov
c72e2bb4a9 Update Tajik Translation 2019-03-13 21:39:34 +05:00
Victor Ibragimov
68c182b1df Update Tajik Translation 2019-03-13 21:18:10 +05:00
Alex Monday
348d303794 theme: Fix :checked:active page-indicator
Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1036
2019-03-12 11:58:36 +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
Robert Mader
187c2193e8 st-theme-node-transition: Exclude get_new_paint_state() from introspection
to silence a build warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/449
2019-03-12 01:14:52 +00:00
Florian Müllner
706bdd8059 st-widget: Add missing g_return_val_if_fail()
It's a public function, so it's good practice to sanity-check its
input (unless disabled at compile time of course).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1018
2019-03-12 01:00:32 +00:00
Jakub Steiner
436861edc8 theme: improve legibility of error messages
- the login dialog uses warning_color, so be consistent
- nevertheless increase lightness of the error_color

Fixes issue https://gitlab.gnome.org/GNOME/gnome-shell/issues/1016
2019-03-12 00:54:26 +00:00
Florian Müllner
9729a2e772 texture-cache: Apply resource scale to the right dimension
Size matters!

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/444
2019-03-12 00:48:11 +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
Florian Müllner
47915f8c11 Bump version to 3.32.0
Update NEWS.
2019-03-11 23:54:15 +01:00
Florian Müllner
5dfdeaa4ea theme: Fix menu arrows
After the latest texture cache changes, loading the icon at its preferred
size and scaling it via the actor size no longer works. Instead, use the
icon-size property which is applied when loading the icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/452
2019-03-10 22:03:05 +01:00
Mart Raudsepp
98a2a81f2a Update Estonian translation 2019-03-10 16:57:52 +00:00
Piotr Drąg
c4850027bc Fix Icon in translations 2019-03-10 17:32:06 +01:00
Florian Müllner
d4202e7f38 theme: Handle fallback app icons in notifications
Since commit 3eb80dc6c0, the size of notification icons is determined
by the theme to make it font-relative. Also handle the case where the
icon isn't an StIcon, but a fallback window icon.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
4f65283f31 app: Set styleclass on fallback app icons
For window backed apps, create_icon_texture() doesn't return an StIcon
but a generic widget. Set an appropriate style class to make it easier
to apply a specific style only to fallback icons.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
d86d3bbe54 texture-cache: Fall back to actor size for bound textures
With StImageContent, the meaning of passing -1 as size parameter changed
from "load the image at its preferred size" to "abort the session". It
is therefore no longer possible to just load the image and then have it
scaled by applying a CSS size to the texture's parent.

Setting the size from CSS is useful though, so to still allow that, fall
back to the actor's size (which can be determined by the style).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
6f794738e8 texture-cache: Load bound surfaces into StWidgets
Using widgets instead of plain actors will allow us to set the size
from CSS.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Ryuta Fujii
ef7a93bb07 Update Japanese translation 2019-03-07 11:17:18 +00:00
Victor Ibragimov
5197a992a6 Update Tajik translation 2019-03-06 20:15:01 +05:00
Victor Ibragimov
49d8540f6d Update Tajik Translation 2019-03-06 20:08:28 +05:00
Victor Ibragimov
6e1a1f1a57 Update Tajik Translation 2019-03-06 20:06:55 +05:00
Iain Lane
c73428247c build: Add mutter's private directory to libst's build-time RPATH
We need this to run `test-theme`, otherwise when run as part of the
build tests it fails like:

  error while loading shared libraries: libmutter-cogl-4.so.0: cannot
  open shared object file: No such file or directory

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/442
2019-03-06 12:45:48 +00:00
Gábor Kelemen
fc2caf5794 Update Hungarian translation 2019-03-05 22:05:20 +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
6349f0feb1 Bump version to 3.31.92
Update NEWS.
2019-03-05 05:07:44 +01: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
Robert Mader
4785093a5c st-shadow: Remove unnecessary ';'
to silence a build warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/434
2019-03-04 22:29:33 +00:00
Florian Müllner
859aef78c4 osk-layouts: Fix French layout
The script to convert XML keyboard layouts to json has a small bug
that causes the French-Canadian layout to end up as French.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/997
2019-03-04 20:55:15 +00:00
Florian Müllner
20730a5465 data: Don't drop emoji layout on update
https://gitlab.gnome.org/GNOME/gnome-shell/issues/997
2019-03-04 20:55:15 +00:00
Florian Müllner
fc5f687afc Fix override for fr-CA 2019-03-04 20:55:15 +00:00
Carlos Garnacho
53e56f2395 Generate all json files for the android directory in a go 2019-03-04 20:55:15 +00:00
Alan
da314aff79 Add convert_xml test 2019-03-04 20:55:15 +00:00
Alan
fe89f7c5ac Add level modifiers in JSON
This is needed because some layouts don't have an uppercase level.
That shouldn't make symbols the 2nd level.
2019-03-04 20:55:15 +00:00
Alan
8b3be5e063 Remove garbage 2019-03-04 20:55:15 +00:00
Alan
58dc538510 Load mappings at module initialisation 2019-03-04 20:55:15 +00:00
Alan
6cbef9355d Add unit tests 2019-03-04 20:55:15 +00:00
Alan
22eac5c508 Add basic documentation 2019-03-04 20:55:15 +00:00
Alan
a2860e9c73 Remove useless test 2019-03-04 20:55:15 +00:00
Alan
1c5258ab68 Rename script 2019-03-04 20:55:15 +00:00
Alan
8641eaa538 Output JSON and work on directories 2019-03-04 20:55:14 +00:00
Alan
88436383c0 Add licence statement from Caribou 2019-03-04 20:55:14 +00:00
Alan
affdcdcb0e Import script from caribou source 2019-03-04 20:55:14 +00:00
Florian Müllner
06174be777 build: Include test-theme in tests
It's an existing test that doesn't require interaction, so there's
no reason why it shouldn't be run by `ninja test`.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/419
2019-03-04 20:10:07 +00:00
Florian Müllner
fde8401124 test-theme: Change presumed CWD
The executable is assumed to be run from $top_srcdir/src, which is
essentially an autotools left-over (it's where the program ended
up with srcdir == builddir).

Now with meson, its actual srcdir makes more senses.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/419
2019-03-04 20:10:07 +00:00
Florian Müllner
70ac33d58c test-theme: Force default resolution
Clutter no longer hard-codes a resolution of 96 DPI (although that's
still the default), so any assertions of sizes for physical units
may be off.

Fix this by setting up the test environment according to the
assumptions.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/419
2019-03-04 20:10:07 +00:00
Robert Mader
5a897407d9 shell-tray-manager: Silence gdk_window_set_background_pattern warning
Apparently we can't get rid of it without breaking backward compatibility.
So let's stick to how GTK handles it and just silence the warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/423
2019-03-04 19:57:47 +00:00
Robert Mader
1b3c26364b na-tray-child: Silence gdk_window_set_background_pattern warnings
Apparently we can't get rid of them without breaking backward compatibility.
So let's stick to how GTK handles it and just silence the warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/423
2019-03-04 19:57:47 +00:00
Florian Müllner
ae07aa7864 gtk-embed: Hide window actors from pick
Since we started to support tray icons on wayland, the icon we show
is not the actual XEmbed window. Instead, we let mutter create a
MetaWindow for it, then use its window actor as source for a clone
we (or nowadays: extensions) can add, remove and destroy freely.

To not let the real icon get in the way, we set an empty input shape
and make its window actor fully transparent. This works OK on X11,
but on wayland all events still go through Clutter, so any reactive
surface actor inside the window actor will block events for any actors
underneath (and status icons go into the top-windows group, so almost
all actors are affected).

Luckily we can pile another hack onto the pile of status icon hacks ...

https://gitlab.gnome.org/GNOME/gnome-shell/issues/191
2019-03-04 19:52:24 +00:00
Carlos Garnacho
fb80831269 inputMethod: Handle OSK hiding after unfocus
Set a small timeout in order to let focus changes preserve OSK state. If
focus is eventually unset, the OSK will be hidden.

https://gitlab.gnome.org/GNOME/gtk/issues/1277
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/397
2019-03-04 18:24:38 +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
Aurimas Černius
9dc99ad611 Updated Lithuanian translation 2019-03-03 18:54:25 +02:00
Rūdolfs Mazurs
628cb4d553 Update Latvian translation 2019-03-03 14:18:43 +00:00
Nathan Follens
ad80bce78d Update Dutch translation 2019-03-03 10:15:54 +00: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
Trần Ngọc Quân
510b060947 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2019-03-03 13:48:55 +07: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
Florian Müllner
5f2bd70690 network: Don't destroy wireless dialog twice
The dialog doesn't change the `destroyOnClose` property from its default,
so it is already destroyed automatically on close. So if we also destroy
it explicitly, we end up (rightfully) with one of gjs' infamous "invalid
access" warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/430
2019-03-02 22:09:20 +01:00
Bernd Homuth
6dfa550663 Update German translation 2019-03-02 20:14:39 +00:00
Daniel Șerbănescu
252e2420ad Update Romanian translation 2019-03-02 19:55:56 +00:00
Florian Müllner
572d54981e appsMenu: Fix initial visibility of "Details" item
It is only supposed to be visible when Software is installed, but
we currently only update the visibility on changes.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/989
2019-03-02 18:13:38 +00:00
verdre
61471f9fb4 search: Hide the separator line of the last result
If a result is displayed at the end of the search results, there should
obviously not be a line separating it from the next result underneath
it. To fix this, always hide the separator for the last result visible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/311
2019-03-02 12:29:41 +00:00
Florian Müllner
4d0a742d64 st: Only consider visible children for :first/:last-child
While mapping the :first/:last-child pseudo classes directly to the
ClutterActor:first-child/:last-child properties allows for an easy
implementation, it is unexpected that rules can appear to not have
an effect because the selected child is hidden. GTK's behavior of
applying the classes to visible children makes much more sense, so
change our implementation to do the same.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/312
2019-03-02 12:19:40 +00:00
Niels De Graef
5f4e0e5ff8 plugin: Style consistency fix
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/315
2019-03-02 11:57:21 +00:00
Niels De Graef
a4c159ecad plugin: Use G_DECLARE_FINAL_TYPE
libmutter-4 added support for this, so we can also drop the boilerplate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/315
2019-03-02 11:57:21 +00:00
Niels De Graef
b1f893e998 plugin: Move class_init and init below methods
This allows us to get rid of all the forward declarations, tidying up
the file a bit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/315
2019-03-02 11:57:21 +00:00
Niels De Graef
789dc165af plugin: Add some comments on its purpose
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/315
2019-03-02 11:57:21 +00:00
Marco Trevisan (Treviño)
115eda9650 shell-screenshot: Apply monitor scale to cursor surface
When we grab a screenshot of a framebuffer scaled shell, we shoudl apply the
device scale to the image surface, while the monitor scaling should be applied
to the cursor surface, so that it's painted at proper coordinates and in proper
size in the generated image.

This is not needed for XWayland clients as they are not scaled anyways, while
for wayland clients that are painted in multiple monitors, this might cause
a lower quality cursor in the lower dpi monitor, because the cursor sprite is
generated for the monitor scale, and not for the surface scale.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
d027e35cef shell-screenshot: Always use "actors-painted" signal
Since we don't care about all the stage to be painted here, we can just proceed
when all the actors have been put in place.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
b3e178af9d shell-screenshot: Use mutter paint signals to optionally draw cursor
Under wayland, if the cursor should be included when doing a fullscreen
screenshot, we can rely on mutter "paint" signal to have it composited for free.
Otherwise if it's not requested, we can use the "actors-painted" signal to get a
stage texture before the mouse overlay has been added.

Instead, under X11 or when only a window screenshot is requested, we still
need to draw it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
559ec8750a shell-screenshot: Add utility function to check when draw the cursor
Don't repeat the same logic in multiple places, just set include_cursor to the
proper value once depending on the settings we have.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
02c3980b83 shell-screenshot: Initialize cursor tracker in draw cursor function
Avoid code duplication, since we're using this only if the cursor has to be
painted differently.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
6f027ee7dc shell-util: Apply resource_scale on clipping when getting the meta texture image
https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
6d6c2e5b99 shell-recorder: Use clutter-computed sizes and scaling for the capture
Get from clutter the capture sizes and scale and don't mind
about doing any rounding here, as it might be different
from the one done at clutter level (causing mismatch and
not-working videos). Delegate this to clutter, and forget
about the internal details.

These values are then used to composte the image and set the video caps.

https://bugzilla.gnome.org/show_bug.cgi?id=7650111
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
4a4f752459 dateMenu: Relayout IndicatorPad when parent size changes
This happens often in resource-scaled world

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
8f1fff1374 background: Don't set background actor sizing and scaling
Mutter BackgroundActor is able do detect this at lower level

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
deead2af97 layout: Add scale property to Monitor
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
9e881ab637 animation: Reload sliced texture on global scale change
When the scale has changed we need to reload the texture at proper size.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
b6ec02cef2 animation: Load sliced image using resource scale, and reload on change
Also make sure that the textures size is matching the container size.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
26e3ccda49 loginDialog: Load logo file texture given resource scale
And reload the logo if the resource scale changes.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
2bda79cb3a st-texture-cache: Use GSlice to manage memory of leaders data
This allows some memory optimizations when possible, so let's use it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
19c60ff5c5 st-texture-cache: use StImageContent for cairo bound surface
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
e3c5c9a2e7 st-texture-cache: Cancel sliced image loading on target actor destroy
It might happen that the target clutter actor that we return on call
of st_texture_cache_load_sliced_image might be destroyed while the
loading task is still running. To protect from this, let's connect
to "destroy" signal and when this happens we use a cancellable to
stop the task.

This allows to safely reuse the return value of this function to
cancel the execution and avoiding that load_callback is called
even for a request that is not anymore under our control.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
2c17c186b8 st-texture-cache: Load sliced contents with REQUEST_CONTENTENT_SIZE
When loading an actor for a sliced image actor, we can now use the
REQUEST_CONTENT_SIZE request-mode for the actor since we the content image
has now a predictable size and thus we can be sure that the size will be applied
taking care of the resource scale.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Marco Trevisan (Treviño)
ef1697d00d st-texture-cache: Set sliced actor size in logical size
The actor size should be set in logical size more than in the actual size
of the texture when using resource scale.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:53 +00:00
Jonas Ådahl
40e7638a4b st-icon: Add resource-scale support
This commit adds support for scaling the StIcon resource (the icon
texture) according to the resource scale.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
aaf69b2898 st-texture-cache: Use StContentImage to create actor contents
This will allow to use resource-scale aware content that will use a preferred
size that takes in account the icon scaling and the resource scaling.

If no size is passed we should just divide the actual resource size by the
resource scale, as we assume that it's loaded with such scaling applied.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
0464361ca5 st-image-content: Wrap ClutterImage with explicit preferred size
Create StImageContent as a simple ClutterImage with preferred width/height
properties in order to be able to use explicit sizing when creating clutter
contents that will be applied to actors whose size depends on the content itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
420697693b st-texture-cache: Separate 'scale' to 'paint_scale' and 'resource_scale'
Instead of just passing a scale when getting a cached icon, pass both a
'paint_scale', the scale of which the icon will be painted on the
stage, and a 'resource_scale', the scale of the resource used for
painting.

In effect, the texture size will use the scale 'paint_scale * resource_scale'
in a ceiled value while the size of the actor will use 'paint_scale' when
determining the size.
this would load a bigger texture, but the downscaling would keep the visual
quality.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
37f53a42da st: Create shadow pipeline taking resource scale in account
The shadow pipeline is created doing software blurring of the texture so the
shadow spec blur parameter should be scaled accordingly with the texture scaling
otherwise we won't take enough pixels in account creating stronger shadows.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
5617ffc79c st: Use scaled surfaces for creating cairo background shadows
Create the surfaces for background shadows at scaled sizes and then draw on them
using logical coordinates, by setting the surface device scale accordingly.

Use the said surface scale when generating the actual shadow cairo pattern
but in such case, to reduce the number of code changes, is better to work in
absolute coordinates, and to do so:
  1) Create a temporary shadow-spec copy with scaled values to absolute sizes
  2) Invert the scaling on the shadow matrix
  3) Do the actual painting in absolute coordinates
  4) Set the shadow matrix scaling back to the logical coordinates.

Finally scale down the created shadow pattern surface size when painting it,
applying again a reverse scale to the matrix.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
ca4d86e9e5 st-shadow: Define autoptr cleanup function for StShadow
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
0141fef561 st-theme-node: Paint elements in resource-scale scaled surfaces
Pass resource-scale to drawing phase, and use it to create texture
surfaces scaled with the widget current scaling.
Also redraw by default widgets when the resource scale changes.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
5d4a804c90 st-shadow: Ceil size before comparing with texture
A fractional resource scale would mean we never use the fast path for
creating the shadow, because we'd cast the int to a float before
comparing, which would never match.

Instead compare the expected texture size with the source texture, to
actually potentially trigger the fast path.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
6bc3300e5a st-scroll-view-fade: Include outer bound of pixel on border
The fade shader will draw the fade effect up until the border pixel. If
we set the bottom right coordinate to the outer edge of the pixel we
might end up not drawing the fade effect on all of the pixels. This
could for example happen if one logical pixel (clutter stage pixel)
consists of more than one physical pixel.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
15f69bdc3b st-label: Paint shadow using resource-scaled texture
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
0bcf76970a st-private: Scale shadows accordingly to actor resource scaling
Use scaled offscreen framebuffer to paint shadows so that it will match the
scaling applied to the actual actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Marco Trevisan (Treviño)
03c4628cad st-drawing-area: Draw content taking care of the resource_scale
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Jonas Ådahl
9f4ae9618a st-widget: Introduce widget resource scale
This commit makes StWidget manage the scale of which its associated
resources should be multiplied with. The resource scale is calculated
by clutter, and is retrieved by clutter_actor_get_resource_scale(). Due
to the resource scale not always being available, the getter may fail,
and the actual widget that draws the content will have to deal with
this situation.

As the resource scale depends on where on the stage the widget is drawn,
the resource scale will in general be available once the widget is
mapped.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2019-03-01 17:12:52 +00:00
Kukuh Syafaat
3590af15bb Update Indonesian translation 2019-03-01 15:32:29 +00:00
Ask Hjorth Larsen
c5de7fd20e Updated Danish translation 2019-02-28 23:09:39 +01:00
Robert Mader
7127fb1fa1 gvc: Update submodule to up-to-date version
This frees us from all remaining '‘g_type_class_add_private’ is deprecated'
warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/427
2019-02-28 21:59:08 +01:00
Florian Müllner
7cf11abefc build: Bump gjs requirement
While we don't actually require a more recent version at build time,
we do need the latest stable version at runtime. There's no strong
reason for making that differentiation, so bump the requirement.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1006
2019-02-28 19:43:45 +01:00
Marco Trevisan (Treviño)
d78b416e1a lookingGlass: Use symbolic icon for close button
As per commit 4d2dce2c, the actual close button is generated using custom css
and a symbolic icon.

Apply the same change to lookingGlass too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/425
2019-02-28 16:21:38 +01:00
Марко Костић
f5144ec899 Update Serbian translation 2019-02-28 13:26:19 +00:00
Milo Casagrande
08d1ebe7ee Update Italian translation 2019-02-28 08:14:02 +00:00
Julien Humbert
a665801e9f Update French translation 2019-02-28 07:39:24 +00:00
Changwoo Ryu
112e3b110b Update Korean translation 2019-02-28 03:16:35 +00:00
Robert Mader
94a674c008 na-tray-manager: Use gdk_screen_get_default() and gdk_x11_get_default_screen()
instead of explicit screen arguments and `gdk_screen_get_number()`, as nowadays there
is always only one screen. This silences some deprecation warnings and removes
deprecated API.

Bonus: some code style cleanups

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/422
2019-02-27 00:35:04 +01:00
Florian Müllner
72be8eeb31 ci: Use custom image for JS checks
Running dnf to update and install additional packages every time
the job is executed slows down the CI pipeline. Avoid this by
using another custom images for JS source checks.

In addition to the js shell we use for the existing syntax check,
also include eslint for future jobs and some extension-specific
tooling to make the image more useful to extension authors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
ad8690bb2e ci: Check that pot file is generated correctly
This is to guard against the now infamous xgettext bug[0].

[0] https://savannah.gnu.org/bugs/?50920#comment5

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
76cb08a72a ci: Add test stage
We never gained a proper test suite, but run at least the tests we
have.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
2d4989e937 ci: Add build stage
So far we are only performing a basic syntax check on javascript
sources; it's time to test the C code as well. As mutter is tightly
coupled, we bite the bullet and build it as well, either using a
matching branch (if it exists), or current master.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
f248b91f82 ci: Skip source_check stage when appropriate
We don't have to run the static analyzer on javascript sources when
no javascript source was changed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
d671eb1969 ci: Sync check-commit-log script with mutter
A couple of cleanups came out from the review in mutter, catch
up with those.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408
2019-02-26 21:08:17 +00:00
Florian Müllner
70f4906ca5 aggregateLayout: Fix natural width computation
Ouch, this went unnoticed for a long time: As the minimum size of menu
items is generally small (because its label can be ellipsized), we are
requesting the unellipsized width of the last "size child" instead of
the widest one.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/996
2019-02-26 08:25:00 +00:00
Florian Müllner
ffb9aa1ace test-theme: Stop using ClutterCairoTexture
It's deprecated, so use one of our own types for testing type
inheritance.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/420
2019-02-26 03:04:00 +01:00
Robert Mader
823fd855cf na-tray-child: Silence some deprecation warnings
Use `gdk_x11_display_error_trap_...` instead of `gdk_error_trap_...`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/417
2019-02-26 01:37:54 +01:00
Robert Mader
f5ee225362 shell-tray-icon: Silence some deprecation warnings
Use `gdk_x11_display_error_trap_...` instead of `gdk_error_trap_...`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/417
2019-02-26 01:37:46 +01:00
Andrea Azzarone
ff1ea4b1c9 st-clipboard: Remove get/set_property functions.
Remove st_clipboard_get_property and st_clipboard_set_property because they are
identical to the default implementation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/414
2019-02-26 00:23:36 +00:00
Alex Monday
779b5afa51 theme: Add bottom padding for sub menus
Prevents overlapping sub menu borders with menu item background.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/987
2019-02-25 11:35:13 +01:00
Stas Solovey
6d870f6ae4 Update Russian translation 2019-02-24 20:48:43 +00:00
Asier Sarasua Garmendia
d3926cbca9 Update Basque translation 2019-02-23 20:43:56 +00:00
Carmen Bianca BAKKER
a308804679 Update Esperanto translation 2019-02-23 09:23:49 +00:00
120 changed files with 18524 additions and 14170 deletions

1
.gitignore vendored
View File

@@ -80,3 +80,4 @@ tests/run-test.sh
*~
*.patch
*.sw?
.vscode

View File

@@ -1,32 +1,86 @@
stages:
- review
- source_check
- build
- test
variables:
JS_LOG: "js-report.txt"
POT_LOG: "pot-update.txt"
.only_default: &only_default
only:
- branches
- tags
- merge_requests
check_commit_log:
image: registry.fedoraproject.org/fedora:latest
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
stage: review
before_script:
- dnf install -y git
script:
- ./.gitlab-ci/check-commit-log.sh
only:
- merge_requests
js_check:
image: registry.fedoraproject.org/fedora:latest
image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1
stage: source_check
before_script:
- dnf install -y findutils mozjs60-devel
script:
- find js -name '*.js' -exec js60 -c -s '{}' ';' 2>&1 | tee $JS_LOG
- (! grep -q . $JS_LOG)
<<: *only_default
only:
changes:
- js/**/*
artifacts:
paths:
- ${JS_LOG}
when: on_failure
only:
- merge_requests
- /^.*$/
build:
image: registry.gitlab.gnome.org/gnome/gnome-shell/master:v1
stage: build
before_script:
- .gitlab-ci/checkout-mutter.sh
- meson mutter mutter/build --prefix=/usr -Dtests=false
- ninja -C mutter/build install
script:
- meson . build -Dbuiltype=debugoptimized
- ninja -C build
- ninja -C build install
<<: *only_default
artifacts:
expire_in: 1 day
paths:
- mutter
- build
test:
image: registry.gitlab.gnome.org/gnome/gnome-shell/master:v1
stage: test
before_script:
- ninja -C mutter/build install
script:
- xvfb-run meson test -C build --no-rebuild
<<: *only_default
artifacts:
expire_in: 1 day
paths:
- build/meson-logs/testlog.txt
when: on_failure
test-pot:
image: registry.gitlab.gnome.org/gnome/gnome-shell/master:v1
stage: test
before_script:
- ninja -C mutter/build install
script:
# Check that pot files are generated correctly:
# https://savannah.gnu.org/bugs/?50920#comment5
- ninja -C build gnome-shell-pot 2>&1 | awk '
BEGIN { start=0; }
start==1 { print $0; }
/gnome-shell-pot/ { start=1; }
' | tee $POT_LOG
- (! grep -q . $POT_LOG)
<<: *only_default

19
.gitlab-ci/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM registry.gitlab.gnome.org/gnome/mutter/master:v1
RUN dnf -y update && dnf -y upgrade && \
dnf install -y 'dnf-command(copr)' && \
dnf copr enable -y fmuellner/gnome-shell-ci && \
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
# bt only exports HAVE_BLUETOOTH to js, rest are outdated build-requires
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel \
upower-devel python3-devel && \
# We'll build mutter ourselves
dnf remove -y --noautoremove mutter mutter-devel && \
# Needed for tests
dnf install -y '*/xvfb-run' gdm-lib accountsservice-libs && \
dnf clean all && \
rm -rf /var/cache/dnf

View File

@@ -0,0 +1,18 @@
FROM registry.fedoraproject.org/fedora:latest
RUN dnf -y update && dnf -y upgrade && \
dnf install -y 'dnf-command(copr)' && \
# For syntax checks with `find . -name '*.js' -exec js60 -c -s '{}' ';'`
dnf install -y findutils mozjs60-devel && \
# For static analysis with eslint
dnf install -y nodejs && \
npm install -g eslint && \
# Shameless plug for my own tooling; useful for generating zip
dnf copr enable -y fmuellner/gnome-shell-ci && \
dnf install -y gnome-extensions-tool meson && \
dnf clean all && \
rm -rf /var/cache/dnf

View File

@@ -11,9 +11,21 @@ branch_point=$(git merge-base HEAD FETCH_HEAD)
commits=$(git log --format='format:%H' $branch_point..$CI_COMMIT_SHA)
test -z "$commits" && { echo Commit range empty; exit 1; }
if [ -z "$commits" ]; then
echo Commit range empty
exit 1
fi
function commit_message_has_url() {
commit=$1
commit_message=$(git show -s --format='format:%b' $commit)
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
return $?
}
for commit in $commits; do
git show -s --format='format:%b' $commit | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)" ||
{ echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"; exit 1; }
if ! commit_message_has_url $commit; then
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
exit 1
fi
done

31
.gitlab-ci/checkout-mutter.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/bash
shell_branch=$(git describe --contains --all HEAD)
mutter_target=
git clone https://gitlab.gnome.org/GNOME/mutter.git
if [ $? -ne 0 ]; then
echo Checkout failed
exit 1
fi
cd mutter
if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//gnome-shell/mutter}
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
echo Looking for $merge_request_branch on remote ...
if git fetch $merge_request_remote $merge_request_branch >/dev/null 2>&1; then
mutter_target=FETCH_HEAD
fi
fi
if [ -z "$mutter_target" ]; then
mutter_target=$(git branch -r -l $shell_branch)
mutter_target=${mutter_target:-origin/master}
echo Using $mutter_target instead
fi
git checkout $mutter_target

41
NEWS
View File

@@ -1,3 +1,44 @@
3.32.0
======
* Fix sizing issues in on-screen-keyboard emoji panel [Carlos; !439]
* Fix test linker failure on Debian/Ubuntu [Iain; !442]
* Avoid assertion when sizing fallback app icons from CSS [Florian; #1027]
* Fix mis-sized menu arrows after texture cache changes [Florian; !452]
Contributors:
Carlos Garnacho, Iain Lane, Florian Müllner
Translators:
Gábor Kelemen [hu], Victor Ibragimov [tg], Ryuta Fujii [ja], Piotr Drąg [af,
tg], Mart Raudsepp [et]
3.31.92
=======
* Fix visual glitch in submenus [Alex; #987]
* Support fractional scaling [Jonas, Marco; #765011, !5]
* Only consider visible children for :first-child/:last-child [Florian; !312]
* Hide trailing separator in search results [verdre; !311]
* Remember choice in inhibit-shortcuts dialogue [Olivier; !382]
* Don't toggle on-screen keyboard on every focus change [Carlos; !397]
* Fix legacy tray icons not responding to events on wayland [Florian; #191]
* Fix generating French OSK layout [Florian; #997]
* Use borderless round user images [Florian; #811]
* Misc. bug fixes and cleanups [Andrea, Robert, Florian, Marco, Niels,
Benjamin; !414, !417, !420, #996, !408, !422, !425, #1006, !427, !315,
#989, !430, !431, !432, #1015, !429, !423, !419, !434]
Contributors:
Jonas Ådahl, Alan, Andrea Azzarone, Benjamin Berg, Olivier Fourdan,
Carlos Garnacho, Niels De Graef, Robert Mader, Alex Monday, Florian Müllner,
Marco Trevisan (Treviño), verdre
Translators:
Carmen Bianca BAKKER [eo], Asier Sarasua Garmendia [eu], Stas Solovey [ru],
Changwoo Ryu [ko], Julien Humbert [fr], Milo Casagrande [it],
Марко Костић [sr], Ask Hjorth Larsen [da], Kukuh Syafaat [id],
Daniel Șerbănescu [ro], Bernd Homuth [de], Trần Ngọc Quân [vi],
Nathan Follens [nl], Rūdolfs Mazurs [lv], Aurimas Černius [lt]
3.31.91
=======
* Don't close on-screen-keyboard's language menu on hover [Florian; #171]

40
README.mdwn Normal file
View File

@@ -0,0 +1,40 @@
cldr2json
=========
This script converts Unicode CLDR android keyboard layouts to JSON usable by
GNOME Shell.
CLDR keyboard layouts can be found at
<http://www.unicode.org/Public/cldr/latest/keyboards.zip>
Usage
=====
./cldr2json <input file or directory> <output directory>
example:
./cldr2json cldr/keyboards/android/ json_layouts/
Keyboard layout mapping
=======================
Unicode CLDR layout identifiers are language codes, while XKB layout
identifiers are... something else. The mapping between the two currently uses
heuristic based on the layout descriptions, in this order:
- if the CLDR layout description matches an XKB layout description, chose its
XKB identifier
- if one word of the CLDR layout description matches an XKB layout
description, chose its XKB identifier
- if the CLDR layout description matches one word of an XKB layout description,
chose its XKB identifier
That doesn't always work. For instance it fails for "en" language, that should
match "us" XKB identifier. For such cases, there is a mapping in
LOCALE_TO_XKB_OVERRIDES at the top of the script. If you discover a weird
mapping of if you get a "failed to find XKB mapping for <locale>" warning then
please consider adding an override there.

208
cldr2json.py Executable file
View File

@@ -0,0 +1,208 @@
#!/usr/bin/python3
#
# Copyright 2015 Daiki Ueno <dueno@src.gnome.org>
# 2016 Parag Nemade <pnemade@redhat.com>
# 2017 Alan <alan@boum.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see
# <http://www.gnu.org/licenses/>.
import glob
import json
import locale
import logging
import os
import re
import sys
import xml.etree.ElementTree
import gi
gi.require_version('GnomeDesktop', '3.0') # NOQA: E402
from gi.repository import GnomeDesktop
ESCAPE_PATTERN = re.compile(r'\\u\{([0-9A-Fa-f]+?)\}')
ISO_PATTERN = re.compile(r'[A-E]([0-9]+)')
LOCALE_TO_XKB_OVERRIDES = {
'af': 'za',
'en': 'us',
'en-GB': 'uk',
'es-US': 'latam',
'fr-CA': 'ca',
'hi': 'in+bolnagri',
'ky': 'kg',
'nl-BE': 'be',
'zu': None
}
def parse_single_key(value):
def unescape(m):
return chr(int(m.group(1), 16))
value = ESCAPE_PATTERN.sub(unescape, value)
return value
def parse_rows(keymap):
unsorted_rows = {}
for _map in keymap.iter('map'):
value = _map.get('to')
key = [parse_single_key(value)]
iso = _map.get('iso')
if not ISO_PATTERN.match(iso):
sys.stderr.write('invalid ISO key name: %s\n' % iso)
continue
if not iso[0] in unsorted_rows:
unsorted_rows[iso[0]] = []
unsorted_rows[iso[0]].append((int(iso[1:]), key))
# add subkeys
longPress = _map.get('longPress')
if longPress:
for value in longPress.split(' '):
subkey = parse_single_key(value)
key.append(subkey)
rows = []
for k, v in sorted(list(unsorted_rows.items()),
key=lambda x: x[0],
reverse=True):
row = []
for key in sorted(v, key=lambda x: x):
row.append(key[1])
rows.append(row)
return rows
def convert_xml(tree):
root = {}
for xml_keyboard in tree.iter("keyboard"):
locale_full = xml_keyboard.get("locale")
locale, sep, end = locale_full.partition("-t-")
root["locale"] = locale
for xml_name in tree.iter("name"):
name = xml_name.get("value")
root["name"] = name
root["levels"] = []
# parse levels
for index, keymap in enumerate(tree.iter('keyMap')):
# FIXME: heuristics here
modifiers = keymap.get('modifiers')
if not modifiers:
mode = 'default'
modifiers = ''
elif 'shift' in modifiers.split(' '):
mode = 'latched'
modifiers = 'shift'
else:
mode = 'locked'
level = {}
level["level"] = modifiers
level["mode"] = mode
level["rows"] = parse_rows(keymap)
root["levels"].append(level)
return root
def locale_to_xkb(locale, name):
if locale in sorted(LOCALE_TO_XKB_OVERRIDES.keys()):
xkb = LOCALE_TO_XKB_OVERRIDES[locale]
logging.debug("override for %s%s",
locale, xkb)
if xkb:
return xkb
else:
raise KeyError("layout %s explicitely disabled in overrides"
% locale)
xkb_names = sorted(name_to_xkb.keys())
if name in xkb_names:
return name_to_xkb[name]
else:
logging.debug("name %s failed" % name)
for sub_name in name.split(' '):
if sub_name in xkb_names:
xkb = name_to_xkb[sub_name]
logging.debug("dumb mapping failed but match with locale word: "
"%s (%s) → %s (%s)",
locale, name, xkb, sub_name)
return xkb
else:
logging.debug("sub_name failed")
for xkb_name in xkb_names:
for xkb_sub_name in xkb_name.split(' '):
if xkb_sub_name.strip('()') == name:
xkb = name_to_xkb[xkb_name]
logging.debug("dumb mapping failed but match with xkb word: "
"%s (%s) → %s (%s)",
locale, name, xkb, xkb_name)
return xkb
raise KeyError("failed to find XKB mapping for %s" % locale)
def convert_file(source_file, destination_path):
logging.info("Parsing %s", source_file)
itree = xml.etree.ElementTree.ElementTree()
itree.parse(source_file)
root = convert_xml(itree)
try:
xkb_name = locale_to_xkb(root["locale"], root["name"])
except KeyError as e:
logging.warn(e)
return False
destination_file = os.path.join(destination_path, xkb_name + ".json")
with open(destination_file, 'w', encoding="utf-8") as dest_fd:
json.dump(root, dest_fd, ensure_ascii=False, indent=2, sort_keys=True)
logging.debug("written %s", destination_file)
def load_xkb_mappings():
xkb = GnomeDesktop.XkbInfo()
layouts = xkb.get_all_layouts()
name_to_xkb = {}
for layout in layouts:
name = xkb.get_layout_info(layout).display_name
name_to_xkb[name] = layout
return name_to_xkb
locale.setlocale(locale.LC_ALL, "C")
name_to_xkb = load_xkb_mappings()
if __name__ == "__main__":
if "DEBUG" in os.environ:
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) < 2:
print("supply a CLDR keyboard file")
sys.exit(1)
if len(sys.argv) < 3:
print("supply an output directory")
sys.exit(1)
source = sys.argv[1]
destination = sys.argv[2]
if os.path.isfile(source):
convert_file(source, destination)
elif os.path.isdir(source):
for path in glob.glob(source + "/*-t-k0-android.xml"):
convert_file(path, destination)

View File

@@ -9,9 +9,6 @@
<method name="ShowOSD">
<arg type="a{sv}" direction="in" name="params"/>
</method>
<method name="ShowMonitorLabels">
<arg type="a{uv}" direction="in" name="params"/>
</method>
<method name="ShowMonitorLabels2">
<arg type="a{sv}" direction="in" name="params"/>
</method>
@@ -34,6 +31,10 @@
<arg type="u" direction="in" name="action"/>
<arg type="b" direction="out" name="success"/>
</method>
<method name="UngrabAccelerators">
<arg type="au" direction="in" name="action"/>
<arg type="b" direction="out" name="success"/>
</method>
<signal name="AcceleratorActivated">
<arg name="action" type="u"/>
<arg name="parameters" type="a{sv}"/>

View File

@@ -6,6 +6,7 @@
<file>be.json</file>
<file>bg.json</file>
<file>by.json</file>
<file>ca.json</file>
<file>cz.json</file>
<file>de.json</file>
<file>dk.json</file>

599
data/osk-layouts/ca.json Normal file
View File

@@ -0,0 +1,599 @@
{
"levels": [
{
"level": "",
"mode": "default",
"rows": [
[
[
"q"
],
[
"w"
],
[
"e",
"é",
"è",
"ê",
"ë",
"%",
"ę",
"ė",
"ē"
],
[
"r"
],
[
"t"
],
[
"y",
"%",
"ÿ"
],
[
"u",
"ù",
"û",
"%",
"ü",
"ú",
"ū"
],
[
"i",
"î",
"%",
"ï",
"ì",
"í",
"į",
"ī"
],
[
"o",
"ô",
"œ",
"%",
"ö",
"ò",
"ó",
"õ",
"ø",
"ō",
"º"
],
[
"p"
]
],
[
[
"a",
"à",
"â",
"%",
"æ",
"á",
"ä",
"ã",
"å",
"ā",
"ª"
],
[
"s"
],
[
"d"
],
[
"f"
],
[
"g"
],
[
"h"
],
[
"j"
],
[
"k"
],
[
"l"
]
],
[
[
"z"
],
[
"x"
],
[
"c",
"ç",
"ć",
"č"
],
[
"v"
],
[
"b"
],
[
"n"
],
[
"m"
]
],
[
[
","
],
[
" "
],
[
".",
"#",
"!",
",",
"?",
"-",
":",
"'",
"@"
]
]
]
},
{
"level": "shift",
"mode": "latched",
"rows": [
[
[
"Q"
],
[
"W"
],
[
"E",
"É",
"È",
"Ê",
"Ë",
"%",
"Ę",
"Ė",
"Ē"
],
[
"R"
],
[
"T"
],
[
"Y",
"%",
"Ÿ"
],
[
"U",
"Ù",
"Û",
"%",
"Ü",
"Ú",
"Ū"
],
[
"I",
"Î",
"%",
"Ï",
"Ì",
"Í",
"Į",
"Ī"
],
[
"O",
"Ô",
"Œ",
"%",
"Ö",
"Ò",
"Ó",
"Õ",
"Ø",
"Ō",
"º"
],
[
"P"
]
],
[
[
"A",
"À",
"Â",
"%",
"Æ",
"Á",
"Ä",
"Ã",
"Å",
"Ā",
"ª"
],
[
"S"
],
[
"D"
],
[
"F"
],
[
"G"
],
[
"H"
],
[
"J"
],
[
"K"
],
[
"L"
]
],
[
[
"Z"
],
[
"X"
],
[
"C",
"Ç",
"Ć",
"Č"
],
[
"V"
],
[
"B"
],
[
"N"
],
[
"M"
]
],
[
[
","
],
[
" "
],
[
".",
"#",
"!",
",",
"?",
"-",
":",
"'",
"@"
]
]
]
},
{
"level": "opt",
"mode": "locked",
"rows": [
[
[
"1",
"¹",
"½",
"⅓",
"¼",
"⅛"
],
[
"2",
"²",
"⅔"
],
[
"3",
"³",
"¾",
"⅜"
],
[
"4",
"⁴"
],
[
"5",
"⅝"
],
[
"6"
],
[
"7",
"⅞"
],
[
"8"
],
[
"9"
],
[
"0",
"ⁿ",
"∅"
]
],
[
[
"@"
],
[
"#"
],
[
"$",
"¢",
"£",
"€",
"¥",
"₱"
],
[
"%",
"‰"
],
[
"&"
],
[
"-",
"_",
"",
"—",
"·"
],
[
"+",
"±"
],
[
"(",
"<",
"{",
"["
],
[
")",
">",
"}",
"]"
]
],
[
[
"*",
"†",
"‡",
"★"
],
[
"\"",
"“",
"”",
"«",
"»"
],
[
"'",
"",
"",
"",
""
],
[
":"
],
[
";"
],
[
"!",
"¡"
],
[
"?",
"¿"
]
],
[
[
"_"
],
[
"/"
],
[
" "
],
[
","
],
[
".",
"…"
]
]
]
},
{
"level": "opt+shift",
"mode": "locked",
"rows": [
[
[
"~"
],
[
"`"
],
[
"|"
],
[
"•",
"♪",
"♥",
"♠",
"♦",
"♣"
],
[
"√"
],
[
"Π",
"π"
],
[
"÷"
],
[
"×"
],
[
"¶",
"§"
],
[
"∆"
]
],
[
[
"£"
],
[
"¢"
],
[
"€"
],
[
"¥"
],
[
"^",
"↑",
"↓",
"←",
"→"
],
[
"°",
"",
"″"
],
[
"=",
"≠",
"≈",
"∞"
],
[
"{"
],
[
"}"
]
],
[
[
"\\"
],
[
"©"
],
[
"®"
],
[
"™"
],
[
"℅"
],
[
"["
],
[
"]"
]
],
[
[
"<",
"",
"≤",
"«"
],
[
">",
"",
"≥",
"»"
],
[
" "
],
[
","
],
[
".",
"…"
]
]
]
}
],
"locale": "fr-CA",
"name": "French Canada"
}

View File

@@ -6,10 +6,20 @@
"rows": [
[
[
"q"
"a",
"à",
"â",
"%",
"æ",
"á",
"ä",
"ã",
"å",
"ā",
"ª"
],
[
"w"
"z"
],
[
"e",
@@ -71,17 +81,7 @@
],
[
[
"a",
"à",
"â",
"%",
"æ",
"á",
"ä",
"ã",
"å",
"ā",
"ª"
"q"
],
[
"s"
@@ -106,11 +106,14 @@
],
[
"l"
],
[
"m"
]
],
[
[
"z"
"w"
],
[
"x"
@@ -131,7 +134,11 @@
"n"
],
[
"m"
"'",
"",
"",
"",
""
]
],
[
@@ -161,10 +168,20 @@
"rows": [
[
[
"Q"
"A",
"À",
"Â",
"%",
"Æ",
"Á",
"Ä",
"Ã",
"Å",
"Ā",
"ª"
],
[
"W"
"Z"
],
[
"E",
@@ -226,17 +243,7 @@
],
[
[
"A",
"À",
"Â",
"%",
"Æ",
"Á",
"Ä",
"Ã",
"Å",
"Ā",
"ª"
"Q"
],
[
"S"
@@ -261,11 +268,14 @@
],
[
"L"
],
[
"M"
]
],
[
[
"Z"
"W"
],
[
"X"
@@ -286,7 +296,11 @@
"N"
],
[
"M"
"'",
"",
"",
"",
""
]
],
[
@@ -369,10 +383,10 @@
"#"
],
[
"$",
"",
"¢",
"£",
"",
"$",
"¥",
"₱"
],
@@ -511,13 +525,14 @@
"£"
],
[
"¥"
],
[
"$",
"¢"
],
[
""
],
[
"¥"
"¢"
],
[
"^",
@@ -594,6 +609,6 @@
]
}
],
"locale": "fr-CA",
"name": "French Canada"
"locale": "fr",
"name": "French"
}

View File

@@ -16,12 +16,12 @@ $link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), li
$top_hilight: $borders_edge;
$warning_color: #f57900;
$error_color: #cc0000;
$error_color: #ff8080;
$success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%));
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));
$osd_fg_color: #eeeeec;
$osd_bg_color: #2e3436;
$osd_bg_color: transparentize(darken(desaturate(#3d3846, 100%), 15%),0.3);
$osd_borders_color: transparentize(black, 0.3);
$osd_outer_borders_color: transparentize(white, 0.9);

View File

@@ -29,7 +29,7 @@ $panel-corner-radius: 6px;
/* GLOBALS */
$font-size: 11;
$font-family: Cantarell, Sans-Serif;
$_bubble_bg_color: opacify($osd_bg_color,0.25);
$_bubble_bg_color: $osd_bg_color;
$_bubble_fg_color: $osd_fg_color;
$_bubble_borders_color: transparentize($osd_fg_color,0.8);
@@ -184,7 +184,7 @@ StScrollBar {
.modal-dialog {
border-radius: 9px;
color: $osd_fg_color;
background-color: transparentize(darken($osd_bg_color,10%),0.05);
background-color: $osd_bg_color;
border: 1px solid $_bubble_borders_color;
.modal-dialog-content-box {
padding: 24px;
@@ -267,8 +267,7 @@ StScrollBar {
}
.end-session-dialog-logout-icon {
//border: 2px solid #8b8b8b;
border-radius: 5px;
border-radius: 99px;
width: 48px;
height: 48px;
background-size: contain;
@@ -393,7 +392,7 @@ StScrollBar {
.prompt-dialog-error-label {
font-size: 10pt;
color: $error_color;
color: $warning_color;
padding-bottom: 8px;
}
@@ -428,7 +427,7 @@ StScrollBar {
}
.polkit-dialog-user-icon {
border-radius: 5px;
border-radius: 99px;
background-size: contain;
width: 48px;
height: 48px;
@@ -508,6 +507,7 @@ StScrollBar {
.popup-menu-arrow { } //defined globally in the TOP BAR
.popup-sub-menu {
padding-bottom: 1px;
background-color: darken($bg_color,2%);
box-shadow: inset 0 -1px 0px lighten($borders_color,5%);
}
@@ -1031,6 +1031,11 @@ StScrollBar {
-st-icon-style: symbolic;
}
.message-icon-bin > .fallback-window-icon {
width: 1.09em;
height: 1.09em;
}
.message-secondary-bin {
padding: 0 0.82em;;
}
@@ -1137,8 +1142,14 @@ StScrollBar {
.ripple-box:rtl { border-radius: 0 0 0 52px; } // just a simple change to the border radius position
// Rubberband for select-area screenshots
.select-area-rubberband {
background-color: transparentize($selected_bg_color,0.7);
border: 1px solid $selected_bg_color;
}
// not really top bar only
.popup-menu-arrow { width: 16px; height: 16px; }
.popup-menu-arrow { icon-size: 1.09em; }
.popup-menu-icon { icon-size: 1.09em; }
//close buttons
@@ -1284,6 +1295,8 @@ StScrollBar {
.search-section-separator { height: 2px; background-color: rgba(255, 255, 255, 0.2); }
.search-section:last-child .search-section-separator { background-color: transparent; }
.list-search-result-content { spacing: 30px; }
.list-search-result-title { color: darken($osd_fg_color,5%); spacing: 12px; }
.list-search-result-description { color: transparentize(darken($osd_fg_color,15%), 0.5); }
@@ -1446,13 +1459,13 @@ StScrollBar {
height: 12px;
background-color: transparent;
border: 2px solid rgba(255, 255, 255, 0.4);
border-radius:12px;
border-radius: 12px;
}
&:hover .page-indicator-icon { border-color: white; }
&:active .page-indicator-icon { border: none; margin: 2px; background-color:#fff; }
&:active .page-indicator-icon { border: none; margin: 2px; background-color: white; }
&:checked .page-indicator-icon,
&:checked:active { background-color: #fff;}
&:checked:active .page-indicator-icon { background-color: white;}
}
.no-frequent-applications-label { @extend %status_text; }
@@ -1754,13 +1767,11 @@ StScrollBar {
/* Auth Dialogs & Screen Shield */
.framed-user-icon {
.user-icon {
background-size: contain;
border: 2px solid $osd_fg_color;
color: $osd_fg_color;
border-radius: 3px;
border-radius: 99px;
&:hover {
border-color: lighten($osd_fg_color,30%);
color: lighten($osd_fg_color,30%);
}
}

View File

@@ -111,7 +111,7 @@
}
}
@mixin button($t, $c:$osd_bg_color, $tc:$fg_color, $edge: $borders_edge) {
@mixin button($t, $c:opacify(lighten($osd_bg_color, 5%),1.0), $tc:$fg_color, $edge: $borders_edge) {
//
// Button drawing function
//
@@ -136,8 +136,7 @@
//
// normal button
//
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.5),
$osd_bg_color);
$_bg: $c;
color: $osd_fg_color;
background-color: $_bg;
@@ -150,8 +149,7 @@
//
// focused button
//
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.3),
lighten($osd_bg_color,3%));
$_bg: lighten($c,3%);
color: $osd_fg_color;
text-shadow: 0 1px black;
@@ -163,8 +161,7 @@
//
// active osd button
//
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.3),
lighten($osd_bg_color,3%));
$_bg: lighten($c,3%);
color: white;
border-color: $osd_borders_color;

View File

@@ -40,6 +40,7 @@ do
done
cat >>$TMP_GRESOURCE_FILE <<EOF
<file>emoji.json</file>
</gresource>
</gresources>
EOF

View File

@@ -551,9 +551,9 @@ class ExtensionRow extends Gtk.ListBoxRow {
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,
no_show_all: true });
button.add(new Gtk.Image({ icon_name: 'emblem-system-symbolic',
icon_size: Gtk.IconSize.BUTTON,
visible: true }));
button.set_image(new Gtk.Image({ icon_name: 'emblem-system-symbolic',
icon_size: Gtk.IconSize.BUTTON,
visible: true }));
button.get_style_context().add_class('circular');
hbox.add(button);

View File

@@ -481,6 +481,9 @@ var LoginDialog = GObject.registerClass({
this._logoBin = new St.Widget({ style_class: 'login-dialog-logo-bin',
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.END });
this._logoBin.connect('resource-scale-changed', () => {
this._updateLogoTexture(this._textureCache, this._logoFile);
});
this.add_child(this._logoBin);
this._updateLogo();
@@ -778,11 +781,12 @@ var LoginDialog = GObject.registerClass({
return;
this._logoBin.destroy_all_children();
if (this._logoFile) {
if (this._logoFile && this._logoBin.resource_scale > 0) {
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
-1, _LOGO_ICON_HEIGHT,
scaleFactor));
scaleFactor,
this._logoBin.resource_scale));
}
}

View File

@@ -1,8 +1,10 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Clutter, GObject, IBus } = imports.gi;
const { Clutter, GLib, GObject, IBus } = imports.gi;
const Keyboard = imports.ui.status.keyboard;
var HIDE_PANEL_TIME = 50;
var InputMethod = GObject.registerClass(
class InputMethod extends Clutter.InputMethod {
_init() {
@@ -13,6 +15,7 @@ class InputMethod extends Clutter.InputMethod {
this._preeditStr = '';
this._preeditPos = 0;
this._preeditVisible = false;
this._hidePanelId = 0;
this._ibus = IBus.Bus.new_async();
this._ibus.connect('connected', this._onConnected.bind(this));
this._ibus.connect('disconnected', this._clear.bind(this));
@@ -136,6 +139,11 @@ class InputMethod extends Clutter.InputMethod {
this._updateCapabilities();
this._emitRequestSurrounding();
}
if (this._hidePanelId) {
GLib.source_remove(this._hidePanelId);
this._hidePanelId = 0;
}
}
vfunc_focus_out() {
@@ -150,6 +158,12 @@ class InputMethod extends Clutter.InputMethod {
this.set_preedit_text(null, 0);
this._preeditStr = null;
}
this._hidePanelId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, HIDE_PANEL_TIME, () => {
this.set_input_panel_state(Clutter.InputPanelState.OFF);
this._hidePanelId = 0;
return GLib.SOURCE_REMOVE;
});
}
vfunc_reset() {

View File

@@ -30,6 +30,14 @@ var WeatherClient = class {
return;
}
if (this._permStore.g_name_owner == null) {
// Failed to auto-start, likely because xdg-desktop-portal
// isn't installed; don't restrict access to location service
this._weatherAuthorized = true;
this._updateAutoLocation();
return;
}
this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
if (error)
log('Error looking up permission: ' + error.message);

View File

@@ -10,7 +10,7 @@ const Scripting = imports.ui.scripting;
// someone should be able to get an idea of how well the shell is performing
// on a particular system.
let METRICS = {
var METRICS = {
overviewLatencyFirst:
{ description: "Time to first frame after triggering overview, first time",
units: "us" },

View File

@@ -1,8 +1,8 @@
const { Clutter, Gio, Gtk, Shell } = imports.gi;
const { Clutter, Gio, Shell } = imports.gi;
const Main = imports.ui.main;
const Scripting = imports.ui.scripting;
let METRICS = {
var METRICS = {
timeToDesktop:
{ description: "Time from starting graphical.target to desktop showing",
units: "us" },
@@ -104,7 +104,10 @@ function *run() {
yield Scripting.waitLeisure();
Scripting.scriptEvent('desktopShown');
Gtk.Settings.get_default().gtk_enable_animations = false;
let interfaceSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.interface'
});
interfaceSettings.set_boolean('enable-animations', false);
Scripting.scriptEvent('overviewShowStart');
Main.overview.show();
@@ -200,7 +203,7 @@ function *run() {
yield Scripting.sleep(1000);
Gtk.Settings.get_default().gtk_enable_animations = true;
interfaceSettings.set_boolean('enable-animations', true);
}
let overviewShowStart;

View File

@@ -619,9 +619,8 @@ class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
var WindowCyclerPopup = GObject.registerClass(
class WindowCyclerPopup extends CyclerPopup {
_init() {
super._init();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' });
super._init();
}
_getWindows() {

View File

@@ -12,7 +12,16 @@ var SPINNER_ANIMATION_DELAY = 1.0;
var Animation = class {
constructor(file, width, height, speed) {
this.actor = new St.Bin();
this.actor.set_size(width, height);
this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('notify::size', this._syncAnimationSize.bind(this));
this.actor.connect('resource-scale-changed',
this._loadFile.bind(this, file, width, height));
let themeContext = St.ThemeContext.get_for_stage(global.stage);
this._scaleChangedId = themeContext.connect('notify::scale-factor',
this._loadFile.bind(this, file, width, height));
this._speed = speed;
this._isLoaded = false;
@@ -20,10 +29,7 @@ var Animation = class {
this._timeoutId = 0;
this._frame = 0;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._animations = St.TextureCache.get_default().load_sliced_image (file, width, height, scaleFactor,
this._animationsLoaded.bind(this));
this.actor.set_child(this._animations);
this._loadFile(file, width, height);
}
play() {
@@ -47,6 +53,23 @@ var Animation = class {
this._isPlaying = false;
}
_loadFile(file, width, height) {
let [validResourceScale, resourceScale] = this.actor.get_resource_scale();
this._isLoaded = false;
this.actor.destroy_all_children();
if (!validResourceScale)
return;
let texture_cache = St.TextureCache.get_default();
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._animations = texture_cache.load_sliced_image(file, width, height,
scaleFactor, resourceScale,
this._animationsLoaded.bind(this));
this.actor.set_child(this._animations);
}
_showFrame(frame) {
let oldFrameActor = this._animations.get_child_at_index(this._frame);
if (oldFrameActor)
@@ -64,15 +87,32 @@ var Animation = class {
return GLib.SOURCE_CONTINUE;
}
_syncAnimationSize() {
if (!this._isLoaded)
return;
let [width, height] = this.actor.get_size();
for (let i = 0; i < this._animations.get_n_children(); ++i)
this._animations.get_child_at_index(i).set_size(width, height);
}
_animationsLoaded() {
this._isLoaded = this._animations.get_n_children() > 0;
this._syncAnimationSize();
if (this._isPlaying)
this.play();
}
_onDestroy() {
this.stop();
let themeContext = St.ThemeContext.get_for_stage(global.stage);
if (this._scaleChangedId)
themeContext.disconnect(this._scaleChangedId);
this._scaleChangedId = 0;
}
};

View File

@@ -14,39 +14,47 @@ const RENAMED_DESKTOP_IDS = {
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
'evolution.desktop': 'org.gnome.Evolution.desktop',
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
'five-or-more.desktop': 'org.gnome.five-or-more.desktop',
'four-in-a-row.desktop': 'org.gnome.Four-in-a-row.desktop',
'gcalctool.desktop': 'org.gnome.Calculator.desktop',
'geary.desktop': 'org.gnome.Geary.desktop',
'gedit.desktop': 'org.gnome.gedit.desktop',
'glchess.desktop': 'gnome-chess.desktop',
'glines.desktop': 'five-or-more.desktop',
'gnect.desktop': 'four-in-a-row.desktop',
'glchess.desktop': 'org.gnome.Chess.desktop',
'glines.desktop': 'org.gnome.five-or-more.desktop',
'gnect.desktop': 'org.gnome.Four-in-a-row.desktop',
'gnibbles.desktop': 'org.gnome.Nibbles.desktop',
'gnobots2.desktop': 'gnome-robots.desktop',
'gnobots2.desktop': 'org.gnome.Robots.desktop',
'gnome-boxes.desktop': 'org.gnome.Boxes.desktop',
'gnome-calculator.desktop': 'org.gnome.Calculator.desktop',
'gnome-chess.desktop': 'org.gnome.Chess.desktop',
'gnome-clocks.desktop': 'org.gnome.clocks.desktop',
'gnome-contacts.desktop': 'org.gnome.Contacts.desktop',
'gnome-documents.desktop': 'org.gnome.Documents.desktop',
'gnome-font-viewer.desktop': 'org.gnome.font-viewer.desktop',
'gnome-klotski.desktop': 'org.gnome.Klotski.desktop',
'gnome-nibbles.desktop': 'org.gnome.Nibbles.desktop',
'gnome-mahjongg.desktop': 'org.gnome.Mahjongg.desktop',
'gnome-mines.desktop': 'org.gnome.Mines.desktop',
'gnome-music.desktop': 'org.gnome.Music.desktop',
'gnome-photos.desktop': 'org.gnome.Photos.desktop',
'gnome-robots.desktop': 'org.gnome.Robots.desktop',
'gnome-screenshot.desktop': 'org.gnome.Screenshot.desktop',
'gnome-software.desktop': 'org.gnome.Software.desktop',
'gnome-terminal.desktop': 'org.gnome.Terminal.desktop',
'gnome-tetravex.desktop': 'org.gnome.Tetravex.desktop',
'gnome-tweaks.desktop': 'org.gnome.tweaks.desktop',
'gnome-weather.desktop': 'org.gnome.Weather.desktop',
'gnomine.desktop': 'gnome-mines.desktop',
'gnotravex.desktop': 'gnome-tetravex.desktop',
'gnotski.desktop': 'gnome-klotski.desktop',
'gtali.desktop': 'tali.desktop',
'gnomine.desktop': 'org.gnome.Mines.desktop',
'gnotravex.desktop': 'org.gnome.Tetravex.desktop',
'gnotski.desktop': 'org.gnome.Klotski.desktop',
'gtali.desktop': 'org.gnome.Tali.desktop',
'iagno.desktop': 'org.gnome.Reversi.desktop',
'nautilus.desktop': 'org.gnome.Nautilus.desktop',
'org.gnome.gnome-2048.desktop': 'org.gnome.TwentyFortyEight.desktop',
'org.gnome.taquin.desktop': 'org.gnome.Taquin.desktop',
'org.gnome.Weather.Application.desktop': 'org.gnome.Weather.desktop',
'polari.desktop': 'org.gnome.Polari.desktop',
'tali.desktop': 'org.gnome.Tali.desktop',
'totem.desktop': 'org.gnome.Totem.desktop',
'evince.desktop': 'org.gnome.Evince.desktop',
};

View File

@@ -746,10 +746,8 @@ var BackgroundManager = class BackgroundManager {
this._container.add_child(backgroundActor);
let monitor = this._layoutManager.monitors[this._monitorIndex];
backgroundActor.set_size(monitor.width, monitor.height);
if (this._controlPosition) {
let monitor = this._layoutManager.monitors[this._monitorIndex];
backgroundActor.set_position(monitor.x, monitor.y);
backgroundActor.lower_bottom();
}

View File

@@ -24,7 +24,7 @@ var POPUP_ANIMATION_TIME = 0.15;
* placed. The arrow position may be controlled via
* setArrowOrigin(). The arrow side might be temporarily flipped
* depending on the box size and source position to keep the box
* totally inside the monitor if possible.
* totally inside the monitor workarea if possible.
*
*/
var BoxPointer = GObject.registerClass({
@@ -47,10 +47,6 @@ var BoxPointer = GObject.registerClass({
this._border.connect('repaint', this._drawBorder.bind(this));
this.add_actor(this._border);
this.bin.raise(this._border);
this._xOffset = 0;
this._yOffset = 0;
this._xPosition = 0;
this._yPosition = 0;
this._sourceAlignment = 0.5;
this._capturedEventId = 0;
this._muteInput();
@@ -118,23 +114,23 @@ var BoxPointer = GObject.registerClass({
if (animate & PopupAnimation.SLIDE) {
switch (this._arrowSide) {
case St.Side.TOP:
this.yOffset = -rise;
this.translation_y = -rise;
break;
case St.Side.BOTTOM:
this.yOffset = rise;
this.translation_y = rise;
break;
case St.Side.LEFT:
this.xOffset = -rise;
this.translation_x = -rise;
break;
case St.Side.RIGHT:
this.xOffset = rise;
this.translation_x = rise;
break;
}
}
Tweener.addTween(this, { opacity: 255,
xOffset: 0,
yOffset: 0,
translation_x: 0,
translation_y: 0,
transition: 'linear',
onComplete: () => {
this._unmuteInput();
@@ -148,8 +144,8 @@ var BoxPointer = GObject.registerClass({
if (!this.visible)
return;
let xOffset = 0;
let yOffset = 0;
let translationX = 0;
let translationY = 0;
let themeNode = this.get_theme_node();
let rise = themeNode.get_length('-arrow-rise');
let fade = (animate & PopupAnimation.FADE);
@@ -158,16 +154,16 @@ var BoxPointer = GObject.registerClass({
if (animate & PopupAnimation.SLIDE) {
switch (this._arrowSide) {
case St.Side.TOP:
yOffset = rise;
translationY = rise;
break;
case St.Side.BOTTOM:
yOffset = -rise;
translationY = -rise;
break;
case St.Side.LEFT:
xOffset = rise;
translationX = rise;
break;
case St.Side.RIGHT:
xOffset = -rise;
translationX = -rise;
break;
}
}
@@ -176,15 +172,15 @@ var BoxPointer = GObject.registerClass({
Tweener.removeTweens(this);
Tweener.addTween(this, { opacity: fade ? 0 : 255,
xOffset: xOffset,
yOffset: yOffset,
translation_x: translationX,
translation_y: translationY,
transition: 'linear',
time: animationTime,
onComplete: () => {
this.hide();
this.opacity = 0;
this.xOffset = 0;
this.yOffset = 0;
this.translation_x = 0;
this.translation_y = 0;
if (onComplete)
onComplete();
}
@@ -477,11 +473,15 @@ var BoxPointer = GObject.registerClass({
_reposition() {
let sourceActor = this._sourceActor;
let alignment = this._arrowAlignment;
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
this._sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
// Position correctly relative to the sourceActor
let sourceNode = sourceActor.get_theme_node();
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
let sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
let sourceAllocation = this._sourceAllocation;
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
let [minWidth, minHeight, natWidth, natHeight] = this.get_preferred_size();
@@ -489,7 +489,7 @@ var BoxPointer = GObject.registerClass({
// We also want to keep it onscreen, and separated from the
// edge by the same distance as the main part of the box is
// separated from its sourceActor
let monitor = Main.layoutManager.findMonitorForActor(sourceActor);
let workarea = this._workArea;
let themeNode = this.get_theme_node();
let borderWidth = themeNode.get_length('-arrow-border-width');
let arrowBase = themeNode.get_length('-arrow-base');
@@ -539,8 +539,8 @@ var BoxPointer = GObject.registerClass({
case St.Side.BOTTOM:
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
resX = Math.max(resX, monitor.x + padding);
resX = Math.min(resX, monitor.x + monitor.width - (padding + natWidth));
resX = Math.max(resX, workarea.x + padding);
resX = Math.min(resX, workarea.x + workarea.width - (padding + natWidth));
arrowOrigin = sourceCenterX - resX;
if (arrowOrigin <= (x1 + (borderRadius + halfBase))) {
@@ -558,8 +558,8 @@ var BoxPointer = GObject.registerClass({
case St.Side.RIGHT:
resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
resY = Math.max(resY, monitor.y + padding);
resY = Math.min(resY, monitor.y + monitor.height - (padding + natHeight));
resY = Math.max(resY, workarea.y + padding);
resY = Math.min(resY, workarea.y + workarea.height - (padding + natHeight));
arrowOrigin = sourceCenterY - resY;
if (arrowOrigin <= (y1 + (borderRadius + halfBase))) {
@@ -583,9 +583,9 @@ var BoxPointer = GObject.registerClass({
parent = parent.get_parent();
}
this._xPosition = Math.floor(x);
this._yPosition = Math.floor(y);
this._shiftActor();
// Actually set the position
this.x = Math.floor(x);
this.y = Math.floor(y);
}
// @origin: Coordinate specifying middle of the arrow, along
@@ -608,44 +608,30 @@ var BoxPointer = GObject.registerClass({
}
}
_shiftActor() {
// Since the position of the BoxPointer depends on the allocated size
// of the BoxPointer and the position of the source actor, trying
// to position the BoxPointer via the x/y properties will result in
// allocation loops and warnings. Instead we do the positioning via
// the anchor point, which is independent of allocation, and leave
// x == y == 0.
this.set_anchor_point(-(this._xPosition + this._xOffset),
-(this._yPosition + this._yOffset));
}
_calculateArrowSide(arrowSide) {
let sourceAllocation = Shell.util_get_transformed_allocation(this._sourceActor);
let sourceAllocation = this._sourceAllocation;
let [minWidth, minHeight, boxWidth, boxHeight] = this.get_preferred_size();
let monitorActor = this.sourceActor;
if (!monitorActor)
monitorActor = this;
let monitor = Main.layoutManager.findMonitorForActor(monitorActor);
let workarea = this._workArea;
switch (arrowSide) {
case St.Side.TOP:
if (sourceAllocation.y2 + boxHeight > monitor.y + monitor.height &&
boxHeight < sourceAllocation.y1 - monitor.y)
if (sourceAllocation.y2 + boxHeight > workarea.y + workarea.height &&
boxHeight < sourceAllocation.y1 - workarea.y)
return St.Side.BOTTOM;
break;
case St.Side.BOTTOM:
if (sourceAllocation.y1 - boxHeight < monitor.y &&
boxHeight < monitor.y + monitor.height - sourceAllocation.y2)
if (sourceAllocation.y1 - boxHeight < workarea.y &&
boxHeight < workarea.y + workarea.height - sourceAllocation.y2)
return St.Side.TOP;
break;
case St.Side.LEFT:
if (sourceAllocation.x2 + boxWidth > monitor.x + monitor.width &&
boxWidth < sourceAllocation.x1 - monitor.x)
if (sourceAllocation.x2 + boxWidth > workarea.x + workarea.width &&
boxWidth < sourceAllocation.x1 - workarea.x)
return St.Side.RIGHT;
break;
case St.Side.RIGHT:
if (sourceAllocation.x1 - boxWidth < monitor.x &&
boxWidth < monitor.x + monitor.width - sourceAllocation.x2)
if (sourceAllocation.x1 - boxWidth < workarea.x &&
boxWidth < workarea.x + workarea.width - sourceAllocation.x2)
return St.Side.LEFT;
break;
}
@@ -667,24 +653,6 @@ var BoxPointer = GObject.registerClass({
}
}
set xOffset(offset) {
this._xOffset = offset;
this._shiftActor();
}
get xOffset() {
return this._xOffset;
}
set yOffset(offset) {
this._yOffset = offset;
this._shiftActor();
}
get yOffset() {
return this._yOffset;
}
updateArrowSide(side) {
this._arrowSide = side;
this._border.queue_repaint();

View File

@@ -93,10 +93,10 @@ var AutomountManager = class {
if (!this._session.SessionIsActive)
return;
let sound = global.display.get_sound();
sound.play_from_theme('device-removed-media',
_("External drive disconnected"),
null);
let player = global.display.get_sound_player();
player.play_from_theme('device-removed-media',
_("External drive disconnected"),
null);
}
_onDriveEjectButton(monitor, drive) {

View File

@@ -94,7 +94,9 @@ var CtrlAltTabManager = class CtrlAltTabManager {
if (app)
icon = app.create_icon_texture(POPUP_APPICON_SIZE);
else
icon = textureCache.bind_cairo_surface_property(windows[i], 'icon');
icon = textureCache.bind_cairo_surface_property(windows[i],
'icon',
POPUP_APPICON_SIZE);
}
items.push({ name: windows[i].title,

View File

@@ -584,22 +584,18 @@ var Dash = class Dash {
let firstButton = iconChildren[0].child;
let firstIcon = firstButton._delegate.icon;
let minHeight, natHeight;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
// Enforce the current icon size during the size request
// Enforce valid spacings during the size request
firstIcon.icon.ensure_style();
let [, currentHeight] = firstIcon.icon.get_size();
firstIcon.icon.set_height(this.iconSize * scaleFactor);
[minHeight, natHeight] = firstButton.get_preferred_height(-1);
firstIcon.icon.set_height(currentHeight);
let [, iconHeight] = firstIcon.icon.get_preferred_height(-1);
let [, buttonHeight] = firstButton.get_preferred_height(-1);
// Subtract icon padding and box spacing from the available height
availHeight -= iconChildren.length * (natHeight - this.iconSize * scaleFactor) +
availHeight -= iconChildren.length * (buttonHeight - iconHeight) +
(iconChildren.length - 1) * spacing;
let availSize = availHeight / iconChildren.length;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let iconSizes = baseIconSizes.map(s => s * scaleFactor);
let newIconSize = baseIconSizes[0];

View File

@@ -136,11 +136,12 @@ var WorldClocksSection = class WorldClocksSection {
layout.attach(header, 0, 0, 2, 1);
this.actor.label_actor = header;
let localOffset = GLib.DateTime.new_now_local().get_utc_offset();
for (let i = 0; i < this._locations.length; i++) {
let l = this._locations[i].location;
let name = l.get_level() == GWeather.LocationLevel.NAMED_TIMEZONE ? l.get_name()
: l.get_city_name();
let name = l.get_city_name() || l.get_name();
let label = new St.Label({ style_class: 'world-clocks-city',
text: name,
x_align: Clutter.ActorAlign.START,
@@ -149,7 +150,8 @@ var WorldClocksSection = class WorldClocksSection {
let time = new St.Label({ style_class: 'world-clocks-time' });
let offset = l.get_timezone().get_offset() / 60.;
let otherOffset = this._getTimeAtLocation(l).get_utc_offset();
let offset = (otherOffset - localOffset) / GLib.TIME_SPAN_HOUR;
let fmt = (Math.trunc(offset) == offset) ? '%s%.0f' : '%s%.1f';
let prefix = (offset >= 0) ? '+' : '-';
let tz = new St.Label({ style_class: 'world-clocks-timezone',
@@ -182,11 +184,15 @@ var WorldClocksSection = class WorldClocksSection {
}
}
_getTimeAtLocation(location) {
let tz = GLib.TimeZone.new(location.get_timezone().get_tzid());
return GLib.DateTime.new_now(tz);
}
_updateLabels() {
for (let i = 0; i < this._locations.length; i++) {
let l = this._locations[i];
let tz = GLib.TimeZone.new(l.location.get_timezone().get_tzid());
let now = GLib.DateTime.new_now(tz);
let now = this._getTimeAtLocation(l.location);
l.actor.text = Util.formatTime(now, { timeOnly: true });
}
}
@@ -379,6 +385,7 @@ class IndicatorPad extends St.Widget {
_init(actor) {
this._source = actor;
this._source.connect('notify::visible', () => { this.queue_relayout(); });
this._source.connect('notify::size', () => { this.queue_relayout(); });
super._init();
}

View File

@@ -125,6 +125,16 @@ var _Draggable = class _Draggable {
}
_onTouchEvent(actor, event) {
// We only handle touch events here on wayland. On X11
// we do get emulated pointer events, which already works
// for single-touch cases. Besides, the X11 passive touch grab
// set up by Mutter will make us see first the touch events
// and later the pointer events, so it will look like two
// unrelated series of events, we want to avoid double handling
// in these cases.
if (!Meta.is_wayland_compositor())
return Clutter.EVENT_PROPAGATE;
if (event.type() != Clutter.EventType.TOUCH_BEGIN ||
!global.display.is_pointer_emulating_sequence(event.get_event_sequence()))
return Clutter.EVENT_PROPAGATE;
@@ -296,6 +306,9 @@ var _Draggable = class _Draggable {
* for the draggable.
*/
startDrag(stageX, stageY, time, sequence, device) {
if (currentDraggable)
return;
if (device == undefined) {
let event = Clutter.get_current_event();
@@ -437,7 +450,8 @@ var _Draggable = class _Draggable {
let [stageX, stageY] = event.get_coords();
// See if the user has moved the mouse enough to trigger a drag
let threshold = St.Settings.get().drag_threshold;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let threshold = St.Settings.get().drag_threshold * scaleFactor;
if (!currentDraggable &&
(Math.abs(stageX - this._dragStartX) > threshold ||
Math.abs(stageY - this._dragStartY) > threshold)) {

View File

@@ -104,6 +104,7 @@ class BaseIcon extends St.Bin {
}
vfunc_style_changed() {
super.vfunc_style_changed();
let node = this.get_theme_node();
let size;

View File

@@ -1,11 +1,16 @@
const { Clutter, Gio, GObject, Gtk, Meta, Shell } = imports.gi;
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell } = imports.gi;
const Dialog = imports.ui.dialog;
const ModalDialog = imports.ui.modalDialog;
const PermissionStore = imports.misc.permissionStore;
const WAYLAND_KEYBINDINGS_SCHEMA = 'org.gnome.mutter.wayland.keybindings';
const APP_WHITELIST = ['gnome-control-center.desktop'];
const APP_PERMISSIONS_TABLE = 'gnome';
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
const GRANTED = 'GRANTED';
const DENIED = 'DENIED';
var DialogResponse = Meta.InhibitShortcutsDialogResponse;
@@ -43,6 +48,29 @@ var InhibitShortcutsDialog = GObject.registerClass({
Gtk.accelerator_parse(accel));
}
_shouldUsePermStore() {
return this._app && !this._app.is_window_backed();
}
_saveToPermissionStore(grant) {
if (!this._shouldUsePermStore() || this._permStore == null)
return;
let permissions = {};
permissions[this._app.get_id()] = [grant];
let data = GLib.Variant.new('av', {});
this._permStore.SetRemote(APP_PERMISSIONS_TABLE,
true,
APP_PERMISSIONS_ID,
permissions,
data,
(result, error) => {
if (error != null)
log(error.message);
});
}
_buildLayout() {
let name = this._app ? this._app.get_name() : this._window.title;
@@ -64,12 +92,14 @@ var InhibitShortcutsDialog = GObject.registerClass({
this._dialog.addButton({ label: _("Deny"),
action: () => {
this._saveToPermissionStore(DENIED);
this._emitResponse(DialogResponse.DENY);
},
key: Clutter.KEY_Escape });
this._dialog.addButton({ label: _("Allow"),
action: () => {
this._saveToPermissionStore(GRANTED);
this._emitResponse(DialogResponse.ALLOW);
},
default: true });
@@ -81,10 +111,43 @@ var InhibitShortcutsDialog = GObject.registerClass({
}
vfunc_show() {
if (this._app && APP_WHITELIST.indexOf(this._app.get_id()) != -1)
if (this._app && APP_WHITELIST.indexOf(this._app.get_id()) != -1) {
this._emitResponse(DialogResponse.ALLOW);
else
return;
}
if (!this._shouldUsePermStore()) {
this._dialog.open();
return;
}
/* Check with the permission store */
let appId = this._app.get_id();
this._permStore = new PermissionStore.PermissionStore((proxy, error) => {
if (error) {
log(error.message);
this._dialog.open();
return;
}
this._permStore.LookupRemote(APP_PERMISSIONS_TABLE,
APP_PERMISSIONS_ID,
(res, error) => {
if (error) {
this._dialog.open();
log(error.message);
return;
}
let [permissions, data] = res;
if (permissions[appId] === undefined) // Not found
this._dialog.open();
else if (permissions[appId] == GRANTED)
this._emitResponse(DialogResponse.ALLOW);
else
this._emitResponse(DialogResponse.DENY);
});
});
}
vfunc_hide() {

View File

@@ -73,12 +73,9 @@ class AspectContainer extends St.Widget {
box.x1 += Math.floor(diff / 2);
box.x2 -= Math.ceil(diff / 2);
} else {
/* Restrict vertically */
/* Restrict vertically, align to bottom */
let height = box.get_width() / this._ratio;
let diff = box.get_height() - height;
box.y1 += Math.floor(diff / 2);
box.y2 -= Math.floor(diff / 2);
box.y1 = box.y2 - Math.floor(height);
}
}
@@ -884,7 +881,7 @@ var EmojiSelection = class EmojiSelection {
this._pageIndicator.setReactive(false);
let bottomRow = this._createBottomRow();
this.actor.add(bottomRow, { x_fill: true, y_fill: false });
this.actor.add(bottomRow, { expand: true, x_fill: false, y_fill: false });
this._emojiPager.setCurrentPage(0);
}
@@ -973,7 +970,16 @@ var EmojiSelection = class EmojiSelection {
row.appendKey(key.actor);
row.layoutButtons();
return row;
let actor = new AspectContainer({ layout_manager: new Clutter.BinLayout(),
x_expand: true, y_expand: true });
actor.add_child(row);
/* Regular keyboard layouts are 11.5×4 grids, optimize for that
* at the moment. Ideally this should be as wide as the current
* keymap.
*/
actor.setRatio(11.5, 1);
return actor;
}
};
Signals.addSignalMethods(EmojiSelection.prototype);

View File

@@ -146,12 +146,13 @@ var MonitorConstraint = GObject.registerClass({
});
var Monitor = class Monitor {
constructor(index, geometry) {
constructor(index, geometry, geometry_scale) {
this.index = index;
this.x = geometry.x;
this.y = geometry.y;
this.width = geometry.width;
this.height = geometry.height;
this.geometry_scale = geometry_scale;
}
get inFullscreen() {
@@ -159,6 +160,19 @@ var Monitor = class Monitor {
}
};
const UiActor = GObject.registerClass(
class UiActor extends St.Widget {
vfunc_get_preferred_width (forHeight) {
let width = global.stage.width;
return [width, width];
}
vfunc_get_preferred_height (forWidth) {
let height = global.stage.height;
return [height, height];
}
});
const defaultParams = {
trackFullscreen: false,
affectsStruts: false,
@@ -199,12 +213,8 @@ var LayoutManager = GObject.registerClass({
global.stage.no_clear_hint = true;
// Set up stage hierarchy to group all UI actors under one container.
this.uiGroup = new St.Widget({ name: 'uiGroup' });
this.uiGroup = new UiActor({ name: 'uiGroup' });
this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
this.uiGroup.add_constraint(new Clutter.BindConstraint({
source: global.stage,
coordinate: Clutter.BindCoordinate.ALL,
}));
global.stage.remove_actor(global.window_group);
this.uiGroup.add_actor(global.window_group);
@@ -242,7 +252,7 @@ var LayoutManager = GObject.registerClass({
// A dummy actor that tracks the mouse or text cursor, based on the
// position and size set in setDummyCursorGeometry.
this.dummyCursor = new St.Widget({ width: 0, height: 0, visible: false });
this.dummyCursor = new St.Widget({ width: 0, height: 0, opacity: 0 });
this.uiGroup.add_actor(this.dummyCursor);
global.stage.remove_actor(global.top_window_group);
@@ -318,7 +328,9 @@ var LayoutManager = GObject.registerClass({
this.monitors = [];
let nMonitors = display.get_n_monitors();
for (let i = 0; i < nMonitors; i++)
this.monitors.push(new Monitor(i, display.get_monitor_geometry(i)));
this.monitors.push(new Monitor(i,
display.get_monitor_geometry(i),
display.get_monitor_scale(i)));
if (nMonitors == 0) {
this.primaryIndex = this.bottomIndex = -1;

View File

@@ -382,6 +382,7 @@ var ObjInspector = class ObjInspector {
}
button = new St.Button({ style_class: 'window-close' });
button.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
button.connect('clicked', this.close.bind(this));
hbox.add(button);
if (typeof(obj) == typeof({})) {

View File

@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Atspi, Clutter, Cogl, GDesktopEnums,
const { Atspi, Clutter, GDesktopEnums,
Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
@@ -18,9 +18,6 @@ var NO_CHANGE = 0.0;
var POINTER_REST_TIME = 1000; // milliseconds
// Settings
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
const SHOW_KEY = 'screen-magnifier-enabled';
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
const SCREEN_POSITION_KEY = 'screen-position';
const MAG_FACTOR_KEY = 'mag-factor';
@@ -56,22 +53,19 @@ var MouseSpriteContent = GObject.registerClass({
vfunc_get_preferred_size() {
if (!this._texture)
return [0, 0];
return [false, 0, 0];
return [this._texture.get_width(), this._texture.get_height()];
return [true, this._texture.get_width(), this._texture.get_height()];
}
vfunc_paint_content(actor, node) {
if (!this._texture)
return;
let color = new Cogl.Color();
color.init_from_4ub(0, 0, 0, 0);
let color = Clutter.Color.get_static(Clutter.StaticColor.WHITE);
let [minFilter, magFilter] = actor.get_content_scaling_filters();
let textureNode = new Clutter.TextureNode(this._texture,
color,
Clutter.ScalingFilter.NEAREST,
Clutter.ScalingFilter.NEAREST);
color, minFilter, magFilter);
textureNode.set_name('MouseSpriteContent');
node.add_child(textureNode);
@@ -86,8 +80,14 @@ var MouseSpriteContent = GObject.registerClass({
if (this._texture == coglTexture)
return;
let oldTexture = this._texture;
this._texture = coglTexture;
this.invalidate();
if (!oldTexture || !coglTexture ||
oldTexture.get_width() != coglTexture.get_width() ||
oldTexture.get_height() != coglTexture.get_height())
this.invalidate_size();
}
});
@@ -102,7 +102,6 @@ var Magnifier = class Magnifier {
this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
this._mouseSprite.content = new MouseSpriteContent();
this._updateSpriteTexture();
this._cursorRoot = new Clutter.Actor();
this._cursorRoot.add_actor(this._mouseSprite);
@@ -115,14 +114,16 @@ var Magnifier = class Magnifier {
let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
this._zoomRegions.push(aZoomRegion);
let showAtLaunch = this._settingsInit(aZoomRegion);
this._settingsInit(aZoomRegion);
aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
cursorTracker.connect('cursor-changed', this._updateMouseSprite.bind(this));
St.Settings.get().connect('notify::magnifier-active', () => {
this.setActive(St.Settings.get().magnifier_active);
});
// Export to dbus.
magDBusService = new MagnifierDBus.ShellMagnifier();
this.setActive(showAtLaunch);
this.setActive(St.Settings.get().magnifier_active);
}
/**
@@ -155,9 +156,15 @@ var Magnifier = class Magnifier {
if (isActive != activate) {
if (activate) {
this._updateMouseSprite();
this._cursorSpriteChangedId =
this._cursorTracker.connect('cursor-changed',
this._updateMouseSprite.bind(this));
Meta.disable_unredirect_for_display(global.display);
this.startTrackingMouse();
} else {
this._cursorTracker.disconnect(this._cursorSpriteChangedId);
this._mouseSprite.content.texture = null;
Meta.enable_unredirect_for_display(global.display);
this.stopTrackingMouse();
}
@@ -495,13 +502,8 @@ var Magnifier = class Magnifier {
}
_settingsInit(zoomRegion) {
this._appSettings = new Gio.Settings({ schema_id: APPLICATIONS_SCHEMA });
this._settings = new Gio.Settings({ schema_id: MAGNIFIER_SCHEMA });
this._appSettings.connect('changed::' + SHOW_KEY, () => {
this.setActive(this._appSettings.get_boolean(SHOW_KEY));
});
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
this._updateScreenPosition.bind(this));
this._settings.connect('changed::' + MAG_FACTOR_KEY,
@@ -608,8 +610,6 @@ var Magnifier = class Magnifier {
let showCrosshairs = this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY);
this.addCrosshairs();
this.setCrosshairsVisible(showCrosshairs);
return this._appSettings.get_boolean(SHOW_KEY);
}
_updateScreenPosition() {
@@ -756,13 +756,41 @@ var ZoomRegion = class ZoomRegion {
this._pointerIdleMonitor = Meta.IdleMonitor.get_for_device(Meta.VIRTUAL_CORE_POINTER_ID);
this._scrollContentsTimerId = 0;
}
Main.layoutManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._focusCaretTracker.connect('caret-moved',
this._updateCaret.bind(this));
this._focusCaretTracker.connect('focus-changed',
this._updateFocus.bind(this));
_connectSignals() {
if (this._signalConnections)
return;
this._signalConnections = [];
let id = Main.layoutManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._signalConnections.push([Main.layoutManager, id]);
id = this._focusCaretTracker.connect('caret-moved', this._updateCaret.bind(this));
this._signalConnections.push([this._focusCaretTracker, id]);
id = this._focusCaretTracker.connect('focus-changed', this._updateFocus.bind(this));
this._signalConnections.push([this._focusCaretTracker, id]);
}
_disconnectSignals() {
for (let [obj, id] of this._signalConnections)
obj.disconnect(id);
delete this._signalConnections;
}
_updateScreenPosition() {
if (this._screenPosition == GDesktopEnums.MagnifierScreenPosition.NONE)
this._setViewPort({
x: this._viewPortX,
y: this._viewPortY,
width: this._viewPortWidth,
height: this._viewPortHeight
});
else
this.setScreenPosition(this._screenPosition);
}
_updateFocus(caller, event) {
@@ -810,10 +838,13 @@ var ZoomRegion = class ZoomRegion {
this._createActors();
if (this._isMouseOverRegion())
this._magnifier.hideSystemCursor();
this._updateScreenPosition();
this._updateMagViewGeometry();
this._updateCloneGeometry();
this._updateMousePosition();
this._connectSignals();
} else {
this._disconnectSignals();
this._destroyActors();
}
@@ -1563,18 +1594,8 @@ var ZoomRegion = class ZoomRegion {
}
_monitorsChanged() {
if (!this.isActive())
return;
this._background.set_size(global.screen_width, global.screen_height);
if (this._screenPosition == GDesktopEnums.MagnifierScreenPosition.NONE)
this._setViewPort({ x: this._viewPortX,
y: this._viewPortY,
width: this._viewPortWidth,
height: this._viewPortHeight });
else
this.setScreenPosition(this._screenPosition);
this._updateScreenPosition();
}
};

View File

@@ -211,13 +211,6 @@ function _initializeUI() {
_startDate = new Date();
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
if (perfModuleName) {
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
let module = eval('imports.perf.' + perfModuleName + ';');
Scripting.runPerfScript(module, perfOutput);
}
ExtensionDownloader.init();
ExtensionSystem.init();
@@ -239,6 +232,13 @@ function _initializeUI() {
Shell.Global.log_structured('GNOME Shell started at ' + _startDate,
['MESSAGE_ID=' + GNOMESHELL_STARTED_MESSAGE_ID]);
}
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
if (perfModuleName) {
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
let module = eval('imports.perf.' + perfModuleName + ';');
Scripting.runPerfScript(module, perfOutput);
}
});
}

View File

@@ -708,6 +708,12 @@ var Source = class Source {
return this._policy;
}
set policy(policy) {
if (this._policy)
this._policy.destroy();
this._policy = policy;
}
get count() {
return this.notifications.length;
}

View File

@@ -95,28 +95,6 @@ var OsdMonitorLabeler = class {
this._reset();
for (let id in params) {
let monitor = this._monitorManager.get_monitor_for_output(id);
if (monitor == -1)
continue;
this._monitorLabels.get(monitor).push(params[id].deep_unpack());
}
// In mirrored display setups, more than one physical outputs
// might be showing the same logical monitor. In that case, we
// join each output's labels on the same OSD widget.
for (let [monitor, labels] of this._monitorLabels.entries()) {
labels.sort();
this._osdLabels.push(new OsdMonitorLabel(monitor, labels.join(' ')));
}
}
show2(client, params) {
if (!this._trackClient(client))
return;
this._reset();
for (let connector in params) {
let monitor = this._monitorManager.get_monitor_for_connector(connector);
if (monitor == -1)

View File

@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Atk, Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
const { Atk, Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Cairo = imports.cairo;
const Mainloop = imports.mainloop;
@@ -110,9 +110,14 @@ class AppMenu extends PopupMenu.PopupMenu {
});
this._appSystem.connect('installed-changed', () => {
let sw = this._appSystem.lookup_app('org.gnome.Software.desktop');
this._detailsItem.actor.visible = (sw != null);
this._updateDetailsVisibility();
});
this._updateDetailsVisibility();
}
_updateDetailsVisibility() {
let sw = this._appSystem.lookup_app('org.gnome.Software.desktop');
this._detailsItem.actor.visible = (sw != null);
}
isEmpty() {
@@ -196,7 +201,6 @@ var AppMenuButton = GObject.registerClass({
this._startingApps = [];
this._menuManager = panel.menuManager;
this._gtkSettings = Gtk.Settings.get_default();
this._targetApp = null;
this._busyNotifyId = 0;
@@ -729,7 +733,7 @@ class AggregateLayout extends Clutter.BoxLayout {
let child = this._sizeChildren[i];
let [childMin, childNat] = child.get_preferred_width(forHeight);
minWidth = Math.max(minWidth, childMin);
natWidth = Math.max(minWidth, childNat);
natWidth = Math.max(natWidth, childNat);
}
return [minWidth, natWidth];
}
@@ -804,6 +808,7 @@ class AggregateMenu extends PanelMenu.Button {
menuLayout.addSizeChild(this._location.menu.actor);
menuLayout.addSizeChild(this._rfkill.menu.actor);
menuLayout.addSizeChild(this._power.menu.actor);
menuLayout.addSizeChild(this._system.buttonGroup);
}
});

View File

@@ -810,16 +810,8 @@ var ScreenShield = class {
this._maybeCancelDialog();
if (this._longLightbox.actor.visible ||
this._isActive) {
// We're either shown and active, or in the process of
// showing.
// The latter is a very unlikely condition (it requires
// idle-delay < 20), but in any case we have nothing
// to do at this point: either isActive is true, or
// it will soon be.
// isActive can also be true if the lightbox is hidden,
// in case the shield is down and the user hasn't unlocked yet
if (this._longLightbox.actor.visible) {
// We're in the process of showing.
return;
}

View File

@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Clutter, Gio, GLib, Gtk, Meta, Shell, St } = imports.gi;
const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const GrabHelper = imports.ui.grabHelper;
@@ -227,8 +227,6 @@ var SelectArea = class {
this._lastY = 0;
this._result = null;
this._initRubberbandColors();
this._group = new St.Widget({ visible: false,
reactive: true,
x: 0,
@@ -248,10 +246,10 @@ var SelectArea = class {
coordinate: Clutter.BindCoordinate.ALL });
this._group.add_constraint(constraint);
this._rubberband = new Clutter.Rectangle({ color: this._background,
has_border: true,
border_width: 1,
border_color: this._border });
this._rubberband = new St.Widget({
style_class: 'select-area-rubberband',
visible: false
});
this._group.add_actor(this._rubberband);
}
@@ -265,25 +263,6 @@ var SelectArea = class {
this._group.visible = true;
}
_initRubberbandColors() {
function colorFromRGBA(rgba) {
return new Clutter.Color({ red: rgba.red * 255,
green: rgba.green * 255,
blue: rgba.blue * 255,
alpha: rgba.alpha * 255 });
}
let path = new Gtk.WidgetPath();
path.append_type(Gtk.IconView);
let context = new Gtk.StyleContext();
context.set_path(path);
context.add_class('rubberband');
this._background = colorFromRGBA(context.get_background_color(Gtk.StateFlags.NORMAL));
this._border = colorFromRGBA(context.get_border_color(Gtk.StateFlags.NORMAL));
}
_getGeometry() {
return { x: Math.min(this._startX, this._lastX),
y: Math.min(this._startY, this._lastY),
@@ -302,6 +281,7 @@ var SelectArea = class {
this._rubberband.set_position(geometry.x, geometry.y);
this._rubberband.set_size(geometry.width, geometry.height);
this._rubberband.show();
return Clutter.EVENT_PROPAGATE;
}

View File

@@ -37,16 +37,13 @@ const { loadInterfaceXML } = imports.misc.fileUtils;
* 'yield Scripting.sleep(500);'
*/
function sleep(milliseconds) {
let cb;
let id = Mainloop.timeout_add(milliseconds, () => {
if (cb)
cb();
return GLib.SOURCE_REMOVE;
return new Promise(resolve => {
let id = Mainloop.timeout_add(milliseconds, () => {
resolve();
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] sleep');
});
GLib.Source.set_name_by_id(id, '[gnome-shell] sleep');
return callback => { cb = callback; };
}
/**
@@ -57,14 +54,9 @@ function sleep(milliseconds) {
* 'yield Scripting.waitLeisure();'
*/
function waitLeisure() {
let cb;
global.run_at_leisure(() => {
if (cb)
cb();
return new Promise(resolve => {
global.run_at_leisure(resolve);
});
return callback => { cb = callback; };
}
const PerfHelperIface = loadInterfaceXML('org.gnome.Shell.PerfHelper');
@@ -82,25 +74,16 @@ function _getPerfHelper() {
}
function _callRemote(obj, method, ...args) {
let cb;
let errcb;
return new Promise((resolve, reject) => {
args.push((result, excp) => {
if (excp)
reject(excp);
else
resolve();
});
args.push((result, excp) => {
if (excp) {
if (errcb)
errcb(excp);
} else {
if (cb)
cb();
}
method.apply(obj, args);
});
method.apply(obj, args);
return (callback, error_callback) => {
cb = callback;
errcb = error_callback;
};
}
/**
@@ -192,27 +175,6 @@ function collectStatistics() {
Shell.PerfLog.get_default().collect_statistics();
}
function _step(g, finish, onError) {
try {
let waitFunction = g.next();
waitFunction(() => {
_step(g, finish, onError);
},
err => {
if (onError)
onError(err);
});
} catch (err) {
if (err instanceof StopIteration) {
if (finish)
finish();
} else {
if (onError)
onError(err);
}
}
}
function _collect(scriptModule, outputFile) {
let eventHandlers = {};
@@ -348,23 +310,23 @@ function _collect(scriptModule, outputFile) {
* After running the script and collecting statistics from the
* event log, GNOME Shell will exit.
**/
function runPerfScript(scriptModule, outputFile) {
async function runPerfScript(scriptModule, outputFile) {
Shell.PerfLog.get_default().set_enabled(true);
let g = scriptModule.run();
for (let step of scriptModule.run()) {
try {
await step;
} catch (err) {
log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR);
}
}
_step(g,
() => {
try {
_collect(scriptModule, outputFile);
} catch (err) {
log("Script failed: " + err + "\n" + err.stack);
Meta.exit(Meta.ExitCode.ERROR);
}
Meta.exit(Meta.ExitCode.SUCCESS);
},
err => {
log("Script failed: " + err + "\n" + err.stack);
Meta.exit(Meta.ExitCode.ERROR);
});
try {
_collect(scriptModule, outputFile);
} catch (err) {
log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR);
}
Meta.exit(Meta.ExitCode.SUCCESS);
}

View File

@@ -79,14 +79,17 @@ var GnomeShell = class {
for (let param in params)
params[param] = params[param].deep_unpack();
let { monitor: monitorIndex,
let { connector,
label,
level,
max_level: maxLevel,
icon: serializedIcon } = params;
if (monitorIndex === undefined)
monitorIndex = -1;
let monitorIndex = -1;
if (connector) {
let monitorManager = Meta.MonitorManager.get();
monitorIndex = monitorManager.get_monitor_for_connector(connector);
}
let icon = null;
if (serializedIcon)
@@ -124,13 +127,20 @@ var GnomeShell = class {
UngrabAcceleratorAsync(params, invocation) {
let [action] = params;
let grabbedBy = this._grabbedAccelerators.get(action);
if (invocation.get_sender() != grabbedBy)
return invocation.return_value(GLib.Variant.new('(b)', [false]));
let sender = invocation.get_sender();
let ungrabSucceeded = this._ungrabAcceleratorForSender(action, sender);
return invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded]));
}
UngrabAcceleratorsAsync(params, invocation) {
let [actions] = params;
let sender = invocation.get_sender();
let ungrabSucceeded = true;
for (let i = 0; i < actions.length; i++)
ungrabSucceeded &= this._ungrabAcceleratorForSender(actions[i], sender);
let ungrabSucceeded = global.display.ungrab_accelerator(action);
if (ungrabSucceeded)
this._grabbedAccelerators.delete(action);
return invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded]));
}
@@ -174,6 +184,16 @@ var GnomeShell = class {
let ungrabSucceeded = global.display.ungrab_accelerator(action);
if (ungrabSucceeded)
this._grabbedAccelerators.delete(action);
return ungrabSucceeded;
}
_ungrabAcceleratorForSender(action, sender) {
let grabbedBy = this._grabbedAccelerators.get(action);
if (sender != grabbedBy)
return false;
return this._ungrabAccelerator(action);
}
_onGrabberBusNameVanished(connection, name) {
@@ -186,16 +206,10 @@ var GnomeShell = class {
this._grabbers.delete(name);
}
ShowMonitorLabelsAsync(params, invocation) {
let sender = invocation.get_sender();
let [dict] = params;
Main.osdMonitorLabeler.show(sender, dict);
}
ShowMonitorLabels2Async(params, invocation) {
let sender = invocation.get_sender();
let [dict] = params;
Main.osdMonitorLabeler.show2(sender, dict);
Main.osdMonitorLabeler.show(sender, dict);
}
HideMonitorLabelsAsync(params, invocation) {

View File

@@ -1236,7 +1236,6 @@ var NMDeviceWireless = class {
}
_dialogClosed() {
this._dialog.destroy();
this._dialog = null;
}
@@ -1674,7 +1673,11 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
_readDevices() {
let devices = this._client.get_devices() || [ ];
for (let i = 0; i < devices.length; ++i) {
this._deviceAdded(this._client, devices[i], true);
try {
this._deviceAdded(this._client, devices[i], true);
} catch (e) {
log(`Failed to add device ${devices[i]}: ${e}`);
}
}
this._syncDeviceNames();
}

View File

@@ -236,6 +236,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
item = new PopupMenu.PopupBaseMenuItem({ reactive: false,
can_focus: false });
this.buttonGroup = item.actor;
let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
'gnome-control-center.desktop'

View File

@@ -18,7 +18,7 @@ var Avatar = class {
this._user = user;
params = Params.parse(params, { reactive: false,
iconSize: AVATAR_ICON_SIZE,
styleClass: 'framed-user-icon' });
styleClass: 'user-icon' });
this._iconSize = params.iconSize;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
@@ -46,15 +46,14 @@ var Avatar = class {
if (iconFile) {
let file = Gio.File.new_for_path(iconFile);
this.actor.child = null;
this.actor.style = 'background-image: url("%s");'.format(iconFile);
this.actor.style = `
background-image: url("${iconFile}");
background-size: ${this._iconSize}px`;
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default-symbolic',
icon_size: this._iconSize });
}
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this.actor.set_size(this._iconSize * scaleFactor, this._iconSize * scaleFactor);
}
};

View File

@@ -101,6 +101,5 @@ var Source = class WindowAttentionSource extends MessageTray.Source {
open() {
Main.activateWindow(this._window);
this.destroy();
}
};

View File

@@ -456,13 +456,28 @@ var TilePreview = class {
};
var TouchpadWorkspaceSwitchAction = class {
constructor(actor) {
constructor(actor, allowedModes) {
this._allowedModes = allowedModes;
this._dx = 0;
this._dy = 0;
this._enabled = true;
actor.connect('captured-event', this._handleEvent.bind(this));
this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
}
get enabled() {
return this._enabled;
}
set enabled(enabled) {
if (this._enabled == enabled)
return;
this._enabled = enabled;
if (!enabled)
this.emit('cancel');
}
_checkActivated() {
let dir;
@@ -482,15 +497,16 @@ var TouchpadWorkspaceSwitchAction = class {
}
_handleEvent(actor, event) {
let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
if (event.type() != Clutter.EventType.TOUCHPAD_SWIPE)
return Clutter.EVENT_PROPAGATE;
if (event.get_touchpad_gesture_finger_count() != 4)
return Clutter.EVENT_PROPAGATE;
if ((allowedModes & Main.actionMode) == 0)
if ((this._allowedModes & Main.actionMode) == 0)
return Clutter.EVENT_PROPAGATE;
if (!this._enabled)
return Clutter.EVENT_PROPAGATE;
if (event.get_gesture_phase() == Clutter.TouchpadGesturePhase.UPDATE) {
@@ -523,10 +539,11 @@ var WorkspaceSwitchAction = GObject.registerClass({
'motion': { param_types: [GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
'cancel': { param_types: [] }},
}, class WorkspaceSwitchAction extends Clutter.SwipeAction {
_init() {
_init(allowedModes) {
super._init();
this.set_n_touch_points(4);
this._swept = false;
this._allowedModes = allowedModes;
global.display.connect('grab-op-begin', () => {
this.cancel();
@@ -534,14 +551,12 @@ var WorkspaceSwitchAction = GObject.registerClass({
}
vfunc_gesture_prepare(actor) {
let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
this._swept = false;
if (!super.vfunc_gesture_prepare(actor))
return false;
return (allowedModes & Main.actionMode);
return (this._allowedModes & Main.actionMode);
}
vfunc_gesture_progress(actor) {
@@ -1043,14 +1058,15 @@ var WindowManager = class {
global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT,
false, -1, 1);
let gesture = new WorkspaceSwitchAction();
let allowedModes = Shell.ActionMode.NORMAL;
let gesture = new WorkspaceSwitchAction(allowedModes);
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
global.stage.add_action(gesture);
// This is not a normal Clutter.GestureAction, doesn't need add_action()
gesture = new TouchpadWorkspaceSwitchAction(global.stage);
gesture = new TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
@@ -1202,6 +1218,10 @@ var WindowManager = class {
// Same for OR windows
if (window.is_override_redirect())
return;
// Sticky windows don't need moving, in fact moving would
// unstick them
if (window.on_all_workspaces)
return;
// Windows on workspaces below pos don't need moving
let index = window.get_workspace().index();
if (index < pos)

View File

@@ -1,10 +1,11 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Clutter, Gio, GObject, Meta, St } = imports.gi;
const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
const WindowManager = imports.ui.windowManager;
const Workspace = imports.ui.workspace;
var WORKSPACE_SWITCH_TIME = 0.25;
@@ -82,6 +83,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
this._animating = false; // tweening
this._scrolling = false; // swipe-scrolling
this._gestureActive = false; // touch(pad) gestures
this._animatingScroll = false; // programatically updating the adjustment
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
@@ -211,7 +213,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
for (let w = 0; w < this._workspaces.length; w++) {
let workspace = this._workspaces[w];
if (this._animating || this._scrolling) {
if (this._animating || this._scrolling || this._gestureActive) {
workspace.actor.show();
} else {
if (this._inDrag)
@@ -223,7 +225,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
}
_updateScrollAdjustment(index) {
if (this._scrolling)
if (this._scrolling || this._gestureActive)
return;
this._animatingScroll = true;
@@ -300,6 +302,18 @@ var WorkspacesView = class extends WorkspacesViewBase {
this._updateVisibility();
}
startTouchGesture() {
this._gestureActive = true;
}
endTouchGesture() {
this._gestureActive = false;
// Make sure title captions etc are shown as necessary
this._scrollToActive();
this._updateVisibility();
}
// sync the workspaces' positions to the value of the scroll adjustment
// and change the active workspace if appropriate
_onScroll(adj) {
@@ -310,7 +324,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
let active = workspaceManager.get_active_workspace_index();
let current = Math.round(adj.value);
if (active != current) {
if (active != current && !this._gestureActive) {
if (!this._workspaces[current]) {
// The current workspace was destroyed. This could happen
// when you are on the last empty workspace, and consolidate
@@ -391,6 +405,12 @@ var ExtraWorkspaceView = class extends WorkspacesViewBase {
endSwipeScroll() {
}
startTouchGesture() {
}
endTouchGesture() {
}
};
var DelegateFocusNavigator = GObject.registerClass(
@@ -430,23 +450,37 @@ var WorkspacesDisplay = class {
return false;
}
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].startSwipeScroll();
this._startSwipeScroll();
return true;
});
panAction.connect('gesture-cancel', () => {
clickAction.release();
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].endSwipeScroll();
this._endSwipeScroll();
});
panAction.connect('gesture-end', () => {
clickAction.release();
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].endSwipeScroll();
this._endSwipeScroll();
});
Main.overview.addAction(panAction);
this.actor.bind_property('mapped', panAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
let allowedModes = Shell.ActionMode.OVERVIEW;
let switchGesture = new WindowManager.WorkspaceSwitchAction(allowedModes);
switchGesture.connect('motion', this._onSwitchWorkspaceMotion.bind(this));
switchGesture.connect('activated', this._onSwitchWorkspaceActivated.bind(this));
switchGesture.connect('cancel', this._endTouchGesture.bind(this));
Main.overview.addAction(switchGesture);
this.actor.bind_property('mapped', switchGesture, 'enabled', GObject.BindingFlags.SYNC_CREATE);
switchGesture = new WindowManager.TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
switchGesture.connect('motion', this._onSwitchWorkspaceMotion.bind(this));
switchGesture.connect('activated', this._onSwitchWorkspaceActivated.bind(this));
switchGesture.connect('cancel', this._endTouchGesture.bind(this));
this.actor.connect('notify::mapped', () => {
switchGesture.enabled = this.actor.mapped;
});
switchGesture.enabled = this.actor.mapped;
this._primaryIndex = Main.layoutManager.primaryIndex;
this._workspacesViews = [];
@@ -474,6 +508,47 @@ var WorkspacesDisplay = class {
return false;
}
_startSwipeScroll() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].startSwipeScroll();
}
_endSwipeScroll() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].endSwipeScroll();
}
_startTouchGesture() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].startTouchGesture();
}
_endTouchGesture() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].endTouchGesture();
}
_onSwitchWorkspaceMotion(action, xRel, yRel) {
// We don't have a way to hook into start of touchpad actions,
// luckily this is safe to call repeatedly.
this._startTouchGesture();
let workspaceManager = global.workspace_manager;
let active = workspaceManager.get_active_workspace_index();
let adjustment = this._scrollAdjustment;
adjustment.value = (active - yRel / this.actor.height) * adjustment.page_size;
}
_onSwitchWorkspaceActivated(action, direction) {
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let newWs = activeWorkspace.get_neighbor(direction);
if (newWs != activeWorkspace)
newWs.activate(global.get_current_time());
this._endTouchGesture();
}
navigateFocus(from, direction) {
return this._getPrimaryView().actor.navigate_focus(from, direction, false);
}

View File

@@ -1,5 +1,5 @@
project('gnome-shell', 'c',
version: '3.31.91',
version: '3.32.0',
meson_version: '>= 0.47.0',
license: 'GPLv2+'
)
@@ -20,10 +20,10 @@ gcr_req = '>= 3.7.5'
gdesktop_req = '>= 3.7.90'
gio_req = '>= 2.56.0'
gi_req = '>= 1.49.1'
gjs_req = '>= 1.47.0'
gjs_req = '>= 1.54.0'
gtk_req = '>= 3.15.0'
json_glib_req = '>= 0.13.2'
mutter_req = '>= 3.31.91'
mutter_req = '>= 3.32.0'
polkit_req = '>= 0.100'
schemas_req = '>= 3.27.90'
startup_req = '>= 0.11'

View File

@@ -330,7 +330,7 @@ msgstr "Netwerkaanmelding"
#. Translators: Do NOT translate or transliterate this text (this is an icon file name)!
#: data/org.gnome.Shell.PortalHelper.desktop.in.in:9
msgid "network-workgroup"
msgstr "netwerk-werkgroep"
msgstr "network-workgroup"
#: js/extensionPrefs/main.js:120
#, javascript-format

1038
po/ar.po

File diff suppressed because it is too large Load Diff

794
po/da.po

File diff suppressed because it is too large Load Diff

1026
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

950
po/eo.po

File diff suppressed because it is too large Load Diff

780
po/es.po

File diff suppressed because it is too large Load Diff

1067
po/et.po

File diff suppressed because it is too large Load Diff

2110
po/eu.po

File diff suppressed because it is too large Load Diff

1001
po/fr.po

File diff suppressed because it is too large Load Diff

1520
po/hr.po

File diff suppressed because it is too large Load Diff

765
po/hu.po

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
"POT-Creation-Date: 2019-02-11 18:01+0000\n"
"POT-Creation-Date: 2019-02-21 18:43+0000\n"
"PO-Revision-Date: 2019-02-14 22:18+0700\n"
"Last-Translator: Kukuh Syafaat <kukuhsyafaat@gnome.org>\n"
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
@@ -480,7 +480,7 @@ msgstr "Jendela Log Masuk"
#: js/gdm/util.js:337
msgid "Authentication error"
msgstr "Galat otentikasi"
msgstr "Galat autentikasi"
#. We don't show fingerprint messages directly since it's
#. not the main auth service. Instead we use the messages
@@ -748,12 +748,12 @@ msgstr "Tambah ke Favorit"
msgid "Show Details"
msgstr "Tampilkan Rincian"
#: js/ui/appFavorites.js:139
#: js/ui/appFavorites.js:141
#, javascript-format
msgid "%s has been added to your favorites."
msgstr "%s telah ditambahkan ke favorit Anda."
#: js/ui/appFavorites.js:173
#: js/ui/appFavorites.js:175
#, javascript-format
msgid "%s has been removed from your favorites."
msgstr "%s telah dihapus dari favorit Anda."
@@ -791,7 +791,7 @@ msgid "Settings"
msgstr "Pengaturan"
#. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday).
#: js/ui/calendar.js:38
#: js/ui/calendar.js:40
msgctxt "calendar-no-work"
msgid "06"
msgstr "06"
@@ -801,43 +801,43 @@ msgstr "06"
#. * NOTE: These grid abbreviations are always shown together
#. * and in order, e.g. "S M T W T F S".
#.
#: js/ui/calendar.js:67
#: js/ui/calendar.js:69
msgctxt "grid sunday"
msgid "S"
msgstr "M"
#. Translators: Calendar grid abbreviation for Monday
#: js/ui/calendar.js:69
#: js/ui/calendar.js:71
msgctxt "grid monday"
msgid "M"
msgstr "S"
#. Translators: Calendar grid abbreviation for Tuesday
#: js/ui/calendar.js:71
#: js/ui/calendar.js:73
msgctxt "grid tuesday"
msgid "T"
msgstr "S"
#. Translators: Calendar grid abbreviation for Wednesday
#: js/ui/calendar.js:73
#: js/ui/calendar.js:75
msgctxt "grid wednesday"
msgid "W"
msgstr "R"
#. Translators: Calendar grid abbreviation for Thursday
#: js/ui/calendar.js:75
#: js/ui/calendar.js:77
msgctxt "grid thursday"
msgid "T"
msgstr "K"
#. Translators: Calendar grid abbreviation for Friday
#: js/ui/calendar.js:77
#: js/ui/calendar.js:79
msgctxt "grid friday"
msgid "F"
msgstr "J"
#. Translators: Calendar grid abbreviation for Saturday
#: js/ui/calendar.js:79
#: js/ui/calendar.js:81
msgctxt "grid saturday"
msgid "S"
msgstr "S"
@@ -848,7 +848,7 @@ msgstr "S"
#. * "%OB" is the new format specifier introduced in glibc 2.27,
#. * in most cases you should not change it.
#.
#: js/ui/calendar.js:342
#: js/ui/calendar.js:332
msgid "%OB"
msgstr "%OB"
@@ -861,55 +861,55 @@ msgstr "%OB"
#. * in most cases you should not use the old "%B" here unless you
#. * absolutely know what you are doing.
#.
#: js/ui/calendar.js:352
#: js/ui/calendar.js:342
msgid "%OB %Y"
msgstr "%OB %Y"
#: js/ui/calendar.js:409
#: js/ui/calendar.js:399
msgid "Previous month"
msgstr "Bulan sebelumnya"
#: js/ui/calendar.js:420
#: js/ui/calendar.js:410
msgid "Next month"
msgstr "Bulan selanjutnya"
#: js/ui/calendar.js:574
#: js/ui/calendar.js:564
#, no-javascript-format
msgctxt "date day number format"
msgid "%d"
msgstr "%d"
#: js/ui/calendar.js:629
#: js/ui/calendar.js:619
msgid "Week %V"
msgstr "Minggu %V"
#. Translators: Shown in calendar event list for all day events
#. * Keep it short, best if you can use less then 10 characters
#.
#: js/ui/calendar.js:697
#: js/ui/calendar.js:687
msgctxt "event list time"
msgid "All Day"
msgstr "Sepanjang Hari"
#: js/ui/calendar.js:829
#: js/ui/calendar.js:819
msgctxt "calendar heading"
msgid "%A, %B %-d"
msgstr "%A, %d %B"
#: js/ui/calendar.js:833
#: js/ui/calendar.js:823
msgctxt "calendar heading"
msgid "%A, %B %-d, %Y"
msgstr "%A, %d %B %Y"
#: js/ui/calendar.js:1056
#: js/ui/calendar.js:1046
msgid "No Notifications"
msgstr "Tak Ada Pemberitahuan"
#: js/ui/calendar.js:1059
#: js/ui/calendar.js:1049
msgid "No Events"
msgstr "Tak Ada Kejadian"
#: js/ui/calendar.js:1085
#: js/ui/calendar.js:1075
msgid "Clear"
msgstr "Bersihkan"
@@ -1045,7 +1045,7 @@ msgstr "Manajer Jaringan"
#: js/ui/components/polkitAgent.js:34
msgid "Authentication Required"
msgstr "Diperlukan Otentikasi"
msgstr "Diperlukan Autentikasi"
#: js/ui/components/polkitAgent.js:62
msgid "Administrator"
@@ -2266,7 +2266,7 @@ msgstr "Sandi tidak boleh kosong"
#: src/shell-polkit-authentication-agent.c:348
msgid "Authentication dialog was dismissed by the user"
msgstr "Dialog otentikasi ditolak oleh pengguna"
msgstr "Dialog autentikasi ditolak oleh pengguna"
#. translators:
#. * The number of sound outputs on a particular device

1506
po/it.po

File diff suppressed because it is too large Load Diff

757
po/ja.po

File diff suppressed because it is too large Load Diff

992
po/ko.po

File diff suppressed because it is too large Load Diff

905
po/lt.po

File diff suppressed because it is too large Load Diff

1554
po/lv.po

File diff suppressed because it is too large Load Diff

1515
po/nl.po

File diff suppressed because it is too large Load Diff

1039
po/ro.po

File diff suppressed because it is too large Load Diff

981
po/ru.po

File diff suppressed because it is too large Load Diff

1029
po/sk.po

File diff suppressed because it is too large Load Diff

986
po/sr.po

File diff suppressed because it is too large Load Diff

1909
po/tg.po

File diff suppressed because it is too large Load Diff

1495
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,16 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* GnomeShellPlugin is the entry point for for GNOME Shell into and out of
* Mutter. By registering itself into Mutter using
* meta_plugin_manager_set_plugin_type(), Mutter will call the vfuncs of the
* plugin at the appropriate time.
*
* The funcions in in GnomeShellPlugin are all just stubs, which just call the
* similar methods in GnomeShellWm.
*/
#include "config.h"
#include <stdlib.h>
@@ -37,72 +47,10 @@
#include "shell-perf-log.h"
#include "shell-wm-private.h"
static void gnome_shell_plugin_start (MetaPlugin *plugin);
static void gnome_shell_plugin_minimize (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_unminimize (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_size_changed (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_size_change (MetaPlugin *plugin,
MetaWindowActor *actor,
MetaSizeChange which_change,
MetaRectangle *old_frame_rect,
MetaRectangle *old_buffer_rect);
static void gnome_shell_plugin_map (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_destroy (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_switch_workspace (MetaPlugin *plugin,
gint from,
gint to,
MetaMotionDirection direction);
static void gnome_shell_plugin_kill_window_effects (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_kill_switch_workspace (MetaPlugin *plugin);
static void gnome_shell_plugin_show_tile_preview (MetaPlugin *plugin,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor);
static void gnome_shell_plugin_hide_tile_preview (MetaPlugin *plugin);
static void gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
MetaWindow *window,
MetaWindowMenuType menu,
int x,
int y);
static void gnome_shell_plugin_show_window_menu_for_rect (MetaPlugin *plugin,
MetaWindow *window,
MetaWindowMenuType menu,
MetaRectangle *rect);
static gboolean gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
XEvent *event);
static gboolean gnome_shell_plugin_keybinding_filter (MetaPlugin *plugin,
MetaKeyBinding *binding);
static void gnome_shell_plugin_confirm_display_change (MetaPlugin *plugin);
static const MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin);
static MetaCloseDialog * gnome_shell_plugin_create_close_dialog (MetaPlugin *plugin,
MetaWindow *window);
static MetaInhibitShortcutsDialog * gnome_shell_plugin_create_inhibit_shortcuts_dialog (MetaPlugin *plugin,
MetaWindow *window);
#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ())
#define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin))
#define GNOME_SHELL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPluginClass))
#define GNOME_IS_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_SHELL_PLUGIN_TYPE))
#define GNOME_IS_SHELL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_SHELL_PLUGIN))
#define GNOME_SHELL_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPluginClass))
typedef struct _GnomeShellPlugin GnomeShellPlugin;
typedef struct _GnomeShellPluginClass GnomeShellPluginClass;
#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ())
G_DECLARE_FINAL_TYPE (GnomeShellPlugin, gnome_shell_plugin,
GNOME, SHELL_PLUGIN,
MetaPlugin)
struct _GnomeShellPlugin
{
@@ -116,54 +64,8 @@ struct _GnomeShellPlugin
ShellGlobal *global;
};
struct _GnomeShellPluginClass
{
MetaPluginClass parent_class;
};
GType gnome_shell_plugin_get_type (void);
G_DEFINE_TYPE (GnomeShellPlugin, gnome_shell_plugin, META_TYPE_PLUGIN)
static void
gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
{
MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass);
plugin_class->start = gnome_shell_plugin_start;
plugin_class->map = gnome_shell_plugin_map;
plugin_class->minimize = gnome_shell_plugin_minimize;
plugin_class->unminimize = gnome_shell_plugin_unminimize;
plugin_class->size_changed = gnome_shell_plugin_size_changed;
plugin_class->size_change = gnome_shell_plugin_size_change;
plugin_class->destroy = gnome_shell_plugin_destroy;
plugin_class->switch_workspace = gnome_shell_plugin_switch_workspace;
plugin_class->kill_window_effects = gnome_shell_plugin_kill_window_effects;
plugin_class->kill_switch_workspace = gnome_shell_plugin_kill_switch_workspace;
plugin_class->show_tile_preview = gnome_shell_plugin_show_tile_preview;
plugin_class->hide_tile_preview = gnome_shell_plugin_hide_tile_preview;
plugin_class->show_window_menu = gnome_shell_plugin_show_window_menu;
plugin_class->show_window_menu_for_rect = gnome_shell_plugin_show_window_menu_for_rect;
plugin_class->xevent_filter = gnome_shell_plugin_xevent_filter;
plugin_class->keybinding_filter = gnome_shell_plugin_keybinding_filter;
plugin_class->confirm_display_change = gnome_shell_plugin_confirm_display_change;
plugin_class->plugin_info = gnome_shell_plugin_plugin_info;
plugin_class->create_close_dialog = gnome_shell_plugin_create_close_dialog;
plugin_class->create_inhibit_shortcuts_dialog = gnome_shell_plugin_create_inhibit_shortcuts_dialog;
}
static void
gnome_shell_plugin_init (GnomeShellPlugin *shell_plugin)
{
}
static gboolean
gnome_shell_plugin_has_swap_event (GnomeShellPlugin *shell_plugin)
{
@@ -416,8 +318,8 @@ gnome_shell_plugin_confirm_display_change (MetaPlugin *plugin)
_shell_wm_confirm_display_change (get_shell_wm ());
}
static const
MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin)
static const MetaPluginInfo *
gnome_shell_plugin_plugin_info (MetaPlugin *plugin)
{
static const MetaPluginInfo info = {
.name = "GNOME Shell",
@@ -443,3 +345,42 @@ gnome_shell_plugin_create_inhibit_shortcuts_dialog (MetaPlugin *plugin,
{
return _shell_wm_create_inhibit_shortcuts_dialog (get_shell_wm (), window);
}
static void
gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
{
MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass);
plugin_class->start = gnome_shell_plugin_start;
plugin_class->map = gnome_shell_plugin_map;
plugin_class->minimize = gnome_shell_plugin_minimize;
plugin_class->unminimize = gnome_shell_plugin_unminimize;
plugin_class->size_changed = gnome_shell_plugin_size_changed;
plugin_class->size_change = gnome_shell_plugin_size_change;
plugin_class->destroy = gnome_shell_plugin_destroy;
plugin_class->switch_workspace = gnome_shell_plugin_switch_workspace;
plugin_class->kill_window_effects = gnome_shell_plugin_kill_window_effects;
plugin_class->kill_switch_workspace = gnome_shell_plugin_kill_switch_workspace;
plugin_class->show_tile_preview = gnome_shell_plugin_show_tile_preview;
plugin_class->hide_tile_preview = gnome_shell_plugin_hide_tile_preview;
plugin_class->show_window_menu = gnome_shell_plugin_show_window_menu;
plugin_class->show_window_menu_for_rect = gnome_shell_plugin_show_window_menu_for_rect;
plugin_class->xevent_filter = gnome_shell_plugin_xevent_filter;
plugin_class->keybinding_filter = gnome_shell_plugin_keybinding_filter;
plugin_class->confirm_display_change = gnome_shell_plugin_confirm_display_change;
plugin_class->plugin_info = gnome_shell_plugin_plugin_info;
plugin_class->create_close_dialog = gnome_shell_plugin_create_close_dialog;
plugin_class->create_inhibit_shortcuts_dialog = gnome_shell_plugin_create_inhibit_shortcuts_dialog;
}
static void
gnome_shell_plugin_init (GnomeShellPlugin *shell_plugin)
{
}

View File

@@ -184,7 +184,7 @@ window_backed_app_get_icon (ShellApp *app,
int size)
{
MetaWindow *window = NULL;
ClutterActor *actor;
StWidget *widget;
gint scale;
ShellGlobal *global;
StThemeContext *context;
@@ -204,16 +204,20 @@ window_backed_app_get_icon (ShellApp *app,
if (window == NULL)
{
ClutterActor *actor;
actor = clutter_actor_new ();
g_object_set (actor, "opacity", 0, "width", (float) size, "height", (float) size, NULL);
return actor;
}
actor = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
G_OBJECT (window),
"icon");
g_object_set (actor, "width", (float) size, "height", (float) size, NULL);
return actor;
widget = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
G_OBJECT (window),
"icon",
size);
st_widget_add_style_class_name (widget, "fallback-app-icon");
return CLUTTER_ACTOR (widget);
}
/**
@@ -1179,13 +1183,26 @@ _shell_app_handle_startup_sequence (ShellApp *app,
gboolean
shell_app_request_quit (ShellApp *app)
{
GActionGroup *group = NULL;
GSList *iter;
if (shell_app_get_state (app) != SHELL_APP_STATE_RUNNING)
return FALSE;
/* TODO - check for an XSMP connection; we could probably use that */
/* First, check whether the app exports an explicit "quit" action
* that we can activate on the bus
*/
group = G_ACTION_GROUP (app->running_state->muxer);
if (g_action_group_has_action (group, "app.quit") &&
g_action_group_get_action_parameter_type (group, "app.quit") == NULL)
{
g_action_group_activate_action (group, "app.quit", NULL);
return TRUE;
}
/* Otherwise, fall back to closing all the app's windows */
for (iter = app->running_state->windows; iter; iter = iter->next)
{
MetaWindow *win = iter->data;

View File

@@ -4,6 +4,7 @@
#include "shell-embedded-window-private.h"
#include "shell-global.h"
#include "shell-util.h"
#include <gdk/gdkx.h>
#include <meta/display.h>
@@ -94,6 +95,10 @@ shell_gtk_embed_window_created_cb (MetaDisplay *display,
as a normal window */
clutter_actor_set_opacity (window_actor, 0);
/* Also make sure it (or any of its children) doesn't block
events on wayland */
shell_util_set_hidden_from_pick (window_actor, TRUE);
/* Set an empty input shape on the window so that it can't get
any input. This probably isn't the ideal way to achieve this.
It would probably be better to force the window to go behind

View File

@@ -17,15 +17,13 @@
#include <meta/meta-cursor-tracker.h>
#include <meta/display.h>
#include <meta/compositor-mutter.h>
#include <st/st.h>
#include "shell-global.h"
#include "shell-recorder-src.h"
#include "shell-recorder.h"
#include "shell-util.h"
#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications"
#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled"
typedef enum {
RECORDER_STATE_CLOSED,
RECORDER_STATE_RECORDING
@@ -51,10 +49,13 @@ struct _ShellRecorder {
int stage_width;
int stage_height;
int capture_width;
int capture_height;
float scale;
int pointer_x;
int pointer_y;
GSettings *a11y_settings;
gboolean draw_cursor;
MetaCursorTracker *cursor_tracker;
cairo_surface_t *cursor_image;
@@ -209,8 +210,6 @@ shell_recorder_init (ShellRecorder *recorder)
recorder->memory_target = get_memory_target();
recorder->a11y_settings = g_settings_new (A11Y_APPS_SCHEMA);
recorder->state = RECORDER_STATE_CLOSED;
recorder->framerate = DEFAULT_FRAMES_PER_SECOND;
recorder->draw_cursor = TRUE;
@@ -235,8 +234,6 @@ shell_recorder_finalize (GObject *object)
recorder_remove_redraw_timeout (recorder);
g_clear_object (&recorder->a11y_settings);
G_OBJECT_CLASS (shell_recorder_parent_class)->finalize (object);
}
@@ -430,10 +427,8 @@ recorder_record_frame (ShellRecorder *recorder,
return;
recorder->last_frame_time = now;
clutter_stage_capture (recorder->stage, paint, &recorder->area,
&captures, &n_captures);
if (n_captures == 0)
if (!clutter_stage_capture (recorder->stage, paint, &recorder->area,
&captures, &n_captures))
return;
if (n_captures == 1)
@@ -443,8 +438,9 @@ recorder_record_frame (ShellRecorder *recorder,
n_captures,
recorder->area.x,
recorder->area.y,
recorder->area.width,
recorder->area.height);
recorder->capture_width,
recorder->capture_height,
recorder->scale);
data = cairo_image_surface_get_data (image);
size = (cairo_image_surface_get_height (image) *
@@ -462,9 +458,16 @@ recorder_record_frame (ShellRecorder *recorder,
GST_BUFFER_PTS(buffer) = now;
if (recorder->draw_cursor &&
!g_settings_get_boolean (recorder->a11y_settings, MAGNIFIER_ACTIVE_KEY))
recorder_draw_cursor (recorder, buffer);
if (recorder->draw_cursor)
{
StSettings *settings = st_settings_get ();
gboolean magnifier_active = FALSE;
g_object_get (settings, "magnifier-active", &magnifier_active, NULL);
if (magnifier_active)
recorder_draw_cursor (recorder, buffer);
}
shell_recorder_src_add_buffer (SHELL_RECORDER_SRC (recorder->current_pipeline->src), buffer);
gst_buffer_unref (buffer);
@@ -500,6 +503,11 @@ recorder_update_size (ShellRecorder *recorder)
recorder->area.y = 0;
recorder->area.width = recorder->stage_width;
recorder->area.height = recorder->stage_height;
clutter_stage_get_capture_final_size (recorder->stage, NULL,
&recorder->capture_width,
&recorder->capture_height,
&recorder->scale);
}
}
@@ -618,6 +626,8 @@ recorder_connect_stage_callbacks (ShellRecorder *recorder)
G_CALLBACK (recorder_on_stage_notify_size), recorder);
g_signal_connect (recorder->stage, "notify::height",
G_CALLBACK (recorder_on_stage_notify_size), recorder);
g_signal_connect (recorder->stage, "notify::resource-scale",
G_CALLBACK (recorder_on_stage_notify_size), recorder);
}
static void
@@ -875,6 +885,7 @@ shell_recorder_class_init (ShellRecorderClass *klass)
static void
recorder_pipeline_set_caps (RecorderPipeline *pipeline)
{
ShellRecorder *recorder = pipeline->recorder;
GstCaps *caps;
/* The data is always native-endian xRGB; videoconvert
@@ -887,9 +898,9 @@ recorder_pipeline_set_caps (RecorderPipeline *pipeline)
#else
"format", G_TYPE_STRING, "xRGB",
#endif
"framerate", GST_TYPE_FRACTION, pipeline->recorder->framerate, 1,
"width", G_TYPE_INT, pipeline->recorder->area.width,
"height", G_TYPE_INT, pipeline->recorder->area.height,
"framerate", GST_TYPE_FRACTION, recorder->framerate, 1,
"width", G_TYPE_INT, recorder->capture_width,
"height", G_TYPE_INT, recorder->capture_height,
NULL);
g_object_set (pipeline->src, "caps", caps, NULL);
gst_caps_unref (caps);
@@ -1496,6 +1507,11 @@ shell_recorder_set_area (ShellRecorder *recorder,
recorder->area.height = CLAMP (height,
0, recorder->stage_height - recorder->area.y);
clutter_stage_get_capture_final_size (recorder->stage, &recorder->area,
&recorder->capture_width,
&recorder->capture_height,
&recorder->scale);
/* This breaks the recording but tweaking the GStreamer pipeline a bit
* might make it work, at least if the codec can handle a stream where
* the frame size changes in the middle.

View File

@@ -7,14 +7,12 @@
#include <meta/meta-plugin.h>
#include <meta/meta-shaped-texture.h>
#include <meta/meta-cursor-tracker.h>
#include <st/st.h>
#include "shell-global.h"
#include "shell-screenshot.h"
#include "shell-util.h"
#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications"
#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled"
typedef struct _ShellScreenshotPrivate ShellScreenshotPrivate;
struct _ShellScreenshot
@@ -40,6 +38,13 @@ struct _ShellScreenshotPrivate
gboolean include_frame;
};
typedef enum
{
SHELL_SCREENSHOT_SCREEN,
SHELL_SCREENSHOT_WINDOW,
SHELL_SCREENSHOT_AREA,
} ShellScreenshotMode;
G_DEFINE_TYPE_WITH_PRIVATE (ShellScreenshot, shell_screenshot, G_TYPE_OBJECT);
static void
@@ -195,6 +200,9 @@ write_screenshot_thread (GTask *result,
cairo_image_surface_get_height (priv->image));
creation_time = g_date_time_format (priv->datetime, "%c");
if (!creation_time)
creation_time = g_date_time_format (priv->datetime, "%FT%T%z");
if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
"tEXt::Software", "gnome-screenshot",
"tEXt::Creation Time", creation_time,
@@ -222,29 +230,32 @@ do_grab_screenshot (ShellScreenshot *screenshot,
int height)
{
ShellScreenshotPrivate *priv = screenshot->priv;
cairo_rectangle_int_t screenshot_rect = { x, y, width, height };
ClutterCapture *captures;
int n_captures;
int i;
clutter_stage_capture (stage, FALSE,
&(cairo_rectangle_int_t) {
.x = x,
.y = y,
.width = width,
.height = height
},
&captures,
&n_captures);
if (n_captures == 0)
if (!clutter_stage_capture (stage, FALSE,
&screenshot_rect,
&captures,
&n_captures))
return;
else if (n_captures == 1)
if (n_captures == 1)
priv->image = cairo_surface_reference (captures[0].image);
else
priv->image = shell_util_composite_capture_images (captures,
n_captures,
x, y,
width, height);
{
float target_scale;
clutter_stage_get_capture_final_size (stage, &screenshot_rect,
&width, &height, &target_scale);
priv->image = shell_util_composite_capture_images (captures,
n_captures,
x, y,
width, height,
target_scale);
}
priv->datetime = g_date_time_new_now_local ();
for (i = 0; i < n_captures; i++)
@@ -253,22 +264,44 @@ do_grab_screenshot (ShellScreenshot *screenshot,
g_free (captures);
}
static gboolean
should_draw_cursor_image (ShellScreenshotMode mode)
{
if (mode == SHELL_SCREENSHOT_WINDOW || !meta_is_wayland_compositor ())
{
StSettings *settings = st_settings_get ();
gboolean magnifier_active = FALSE;
g_object_get (settings, "magnifier-active", &magnifier_active, NULL);
if (!magnifier_active)
return TRUE;
}
return FALSE;
}
static void
_draw_cursor_image (MetaCursorTracker *tracker,
cairo_surface_t *surface,
cairo_rectangle_int_t area)
draw_cursor_image (cairo_surface_t *surface,
cairo_rectangle_int_t area)
{
CoglTexture *texture;
int width, height;
int stride;
guint8 *data;
MetaDisplay *display;
MetaCursorTracker *tracker;
cairo_surface_t *cursor_surface;
cairo_region_t *screenshot_region;
cairo_t *cr;
int x, y;
int xhot, yhot;
double xscale, yscale;
display = shell_global_get_display (shell_global_get ());
tracker = meta_cursor_tracker_get_for_display (display);
texture = meta_cursor_tracker_get_sprite (tracker);
if (!texture)
return;
@@ -294,6 +327,22 @@ _draw_cursor_image (MetaCursorTracker *tracker,
width, height,
stride);
cairo_surface_get_device_scale (surface, &xscale, &yscale);
if (xscale != 1.0 || yscale != 1.0)
{
int monitor;
float monitor_scale;
MetaRectangle cursor_rect = {
.x = x, .y = y, .width = width, .height = height
};
monitor = meta_display_get_monitor_index_for_rect (display, &cursor_rect);
monitor_scale = meta_display_get_monitor_scale (display, monitor);
cairo_surface_set_device_scale (cursor_surface, monitor_scale, monitor_scale);
}
cr = cairo_create (surface);
cairo_set_source_surface (cr,
cursor_surface,
@@ -312,9 +361,7 @@ grab_screenshot (ClutterActor *stage,
GTask *result)
{
MetaDisplay *display;
MetaCursorTracker *tracker;
int width, height;
GSettings *settings;
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
GTask *task;
@@ -368,14 +415,8 @@ grab_screenshot (ClutterActor *stage,
priv->screenshot_area.width = width;
priv->screenshot_area.height = height;
settings = g_settings_new (A11Y_APPS_SCHEMA);
if (priv->include_cursor &&
!g_settings_get_boolean (settings, MAGNIFIER_ACTIVE_KEY))
{
tracker = meta_cursor_tracker_get_for_display (display);
_draw_cursor_image (tracker, priv->image, priv->screenshot_area);
}
g_object_unref (settings);
if (priv->include_cursor)
draw_cursor_image (priv->image, priv->screenshot_area);
g_signal_handlers_disconnect_by_func (stage, grab_screenshot, result);
@@ -412,9 +453,7 @@ grab_window_screenshot (ClutterActor *stage,
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
GTask *task;
GSettings *settings;
MetaDisplay *display = shell_global_get_display (priv->global);
MetaCursorTracker *tracker;
MetaWindow *window = meta_display_get_focus_window (display);
ClutterActor *window_actor;
gfloat actor_x, actor_y;
@@ -442,13 +481,19 @@ grab_window_screenshot (ClutterActor *stage,
priv->image = meta_shaped_texture_get_image (stex, &clip);
priv->datetime = g_date_time_new_now_local ();
settings = g_settings_new (A11Y_APPS_SCHEMA);
if (priv->include_cursor && !g_settings_get_boolean (settings, MAGNIFIER_ACTIVE_KEY))
if (priv->include_cursor)
{
tracker = meta_cursor_tracker_get_for_display (display);
_draw_cursor_image (tracker, priv->image, priv->screenshot_area);
if (meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_WAYLAND)
{
float resource_scale;
if (!clutter_actor_get_resource_scale (window_actor, &resource_scale))
resource_scale = 1.0f;
cairo_surface_set_device_scale (priv->image, resource_scale, resource_scale);
}
draw_cursor_image (priv->image, priv->screenshot_area);
}
g_object_unref (settings);
g_signal_handlers_disconnect_by_func (stage, grab_window_screenshot, result);
task = g_task_new (screenshot, NULL, on_screenshot_written, result);
@@ -520,6 +565,7 @@ shell_screenshot_screenshot (ShellScreenshot *screenshot,
{
ClutterActor *stage;
ShellScreenshotPrivate *priv = screenshot->priv;
const char *paint_signal;
GTask *result;
if (priv->filename != NULL) {
@@ -539,13 +585,22 @@ shell_screenshot_screenshot (ShellScreenshot *screenshot,
g_task_set_source_tag (result, shell_screenshot_screenshot);
priv->filename = g_strdup (filename);
priv->include_cursor = include_cursor;
priv->include_cursor = FALSE;
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
paint_signal = "actors-painted";
meta_disable_unredirect_for_display (shell_global_get_display (priv->global));
g_signal_connect_after (stage, "paint", G_CALLBACK (grab_screenshot), result);
if (include_cursor)
{
if (should_draw_cursor_image (SHELL_SCREENSHOT_SCREEN))
priv->include_cursor = TRUE;
else
paint_signal = "paint";
}
g_signal_connect_after (stage, paint_signal, G_CALLBACK (grab_screenshot), result);
clutter_actor_queue_redraw (stage);
}
@@ -634,7 +689,7 @@ shell_screenshot_screenshot_area (ShellScreenshot *screenshot,
meta_disable_unredirect_for_display (shell_global_get_display (shell_global_get ()));
g_signal_connect_after (stage, "paint", G_CALLBACK (grab_area_screenshot), result);
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_area_screenshot), result);
clutter_actor_queue_redraw (stage);
}
@@ -713,13 +768,14 @@ shell_screenshot_screenshot_window (ShellScreenshot *screenshot,
priv->filename = g_strdup (filename);
priv->include_frame = include_frame;
priv->include_cursor = include_cursor;
priv->include_cursor = include_cursor &&
should_draw_cursor_image (SHELL_SCREENSHOT_WINDOW);
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
meta_disable_unredirect_for_display (shell_global_get_display (shell_global_get ()));
g_signal_connect_after (stage, "paint", G_CALLBACK (grab_window_screenshot), result);
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_window_screenshot), result);
clutter_actor_queue_redraw (stage);
}
@@ -787,7 +843,7 @@ shell_screenshot_pick_color (ShellScreenshot *screenshot,
meta_disable_unredirect_for_display (display);
g_signal_connect_after (stage, "paint", G_CALLBACK (grab_pixel), result);
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_pixel), result);
clutter_actor_queue_redraw (stage);
}

View File

@@ -77,13 +77,13 @@ shell_tray_icon_constructed (GObject *object)
plug_xid = GDK_WINDOW_XID (icon_app_window);
display = gtk_widget_get_display (GTK_WIDGET (icon->priv->socket));
gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);
_NET_WM_PID = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PID");
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), plug_xid,
_NET_WM_PID, 0, G_MAXLONG, False, XA_CARDINAL,
&type, &format, &nitems,
&bytes_after, (guchar **)&val);
if (!gdk_error_trap_pop () &&
if (!gdk_x11_display_error_trap_pop (display) &&
result == Success &&
type == XA_CARDINAL &&
nitems == 1)
@@ -190,6 +190,7 @@ shell_tray_icon_click (ShellTrayIcon *icon,
XKeyEvent xkevent;
XButtonEvent xbevent;
XCrossingEvent xcevent;
GdkDisplay *display;
GdkWindow *remote_window;
GdkScreen *screen;
int x_root, y_root;
@@ -201,21 +202,23 @@ shell_tray_icon_click (ShellTrayIcon *icon,
event_type == CLUTTER_KEY_PRESS ||
event_type == CLUTTER_KEY_RELEASE);
gdk_error_trap_push ();
remote_window = gtk_socket_get_plug_window (GTK_SOCKET (icon->priv->socket));
if (remote_window == NULL)
{
g_warning ("shell tray: plug window is gone");
gdk_error_trap_pop_ignored ();
return;
}
xwindow = GDK_WINDOW_XID (remote_window);
xdisplay = GDK_WINDOW_XDISPLAY (remote_window);
display = gdk_x11_lookup_xdisplay (xdisplay);
gdk_x11_display_error_trap_push (display);
xwindow = GDK_WINDOW_XID (remote_window);
screen = gdk_window_get_screen (remote_window);
xrootwindow = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
gdk_window_get_origin (remote_window, &x_root, &y_root);
/* First make the icon believe the pointer is inside it */
xcevent.type = EnterNotify;
xcevent.window = xwindow;
@@ -287,5 +290,5 @@ shell_tray_icon_click (ShellTrayIcon *icon,
xcevent.type = LeaveNotify;
XSendEvent (xdisplay, xwindow, False, 0, (XEvent *)&xcevent);
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (display);
}

View File

@@ -212,13 +212,7 @@ void
shell_tray_manager_manage_screen (ShellTrayManager *manager,
StWidget *theme_widget)
{
GdkDisplay *display;
GdkScreen *gdk_screen;
display = gdk_display_get_default ();
gdk_screen = gdk_display_get_default_screen (display);
na_tray_manager_manage_screen (manager->priv->na_manager, gdk_screen);
na_tray_manager_manage_screen (manager->priv->na_manager);
g_signal_connect_object (theme_widget, "style-changed",
G_CALLBACK (shell_tray_manager_style_changed),
@@ -245,8 +239,10 @@ shell_tray_manager_child_on_realize (GtkWidget *widget,
bg_pattern = cairo_pattern_create_rgb (color.red / 255.,
color.green / 255.,
color.blue / 255.);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_window_set_background_pattern (gtk_widget_get_window (widget),
bg_pattern);
G_GNUC_END_IGNORE_DEPRECATIONS
cairo_pattern_destroy (bg_pattern);
}

View File

@@ -3,6 +3,7 @@
#include "config.h"
#include <errno.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@@ -434,14 +435,23 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
cairo_surface_t *surface;
cairo_rectangle_int_t clip;
gfloat actor_x, actor_y;
gfloat resource_scale;
texture = meta_window_actor_get_texture (window_actor);
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
&resource_scale))
{
resource_scale = 1.0;
g_warning ("Actor resource scale is not know at this point, "
"falling back to default 1.0");
}
clip.x = window_rect->x - (gint) actor_x;
clip.y = window_rect->y - (gint) actor_y;
clip.width = window_rect->width;
clip.height = window_rect->height;
clip.width = ceilf (window_rect->width * resource_scale);
clip.height = ceilf (window_rect->height * resource_scale);
surface = meta_shaped_texture_get_image (META_SHAPED_TEXTURE (texture),
&clip);
@@ -462,31 +472,20 @@ shell_util_composite_capture_images (ClutterCapture *captures,
int n_captures,
int x,
int y,
int width,
int height)
int target_width,
int target_height,
float target_scale)
{
int i;
double target_scale;
cairo_format_t format;
cairo_surface_t *image;
cairo_t *cr;
g_assert (n_captures > 0);
target_scale = 0.0;
for (i = 0; i < n_captures; i++)
{
ClutterCapture *capture = &captures[i];
double capture_scale = 1.0;
cairo_surface_get_device_scale (capture->image, &capture_scale, NULL);
target_scale = MAX (target_scale, capture_scale);
}
g_assert (target_scale > 0.0f);
format = cairo_image_surface_get_format (captures[0].image);
image = cairo_image_surface_create (format,
width * target_scale,
height * target_scale);
image = cairo_image_surface_create (format, target_width, target_height);
cairo_surface_set_device_scale (image, target_scale, target_scale);
cr = cairo_create (image);

View File

@@ -53,8 +53,9 @@ cairo_surface_t * shell_util_composite_capture_images (ClutterCapture *captures
int n_captures,
int x,
int y,
int width,
int height);
int target_width,
int target_height,
float target_scale);
void shell_util_check_cloexec_fds (void);

View File

@@ -12,6 +12,7 @@ st_headers = [
'st-generic-accessible.h',
'st-icon.h',
'st-icon-colors.h',
'st-image-content.h',
'st-label.h',
'st-private.h',
'st-scrollable.h',
@@ -66,6 +67,7 @@ st_sources = [
'st-generic-accessible.c',
'st-icon.c',
'st-icon-colors.c',
'st-image-content.c',
'st-label.c',
'st-private.c',
'st-scrollable.c',
@@ -124,6 +126,7 @@ libst = shared_library('st-1.0',
sources: st_gir_sources + st_non_gir_sources,
c_args: st_cflags,
dependencies: [clutter_dep, gtk_dep, croco_dep, x11_dep, m_dep],
build_rpath: mutter_typelibdir,
install_rpath: mutter_typelibdir,
install_dir: pkglibdir,
install: true
@@ -137,9 +140,14 @@ test_theme = executable('test-theme',
sources: 'test-theme.c',
c_args: st_cflags,
dependencies: [clutter_dep, gtk_dep],
build_rpath: mutter_typelibdir,
link_with: libst
)
test('CSS styling support', test_theme,
workdir: meson.current_source_dir()
)
libst_gir = gnome.generate_gir(libst,
sources: st_gir_sources,
nsversion: '1.0',

View File

@@ -58,32 +58,6 @@ static Atom __atom_clip = None;
static Atom __utf8_string = None;
static Atom __atom_targets = None;
static void
st_clipboard_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
st_clipboard_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
st_clipboard_dispose (GObject *object)
{
@@ -180,8 +154,6 @@ st_clipboard_class_init (StClipboardClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = st_clipboard_get_property;
object_class->set_property = st_clipboard_set_property;
object_class->dispose = st_clipboard_dispose;
object_class->finalize = st_clipboard_finalize;
}

View File

@@ -35,6 +35,7 @@
#include "st-drawing-area.h"
#include <cairo.h>
#include <math.h>
typedef struct _StDrawingAreaPrivate StDrawingAreaPrivate;
struct _StDrawingAreaPrivate {
@@ -84,12 +85,22 @@ st_drawing_area_allocate (ClutterActor *self,
ClutterContent *content = clutter_actor_get_content (self);
ClutterActorBox content_box;
int width, height;
float resource_scale;
if (!st_widget_get_resource_scale (ST_WIDGET (self), &resource_scale))
{
ClutterActorBox empty = CLUTTER_ACTOR_BOX_INIT_ZERO;
clutter_actor_set_allocation (self, &empty, 0);
return;
}
clutter_actor_set_allocation (self, box, flags);
st_theme_node_get_content_box (theme_node, box, &content_box);
width = (int)(0.5 + content_box.x2 - content_box.x1);
height = (int)(0.5 + content_box.y2 - content_box.y1);
clutter_canvas_set_scale_factor (CLUTTER_CANVAS (content), resource_scale);
clutter_canvas_set_size (CLUTTER_CANVAS (content), width, height);
}
@@ -101,6 +112,16 @@ st_drawing_area_style_changed (StWidget *self)
st_drawing_area_queue_repaint (ST_DRAWING_AREA (self));
}
static void
st_drawing_area_resource_scale_changed (StWidget *self)
{
float resource_scale;
ClutterContent *content = clutter_actor_get_content (CLUTTER_ACTOR (self));
if (st_widget_get_resource_scale (ST_WIDGET (self), &resource_scale))
clutter_canvas_set_scale_factor (CLUTTER_CANVAS (content), resource_scale);
}
static void
st_drawing_area_class_init (StDrawingAreaClass *klass)
{
@@ -109,6 +130,7 @@ st_drawing_area_class_init (StDrawingAreaClass *klass)
actor_class->allocate = st_drawing_area_allocate;
widget_class->style_changed = st_drawing_area_style_changed;
widget_class->resource_scale_changed = st_drawing_area_resource_scale_changed;
st_drawing_area_signals[REPAINT] =
g_signal_new ("repaint",
@@ -185,7 +207,7 @@ st_drawing_area_get_surface_size (StDrawingArea *area,
{
StDrawingAreaPrivate *priv;
ClutterContent *content;
float w, h;
float w, h, resource_scale;
g_return_if_fail (ST_IS_DRAWING_AREA (area));
@@ -195,8 +217,18 @@ st_drawing_area_get_surface_size (StDrawingArea *area,
content = clutter_actor_get_content (CLUTTER_ACTOR (area));
clutter_content_get_preferred_size (content, &w, &h);
if (st_widget_get_resource_scale (ST_WIDGET (area), &resource_scale))
{
w /= resource_scale;
h /= resource_scale;
}
else
{
w = h = 0.0f;
}
if (width)
*width = (guint)w;
*width = ceilf (w);
if (height)
*height = (guint)h;
*height = ceilf (h);
}

View File

@@ -210,6 +210,12 @@ st_icon_style_changed (StWidget *widget)
st_icon_update (self);
}
static void
st_icon_resource_scale_changed (StWidget *widget)
{
st_icon_update (ST_ICON (widget));
}
static void
st_icon_class_init (StIconClass *klass)
{
@@ -226,6 +232,7 @@ st_icon_class_init (StIconClass *klass)
actor_class->paint = st_icon_paint;
widget_class->style_changed = st_icon_style_changed;
widget_class->resource_scale_changed = st_icon_resource_scale_changed;
pspec = g_param_spec_object ("gicon",
"GIcon",
@@ -344,6 +351,8 @@ st_icon_finish_update (StIcon *icon)
g_signal_connect_object (priv->icon_texture, "notify::content",
G_CALLBACK (on_content_changed), icon, 0);
}
clutter_actor_queue_relayout (CLUTTER_ACTOR (icon));
}
static void
@@ -366,9 +375,10 @@ st_icon_update (StIcon *icon)
StIconPrivate *priv = icon->priv;
StThemeNode *theme_node;
StTextureCache *cache;
gint scale;
gint paint_scale;
ClutterActor *stage;
StThemeContext *context;
float resource_scale;
if (priv->pending_texture)
{
@@ -378,13 +388,16 @@ st_icon_update (StIcon *icon)
priv->opacity_handler_id = 0;
}
if (!st_widget_get_resource_scale (ST_WIDGET (icon), &resource_scale))
return;
theme_node = st_widget_peek_theme_node (ST_WIDGET (icon));
if (theme_node == NULL)
return;
stage = clutter_actor_get_stage (CLUTTER_ACTOR (icon));
context = st_theme_context_get_for_stage (CLUTTER_STAGE (stage));
g_object_get (context, "scale-factor", &scale, NULL);
g_object_get (context, "scale-factor", &paint_scale, NULL);
cache = st_texture_cache_get_default ();
@@ -393,14 +406,16 @@ st_icon_update (StIcon *icon)
theme_node,
priv->gicon,
priv->icon_size,
scale);
paint_scale,
resource_scale);
if (priv->pending_texture == NULL && priv->fallback_gicon != NULL)
priv->pending_texture = st_texture_cache_load_gicon (cache,
theme_node,
priv->fallback_gicon,
priv->icon_size,
scale);
paint_scale,
resource_scale);
if (priv->pending_texture)
{

191
src/st/st-image-content.c Normal file
View File

@@ -0,0 +1,191 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* st-image-content.h: A content image with scaling support
*
* Copyright 2019 Canonical, Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "st-image-content.h"
struct _StImageContent
{
/*< private >*/
ClutterImage parent_instance;
};
typedef struct _StImageContentPrivate StImageContentPrivate;
struct _StImageContentPrivate
{
int width;
int height;
};
enum
{
PROP_0,
PROP_PREFERRED_WIDTH,
PROP_PREFERRED_HEIGHT,
};
static void clutter_content_interface_init (ClutterContentInterface *iface);
G_DEFINE_TYPE_WITH_CODE (StImageContent, st_image_content, CLUTTER_TYPE_IMAGE,
G_ADD_PRIVATE (StImageContent)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTENT,
clutter_content_interface_init))
static void
st_image_content_init (StImageContent *self)
{
}
static void
st_image_content_constructed (GObject *object)
{
StImageContent *self = ST_IMAGE_CONTENT (object);
StImageContentPrivate *priv = st_image_content_get_instance_private (self);
if (priv->width < 0 || priv->height < 0)
g_warning ("StImageContent initialized with invalid preferred size: %dx%d\n",
priv->width, priv->height);
}
static void
st_image_content_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
StImageContent *self = ST_IMAGE_CONTENT (object);
StImageContentPrivate *priv = st_image_content_get_instance_private (self);
switch (prop_id)
{
case PROP_PREFERRED_WIDTH:
g_value_set_int (value, priv->width);
break;
case PROP_PREFERRED_HEIGHT:
g_value_set_int (value, priv->height);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
st_image_content_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
StImageContent *self = ST_IMAGE_CONTENT (object);
StImageContentPrivate *priv = st_image_content_get_instance_private (self);
switch (prop_id)
{
case PROP_PREFERRED_WIDTH:
priv->width = g_value_get_int (value);
break;
case PROP_PREFERRED_HEIGHT:
priv->height = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
st_image_content_class_init (StImageContentClass *klass)
{
GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = st_image_content_constructed;
object_class->get_property = st_image_content_get_property;
object_class->set_property = st_image_content_set_property;
pspec = g_param_spec_int ("preferred-width",
"Preferred Width",
"Preferred Width of the Content when painted",
-1, G_MAXINT, -1,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PREFERRED_WIDTH, pspec);
pspec = g_param_spec_int ("preferred-height",
"Preferred Height",
"Preferred Height of the Content when painted",
-1, G_MAXINT, -1,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PREFERRED_HEIGHT, pspec);
}
static gboolean
st_image_content_get_preferred_size (ClutterContent *content,
float *width,
float *height)
{
StImageContent *self = ST_IMAGE_CONTENT (content);
StImageContentPrivate *priv = st_image_content_get_instance_private (self);
ClutterTexture *texture;
texture = clutter_image_get_texture (CLUTTER_IMAGE (content));
if (texture == NULL)
return FALSE;
g_assert_cmpint (priv->width, >, -1);
g_assert_cmpint (priv->height, >, -1);
if (width != NULL)
*width = (float) priv->width;
if (height != NULL)
*height = (float) priv->height;
return TRUE;
}
static void
clutter_content_interface_init (ClutterContentInterface *iface)
{
iface->get_preferred_size = st_image_content_get_preferred_size;
}
/**
* st_image_content_new_with_preferred_size:
* @width: The preferred width to be used when drawing the content
* @height: The preferred width to be used when drawing the content
*
* Creates a new #StImageContent, a simple content for sized images.
*
* Return value: (transfer full): the newly created #StImageContent content
* Use g_object_unref() when done.
*/
ClutterContent *
st_image_content_new_with_preferred_size (int width,
int height)
{
return g_object_new (ST_TYPE_IMAGE_CONTENT,
"preferred-width", width,
"preferred-height", height,
NULL);
}

33
src/st/st-image-content.h Normal file
View File

@@ -0,0 +1,33 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* st-image-content.h: A content image with scaling support
*
* Copyright 2019 Canonical, Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ST_IMAGE_CONTENT_H__
#define __ST_IMAGE_CONTENT_H__
#include <clutter/clutter.h>
#define ST_TYPE_IMAGE_CONTENT (st_image_content_get_type ())
G_DECLARE_FINAL_TYPE (StImageContent, st_image_content,
ST, IMAGE_CONTENT, ClutterImage)
ClutterContent *st_image_content_new_with_preferred_size (int width,
int height);
#endif /* __ST_IMAGE_CONTENT_H__ */

View File

@@ -197,34 +197,52 @@ st_label_paint (ClutterActor *actor)
if (shadow_spec)
{
ClutterActorBox allocation;
float width, height;
float resource_scale;
clutter_actor_get_allocation_box (priv->label, &allocation);
clutter_actor_box_get_size (&allocation, &width, &height);
if (priv->text_shadow_pipeline == NULL ||
width != priv->shadow_width ||
height != priv->shadow_height)
if (clutter_actor_get_resource_scale (priv->label, &resource_scale))
{
g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
ClutterActorBox allocation;
float width, height;
priv->shadow_width = width;
priv->shadow_height = height;
priv->text_shadow_pipeline = _st_create_shadow_pipeline_from_actor (shadow_spec, priv->label);
clutter_actor_get_allocation_box (priv->label, &allocation);
clutter_actor_box_get_size (&allocation, &width, &height);
width *= resource_scale;
height *= resource_scale;
if (priv->text_shadow_pipeline == NULL ||
width != priv->shadow_width ||
height != priv->shadow_height)
{
g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
priv->shadow_width = width;
priv->shadow_height = height;
priv->text_shadow_pipeline =
_st_create_shadow_pipeline_from_actor (shadow_spec,
priv->label);
}
if (priv->text_shadow_pipeline != NULL)
_st_paint_shadow_with_opacity (shadow_spec,
cogl_get_draw_framebuffer (),
priv->text_shadow_pipeline,
&allocation,
clutter_actor_get_paint_opacity (priv->label));
}
if (priv->text_shadow_pipeline != NULL)
_st_paint_shadow_with_opacity (shadow_spec,
cogl_get_draw_framebuffer (),
priv->text_shadow_pipeline,
&allocation,
clutter_actor_get_paint_opacity (priv->label));
}
clutter_actor_paint (priv->label);
}
static void
st_label_resource_scale_changed (StWidget *widget)
{
StLabelPrivate *priv = ST_LABEL (widget)->priv;
g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
}
static void
st_label_class_init (StLabelClass *klass)
{
@@ -243,6 +261,7 @@ st_label_class_init (StLabelClass *klass)
actor_class->get_preferred_height = st_label_get_preferred_height;
widget_class->style_changed = st_label_style_changed;
widget_class->resource_scale_changed = st_label_resource_scale_changed;
widget_class->get_accessible_type = st_label_accessible_get_type;
pspec = g_param_spec_object ("clutter-text",

View File

@@ -359,7 +359,8 @@ blur_pixels (guchar *pixels_in,
CoglPipeline *
_st_create_shadow_pipeline (StShadow *shadow_spec,
CoglTexture *src_texture)
CoglTexture *src_texture,
float resource_scale)
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
@@ -386,7 +387,7 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
rowstride_in, pixels_in);
pixels_out = blur_pixels (pixels_in, width_in, height_in, rowstride_in,
shadow_spec->blur,
shadow_spec->blur * resource_scale,
&width_out, &height_out, &rowstride_out);
g_free (pixels_in);
@@ -431,6 +432,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
{
ClutterContent *image = NULL;
CoglPipeline *shadow_pipeline = NULL;
float resource_scale;
float width, height;
g_return_val_if_fail (clutter_actor_has_allocation (actor), NULL);
@@ -440,6 +442,12 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (width == 0 || height == 0)
return NULL;
if (!clutter_actor_get_resource_scale (actor, &resource_scale))
return NULL;
width = ceilf (width * resource_scale);
height = ceilf (height * resource_scale);
image = clutter_actor_get_content (actor);
if (image && CLUTTER_IS_IMAGE (image))
{
@@ -449,7 +457,8 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (texture &&
cogl_texture_get_width (texture) == width &&
cogl_texture_get_height (texture) == height)
shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, texture);
shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, texture,
resource_scale);
}
if (shadow_pipeline == NULL)
@@ -491,6 +500,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
cogl_framebuffer_clear (fb, COGL_BUFFER_BIT_COLOR, &clear_color);
cogl_framebuffer_translate (fb, -x, -y, 0);
cogl_framebuffer_orthographic (fb, 0, 0, width, height, 0, 1.0);
cogl_framebuffer_scale (fb, resource_scale, resource_scale, 1);
clutter_actor_set_opacity_override (actor, 255);
clutter_actor_paint (actor);
@@ -502,7 +512,8 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
cogl_object_unref (fb);
shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, buffer);
shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, buffer,
resource_scale);
cogl_object_unref (buffer);
}
@@ -528,9 +539,10 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
* the offset.
*/
cairo_pattern_t *
_st_create_shadow_cairo_pattern (StShadow *shadow_spec,
_st_create_shadow_cairo_pattern (StShadow *shadow_spec_in,
cairo_pattern_t *src_pattern)
{
g_autoptr(StShadow) shadow_spec = NULL;
static cairo_user_data_key_t shadow_pattern_user_data;
cairo_t *cr;
cairo_surface_t *src_surface;
@@ -541,9 +553,10 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
gint width_in, height_in, rowstride_in;
gint width_out, height_out, rowstride_out;
cairo_matrix_t shadow_matrix;
double xscale_in, yscale_in;
int i, j;
g_return_val_if_fail (shadow_spec != NULL, NULL);
g_return_val_if_fail (shadow_spec_in != NULL, NULL);
g_return_val_if_fail (src_pattern != NULL, NULL);
if (cairo_pattern_get_surface (src_pattern, &src_surface) != CAIRO_STATUS_SUCCESS)
@@ -556,6 +569,25 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
width_in = cairo_image_surface_get_width (src_surface);
height_in = cairo_image_surface_get_height (src_surface);
cairo_surface_get_device_scale (src_surface, &xscale_in, &yscale_in);
if (xscale_in != 1.0 || yscale_in != 1.0)
{
/* Scale the shadow specifications in a temporary copy so that
* we can work everywhere in absolute surface coordinates */
double scale = (xscale_in + yscale_in) / 2.0;
shadow_spec = st_shadow_new (&shadow_spec_in->color,
shadow_spec_in->xoffset * xscale_in,
shadow_spec_in->yoffset * yscale_in,
shadow_spec_in->blur * scale,
shadow_spec_in->spread * scale,
shadow_spec_in->inset);
}
else
{
shadow_spec = st_shadow_ref (shadow_spec_in);
}
/* We want the output to be a color agnostic alpha mask,
* so we need to strip the color channels from the input
*/
@@ -598,6 +630,7 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
width_out,
height_out,
rowstride_out);
cairo_surface_set_device_scale (surface_out, xscale_in, yscale_in);
cairo_surface_set_user_data (surface_out, &shadow_pattern_user_data,
pixels_out, (cairo_destroy_func_t) g_free);
@@ -608,6 +641,9 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
if (shadow_spec->inset)
{
/* Scale the matrix in surface absolute coordinates */
cairo_matrix_scale (&shadow_matrix, 1.0 / xscale_in, 1.0 / yscale_in);
/* For inset shadows, offsets and spread radius have already been
* applied to the original pattern, so all left to do is shift the
* blurred image left, so that it aligns centered under the
@@ -616,6 +652,10 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
cairo_matrix_translate (&shadow_matrix,
(width_out - width_in) / 2.0,
(height_out - height_in) / 2.0);
/* Scale back the matrix in original coordinates */
cairo_matrix_scale (&shadow_matrix, xscale_in, yscale_in);
cairo_pattern_set_matrix (dst_pattern, &shadow_matrix);
return dst_pattern;
}
@@ -628,6 +668,9 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
/* 6. Invert the matrix back */
cairo_matrix_invert (&shadow_matrix);
/* Scale the matrix in surface absolute coordinates */
cairo_matrix_scale (&shadow_matrix, 1.0 / xscale_in, 1.0 / yscale_in);
/* 5. Adjust based on specified offsets */
cairo_matrix_translate (&shadow_matrix,
shadow_spec->xoffset,
@@ -649,6 +692,9 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
- (width_out - width_in) / 2.0,
- (height_out - height_in) / 2.0);
/* Scale back the matrix in scaled coordinates */
cairo_matrix_scale (&shadow_matrix, xscale_in, yscale_in);
/* 1. Invert the matrix so we can work with it in pattern space
*/
cairo_matrix_invert (&shadow_matrix);

View File

@@ -63,7 +63,8 @@ CoglPipeline * _st_create_texture_pipeline (CoglTexture *src_texture);
/* Helper for widgets which need to draw additional shadows */
CoglPipeline * _st_create_shadow_pipeline (StShadow *shadow_spec,
CoglTexture *src_texture);
CoglTexture *src_texture,
float resource_scale);
CoglPipeline * _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
ClutterActor *actor);
cairo_pattern_t *_st_create_shadow_cairo_pattern (StShadow *shadow_spec,

View File

@@ -110,8 +110,8 @@ st_scroll_view_fade_paint_target (ClutterOffscreenEffect *effect)
*/
fade_area_topleft[0] = content_box.x1 + (verts[0].x - paint_box.x1);
fade_area_topleft[1] = content_box.y1 + (verts[0].y - paint_box.y1);
fade_area_bottomright[0] = content_box.x2 + (verts[3].x - paint_box.x2);
fade_area_bottomright[1] = content_box.y2 + (verts[3].y - paint_box.y2);
fade_area_bottomright[0] = content_box.x2 + (verts[3].x - paint_box.x2) + 1;
fade_area_bottomright[1] = content_box.y2 + (verts[3].y - paint_box.y2) + 1;
g_object_get (ST_SCROLL_VIEW (self->actor),
"hscrollbar-visible", &h_scroll_visible,

View File

@@ -30,6 +30,7 @@
#define KEY_DRAG_THRESHOLD "drag-threshold"
#define KEY_GTK_THEME "gtk-theme"
#define KEY_GTK_ICON_THEME "icon-theme"
#define KEY_MAGNIFIER_ACTIVE "screen-magnifier-enabled"
enum {
PROP_0,
@@ -38,6 +39,7 @@ enum {
PROP_DRAG_THRESHOLD,
PROP_GTK_THEME,
PROP_GTK_ICON_THEME,
PROP_MAGNIFIER_ACTIVE,
N_PROPS
};
@@ -48,11 +50,13 @@ struct _StSettings
GObject parent_object;
GSettings *interface_settings;
GSettings *mouse_settings;
GSettings *a11y_settings;
gchar *gtk_theme;
gchar *gtk_icon_theme;
gboolean enable_animations;
gboolean primary_paste;
gboolean magnifier_active;
gint drag_threshold;
};
@@ -105,6 +109,9 @@ st_settings_get_property (GObject *object,
case PROP_GTK_ICON_THEME:
g_value_set_string (value, settings->gtk_icon_theme);
break;
case PROP_MAGNIFIER_ACTIVE:
g_value_set_boolean (value, settings->magnifier_active);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -144,6 +151,11 @@ st_settings_class_init (StSettingsClass *klass)
"GTK+ Icon Theme",
"",
G_PARAM_READABLE);
props[PROP_MAGNIFIER_ACTIVE] = g_param_spec_boolean("magnifier-active",
"Magnifier is active",
"Weather the a11y magnifier is active",
FALSE,
G_PARAM_READABLE);
g_object_class_install_properties (object_class, N_PROPS, props);
}
@@ -190,6 +202,18 @@ on_mouse_settings_changed (GSettings *g_settings,
}
}
static void
on_a11y_settings_changed (GSettings *g_settings,
const gchar *key,
StSettings *settings)
{
if (g_str_equal (key, KEY_MAGNIFIER_ACTIVE))
{
settings->magnifier_active = g_settings_get_boolean (g_settings, key);
g_object_notify_by_pspec (G_OBJECT (settings), props[PROP_MAGNIFIER_ACTIVE]);
}
}
static void
st_settings_init (StSettings *settings)
{
@@ -201,6 +225,10 @@ st_settings_init (StSettings *settings)
g_signal_connect (settings->interface_settings, "changed",
G_CALLBACK (on_mouse_settings_changed), settings);
settings->a11y_settings = g_settings_new ("org.gnome.desktop.a11y.applications");
g_signal_connect (settings->a11y_settings, "changed",
G_CALLBACK (on_a11y_settings_changed), settings);
settings->enable_animations = g_settings_get_boolean (settings->interface_settings,
KEY_ENABLE_ANIMATIONS);
settings->primary_paste = g_settings_get_boolean (settings->interface_settings,
@@ -211,6 +239,8 @@ st_settings_init (StSettings *settings)
KEY_GTK_ICON_THEME);
settings->drag_threshold = g_settings_get_int (settings->mouse_settings,
KEY_DRAG_THRESHOLD);
settings->magnifier_active = g_settings_get_boolean (settings->a11y_settings,
KEY_MAGNIFIER_ACTIVE);
}
/**

Some files were not shown because too many files have changed in this diff Show More