Compare commits

..

106 Commits

Author SHA1 Message Date
Matthias Clasen ceac8c6eab application: Bring back app menus
Being able to override the app menu is relevant on macOS, so
bring back the api needed to do that. All the machinery was
still around from when we stripped it before 4.0.
2024-04-19 14:25:36 -04:00
Matthias Clasen 3fac42fd3c Merge branch 'hint-font-metrics-redux' into 'main'
Add a new font rendering setting

See merge request GNOME/gtk!7113
2024-04-19 17:34:57 +00:00
Matthias Clasen 8f0b38b462 tests: Update for the new setting
One of our tests counts our settings. Not super-useful, but lets
keep it working.
2024-04-19 12:56:34 -04:00
Matthias Clasen 6c5a106d7e inspector: Show the font rendering setting
Replace the font options with the new font rendering setting.
The font options are still available for tweaking in the inspector
as properties of the GtkSettings object.
2024-04-19 12:56:34 -04:00
Matthias Clasen 5f7cab4632 Add a new font rendering setting
Add a high-level setting that gives us more freedom to tweak
font rendering knobs according to our needs. It has a 'manual'
value that lets users continue to influence font rendering using
the low-level font-related settings as before.

Once the schemas have this, we can support setting this session-wide.
See https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/79

The initial implementation of 'automatic' font rendering is fairly
simplistic: if the monitor dpi is less than 200, prefer sharpness,
so turn on metrics hinting and slight hinting. If the monitor dpi
is at least 200, we both off.
2024-04-19 12:56:34 -04:00
Matthias Clasen 558db5a3a7 settings: Allow enums as settings
We can easily handle this, and it makes such settings appear
more natural, e.g. in the inspector.
2024-04-19 12:56:34 -04:00
Matthias Clasen bc94b4f235 widget: Simplify our font options handling
Streamline the code that sets up pango contexts.

No functional change.
2024-04-19 09:39:52 -04:00
Matthias Clasen 4c809281b2 widget: Stop hardcoding hint-font-metrics
We used to hardcode hint-font-metrics = TRUE for unscaled
rendering. Stop doing that. Users should be able to decide
for themselves.
2024-04-19 09:19:53 -04:00
Matthias Clasen 81faf7caa3 settings: Change the default of hint-font-metrics
Change the default value to TRUE. This is because we want to stop
hardcoding this value for unscaled situations, but we don't want
to change everybody's font rendering.
2024-04-19 09:19:27 -04:00
Andi Chandler 7477e8626d Update British English translation
(cherry picked from commit e26c5945a9)
2024-04-18 22:44:51 +00:00
Matthias Clasen 47f30d208c Merge branch 'matthiasc/for-main' into 'main'
Add a missing deprecation note

See merge request GNOME/gtk!7152
2024-04-18 17:23:28 +00:00
Matthias Clasen 74a1c0916a Add a missing deprecation note
GdkVulkanContext is deprecated and only exposed in the api because
we need it as return type of the (deprecated)
gdk_surface_create_vulkan_context() API.
2024-04-18 12:49:18 -04:00
Matthias Clasen ee67edbe3a Merge branch 'matthiasc/for-main' into 'main'
inspector: Clean up refcounting in the recorder

Closes #6634

See merge request GNOME/gtk!7149
2024-04-18 00:33:17 +00:00
Matthias Clasen ec9cdb74ef gsk: Actually punch transparent holes
In a57f7e3935 I accidentally replaced { 0, 0, 0, 0 } with
GDK_RGBA_BLACK instead of GDK_RGBA_TRANSPARENT. Oops.

Fixes: #6634
2024-04-17 20:09:13 -04:00
Matthias Clasen ad0f9144ec inspector: Avoid writing settings back needlessly
We were a bit careless and were writing some values back to the
GtkSettings on init, possibly with rounding errors. Avoid that.
2024-04-17 19:02:57 -04:00
Matthias Clasen 3e8215a971 inspector: Cosmetics
Use GDK_RGBA macros instead of parsing colors from names for every
subsurface.
2024-04-17 16:53:52 -04:00
Matthias Clasen 8df7487e2a inspector: Clean up refcounting in the recorder
We were getting things mixed up here, and it was leading to crashes
when clicking around between frames.
2024-04-17 16:49:38 -04:00
Matthias Clasen 633692b53e NEWS: Updates 2024-04-17 15:34:26 -04:00
Matthias Clasen e0a5c65003 Merge branch 'black-background' into 'main'
Add GtkGraphicsOffload:black-background

See merge request GNOME/gtk!7147
2024-04-17 17:38:18 +00:00
Matthias Clasen e4753791c0 video: Use the black-background property
Instead of hardcoding a black background in the theme, use the
new property to tell the GtkGraphicsOffload widget to draw one.
2024-04-17 12:52:35 -04:00
Matthias Clasen a57f7e3935 graphicsoffload: Add a black-background property
This property allows explicit control over whether to draw
a black background behind offloaded content or not, instead
of relying on the theme background.
2024-04-17 12:52:03 -04:00
Matthias Clasen 8de5a94eb7 Merge branch 'fixwmhints' into 'main'
x11: Remove last_wmspec_check_time

Closes #6558

See merge request GNOME/gtk!7145
2024-04-17 15:31:26 +00:00
Matthias Clasen 88872d1986 Merge branch 'rgba-tweaks' into 'main'
Use our defines for color

See merge request GNOME/gtk!7144
2024-04-17 00:17:06 +00:00
oreo639 ab33b56ec9 x11: Remove last_wmspec_check_time
In fetch_net_wm_check_window(), before updating the wmspec_check_window, a
check is performed to verify a 15s difference between last_wmspec_check_time
and the current monotonic time.

The comment suggests that this check is done to ensure that it doesn't check
for a new check window repeatedly over and over again. While that was the case
origionally, currently the last_wmspec_check_time only gets updated when
wmspec_check_window is set, which is already checked earlier, making the time
check useless.

This check causes issues on cold boots where gtk4 applications are not able
to obtain the wmspec_check_window until 15 seconds after boot, making gtk
unable to check for extended wm_hints during that time.

Fixes: #6558
2024-04-16 12:35:00 -07:00
Matthias Clasen c37e88d561 Merge branch 'fix-typo' into 'main'
docs: Fix typo

See merge request GNOME/gtk!7146
2024-04-16 10:32:18 +00:00
Jan Willem 2638700435 Docs: Fix typo 2024-04-16 08:47:25 +00:00
Matthias Clasen 0a5a720fe1 Use gdkrgbaprivate.h in more places
This gets inline functions used where it matters.
2024-04-15 22:57:01 -04:00
Matthias Clasen 0e5f7601e4 Add some inline rgba functions
These are trivial enough to inline everywhere.
2024-04-15 22:57:01 -04:00
Matthias Clasen e583e823b5 Use our defines for color
We have GDK_RGBA_WHITE, GDK_RGBA_BLACK and GDK_RGBA_TRANSPARENT,
lets use it instead of open-coding it.
2024-04-15 22:57:01 -04:00
Matthias Clasen a96358046f Merge branch 'matthiasc/for-main' into 'main'
Drop another unwanted file

See merge request GNOME/gtk!7143
2024-04-16 02:21:26 +00:00
Matthias Clasen 40f26ea09b Drop another unwanted file 2024-04-15 21:40:52 -04:00
Matthias Clasen 71a7f0771b Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main

See merge request GNOME/gtk!7142
2024-04-16 01:32:29 +00:00
Matthias Clasen 00739718ab Drop unwanted files 2024-04-15 20:50:27 -04:00
Matthias Clasen 19881c8c06 NEWS: Updates 2024-04-15 20:50:27 -04:00
Matthias Clasen 8b0aae8536 Merge branch 'matthiasc/single-pixel-buffer' into 'main'
wayland: Use single-pixel buffer optimization for offload

See merge request GNOME/gtk!7136
2024-04-16 00:20:07 +00:00
Matthias Clasen fbe000734a wayland: Refuse offloading when we can't
If we have a subsurface with background, but no single-pixel
buffer support, refuse to offload.
2024-04-15 19:53:46 -04:00
Matthias Clasen 0c67b367ac subsurface: Tweak the attach implementation
Do the backend call before changing the stacking order in the
frontend. This is necessary so the backend can look at the current
stacking order to determine if it will change.
2024-04-15 19:53:46 -04:00
Matthias Clasen f75b4aac1d wayland: Minimize work for subsurfaces
Only commit things that have changed. In the ideal scenario, only
the texture changes from frame to frame, and all the sizing related
setup and the background stay the same, causing the least amount
of work in the compositor.
2024-04-15 19:53:46 -04:00
Matthias Clasen d563d158c0 subsurface: Add gdk_subsurface_get_sibling
This was just a missing getter. The backend implementation will
use this information to determine whether stacking changes.
2024-04-15 19:53:46 -04:00
Matthias Clasen 5c892fa4ea offload: Add more tests
Include background in offload tests.
2024-04-15 19:53:46 -04:00
Matthias Clasen 4aac64edf0 offload: Some renaming
Rename things to be more in line with the subsurface api.
2024-04-15 19:53:46 -04:00
Matthias Clasen c97bbfdfb1 offload: Use subsurface bounds for diffing
When adding the whole subsurface to the diff, use the subsurface
bounds, which takes both the texture and the background into
account.
2024-04-15 19:53:46 -04:00
Matthias Clasen a44598772d wayland: Use subsurface bounds for holes
When punching a hole into the opaque region, use the subsurface
bounds, which takes both the texture and the background into
account.
2024-04-15 19:53:46 -04:00
Matthias Clasen 933a0e5a98 subsurface: Some api revision and documentation
Rename things so they make more sense. The dest/source naming got
a bit unclear when we added background into the mix. Now we're going
for:

source_rect - the texture region to display
texture_rect - dimensions of the subsurface showing the texture
background_rect - dimensions of the background subsurface
bounds - union of texture_rect and background_rect

Also use this opportunity to add some api docs.
2024-04-15 19:53:46 -04:00
Matthias Clasen e33e9c506d theme: Move the black background of the video
We need the black inside the subsurface node for the single-pixel
optimization to work, so put it there.
2024-04-15 19:53:46 -04:00
Matthias Clasen 0108a5f56d offload: Use subsurface background optimization
Detect a black color node below the texture node and pass that
information to the subsurface, to take advange of the single-pixel
buffer optimization.

To make this work, we need to stop using the bounds of the subsurface
node for sizing the offload, and instead use either the clip or
the texture node for that.
2024-04-15 19:53:46 -04:00
Matthias Clasen c995473407 Add more subsurface tests
Add some more tests for the basic functioning of the subsurface API.
2024-04-15 19:53:46 -04:00
Matthias Clasen 3f9bdaa4c8 Add background to subsurfaces
Make it possible for subsurfaces to have a black background on a
secondary subsurface below the actual subsurface. Using a single-pixel
buffer for that background increases the changes that the compositor
will use direct scanout for the actual subsurface.

This changes the private subsurface API. All callers have been
updated to pass an empty background rect.
2024-04-15 19:53:46 -04:00
Robert Mader a70998aa50 wayland: Support the single-pixel-buffer protocol
This just gets the manager object. It is not used yet.
2024-04-15 19:53:46 -04:00
Matthias Clasen 0fb1f44eec gdk: Add a debug flag to allow non-dmabuf offload
This is useful for debugging offloading without having to rely
on gstreamer giving us dmabufs. To use it, set

GDK_DEBUG=force-offload

in the environment.
2024-04-15 19:53:46 -04:00
Matthias Clasen 26cc96bb7f testsuite: Cosmetics
Correct a debug message.
2024-04-15 19:53:46 -04:00
Matthias Clasen 1c8b22cf05 subsurface: Cosmetics 2024-04-15 19:53:46 -04:00
Matthias Clasen abbbd08931 Merge branch 'ebassi/docs-contributing' into 'main'
docs: Update contribution guide

See merge request GNOME/gtk!7141
2024-04-15 12:41:18 +00:00
Matthias Clasen 587cf28dd3 Merge branch 'rendernode-tool-pdf' into 'main'
rendernode-tool: add support for rendering to PDF

See merge request GNOME/gtk!7140
2024-04-15 10:58:36 +00:00
Emmanuele Bassi 53231a137c docs: Update contribution guide
- Fix link to the security policy
- Drop the confusing note about SSH access (with the old URL)
- Use modern idiomatic Meson subcommands for configuring and building
- Use `git switch` instead of `git checkout`
- Specify that you should always use merge requests, not patches
- Link to the handbook instead of the wiki
2024-04-15 11:56:13 +01:00
Christian Hergert 104a264d8b rendernode-tool: add support for rendering to PDF 2024-04-14 22:29:52 -07:00
Anders Jonsson 75fd582b97 Update Swedish translation
(cherry picked from commit f920f51300)
2024-04-14 11:22:05 +00:00
Matthias Clasen 89977412e9 Merge branch 'matthiasc/for-main' into 'main'
gsk: Fix a minor type mismatch

Closes #6628

See merge request GNOME/gtk!7138
2024-04-14 02:51:45 +00:00
Matthias Clasen ce030b1b36 gsk: Fix a minor type mismatch
Use the same types in the declaration of gsk_standard_contour_init.

Fixes: #6628
2024-04-13 22:28:48 -04:00
Matthias Clasen 6c5dc8cd1f Merge branch 'matthiasc/for-main' into 'main'
wayland: Cosmetics

See merge request GNOME/gtk!7137
2024-04-13 21:56:27 +00:00
Matthias Clasen fb4b38e5ea inspector: Fix a bunch of memory leaks
g_list_store_append is *not* transfer full. Oops.
2024-04-13 17:22:42 -04:00
Matthias Clasen fc405f8882 wayland: Cosmetics
Don't clear the same pointer twice.
2024-04-13 17:22:42 -04:00
Benjamin Otte afe61e28e0 Merge branch 'wip/p3732/no-additional-grid-tile' into 'main'
grid-view: make footer tile file empty space

Closes #6076

See merge request GNOME/gtk!6370
2024-04-13 15:35:43 +00:00
Peter Eisenmann 4f3f3c9ae2 grid-view: make footer tile file empty space 2024-04-13 15:35:42 +00:00
Matthias Clasen e699685003 Merge branch 'mr7057-preparation' into 'main'
gdk/wayland: Make the surface handle empty commits

See merge request GNOME/gtk!7133
2024-04-12 15:54:33 +00:00
Robert Mader 9583195e96 gdk/wayland: Make the surface handle empty commits
In order to avoid some code duplication and ensure the Cairo and
Vulkan implementations behave like the GL one.
2024-04-12 17:04:54 +02:00
Matthias Clasen a526f0770e Merge branch 'warning-fix' into 'main'
gdk/gsk: Fix a couple of maybe-uninitialized warnings

See merge request GNOME/gtk!7132
2024-04-12 11:55:04 +00:00
Philip Withnall 707e492f0d gsk: Fix a maybe-uninitialized warning
The compiler (gcc 13.2) thinks that `t` could be used uninitialised.
That’s obviously not the case, because there’s always going to be at
least one loop iteration due to the initial values of `t1` and `t2`.

Change the loop to a `do…while` to make that a bit clearer to the
compiler without making any functional changes to the code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-04-12 12:08:03 +01:00
Philip Withnall 680dba6524 gdk: Fix a maybe-uninitialized warning
If there somehow end up being no `supported_versions`, `ctx` would end
up being dereferenced before being initialised. While I think that’s
unlikely, the compiler doesn’t know that, so let’s just initialise the
variable unconditionally.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-04-12 12:03:29 +01:00
Matthias Clasen d1bb1d091c Merge branch 'gdk-build-dep-fix' into 'main'
build: Add a missing dependency

Closes #6618

See merge request GNOME/gtk!7127
2024-04-11 20:57:34 +00:00
Matthias Clasen 6510b876d1 build: Add a missing dependency
Add the generated gdk headers to the sources for all the backends,
to guarantee that they are generated before the library is used.

Fixes: #6618
2024-04-11 15:47:38 -04:00
Matthias Clasen e376941e49 Merge branch 'scrollbar_accessible_range' into 'main'
a11y: Implement GtkAccessibleRange for scrollbars

Closes gnome-control-center#2994

See merge request GNOME/gtk!7129
2024-04-11 18:20:49 +00:00
Matthias Clasen 4889199b14 Merge branch 'glarea-dispose-fix' into 'main'
dmabuf texture: Survive multiple disposes

Closes #6623

See merge request GNOME/gtk!7131
2024-04-11 18:20:12 +00:00
Luca Bacci 2e15225446 Merge branch 'remove-work-arounds' into 'main'
GdkWin32: Remove some work arounds that are not needed anymore

Closes #6614

See merge request GNOME/gtk!7114
2024-04-11 17:03:08 +00:00
Matthias Clasen 9dad71513c glarea: Clean up dispose
We were getting our gl and dmabuf texture mixed up and ending
up freeing the Texture structs while they were still used as
callback data for dmabuf texture destroys. Avoid that by keeping
separate pointers for the gl and dmabuf textures.

Fixes: #6623
2024-04-11 12:48:01 -04:00
Matthias Clasen ed072b4b5d dmabuf texture: Survive multiple disposes
dispose can be called more than once, so be safe for that.
2024-04-11 12:45:24 -04:00
Boyuan Yang 7ffc4e0a21 Update Chinese (China) translation 2024-04-11 15:46:08 +00:00
Emmanuele Bassi b9403f4f5b Apply review suggestions 2024-04-11 14:04:12 +00:00
Lukáš Tyrychtr 9f1aa3141b a11y: Implement GtkAccessibleRange for scrollbars
Fixes gnome-control-center#2994
2024-04-11 14:25:42 +02:00
Matthias Clasen 06e905f87d Merge branch 'gtk-wlmod' into 'main'
Meson: Use wayland module

See merge request GNOME/gtk!7126
2024-04-11 01:29:29 +00:00
Xavier Claessens 2ba8dcebff Apply 1 suggestion(s) to 1 file(s) 2024-04-10 15:52:42 +00:00
Xavier Claessens 95a8def7c2 Meson: Use wayland module 2024-04-10 11:43:04 -04:00
Matthias Clasen 777799070d Merge branch 'simplify_widget_accessible_get_bounds' into 'main'
a11y: Simplify GtkWidget's GtkAccessible.get_bounds implementation

See merge request GNOME/gtk!7128
2024-04-10 15:40:44 +00:00
Lukáš Tyrychtr 0f83a9550b Proper rounding 2024-04-10 15:46:39 +02:00
Lukáš Tyrychtr 17f2443350 a11y: Simplify GtkWidget's GtkAccessible.get_bounds implementation
We can use the result from gtk_widget_get_bounds for the coordinates as well.
2024-04-10 15:32:16 +02:00
Matthias Clasen 6bfc995097 Merge branch 'matthiasc/for-main' into 'main'
docs: Update some links

See merge request GNOME/gtk!7125
2024-04-10 01:04:14 +00:00
Matthias Clasen 8068111c6e Merge branch 'fix-xi2-input-source-type-debug-msg' into 'main'
xi2: Fix incorrect input source type in Input debug message

Closes #6619

See merge request GNOME/gtk!7120
2024-04-10 00:45:14 +00:00
Matthias Clasen 6e1c47b021 Merge branch 'improve_gtkeditabledelegate_docs' into 'main'
GtkEditable: Document the usage restrictions of gtk_editable_delegate_get_accessible_platform_state

See merge request GNOME/gtk!5691
2024-04-10 00:36:44 +00:00
Matthias Clasen aed4ced032 Merge branch 'broadway-port-2972-3130' into 'main'
[gtk4] gdk/broadway: Port !2972 and !3130 from gtk3

See merge request GNOME/gtk!4467
2024-04-10 00:12:28 +00:00
Matthias Clasen 96160ea5dc docs: Update some links
Use docs.gtk.org for all the documentation that is hosted there.
2024-04-09 20:00:00 -04:00
Matthias Clasen c76c07ddfe Merge branch 'matthiasc/for-main' into 'main'
testsuite: Cosmetics

See merge request GNOME/gtk!7124
2024-04-09 23:41:01 +00:00
Matthias Clasen 7b82dc7ac5 inspector: Show monitor resolution 2024-04-09 19:14:01 -04:00
Matthias Clasen a63e9d38fb gdk: Add private convenience api
Add a function to get the monitor resolution.

We may use this information in the future to make font rendering
decisions.
2024-04-09 19:13:34 -04:00
Matthias Clasen cc8db1805d gsk: Be safer against bad font options
Some combinations of hint-style and hint-metrics lead to bad glyph
placement in the glyph cache, so avoid them.
2024-04-09 19:12:49 -04:00
Matthias Clasen 948532f3c9 Deprecate gtk_widget_set/get_font_options
cairo font options are too low-level, and setting them directly
prevents us from doing smarter things for font rendering.
2024-04-09 19:12:41 -04:00
Matthias Clasen 8f39f8d827 testsuite: Add another test
This test checks that pango attributes can be specified in serialized
form.
2024-04-09 19:06:31 -04:00
Matthias Clasen 5e28c05121 testsuite: Cosmetics
Make the builder parser test less verbose.
2024-04-09 19:06:12 -04:00
Matthias Clasen 32d15a5858 Merge branch 'builder-gtkshortcutaction-warning' into 'main'
builder: Show warning for invalid action on GtkShortcut

See merge request GNOME/gtk!7121
2024-04-09 20:36:59 +00:00
Matthijs Velsink c0b813940e builder: Show warning for invalid action on GtkShortcut
The parsing for a `GTK_TYPE_SHORTCUT_ACTION` on a GtkShortcut in a
builder file can fail, resulting in a `NULL` GtkShortcutAction. This
currently does not result in any warnings, potentially making typos in
builder files tricky to debug.

Since `gtk_shortcut_action_parse_builder()` already sets an error if it
fails, we can just use that and simply return false.
2024-04-09 02:41:57 +02:00
Hansem Ro d90dc7f75e xi2: Fix incorrect input source type in Input debug message
This drops cursor and eraser source names to account for their removal
from GdkInputSource so that GDK_DEBUG=input debug message correctly
prints source type in X11 environment.

Fixes: c1d90273 ("gdk: Drop GDK_SOURCE_ERASER")
Fixes: 3285f52d ("gdk: Drop GDK_SOURCE_CURSOR")
Closes: #6619
2024-04-08 10:15:00 -07:00
Luca Bacci 3c94e91e5e GdkWin32: Do not clear surface contents when restoring from minimize
The code does not work anyway since we dropped WS_EX_LAYERED windows.
2024-04-06 10:58:40 +02:00
Luca Bacci 8a1bee1d79 GdkWin32: Don't explicitly set the transient owner as active
...when a transient child is hidden.

The system does that automatically
2024-04-06 10:58:25 +02:00
Luca Bacci 9297439de4 GdkWin32: Remove some work arounds that are not needed anymore
2cc650ce was added to work around some of the regressions
introduced by 79557271, but that commit was finally reverted
in 43476c09.

We can now revert 2cc650ce as well.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6614
2024-04-06 10:44:02 +02:00
Lukáš Tyrychtr 02cdb36421 Document what to do if the preconditions can not be met 2023-05-22 12:22:18 +02:00
Lukáš Tyrychtr b3d4d70bc1 GtkEditable: Document the usage restrictions of gtk_editable_delegate_get_accessible_platform_state
The API is not always useful, because it depends on the position of the
delegated to widget in the widget tree, so document that.
2023-05-22 12:22:18 +02:00
Maxim Zakharov 715c0bfc0a gdk/broadway: Port !2972 and !3130 from gtk3
!2972 fixes touchscreen events processing
 !3130 adds support for Android/Chrome on-screen keyboard
2022-02-11 09:29:57 +11:00
90 changed files with 2385 additions and 1318 deletions
+9 -14
View File
@@ -35,7 +35,7 @@ The issue tracker is meant to be used for actionable issues only.
You should not open a new issue for security related questions.
When in doubt, follow [security](https://security.gnome.org/).
When in doubt, follow the process for [GNOME security issues](https://security.gnome.org/).
### Bug reports
@@ -144,33 +144,28 @@ $ git clone https://gitlab.gnome.org/yourusername/gtk.git
$ cd gtk
```
**Note**: if you plan to push changes to back to the main repository and
have a GNOME account, you can skip the fork, and use the following instead:
```sh
$ git clone git@gitlab.gnome.org:GNOME/gtk.git
$ cd gtk
```
To compile the Git version of GTK on your system, you will need to
configure your build using Meson:
```sh
$ meson _builddir .
$ cd _builddir
$ ninja
$ meson setup _builddir .
$ meson compile -C _builddir
```
Typically, you should work on your own branch:
```sh
$ git checkout -b your-branch
$ git switch -C your-branch
```
Once you've finished working on the bug fix or feature, push the branch
to the Git repository and open a new merge request, to let the GTK
maintainers review your contribution.
**Important**: Do **not** attach a diff or a patch file to a GitLab issue.
Patches cannot be reviewed, and do not not go through the CI pipeline. If
you wish to submit your changes to GTK, always use a merge request.
### Code reviews
Each contribution is reviewed by the core developers of the GTK project.
@@ -262,4 +257,4 @@ people committing to GTK to follow a few rules:
If you have been contributing to GTK for a while and you don't have commit
access to the repository, you may ask to obtain it following the [GNOME account
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).
process](https://handbook.gnome.org/infrastructure/developer-access.html).
+62
View File
@@ -1,6 +1,68 @@
Overview of Changes in 4.15.0, xx-xx-xxxx
=========================================
* GtkShortcutManager:
- Track the propagation phase of added controllers
* GtkGLArea:
- Produce dmabuf textures, so graphics offload is possible
* GtkGraphicsOffload:
- Add a black-background property
* Accessibility:
- Add support for GetRangeExtents to GtkAccessibleText
- Add support for GetOffsetAtPoint to GtkAccessibleText
- Implement GtkAccessibleRange for scrollbars
* GDK:
- Add a callback-based cursor API
* GSK:
- Avoid an infinite recursion with offscreens in some cases
- Optimize graphics offload to make it more likely that compositors
can use direct scanout
* X11:
- Fix some confusing debug messages
- Drop a no-longer-relevant optimization that was interfering with
getting the current window manager capabilities
* macOS:
- Implement the color picker for macOS 10.15+
* Debugging:
- Snow monitor resolution in the inspector
* Demos:
- Use graphics offload in the shadertoy demo
- Show more reliable fps numbers in the fishbowl demo
* Tools:
- Support generating pdf in gtk4-rendernode-tool
* Build:
- Require pango 1.52
- Require cairo 1.18
- Add a missing dependency that was causing build failures
* Deprecations:
- gdk_widget_set/get_font_options
* Translation updates:
Basque
Brazilian Portuguese
Chinese (China)
Hebrew
Kabyle
Persian
Polish
Russian
Slovenian
Swedish
Turkish
Overview of Changes in 4.14.2, 03-04-2024
=========================================
+5 -5
View File
@@ -58,12 +58,12 @@ GTK is divided into three parts:
storage types for efficient use in GUI applications, and much more.
[gnu-lgpl]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
[glib]: https://developer.gnome.org/glib/stable/
[gobject]: https://developer.gnome.org/gobject/stable/
[gio]: https://developer.gnome.org/gio/stable/
[glib]: https://docs.gtk.org/glib/
[gobject]: https://docs.gtk.org/gobject/
[gio]: https://docs.gtk.org/gio/
[cairo]: https://www.cairographics.org/manual/
[opengl]: https://www.opengl.org/about/
[vulkan]: https://www.vulkan.org/
[pango]: https://pango.gnome.org/
[gdkpixbuf]: https://developer.gnome.org/gdk-pixbuf/stable/
[pango]: https://docs.gtk.org/pango/
[gdkpixbuf]: https://docs.gtk.org/gdk-pixbuf/
[graphene]: https://ebassi.github.io/graphene/
+4
View File
@@ -217,6 +217,10 @@ A number of options affect behavior instead of logging:
`no-portals`
: Disable use of [portals](https://docs.flatpak.org/en/latest/portals.html)
`force-offload`
: Force graphics offload for all textures, even when slower. This allows
to debug offloading in the absence of dmabufs.
`gl-disable`
: Disable OpenGL support
+132 -17
View File
@@ -91,6 +91,31 @@ const GDK_META_MASK = 1 << 28;
var useDataUrls = window.location.search.includes("datauri");
/* check if we are on Android and using Chrome */
var isAndroidChrome = false;
{
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("android") > -1 && ua.indexOf("chrom") > -1) {
isAndroidChrome = true;
}
}
/* check for the passive option for Event listener */
let passiveSupported = false;
try {
const options = {
get passive() { // This function will be called when the browser
// attempts to access the passive property.
passiveSupported = true;
return false;
}
};
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch(err) {
passiveSupported = false;
}
/* This base64code is based on https://github.com/beatgammit/base64-js/blob/master/index.js which is MIT licensed */
var b64_lookup = [];
@@ -215,11 +240,32 @@ function logStackTrace(len) {
log(callstack[i]);
}
/* Helper functions for touch identifier to make it unique on Android */
var globalTouchIdentifier = Math.round(Date.now() / 1000);
function touchIdentifierStart(tId)
{
if (isAndroidChrome) {
if (tId == 0) {
return ++globalTouchIdentifier;
}
return globalTouchIdentifier + tId;
}
return tId;
}
function touchIdentifier(tId)
{
if (isAndroidChrome) {
return globalTouchIdentifier + tId;
}
return tId;
}
var grab = new Object();
grab.surface = null;
grab.ownerEvents = false;
grab.implicit = false;
var keyDownList = [];
var inputList = [];
var lastSerial = 0;
var lastX = 0;
var lastY = 0;
@@ -987,7 +1033,14 @@ function handleDisplayCommands(display_commands)
break;
case DISPLAY_OP_DELETE_SURFACE:
var id = cmd[1];
delete surfaces[id];
if (id == surfaceWithMouse) {
surfaceWithMouse = 0;
}
if (id == realSurfaceWithMouse) {
realSurfaceWithMouse = 0;
firstTouchDownId = null;
}
delete surfaces[id];
break;
case DISPLAY_OP_CHANGE_TEXTURE:
var image = cmd[1];
@@ -1371,8 +1424,14 @@ function getEffectiveEventTarget (id) {
function updateKeyboardStatus() {
if (fakeInput != null && showKeyboardChanged) {
showKeyboardChanged = false;
if (showKeyboard)
if (showKeyboard) {
if (isAndroidChrome) {
fakeInput.blur();
fakeInput.value = ' '.repeat(80); // TODO: Should be exchange with broadway server
// to bring real value here.
}
fakeInput.focus();
}
else
fakeInput.blur();
}
@@ -2924,6 +2983,19 @@ function pushKeyEvent(fev) {
keyDownList.push(fev);
}
function copyInputEvent(ev) {
var members = ['inputType', 'data'], i, obj = {};
for (i = 0; i < members.length; i++) {
if (typeof ev[members[i]] !== "undefined")
obj[members[i]] = ev[members[i]];
}
return obj;
}
function pushInputEvent(fev) {
inputList.push(fev);
}
function getKeyEvent(keyCode, pop) {
var i, fev = null;
for (i = keyDownList.length-1; i >= 0; i--) {
@@ -3022,6 +3094,29 @@ function handleKeyUp(e) {
keysym = fev.keysym;
else {
//log("Key event (keyCode = " + ev.keyCode + ") not found on keyDownList");
if (isAndroidChrome && (ev.keyCode == 229)) {
var i, fev = null, len = inputList.length, str;
for (i = 0; i < len; i++) {
fev = inputList[i];
switch(fev.inputType) {
case "deleteContentBackward":
sendInput(BROADWAY_EVENT_KEY_PRESS, [65288, lastState]);
sendInput(BROADWAY_EVENT_KEY_RELEASE, [65288, lastState]);
break;
case "insertText":
if (fev.data !== undefined) {
for (let sym of fev.data) {
sendInput(BROADWAY_EVENT_KEY_PRESS, [sym.codePointAt(0), lastState]);
sendInput(BROADWAY_EVENT_KEY_RELEASE, [sym.codePointAt(0), lastState]);
}
}
break;
default:
break;
}
}
inputList.splice(0, len);
}
keysym = 0;
}
@@ -3030,6 +3125,16 @@ function handleKeyUp(e) {
return cancelEvent(ev);
}
function handleInput (e) {
var fev = null, ev = (e ? e : window.event), keysym = null, suppress = false;
fev = copyInputEvent(ev);
pushInputEvent(fev);
// Stop keypress events just in case
return cancelEvent(ev);
}
function onKeyDown (ev) {
updateForEvent(ev);
return handleKeyDown(ev);
@@ -3045,6 +3150,11 @@ function onKeyUp (ev) {
return handleKeyUp(ev);
}
function onInput (ev) {
updateForEvent(ev);
return handleInput(ev);
}
function cancelEvent(ev)
{
ev = ev ? ev : window.event;
@@ -3076,13 +3186,14 @@ function onMouseWheel(ev)
}
function onTouchStart(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifierStart(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
@@ -3090,7 +3201,7 @@ function onTouchStart(ev) {
var isEmulated = 0;
if (firstTouchDownId == null) {
firstTouchDownId = touch.identifier;
firstTouchDownId = touchId;
isEmulated = 1;
if (realSurfaceWithMouse != origId || id != surfaceWithMouse) {
@@ -3105,52 +3216,54 @@ function onTouchStart(ev) {
}
}
sendInput (BROADWAY_EVENT_TOUCH, [0, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput (BROADWAY_EVENT_TOUCH, [0, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchMove(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
}
sendInput (BROADWAY_EVENT_TOUCH, [1, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput (BROADWAY_EVENT_TOUCH, [1, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchEnd(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
firstTouchDownId = null;
}
sendInput (BROADWAY_EVENT_TOUCH, [2, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput (BROADWAY_EVENT_TOUCH, [2, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
@@ -3167,11 +3280,11 @@ function setupDocument(document)
document.onkeyup = onKeyUp;
if (document.addEventListener) {
document.addEventListener('DOMMouseScroll', onMouseWheel, false);
document.addEventListener('mousewheel', onMouseWheel, false);
document.addEventListener('touchstart', onTouchStart, false);
document.addEventListener('touchmove', onTouchMove, false);
document.addEventListener('touchend', onTouchEnd, false);
document.addEventListener('DOMMouseScroll', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('mousewheel', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchstart', onTouchStart, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchmove', onTouchMove, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchend', onTouchEnd, passiveSupported ? { passive: false, capture: false } : false);
} else if (document.attachEvent) {
element.attachEvent("onmousewheel", onMouseWheel);
}
@@ -3237,12 +3350,14 @@ function connect()
};
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
if (iOS) {
if (iOS || isAndroidChrome) {
fakeInput = document.createElement("input");
fakeInput.type = "text";
fakeInput.style.position = "absolute";
fakeInput.style.left = "-1000px";
fakeInput.style.top = "-1000px";
document.body.appendChild(fakeInput);
if (isAndroidChrome)
fakeInput.addEventListener('input', onInput, passiveSupported ? { passive: false, capture: false } : false);
}
}
+1 -2
View File
@@ -52,8 +52,7 @@ broadwayjs_h = custom_target('broadwayjs.h',
)
libgdk_broadway = static_library('gdk-broadway',
clienthtml_h, broadwayjs_h,
gdk_broadway_sources, gdkconfig, gdkenum_h,
sources: [ clienthtml_h, broadwayjs_h, gdk_broadway_sources, gdk_gen_headers ],
include_directories: [confinc, gdkinc],
c_args: [
'-DGTK_COMPILATION',
+1
View File
@@ -122,6 +122,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
{ "force-offload", GDK_DEBUG_FORCE_OFFLOAD, "Force graphics offload for all textures" },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
+1 -1
View File
@@ -44,7 +44,7 @@ typedef enum {
GDK_DEBUG_NO_PORTALS = 1 << 15,
GDK_DEBUG_GL_DISABLE = 1 << 16,
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
GDK_DEBUG_FORCE_OFFLOAD = 1 << 18,
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
GDK_DEBUG_GL_PREFER_GL = 1 << 21,
+4 -1
View File
@@ -72,7 +72,10 @@ gdk_dmabuf_texture_dispose (GObject *object)
GdkDmabufTexture *self = GDK_DMABUF_TEXTURE (object);
if (self->destroy)
self->destroy (self->data);
{
self->destroy (self->data);
self->destroy = NULL;
}
g_clear_object (&self->downloader);
g_clear_object (&self->display);
+8
View File
@@ -744,3 +744,11 @@ gdk_monitor_set_description (GdkMonitor *monitor,
g_object_notify_by_pspec (G_OBJECT (monitor), props[PROP_DESCRIPTION]);
}
#define MM_PER_INCH 25.4
double
gdk_monitor_get_dpi (GdkMonitor *monitor)
{
return MAX ((monitor->geometry.width * monitor->scale) / (monitor->width_mm / MM_PER_INCH),
(monitor->geometry.height * monitor->scale) / (monitor->height_mm / MM_PER_INCH));
}
+1
View File
@@ -76,6 +76,7 @@ void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
void gdk_monitor_invalidate (GdkMonitor *monitor);
void gdk_monitor_set_description (GdkMonitor *monitor,
const char *description);
double gdk_monitor_get_dpi (GdkMonitor *monitor);
G_END_DECLS
+7 -18
View File
@@ -98,9 +98,9 @@ gdk_rgba_free (GdkRGBA *rgba)
* Returns: %TRUE if the @rgba is clear
*/
gboolean
gdk_rgba_is_clear (const GdkRGBA *rgba)
(gdk_rgba_is_clear) (const GdkRGBA *rgba)
{
return rgba->alpha < ((float) 0x00ff / (float) 0xffff);
return _gdk_rgba_is_clear (rgba);
}
/**
@@ -115,9 +115,9 @@ gdk_rgba_is_clear (const GdkRGBA *rgba)
* Returns: %TRUE if the @rgba is opaque
*/
gboolean
gdk_rgba_is_opaque (const GdkRGBA *rgba)
(gdk_rgba_is_opaque) (const GdkRGBA *rgba)
{
return rgba->alpha > ((float)0xff00 / (float)0xffff);
return _gdk_rgba_is_opaque (rgba);
}
#define SKIP_WHITESPACES(s) while (*(s) == ' ') (s)++;
@@ -368,21 +368,10 @@ gdk_rgba_hash (gconstpointer p)
* Returns: %TRUE if the two colors compare equal
*/
gboolean
gdk_rgba_equal (gconstpointer p1,
gconstpointer p2)
(gdk_rgba_equal) (gconstpointer p1,
gconstpointer p2)
{
const GdkRGBA *rgba1, *rgba2;
rgba1 = p1;
rgba2 = p2;
if (rgba1->red == rgba2->red &&
rgba1->green == rgba2->green &&
rgba1->blue == rgba2->blue &&
rgba1->alpha == rgba2->alpha)
return TRUE;
return FALSE;
return _gdk_rgba_equal (p1, p2);
}
/**
+29
View File
@@ -43,5 +43,34 @@
gboolean gdk_rgba_parser_parse (GtkCssParser *parser,
GdkRGBA *rgba);
#define gdk_rgba_is_clear(rgba) _gdk_rgba_is_clear (rgba)
#define gdk_rgba_is_opaque(rgba) _gdk_rgba_is_opaque (rgba)
#define gdk_rgba_equal(p1, p2) _gdk_rgba_equal (p1, p2)
static inline gboolean
_gdk_rgba_is_clear (const GdkRGBA *rgba)
{
return rgba->alpha < ((float) 0x00ff / (float) 0xffff);
}
static inline gboolean
_gdk_rgba_is_opaque (const GdkRGBA *rgba)
{
return rgba->alpha > ((float)0xff00 / (float)0xffff);
}
static inline gboolean
_gdk_rgba_equal (gconstpointer p1,
gconstpointer p2)
{
const GdkRGBA *rgba1 = p1;
const GdkRGBA *rgba2 = p2;
return rgba1->red == rgba2->red &&
rgba1->green == rgba2->green &&
rgba1->blue == rgba2->blue &&
rgba1->alpha == rgba2->alpha;
}
G_END_DECLS
+162 -13
View File
@@ -48,6 +48,14 @@ gdk_subsurface_class_init (GdkSubsurfaceClass *class)
object_class->finalize = gdk_subsurface_finalize;
}
/*< private >
* gdk_subsurface_get_parent:
* @subsurface: a `GdkSubsurface`
*
* Returns the parent surface of @subsurface.
*
* Returns: the parent surface
*/
GdkSurface *
gdk_subsurface_get_parent (GdkSubsurface *subsurface)
{
@@ -108,17 +116,41 @@ insert_subsurface (GdkSubsurface *subsurface,
}
}
/*< private >
* gdk_subsurface_attach:
* @subsurface: the `GdkSubsurface`
* @texture: the texture to attach. This typically has to be a `GdkDmabufTexture`
* @source: the source rectangle (i.e. the subset of the texture) to display
* @dest: the dest rectangle, in application pixels, relative to the parent surface.
* It must be integral in application and device pixels, or attaching will fail
* @transform: the transform to apply to the texture contents before displaying
* @background: (nullable): the background rectangle, in application pixels relative
* to the parent surface. This tells GDK to put a black background of this
* size below the subsurface. It must be integral in application and device pixels,
* or attaching will fail
* @above: whether the subsurface should be above its sibling
* @sibling: (nullable): the sibling subsurface to stack relative to, or `NULL` to
* stack relative to the parent surface
*
* Attaches content to a subsurface.
*
* This function takes all the necessary arguments to determine the subsurface
* configuration, including its position, size, content, background and stacking.
*
* Returns: `TRUE` if the attaching succeeded
*/
gboolean
gdk_subsurface_attach (GdkSubsurface *subsurface,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
gboolean lightbox,
const graphene_rect_t *background,
gboolean above,
GdkSubsurface *sibling)
{
GdkSurface *parent = subsurface->parent;
gboolean result;
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
g_return_val_if_fail (GDK_IS_TEXTURE (texture), FALSE);
@@ -132,6 +164,15 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
g_return_val_if_fail (sibling == NULL || sibling->parent == subsurface->parent, FALSE);
result = GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface,
texture,
source,
dest,
transform,
background,
above,
sibling);
remove_subsurface (subsurface);
if (sibling)
@@ -157,9 +198,17 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
}
}
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, source, dest, transform, lightbox, above, sibling);
return result;
}
/*< private >
* gdk_subsurface_detach:
* @subsurface: a `GdkSubsurface`
*
* Hides the subsurface.
*
* To show it again, you need to call gdk_subsurface_attach().
*/
void
gdk_subsurface_detach (GdkSubsurface *subsurface)
{
@@ -170,6 +219,14 @@ gdk_subsurface_detach (GdkSubsurface *subsurface)
GDK_SUBSURFACE_GET_CLASS (subsurface)->detach (subsurface);
}
/*< private >
* gdk_subsurface_get_texture:
* @subsurface: a `GdkSubsurface`
*
* Gets the texture that is currently displayed by the subsurface.
*
* Returns: (nullable): the texture that is displayed
*/
GdkTexture *
gdk_subsurface_get_texture (GdkSubsurface *subsurface)
{
@@ -178,34 +235,91 @@ gdk_subsurface_get_texture (GdkSubsurface *subsurface)
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_texture (subsurface);
}
/*< private >
* gdk_subsurface_get_source_rect:
* @subsurface: a `GdkSubsurface`
* @rect: (out caller-allocates): return location for the rectangle
*
* Returns the source rect that was specified in the most recent
* gdk_subsurface_attach() call for @subsurface.
*/
void
gdk_subsurface_get_source (GdkSubsurface *subsurface,
graphene_rect_t *source)
gdk_subsurface_get_source_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect)
{
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
g_return_if_fail (source != NULL);
g_return_if_fail (rect != NULL);
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_source (subsurface, source);
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_source_rect (subsurface, rect);
}
/*< private >
* gdk_subsurface_get_texture_rect:
* @subsurface: a `GdkSubsurface`
* @rect: (out caller-allocates): return location for the rectangle
*
* Returns the texture rect that was specified in the most recent
* gdk_subsurface_attach() call for @subsurface.
*/
void
gdk_subsurface_get_dest (GdkSubsurface *subsurface,
graphene_rect_t *dest)
gdk_subsurface_get_texture_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect)
{
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
g_return_if_fail (dest != NULL);
g_return_if_fail (rect != NULL);
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_dest (subsurface, dest);
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_texture_rect (subsurface, rect);
}
/*< private >
* gdk_subsurface_is_above_parent:
* @subsurface: a `GdkSubsurface`
*
* Returns whether the subsurface is above the parent surface
* or below. Note that a subsurface can be above its parent
* surface, and still be covered by sibling subsurfaces.
*
* Returns: `TRUE` if @subsurface is above its parent
*/
gboolean
gdk_subsurface_is_above_parent (GdkSubsurface *subsurface)
{
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), TRUE);
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
return subsurface->above_parent;
}
/*< private>
* gdk_subsurface_get_sibling:
* @subsurface: the `GdkSubsurface`
* @above: whether to get the subsurface above
*
* Returns the subsurface above (or below) @subsurface in
* the stacking order.
*
* Returns: the sibling, or `NULL` if there is none.
*/
GdkSubsurface *
gdk_subsurface_get_sibling (GdkSubsurface *subsurface,
gboolean above)
{
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), NULL);
if (above)
return subsurface->sibling_above;
else
return subsurface->sibling_below;
}
/*< private >
* gdk_subsurface_get_transform:
* @subsurface: a `GdkSubsurface`
*
* Returns the transform that was specified in the most recent call to
* gdk_subsurface_attach() call for @subsurface.
*
* Returns: the transform
*/
GdkTextureTransform
gdk_subsurface_get_transform (GdkSubsurface *subsurface)
{
@@ -214,10 +328,45 @@ gdk_subsurface_get_transform (GdkSubsurface *subsurface)
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_transform (subsurface);
}
/*< private >
* gdk_subsurface_get_background_rect:
* @subsurface: a `GdkSubsurface`
* @rect: (out caller-allocates): return location for the rectangle
*
* Obtains the background rect that was specified in the most recent
* gdk_subsurface_attach() call for @subsurface.
*
* Returns: `TRUE` if @subsurface has a background
*/
gboolean
gdk_subsurface_get_lightbox (GdkSubsurface *subsurface)
gdk_subsurface_get_background_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect)
{
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
g_return_val_if_fail (rect != NULL, FALSE);
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_lightbox (subsurface);
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_background_rect (subsurface, rect);
}
/*< private >
* gdk_subsurface_get_bounds:
* @subsurface: a `GdkSubsurface`
* @bounds: (out caller-allocates): return location for the bounds
*
* Returns the bounds of the subsurface.
*
* The bounds are the union of the texture and background rects.
*/
void
gdk_subsurface_get_bounds (GdkSubsurface *subsurface,
graphene_rect_t *bounds)
{
graphene_rect_t background;
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
g_return_if_fail (bounds != NULL);
gdk_subsurface_get_texture_rect (subsurface, bounds);
if (gdk_subsurface_get_background_rect (subsurface, &background))
graphene_rect_union (bounds, &background, bounds);
}
+41 -36
View File
@@ -62,48 +62,53 @@ struct _GdkSubsurfaceClass
{
GObjectClass parent_class;
gboolean (* attach) (GdkSubsurface *subsurface,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
gboolean lightbox,
gboolean above,
GdkSubsurface *sibling);
void (* detach) (GdkSubsurface *subsurface);
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
void (* get_source) (GdkSubsurface *subsurface,
graphene_rect_t *source);
void (* get_dest) (GdkSubsurface *subsurface,
graphene_rect_t *dest);
gboolean (* attach) (GdkSubsurface *subsurface,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
const graphene_rect_t *bg,
gboolean above,
GdkSubsurface *sibling);
void (* detach) (GdkSubsurface *subsurface);
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
void (* get_source_rect) (GdkSubsurface *subsurface,
graphene_rect_t *rect);
void (* get_texture_rect) (GdkSubsurface *subsurface,
graphene_rect_t *rect);
GdkTextureTransform
(* get_transform) (GdkSubsurface *subsurface);
gboolean (* get_lightbox) (GdkSubsurface *subsurface);
(* get_transform) (GdkSubsurface *subsurface);
gboolean (* get_background_rect) (GdkSubsurface *subsurface,
graphene_rect_t *rect);
};
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
gboolean lightbox,
gboolean above,
GdkSubsurface *sibling);
void gdk_subsurface_detach (GdkSubsurface *subsurface);
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
void gdk_subsurface_get_source (GdkSubsurface *subsurface,
graphene_rect_t *source);
void gdk_subsurface_get_dest (GdkSubsurface *subsurface,
graphene_rect_t *dest);
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
const graphene_rect_t *background,
gboolean above,
GdkSubsurface *sibling);
void gdk_subsurface_detach (GdkSubsurface *subsurface);
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
void gdk_subsurface_get_source_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect);
void gdk_subsurface_get_texture_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect);
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
GdkSubsurface * gdk_subsurface_get_sibling (GdkSubsurface *subsurface,
gboolean above);
GdkTextureTransform
gdk_subsurface_get_transform (GdkSubsurface *subsurface);
gboolean gdk_subsurface_get_lightbox (GdkSubsurface *subsurface);
gdk_subsurface_get_transform (GdkSubsurface *subsurface);
gboolean gdk_subsurface_get_background_rect (GdkSubsurface *subsurface,
graphene_rect_t *rect);
void gdk_subsurface_get_bounds (GdkSubsurface *subsurface,
graphene_rect_t *bounds);
G_END_DECLS
+3
View File
@@ -57,6 +57,9 @@ static const GdkDebugKey gsk_vulkan_feature_keys[] = {
*
* Support for `GdkVulkanContext` is platform-specific and context creation
* can fail, returning %NULL context.
*
* Deprecated: 4.14: GTK does not expose any Vulkan internals. This
* struct is a leftover that was accidentally exposed.
*/
typedef struct _GdkVulkanContextPrivate GdkVulkanContextPrivate;
+1 -1
View File
@@ -61,7 +61,7 @@ gdk_macos_deps = [
libgdk_c_args += ['-xobjective-c']
libgdk_macos = static_library('gdk-macos',
gdk_macos_sources, gdkconfig, gdkenum_h,
sources: [ gdk_macos_sources, gdk_gen_headers ],
include_directories: [ confinc, gdkinc, ],
c_args: [ libgdk_c_args, common_cflags, ],
link_with: [],
+9 -3
View File
@@ -202,7 +202,13 @@ gdkwayland_inc = include_directories('wayland')
wlinc = include_directories('.')
win32rcinc = include_directories('win32/rc')
gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros_h, gdk_visibility_h]
gdk_gen_headers = [
gdkenum_h,
gdkmarshal_h,
gdkconfig,
gdkversionmacros_h,
gdk_visibility_h,
]
gdk_deps = [
libm,
@@ -278,7 +284,7 @@ if gdk_backends.length() == 0
endif
libgdk = static_library('gdk',
sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
sources: [gdk_sources, gdk_backends_gen_headers, gdk_gen_headers],
dependencies: gdk_deps + [libgtk_css_dep],
link_with: [libgtk_css],
include_directories: [confinc, gdkx11_inc, wlinc],
@@ -290,7 +296,7 @@ libgdk = static_library('gdk',
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgdk_dep = declare_dependency(
sources: ['gdk.h', gdkconfig, gdkenum_h],
sources: ['gdk.h', gdk_gen_headers],
include_directories: [confinc, gdkx11_inc, wlinc],
dependencies: gdk_deps + [libgtk_css_dep],
)
+1 -10
View File
@@ -198,17 +198,8 @@ static void
gdk_wayland_cairo_context_empty_frame (GdkDrawContext *draw_context)
{
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!impl->has_pending_subsurface_commits)
return;
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
gdk_wayland_surface_handle_empty_frame (surface);
}
static void
+14 -1
View File
@@ -606,7 +606,13 @@ gdk_registry_handle_global (void *data,
&wp_presentation_interface,
MIN (version, 1));
}
else if (strcmp (interface, wp_single_pixel_buffer_manager_v1_interface.name) == 0)
{
display_wayland->single_pixel_buffer =
wl_registry_bind (display_wayland->wl_registry, id,
&wp_single_pixel_buffer_manager_v1_interface,
MIN (version, 1));
}
g_hash_table_insert (display_wayland->known_globals,
GUINT_TO_POINTER (id), g_strdup (interface));
@@ -817,6 +823,7 @@ gdk_wayland_display_dispose (GObject *object)
g_clear_pointer (&display_wayland->fractional_scale, wp_fractional_scale_manager_v1_destroy);
g_clear_pointer (&display_wayland->viewporter, wp_viewporter_destroy);
g_clear_pointer (&display_wayland->presentation, wp_presentation_destroy);
g_clear_pointer (&display_wayland->single_pixel_buffer, wp_single_pixel_buffer_manager_v1_destroy);
g_clear_pointer (&display_wayland->linux_dmabuf, zwp_linux_dmabuf_v1_destroy);
g_clear_pointer (&display_wayland->linux_dmabuf_feedback, zwp_linux_dmabuf_feedback_v1_destroy);
if (display_wayland->linux_dmabuf_formats)
@@ -1804,6 +1811,7 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-rendering", "gtk-font-rendering", G_TYPE_ENUM, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
@@ -2194,6 +2202,11 @@ set_value_from_entry (GdkDisplay *display,
? g_settings_get_boolean (settings, entry->key)
: entry->fallback.b);
break;
case G_TYPE_ENUM:
g_value_set_enum (value, settings && entry->valid
? g_settings_get_enum (settings, entry->key)
: entry->fallback.i);
break;
case G_TYPE_NONE:
if (g_str_equal (entry->setting, "gtk-fontconfig-timestamp"))
g_value_set_uint (value, (guint)entry->fallback.i);
+2
View File
@@ -40,6 +40,7 @@
#include <gdk/wayland/fractional-scale-v1-client-protocol.h>
#include <gdk/wayland/viewporter-client-protocol.h>
#include <gdk/wayland/presentation-time-client-protocol.h>
#include <gdk/wayland/single-pixel-buffer-v1-client-protocol.h>
#include <glib.h>
#include <gdk/gdkkeys.h>
@@ -127,6 +128,7 @@ struct _GdkWaylandDisplay
struct wp_fractional_scale_manager_v1 *fractional_scale;
struct wp_viewporter *viewporter;
struct wp_presentation *presentation;
struct wp_single_pixel_buffer_manager_v1 *single_pixel_buffer;
GList *async_roundtrips;
+1 -8
View File
@@ -88,14 +88,7 @@ gdk_wayland_gl_context_empty_frame (GdkDrawContext *draw_context)
{
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
if (gdk_wayland_surface_needs_commit (surface))
{
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
}
gdk_wayland_surface_handle_empty_frame (surface);
}
static void
+1 -1
View File
@@ -131,7 +131,7 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint *next_image_delay);
void gdk_wayland_surface_sync (GdkSurface *surface);
gboolean gdk_wayland_surface_needs_commit (GdkSurface *surface);
void gdk_wayland_surface_handle_empty_frame (GdkSurface *surface);
void gdk_wayland_surface_commit (GdkSurface *surface);
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
void gdk_wayland_surface_request_frame (GdkSurface *surface);
+6 -1
View File
@@ -25,11 +25,16 @@ struct _GdkWaylandSubsurface
cairo_rectangle_int_t dest;
graphene_rect_t source;
enum wl_output_transform transform;
gboolean lightbox;
struct wl_region *opaque_region;
struct wl_callback *frame_callback;
struct wl_surface *bg_surface;
struct wl_subsurface *bg_subsurface;
struct wp_viewport *bg_viewport;
cairo_rectangle_int_t bg_rect;
gboolean bg_attached;
};
struct _GdkWaylandSubsurfaceClass
+359 -72
View File
@@ -25,6 +25,8 @@
#include "gdkdmabuftextureprivate.h"
#include "gdksurface-wayland-private.h"
#include "gdksubsurfaceprivate.h"
#include "gdkdebugprivate.h"
#include "gsk/gskrectprivate.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
@@ -46,11 +48,55 @@ gdk_wayland_subsurface_finalize (GObject *object)
g_clear_pointer (&self->viewport, wp_viewport_destroy);
g_clear_pointer (&self->subsurface, wl_subsurface_destroy);
g_clear_pointer (&self->surface, wl_surface_destroy);
g_clear_pointer (&self->subsurface, wl_subsurface_destroy);
g_clear_pointer (&self->bg_viewport, wp_viewport_destroy);
g_clear_pointer (&self->bg_subsurface, wl_subsurface_destroy);
g_clear_pointer (&self->bg_surface, wl_surface_destroy);
G_OBJECT_CLASS (gdk_wayland_subsurface_parent_class)->finalize (object);
}
static void
shm_buffer_release (void *data,
struct wl_buffer *buffer)
{
cairo_surface_t *surface = data;
/* Note: the wl_buffer is destroyed as cairo user data */
cairo_surface_destroy (surface);
}
static const struct wl_buffer_listener shm_buffer_listener = {
shm_buffer_release,
};
static struct wl_buffer *
get_shm_wl_buffer (GdkWaylandSubsurface *self,
GdkTexture *texture)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SUBSURFACE (self)->parent));
int width, height;
cairo_surface_t *surface;
GdkTextureDownloader *downloader;
struct wl_buffer *buffer;
width = gdk_texture_get_width (texture);
height = gdk_texture_get_height (texture);
surface = gdk_wayland_display_create_shm_surface (display, width, height, &GDK_FRACTIONAL_SCALE_INIT_INT (1));
downloader = gdk_texture_downloader_new (texture);
gdk_texture_downloader_download_into (downloader,
cairo_image_surface_get_data (surface),
cairo_image_surface_get_stride (surface));
gdk_texture_downloader_free (downloader);
buffer = _gdk_wayland_shm_surface_get_wl_buffer (surface);
wl_buffer_add_listener (buffer, &shm_buffer_listener, surface);
return buffer;
}
static void
dmabuf_buffer_release (void *data,
struct wl_buffer *buffer)
@@ -97,8 +143,8 @@ static const struct zwp_linux_buffer_params_v1_listener params_listener = {
};
static struct wl_buffer *
get_wl_buffer (GdkWaylandSubsurface *self,
GdkTexture *texture)
get_dmabuf_wl_buffer (GdkWaylandSubsurface *self,
GdkTexture *texture)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SUBSURFACE (self)->parent));
const GdkDmabuf *dmabuf;
@@ -149,6 +195,52 @@ get_wl_buffer (GdkWaylandSubsurface *self,
return buffer;
}
static struct wl_buffer *
get_wl_buffer (GdkWaylandSubsurface *self,
GdkTexture *texture)
{
GdkDisplay *display = gdk_surface_get_display (GDK_SUBSURFACE (self)->parent);
struct wl_buffer *buffer = NULL;
if (GDK_IS_DMABUF_TEXTURE (texture))
buffer = get_dmabuf_wl_buffer (self, texture);
if (GDK_DISPLAY_DEBUG_CHECK (display, FORCE_OFFLOAD))
{
if (!buffer)
buffer = get_shm_wl_buffer (self, texture);
}
return buffer;
}
static void
sp_buffer_release (void *data,
struct wl_buffer *buffer)
{
wl_buffer_destroy (buffer);
}
static const struct wl_buffer_listener sp_buffer_listener = {
sp_buffer_release,
};
static struct wl_buffer *
get_sp_buffer (GdkWaylandSubsurface *self)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SUBSURFACE (self)->parent));
struct wl_buffer *buffer = NULL;
if (display->single_pixel_buffer)
buffer = wp_single_pixel_buffer_manager_v1_create_u32_rgba_buffer (display->single_pixel_buffer,
0, 0, 0, 0xffffffffU);
if (buffer)
wl_buffer_add_listener (buffer, &sp_buffer_listener, self);
return buffer;
}
static inline enum wl_output_transform
gdk_texture_transform_to_wl (GdkTextureTransform transform)
{
@@ -161,25 +253,80 @@ wl_output_transform_to_gdk (enum wl_output_transform transform)
return (GdkTextureTransform) transform;
}
static void
ensure_bg_surface (GdkWaylandSubsurface *self)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (GDK_SUBSURFACE (self)->parent);
GdkDisplay *display = gdk_surface_get_display (GDK_SUBSURFACE (self)->parent);
GdkWaylandDisplay *disp = GDK_WAYLAND_DISPLAY (display);
struct wl_region *region;
if (self->bg_surface)
return;
self->bg_surface = wl_compositor_create_surface (disp->compositor);
self->bg_subsurface = wl_subcompositor_get_subsurface (disp->subcompositor,
self->bg_surface,
impl->display_server.wl_surface);
self->bg_viewport = wp_viewporter_get_viewport (disp->viewporter, self->bg_surface);
/* We are opaque */
wl_surface_set_opaque_region (self->bg_surface, self->opaque_region);
/* No input, please */
region = wl_compositor_create_region (disp->compositor);
wl_surface_set_input_region (self->bg_surface, region);
wl_region_destroy (region);
}
static inline gboolean
scaled_rect_is_integral (const graphene_rect_t *rect,
float scale,
graphene_rect_t *device_rect)
{
cairo_rectangle_int_t device_int;
gsk_rect_scale (rect, scale, scale, device_rect);
device_int.x = device_rect->origin.x;
device_int.y = device_rect->origin.y;
device_int.width = device_rect->size.width;
device_int.height = device_rect->size.height;
return device_int.x == device_rect->origin.x &&
device_int.y == device_rect->origin.y &&
device_int.width == device_rect->size.width &&
device_int.height == device_rect->size.height;
}
static gboolean
gdk_wayland_subsurface_attach (GdkSubsurface *sub,
GdkTexture *texture,
const graphene_rect_t *source,
const graphene_rect_t *dest,
GdkTextureTransform transform,
const graphene_rect_t *background,
gboolean above,
gboolean lightbox,
GdkSubsurface *sibling)
{
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
GdkWaylandSurface *parent = GDK_WAYLAND_SURFACE (sub->parent);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (sub->parent));
struct wl_buffer *buffer = NULL;
gboolean result = FALSE;
GdkWaylandSubsurface *sib = sibling ? GDK_WAYLAND_SUBSURFACE (sibling) : NULL;
gboolean will_be_above;
double scale;
graphene_rect_t device_rect;
cairo_rectangle_int_t device_dest;
gboolean has_background;
enum wl_output_transform tf;
gboolean dest_changed = FALSE;
gboolean source_changed = FALSE;
gboolean transform_changed = FALSE;
gboolean stacking_changed = FALSE;
gboolean needs_commit = FALSE;
gboolean background_changed = FALSE;
gboolean needs_bg_commit = FALSE;
if (sibling)
will_be_above = sibling->above_parent;
@@ -192,30 +339,74 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
return FALSE;
}
self->dest.x = dest->origin.x;
self->dest.y = dest->origin.y;
self->dest.width = dest->size.width;
self->dest.height = dest->size.height;
if (self->dest.x != dest->origin.x ||
self->dest.y != dest->origin.y ||
self->dest.width != dest->size.width ||
self->dest.height != dest->size.height)
{
self->dest.x = dest->origin.x;
self->dest.y = dest->origin.y;
self->dest.width = dest->size.width;
self->dest.height = dest->size.height;
dest_changed = TRUE;
}
self->source.origin.x = source->origin.x;
self->source.origin.y = source->origin.y;
self->source.size.width = source->size.width;
self->source.size.height = source->size.height;
if (!gsk_rect_equal (&self->source, source))
{
self->source.origin.x = source->origin.x;
self->source.origin.y = source->origin.y;
self->source.size.width = source->size.width;
self->source.size.height = source->size.height;
source_changed = TRUE;
}
self->transform = gdk_texture_transform_to_wl (transform);
self->lightbox = lightbox;
tf = gdk_texture_transform_to_wl (transform);
if (self->transform != tf)
{
self->transform = tf;
transform_changed = TRUE;
}
if (sibling != gdk_subsurface_get_sibling (sub, above) ||
will_be_above != gdk_subsurface_is_above_parent (sub))
stacking_changed = TRUE;
if (self->texture == NULL)
{
dest_changed = TRUE;
source_changed = TRUE;
transform_changed = TRUE;
stacking_changed = TRUE;
}
scale = gdk_fractional_scale_to_double (&parent->scale);
device_rect.origin.x = dest->origin.x * scale;
device_rect.origin.y = dest->origin.y * scale;
device_rect.size.width = dest->size.width * scale;
device_rect.size.height = dest->size.height * scale;
if (background)
{
background_changed =
!self->bg_attached ||
self->bg_rect.x != background->origin.x ||
self->bg_rect.y != background->origin.y ||
self->bg_rect.width != background->size.width ||
self->bg_rect.height != background->size.height;
self->bg_rect.x = background->origin.x;
self->bg_rect.y = background->origin.y;
self->bg_rect.width = background->size.width;
self->bg_rect.height = background->size.height;
}
else
{
background_changed = self->bg_attached;
self->bg_rect.x = 0;
self->bg_rect.y = 0;
self->bg_rect.width = 0;
self->bg_rect.height = 0;
}
device_dest.x = device_rect.origin.x;
device_dest.y = device_rect.origin.y;
device_dest.width = device_rect.size.width;
device_dest.height = device_rect.size.height;
has_background = self->bg_rect.width > 0 && self->bg_rect.height > 0;
if (has_background)
ensure_bg_surface (self);
if (self->dest.x != dest->origin.x ||
self->dest.y != dest->origin.y ||
@@ -230,19 +421,26 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
gdk_texture_get_height (texture),
self);
}
else if (device_dest.x != device_rect.origin.x ||
device_dest.y != device_rect.origin.y ||
device_dest.width != device_rect.size.width ||
device_dest.height != device_rect.size.height)
else if (!scaled_rect_is_integral (dest, scale, &device_rect))
{
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
"Non-integral device coordinates %g %g %g %g (fractional scale %.2f), hiding subsurface %p",
device_rect.origin.x, device_rect.origin.y,
device_rect.size.width, device_rect.size.width,
device_rect.size.width, device_rect.size.height,
scale,
self);
}
else if (!GDK_IS_DMABUF_TEXTURE (texture))
else if (background && !scaled_rect_is_integral (background, scale, &device_rect))
{
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
"Non-integral background device coordinates %g %g %g %g (fractional scale %.2f), hiding background of subsurface %p",
device_rect.origin.x, device_rect.origin.y,
device_rect.size.width, device_rect.size.height,
scale,
self);
}
else if (!GDK_IS_DMABUF_TEXTURE (texture) &&
!GDK_DISPLAY_DEBUG_CHECK (gdk_surface_get_display (sub->parent), FORCE_OFFLOAD))
{
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
"%dx%d %s is not a GdkDmabufTexture, hiding subsurface %p",
@@ -260,6 +458,12 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
gdk_texture_get_height (texture),
self);
}
else if (has_background && !display->single_pixel_buffer)
{
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
"Cannot offload subsurface %p with background, no single-pixel buffer support",
self);
}
else
{
gboolean was_transparent;
@@ -319,14 +523,28 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
if (result)
{
wl_surface_set_buffer_transform (self->surface, self->transform);
wl_subsurface_set_position (self->subsurface, self->dest.x, self->dest.y);
wp_viewport_set_destination (self->viewport, self->dest.width, self->dest.height);
wp_viewport_set_source (self->viewport,
wl_fixed_from_double (self->source.origin.x),
wl_fixed_from_double (self->source.origin.y),
wl_fixed_from_double (self->source.size.width),
wl_fixed_from_double (self->source.size.height));
if (transform_changed)
{
wl_surface_set_buffer_transform (self->surface, self->transform);
needs_commit = TRUE;
}
if (dest_changed)
{
wl_subsurface_set_position (self->subsurface, self->dest.x, self->dest.y);
wp_viewport_set_destination (self->viewport, self->dest.width, self->dest.height);
needs_commit = TRUE;
}
if (source_changed)
{
wp_viewport_set_source (self->viewport,
wl_fixed_from_double (self->source.origin.x),
wl_fixed_from_double (self->source.origin.y),
wl_fixed_from_double (self->source.size.width),
wl_fixed_from_double (self->source.size.height));
needs_commit = TRUE;
}
if (buffer)
{
@@ -335,39 +553,95 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
0, 0,
gdk_texture_get_width (texture),
gdk_texture_get_height (texture));
needs_commit = TRUE;
}
if (has_background)
{
if (background_changed)
{
wl_subsurface_set_position (self->bg_subsurface, self->bg_rect.x, self->bg_rect.y);
wp_viewport_set_destination (self->bg_viewport, self->bg_rect.width, self->bg_rect.height);
needs_bg_commit = TRUE;
}
if (!self->bg_attached)
{
self->bg_attached = TRUE;
wp_viewport_set_source (self->bg_viewport,
wl_fixed_from_int (0),
wl_fixed_from_int (0),
wl_fixed_from_int (1),
wl_fixed_from_int (1));
wl_surface_attach (self->bg_surface, get_sp_buffer (self), 0, 0);
wl_surface_damage_buffer (self->bg_surface, 0, 0, 1, 1);
needs_bg_commit = TRUE;
}
}
else
{
if (self->bg_attached)
{
self->bg_attached = FALSE;
wl_surface_attach (self->bg_surface, NULL, 0, 0);
needs_bg_commit = TRUE;
}
}
result = TRUE;
}
else
{
g_set_object (&self->texture, NULL);
if (g_set_object (&self->texture, NULL))
{
wl_surface_attach (self->surface, NULL, 0, 0);
needs_commit = TRUE;
}
wl_surface_attach (self->surface, NULL, 0, 0);
if (self->bg_attached)
{
self->bg_attached = FALSE;
wl_surface_attach (self->bg_surface, NULL, 0, 0);
needs_bg_commit = TRUE;
}
}
if (sib)
if (stacking_changed)
{
if (above)
wl_subsurface_place_above (self->subsurface, sib->surface);
if (sib)
{
if (above)
wl_subsurface_place_above (self->subsurface, sib->surface);
else
wl_subsurface_place_below (self->subsurface, sib->surface);
}
else
wl_subsurface_place_below (self->subsurface, sib->surface);
}
else
{
if (above)
wl_subsurface_place_above (self->subsurface,
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
else
wl_subsurface_place_below (self->subsurface,
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
{
if (above)
wl_subsurface_place_above (self->subsurface,
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
else
wl_subsurface_place_below (self->subsurface,
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
}
needs_commit = TRUE;
if (self->bg_attached)
{
wl_subsurface_place_below (self->bg_subsurface, self->surface);
needs_bg_commit = TRUE;
}
}
wl_surface_commit (self->surface);
if (needs_commit)
wl_surface_commit (self->surface);
((GdkWaylandSurface *)sub->parent)->has_pending_subsurface_commits = TRUE;
GDK_WAYLAND_SURFACE (sub->parent)->opaque_region_dirty = TRUE;
if (needs_bg_commit)
wl_surface_commit (self->bg_surface);
((GdkWaylandSurface *)sub->parent)->has_pending_subsurface_commits = needs_commit || needs_bg_commit;
GDK_WAYLAND_SURFACE (sub->parent)->opaque_region_dirty = stacking_changed || dest_changed || background_changed;
return result;
}
@@ -388,6 +662,13 @@ gdk_wayland_subsurface_detach (GdkSubsurface *sub)
wl_surface_set_opaque_region (self->surface, self->opaque_region);
wl_surface_commit (self->surface);
if (self->bg_attached)
{
wl_surface_attach (self->bg_surface, NULL, 0, 0);
wl_surface_commit (self->bg_surface);
self->bg_attached = FALSE;
}
((GdkWaylandSurface *)sub->parent)->has_pending_subsurface_commits = TRUE;
GDK_WAYLAND_SURFACE (sub->parent)->opaque_region_dirty = TRUE;
}
@@ -401,27 +682,27 @@ gdk_wayland_subsurface_get_texture (GdkSubsurface *sub)
}
static void
gdk_wayland_subsurface_get_dest (GdkSubsurface *sub,
graphene_rect_t *dest)
gdk_wayland_subsurface_get_texture_rect (GdkSubsurface *sub,
graphene_rect_t *rect)
{
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
dest->origin.x = self->dest.x;
dest->origin.y = self->dest.y;
dest->size.width = self->dest.width;
dest->size.height = self->dest.height;
rect->origin.x = self->dest.x;
rect->origin.y = self->dest.y;
rect->size.width = self->dest.width;
rect->size.height = self->dest.height;
}
static void
gdk_wayland_subsurface_get_source (GdkSubsurface *sub,
graphene_rect_t *source)
gdk_wayland_subsurface_get_source_rect (GdkSubsurface *sub,
graphene_rect_t *rect)
{
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
source->origin.x = self->source.origin.x;
source->origin.y = self->source.origin.y;
source->size.width = self->source.size.width;
source->size.height = self->source.size.height;
rect->origin.x = self->source.origin.x;
rect->origin.y = self->source.origin.y;
rect->size.width = self->source.size.width;
rect->size.height = self->source.size.height;
}
static GdkTextureTransform
@@ -433,11 +714,17 @@ gdk_wayland_subsurface_get_transform (GdkSubsurface *sub)
}
static gboolean
gdk_wayland_subsurface_get_lightbox (GdkSubsurface *sub)
gdk_wayland_subsurface_get_background_rect (GdkSubsurface *sub,
graphene_rect_t *rect)
{
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
return self->lightbox;
rect->origin.x = self->bg_rect.x;
rect->origin.y = self->bg_rect.y;
rect->size.width = self->bg_rect.width;
rect->size.height = self->bg_rect.height;
return rect->size.width > 0 && rect->size.height > 0;
}
static void
@@ -451,10 +738,10 @@ gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
subsurface_class->attach = gdk_wayland_subsurface_attach;
subsurface_class->detach = gdk_wayland_subsurface_detach;
subsurface_class->get_texture = gdk_wayland_subsurface_get_texture;
subsurface_class->get_source = gdk_wayland_subsurface_get_source;
subsurface_class->get_dest = gdk_wayland_subsurface_get_dest;
subsurface_class->get_source_rect = gdk_wayland_subsurface_get_source_rect;
subsurface_class->get_texture_rect = gdk_wayland_subsurface_get_texture_rect;
subsurface_class->get_transform = gdk_wayland_subsurface_get_transform;
subsurface_class->get_lightbox = gdk_wayland_subsurface_get_lightbox;
subsurface_class->get_background_rect = gdk_wayland_subsurface_get_background_rect;
};
static void
+28 -6
View File
@@ -54,6 +54,8 @@
#include "linux-dmabuf-unstable-v1-client-protocol.h"
#include "presentation-time-client-protocol.h"
#include "gsk/gskrectprivate.h"
/**
* GdkWaylandSurface:
@@ -657,6 +659,7 @@ static void
gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
struct wl_region *wl_region = NULL;
if (!impl->display_server.wl_surface)
@@ -679,16 +682,21 @@ gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
continue;
if (sub->texture != NULL)
cairo_region_subtract_rectangle (region, &sub->dest);
{
graphene_rect_t bounds;
cairo_rectangle_int_t rect;
gdk_subsurface_get_bounds (subsurface, &bounds);
gsk_rect_to_cairo_grow (&bounds, &rect);
cairo_region_subtract_rectangle (region, &rect);
}
}
wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)),
region);
wl_region = wl_region_from_cairo_region (display, region);
cairo_region_destroy (region);
}
else
wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)),
impl->opaque_region);
wl_region = wl_region_from_cairo_region (display, impl->opaque_region);
}
wl_surface_set_opaque_region (impl->display_server.wl_surface, wl_region);
@@ -775,7 +783,7 @@ gdk_wayland_surface_sync (GdkSurface *surface)
gdk_wayland_surface_sync_viewport (surface);
}
gboolean
static gboolean
gdk_wayland_surface_needs_commit (GdkSurface *surface)
{
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
@@ -787,6 +795,20 @@ gdk_wayland_surface_needs_commit (GdkSurface *surface)
self->viewport_dirty;
}
void
gdk_wayland_surface_handle_empty_frame (GdkSurface *surface)
{
if (!gdk_wayland_surface_needs_commit (surface))
return;
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
}
static void
gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
struct wp_fractional_scale_v1 *fractional_scale,
+1 -9
View File
@@ -77,16 +77,8 @@ static void
gdk_vulkan_context_wayland_empty_frame (GdkDrawContext *context)
{
GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!impl->has_pending_subsurface_commits)
return;
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
gdk_wayland_surface_handle_empty_frame (surface);
}
static void
+25 -67
View File
@@ -47,82 +47,40 @@ gdk_wayland_deps = [
wlegldep,
]
wayland_scanner = find_program('wayland-scanner')
# Format:
# - protocol name
# - protocol stability ('private', 'stable' or 'unstable')
# - protocol version (if stability is 'unstable')
wlmod = import('unstable-wayland')
proto_sources = [
['gtk-shell', 'private', ],
['primary-selection', 'unstable', 'v1', ],
['pointer-gestures', 'unstable', 'v1', ],
['viewporter', 'stable', ],
['xdg-shell', 'unstable', 'v6', ],
['xdg-shell', 'stable', ],
['xdg-foreign', 'unstable', 'v1', ],
['xdg-foreign', 'unstable', 'v2', ],
['tablet', 'unstable', 'v2', ],
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
['server-decoration', 'private' ],
['xdg-output', 'unstable', 'v1', ],
['idle-inhibit', 'unstable', 'v1', ],
['xdg-activation', 'staging', 'v1', ],
['fractional-scale', 'staging', 'v1', ],
['linux-dmabuf', 'unstable', 'v1', ],
['presentation-time', 'stable', 'v1', ],
'protocol/gtk-shell.xml',
'protocol/server-decoration.xml',
wlmod.find_protocol('primary-selection', state: 'unstable', version: 1),
wlmod.find_protocol('pointer-gestures', state: 'unstable', version: 1),
wlmod.find_protocol('viewporter', state: 'stable'),
wlmod.find_protocol('xdg-shell', state: 'unstable', version: 6),
wlmod.find_protocol('xdg-shell', state: 'stable'),
wlmod.find_protocol('xdg-foreign', state: 'unstable', version: 1),
wlmod.find_protocol('xdg-foreign', state: 'unstable', version: 2),
wlmod.find_protocol('tablet', state: 'unstable', version: 2),
wlmod.find_protocol('keyboard-shortcuts-inhibit', state: 'unstable', version: 1),
wlmod.find_protocol('xdg-output', state: 'unstable', version: 1),
wlmod.find_protocol('idle-inhibit', state: 'unstable', version: 1),
wlmod.find_protocol('xdg-activation', state: 'staging', version: 1),
wlmod.find_protocol('fractional-scale', state: 'staging', version: 1),
wlmod.find_protocol('linux-dmabuf', state: 'unstable', version: 1),
wlmod.find_protocol('presentation-time', state: 'stable'),
wlmod.find_protocol('single-pixel-buffer', state: 'staging', version: 1),
]
gdk_wayland_gen_headers = []
foreach p: proto_sources
proto_name = p.get(0)
proto_stability = p.get(1)
if proto_stability == 'stable'
output_base = proto_name
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
elif proto_stability == 'staging'
proto_version = p.get(2)
output_base = '@0@-@1@'.format(proto_name, proto_version)
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
elif proto_stability == 'private'
output_base = proto_name
input = files('protocol/@0@.xml'.format(proto_name))
else
proto_version = p.get(2)
output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version)
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
endif
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
],
)
gdk_wayland_sources += custom_target('@0@ source'.format(output_base),
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
],
)
# Returns a list [.c, .h]
gen = wlmod.scan_xml(p)
assert(gen.length() == 2)
gdk_wayland_sources += gen[0]
gdk_wayland_gen_headers += gen[1]
endforeach
libgdk_wayland = static_library('gdk-wayland',
sources: [
gdk_wayland_sources,
gdk_wayland_gen_headers,
gdkconfig,
gdkenum_h,
],
sources: [ gdk_wayland_sources, gdk_wayland_gen_headers, gdk_gen_headers ],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
-14
View File
@@ -3071,20 +3071,6 @@ gdk_event_translate (MSG *msg,
}
}
if ((windowpos->flags & SWP_HIDEWINDOW) &&
!GDK_SURFACE_DESTROYED (window))
{
/* Make transient parent the foreground window when window unmaps */
impl = GDK_WIN32_SURFACE (window);
if (impl->transient_owner &&
GetForegroundWindow () == GDK_SURFACE_HWND (window))
{
SetForegroundWindow (GDK_SURFACE_HWND (impl->transient_owner));
SetCapture (GDK_SURFACE_HWND (impl->transient_owner));
}
}
if (!(windowpos->flags & SWP_NOCLIENTSIZE))
{
if (window->resize_count > 1)
+2 -74
View File
@@ -4200,82 +4200,13 @@ BOOL WINAPI
GtkShowWindow (GdkSurface *window,
int cmd_show)
{
cairo_t *cr;
cairo_surface_t *surface;
RECT window_rect;
HDC hdc;
POINT window_position;
SIZE window_size;
POINT source_point;
BLENDFUNCTION blender;
HWND hwnd = GDK_SURFACE_HWND (window);
GdkWin32Surface *impl = GDK_WIN32_SURFACE (window);
switch (cmd_show)
{
case SW_FORCEMINIMIZE:
case SW_HIDE:
case SW_MINIMIZE:
break;
case SW_MAXIMIZE:
case SW_RESTORE:
case SW_SHOW:
case SW_SHOWDEFAULT:
case SW_SHOWMINIMIZED:
case SW_SHOWMINNOACTIVE:
case SW_SHOWNA:
case SW_SHOWNOACTIVATE:
case SW_SHOWNORMAL:
if (IsWindowVisible (hwnd))
break;
/* Window was hidden, will be shown. Erase it, GDK will repaint soon,
* but not soon enough, so it's possible to see old content before
* the next redraw, unless we erase the window first.
*/
GetWindowRect (hwnd, &window_rect);
source_point.x = source_point.y = 0;
window_position.x = window_rect.left;
window_position.y = window_rect.top;
window_size.cx = window_rect.right - window_rect.left;
window_size.cy = window_rect.bottom - window_rect.top;
blender.BlendOp = AC_SRC_OVER;
blender.BlendFlags = 0;
blender.AlphaFormat = AC_SRC_ALPHA;
blender.SourceConstantAlpha = 255;
/* Create a surface of appropriate size and clear it */
surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32,
window_size.cx,
window_size.cy);
cairo_surface_set_device_scale (surface, impl->surface_scale, impl->surface_scale);
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_flush (surface);
hdc = cairo_win32_surface_get_dc (surface);
/* No API_CALL() wrapper, don't check for errors */
UpdateLayeredWindow (hwnd, NULL,
&window_position, &window_size,
hdc, &source_point,
0, &blender, ULW_ALPHA);
cairo_surface_destroy (surface);
break;
}
/* Ensure that maximized window size is corrected later on */
if (cmd_show == SW_MAXIMIZE)
impl->maximizing = TRUE;
return ShowWindow (hwnd, cmd_show);
return ShowWindow (GDK_SURFACE_HWND (window), cmd_show);
}
static void
@@ -4804,10 +4735,7 @@ gdk_win32_toplevel_set_property (GObject *object,
GDK_SURFACE (surface)->modal_hint = g_value_get_boolean (value);
if (GDK_SURFACE (surface)->modal_hint)
{
SetCapture (GDK_SURFACE_HWND (surface));
_gdk_push_modal_window (surface);
}
_gdk_push_modal_window (surface);
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
+1 -1
View File
@@ -64,7 +64,7 @@ gdk_win32_deps = [
]
libgdk_win32 = static_library('gdk-win32',
gdk_win32_sources, gdkconfig, gdkenum_h,
sources: [ gdk_win32_sources, gdk_gen_headers ],
include_directories: [ confinc, gdkinc ],
c_args: [
'-DGTK_COMPILATION',
+1 -1
View File
@@ -520,7 +520,7 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
if (GDK_DISPLAY_DEBUG_CHECK (display, INPUT))
{
const char *type_names[] = { "logical", "physical", "floating" };
const char *source_names[] = { "mouse", "pen", "eraser", "cursor", "keyboard", "direct touch", "indirect touch", "trackpoint", "pad" };
const char *source_names[] = { "mouse", "pen", "keyboard", "direct touch", "indirect touch", "trackpoint", "pad" };
gdk_debug_message ("input device:\n\tname: %s\n\ttype: %s\n\tsource: %s\n\thas cursor: %d\n\ttouches: %d",
dev->name,
type_names[type],
-1
View File
@@ -665,7 +665,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
{
x11_screen->wmspec_check_window = None;
x11_screen->last_wmspec_check_time = 0;
g_free (x11_screen->window_manager_name);
x11_screen->window_manager_name = g_strdup ("unknown");
+1 -1
View File
@@ -490,7 +490,7 @@ gdk_x11_context_create_glx_context (GdkGLContext *context,
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkX11GLContextGLX *share_glx = NULL;
GdkSurface *surface = gdk_gl_context_get_surface (context);
GLXContext ctx;
GLXContext ctx = NULL;
int context_attribs[N_GLX_ATTRS], i = 0, flags = 0;
gsize major_idx, minor_idx;
GdkGLVersion version;
-7
View File
@@ -1145,7 +1145,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
{
GdkDisplay *display;
Window window;
guint64 now;
int error;
display = x11_screen->display;
@@ -1155,11 +1154,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
if (x11_screen->wmspec_check_window != None)
return; /* already have it */
now = g_get_monotonic_time ();
if ((now - x11_screen->last_wmspec_check_time) / 1e6 < 15)
return; /* we've checked recently */
window = get_net_supporting_wm_check (x11_screen, x11_screen->xroot_window);
if (window == None)
return;
@@ -1184,7 +1178,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
return;
x11_screen->wmspec_check_window = window;
x11_screen->last_wmspec_check_time = now;
x11_screen->need_refetch_net_supported = TRUE;
x11_screen->need_refetch_wm_name = TRUE;
-1
View File
@@ -48,7 +48,6 @@ struct _GdkX11Screen
int xft_dpi;
/* Window manager */
gint64 last_wmspec_check_time;
Window wmspec_check_window;
char *window_manager_name;
+1 -6
View File
@@ -73,12 +73,7 @@ gdk_x11_deps = [
]
libgdk_x11 = static_library('gdk-x11',
sources: [
gdkmarshal_h,
gdkenum_h,
gdkconfig,
gdk_x11_sources,
],
sources: [ gdk_gen_headers, gdk_x11_sources ],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
+1 -1
View File
@@ -4013,7 +4013,7 @@ gsk_gl_render_job_visit_subsurface_node (GskGLRenderJob *job,
/* Clear the area so we can see through */
GskGLCommandBatch *batch;
guint16 color[4];
rgba_to_half (&(GdkRGBA){0,0,0,0}, color);
rgba_to_half (&GDK_RGBA_TRANSPARENT, color);
batch = gsk_gl_command_queue_get_batch (job->command_queue);
batch->draw.blend = 0;
+10 -1
View File
@@ -907,6 +907,7 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
gsize atlas_x, atlas_y, padding;
float subpixel_x, subpixel_y;
PangoFont *scaled_font;
cairo_hint_metrics_t hint_metrics;
cache = g_hash_table_lookup (priv->glyph_cache, &lookup);
if (cache)
@@ -918,7 +919,15 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
return cache->image;
}
scaled_font = gsk_reload_font (font, scale, CAIRO_HINT_METRICS_DEFAULT, CAIRO_HINT_STYLE_DEFAULT, CAIRO_ANTIALIAS_DEFAULT);
/* The combination of hint-style != none and hint-metrics == off
* leads to broken rendering with some fonts.
*/
if (gsk_font_get_hint_style (font) != CAIRO_HINT_STYLE_NONE)
hint_metrics = CAIRO_HINT_METRICS_ON;
else
hint_metrics = CAIRO_HINT_METRICS_DEFAULT;
scaled_font = gsk_reload_font (font, scale, hint_metrics, CAIRO_HINT_STYLE_DEFAULT, CAIRO_ANTIALIAS_DEFAULT);
subpixel_x = (flags & 3) / 4.f;
subpixel_y = ((flags >> 2) & 3) / 4.f;
+1 -1
View File
@@ -556,7 +556,7 @@ gsk_standard_contour_init (GskContour *contour,
gsize n_points,
const gskpathop *ops,
gsize n_ops,
ptrdiff_t offset);
gssize offset);
static void
gsk_standard_contour_copy (const GskContour *contour,
+2 -1
View File
@@ -227,7 +227,7 @@ get_t_by_bisection (const GskCurve *curve,
t1 = 0;
t2 = 1;
while (t1 < t2)
do
{
t = (t1 + t2) / 2;
if (t == t1 || t == t2)
@@ -243,6 +243,7 @@ get_t_by_bisection (const GskCurve *curve,
else
t2 = t;
}
while (t1 < t2);
return t;
}
+62 -40
View File
@@ -29,6 +29,7 @@
#include "gskdebugprivate.h"
#include "gskrendernodeprivate.h"
#include "gdksurfaceprivate.h"
#include "gdkrgbaprivate.h"
#include <graphene.h>
@@ -81,11 +82,12 @@ find_texture_transform (GskTransform *transform)
}
static GdkTexture *
find_texture_to_attach (GskOffload *self,
const GskRenderNode *subsurface_node,
graphene_rect_t *out_clip,
GdkTextureTransform *out_texture_transform,
gboolean *out_lightbox)
find_texture_to_attach (GskOffload *self,
const GskRenderNode *subsurface_node,
graphene_rect_t *out_texture_rect,
graphene_rect_t *out_source_rect,
gboolean *has_background,
GdkTextureTransform *out_texture_transform)
{
GdkSubsurface *subsurface;
const GskRenderNode *node;
@@ -94,8 +96,8 @@ find_texture_to_attach (GskOffload *self,
GskTransform *transform = NULL;
GdkTexture *ret = NULL;
*has_background = FALSE;
*out_texture_transform = GDK_TEXTURE_TRANSFORM_NORMAL;
*out_lightbox = FALSE;
subsurface = gsk_subsurface_node_get_subsurface (subsurface_node);
node = subsurface_node;
@@ -105,10 +107,13 @@ find_texture_to_attach (GskOffload *self,
switch ((int) GSK_RENDER_NODE_TYPE (node))
{
case GSK_DEBUG_NODE:
case GSK_SUBSURFACE_NODE:
node = gsk_debug_node_get_child (node);
break;
case GSK_SUBSURFACE_NODE:
node = gsk_subsurface_node_get_child (node);
break;
case GSK_CONTAINER_NODE:
if (gsk_container_node_get_n_children (node) == 1)
{
@@ -117,15 +122,19 @@ find_texture_to_attach (GskOffload *self,
}
else if (gsk_container_node_get_n_children (node) == 2)
{
GskRenderNode *child;
GskRenderNode *child = gsk_container_node_get_child (node, 0);
graphene_rect_t bounds;
child = gsk_container_node_get_child (node, 0);
gsk_transform_transform_bounds (transform, &child->bounds, &bounds);
if (GSK_RENDER_NODE_TYPE (child) == GSK_COLOR_NODE &&
gsk_rect_equal (&child->bounds, &subsurface_node->bounds) &&
gdk_rgba_equal (gsk_color_node_get_color (child), &(GdkRGBA) { 0, 0, 0, 1 }))
gsk_rect_equal (&bounds, &subsurface_node->bounds) &&
gdk_rgba_equal (gsk_color_node_get_color (child), &GDK_RGBA_BLACK))
{
g_print ("found lightbox\n");
*out_lightbox = TRUE;
GDK_DISPLAY_DEBUG (gdk_surface_get_display (self->surface), OFFLOAD,
"Offloading subsurface %p with background",
subsurface);
*has_background = TRUE;
node = gsk_container_node_get_child (node, 1);
break;
}
@@ -178,6 +187,7 @@ find_texture_to_attach (GskOffload *self,
}
else
{
gsk_transform_transform_bounds (transform, &node->bounds, out_texture_rect);
clip = *c;
has_clip = TRUE;
}
@@ -201,17 +211,18 @@ find_texture_to_attach (GskOffload *self,
gsk_rect_intersection (&node->bounds, &clip, &clip);
out_clip->origin.x = (clip.origin.x - dx) * sx;
out_clip->origin.y = (clip.origin.y - dy) * sy;
out_clip->size.width = clip.size.width * sx;
out_clip->size.height = clip.size.height * sy;
out_source_rect->origin.x = (clip.origin.x - dx) * sx;
out_source_rect->origin.y = (clip.origin.y - dy) * sy;
out_source_rect->size.width = clip.size.width * sx;
out_source_rect->size.height = clip.size.height * sy;
}
else
{
out_clip->origin.x = 0;
out_clip->origin.y = 0;
out_clip->size.width = gdk_texture_get_width (texture);
out_clip->size.height = gdk_texture_get_height (texture);
gsk_transform_transform_bounds (transform, &node->bounds, out_texture_rect);
out_source_rect->origin.x = 0;
out_source_rect->origin.y = 0;
out_source_rect->size.width = gdk_texture_get_width (texture);
out_source_rect->size.height = gdk_texture_get_height (texture);
}
ret = texture;
@@ -469,7 +480,8 @@ visit_node (GskOffload *self,
if (info->can_raise)
{
if (gsk_rect_intersects (&transformed_bounds, &info->dest))
if (gsk_rect_intersects (&transformed_bounds, &info->texture_rect) ||
gsk_rect_intersects (&transformed_bounds, &info->background_rect))
{
GskRenderNodeType type = GSK_RENDER_NODE_TYPE (node);
@@ -494,7 +506,6 @@ visit_node (GskOffload *self,
switch (GSK_RENDER_NODE_TYPE (node))
{
case GSK_BORDER_NODE:
case GSK_COLOR_NODE:
case GSK_CONIC_GRADIENT_NODE:
case GSK_LINEAR_GRADIENT_NODE:
case GSK_REPEATING_LINEAR_GRADIENT_NODE:
@@ -504,6 +515,7 @@ visit_node (GskOffload *self,
case GSK_TEXTURE_NODE:
case GSK_TEXTURE_SCALE_NODE:
case GSK_CAIRO_NODE:
case GSK_COLOR_NODE:
case GSK_INSET_SHADOW_NODE:
case GSK_OUTSET_SHADOW_NODE:
case GSK_GL_SHADER_NODE:
@@ -517,7 +529,7 @@ visit_node (GskOffload *self,
case GSK_MASK_NODE:
case GSK_FILL_NODE:
case GSK_STROKE_NODE:
break;
break;
case GSK_CLIP_NODE:
{
@@ -640,12 +652,16 @@ complex_clip:
}
else
{
info->texture = find_texture_to_attach (self, node, &info->source, &info->transform, &info->lightbox);
gboolean has_background;
info->texture = find_texture_to_attach (self, node, &info->texture_rect, &info->source_rect, &has_background, &info->transform);
if (info->texture)
{
info->can_offload = TRUE;
info->can_raise = TRUE;
transform_bounds (self, &node->bounds, &info->dest);
transform_bounds (self, &info->texture_rect, &info->texture_rect);
info->has_background = has_background;
transform_bounds (self, &node->bounds, &info->background_rect);
info->place_above = self->last_info ? self->last_info->subsurface : NULL;
self->last_info = info;
}
@@ -685,9 +701,12 @@ gsk_offload_new (GdkSurface *surface,
for (gsize i = 0; i < self->n_subsurfaces; i++)
{
GskOffloadInfo *info = &self->subsurfaces[i];
graphene_rect_t rect;
info->subsurface = gdk_surface_get_subsurface (self->surface, i);
info->was_offloaded = gdk_subsurface_get_texture (info->subsurface) != NULL;
info->was_above = gdk_subsurface_is_above_parent (info->subsurface);
info->had_background = gdk_subsurface_get_background_rect (info->subsurface, &rect);
}
if (self->n_subsurfaces > 0)
@@ -704,27 +723,28 @@ gsk_offload_new (GdkSurface *surface,
for (gsize i = 0; i < self->n_subsurfaces; i++)
{
GskOffloadInfo *info = &self->subsurfaces[i];
graphene_rect_t old_dest;
graphene_rect_t old_bounds;
graphene_rect_t bounds;
gdk_subsurface_get_dest (info->subsurface, &old_dest);
gdk_subsurface_get_bounds (info->subsurface, &old_bounds);
if (info->can_offload)
{
if (info->can_raise)
info->is_offloaded = gdk_subsurface_attach (info->subsurface,
info->texture,
&info->source,
&info->dest,
&info->source_rect,
&info->texture_rect,
info->transform,
info->lightbox,
info->has_background ? &info->background_rect : NULL,
TRUE, NULL);
else
info->is_offloaded = gdk_subsurface_attach (info->subsurface,
info->texture,
&info->source,
&info->dest,
&info->source_rect,
&info->texture_rect,
info->transform,
info->lightbox,
info->has_background ? &info->background_rect : NULL,
info->place_above != NULL,
info->place_above);
}
@@ -744,22 +764,24 @@ gsk_offload_new (GdkSurface *surface,
info->is_above = TRUE;
}
gdk_subsurface_get_bounds (info->subsurface, &bounds);
if (info->is_offloaded != info->was_offloaded ||
info->is_above != info->was_above ||
(info->is_offloaded && !gsk_rect_equal (&info->dest, &old_dest)))
(info->is_offloaded && !gsk_rect_equal (&bounds, &old_bounds)))
{
/* We changed things, need to invalidate everything */
cairo_rectangle_int_t int_dest;
cairo_rectangle_int_t rect;
if (info->is_offloaded)
{
gsk_rect_to_cairo_grow (&info->dest, &int_dest);
cairo_region_union_rectangle (diff, &int_dest);
gsk_rect_to_cairo_grow (&bounds, &rect);
cairo_region_union_rectangle (diff, &rect);
}
if (info->was_offloaded)
{
gsk_rect_to_cairo_grow (&old_dest, &int_dest);
cairo_region_union_rectangle (diff, &int_dest);
gsk_rect_to_cairo_grow (&old_bounds, &rect);
cairo_region_union_rectangle (diff, &rect);
}
}
+6 -3
View File
@@ -31,10 +31,10 @@ typedef struct
GdkSubsurface *subsurface;
GdkTexture *texture;
GdkSubsurface *place_above;
graphene_rect_t dest;
graphene_rect_t source;
graphene_rect_t texture_rect;
graphene_rect_t source_rect;
GdkTextureTransform transform;
gboolean lightbox;
graphene_rect_t background_rect;
guint was_offloaded : 1;
guint can_offload : 1;
@@ -43,6 +43,9 @@ typedef struct
guint was_above : 1;
guint can_raise : 1;
guint is_above : 1;
guint had_background : 1;
guint has_background : 1;
} GskOffloadInfo;
GskOffload * gsk_offload_new (GdkSurface *surface,
+1
View File
@@ -39,6 +39,7 @@
#include "gdk/gdksubsurfaceprivate.h"
#include "gdk/gdktextureprivate.h"
#include "gdk/gdktexturedownloaderprivate.h"
#include "gdk/gdkrgbaprivate.h"
#include <cairo.h>
#ifdef CAIRO_HAS_SVG_SURFACE
+2 -1
View File
@@ -27,6 +27,7 @@
#include "gtktextviewprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gdk/gdkrgbaprivate.h"
#include <math.h>
@@ -201,7 +202,7 @@ gsk_pango_renderer_draw_error_underline (PangoRenderer *renderer,
gtk_snapshot_append_color (crenderer->snapshot, &rgba, &dot.bounds);
gtk_snapshot_pop (crenderer->snapshot);
gtk_snapshot_append_color (crenderer->snapshot,
&(GdkRGBA) { 0.f, 0.f, 0.f, 0.f },
&GDK_RGBA_TRANSPARENT,
&GRAPHENE_RECT_INIT (xx, yy, 1.5 * hh, hh));
gtk_snapshot_pop (crenderer->snapshot);
+102
View File
@@ -74,6 +74,10 @@
* It is also possible to provide the menubar manually using
* [method@Gtk.Application.set_menubar].
*
* A custom 'Application' menu can be set using [method@Gtk.Application.set_app_menu].
* This is mainly relevant on macOS, where GTK will otherwise provide a standard
* app menu.
*
* `GtkApplication` will also automatically setup an icon search path for
* the default icon theme by appending "icons" to the resource base
* path. This allows your application to easily store its icons as
@@ -125,6 +129,7 @@ enum {
PROP_ZERO,
PROP_REGISTER_SESSION,
PROP_SCREENSAVER_ACTIVE,
PROP_APP_MENU,
PROP_MENUBAR,
PROP_ACTIVE_WINDOW,
NUM_PROPERTIES
@@ -139,6 +144,7 @@ typedef struct
GList *windows;
GMenuModel *app_menu;
GMenuModel *menubar;
guint last_window_id;
@@ -215,6 +221,9 @@ gtk_application_load_resources (GtkApplication *application)
{
GObject *menu;
menu = gtk_builder_get_object (priv->menus_builder, "app-menu");
if (menu != NULL && G_IS_MENU_MODEL (menu))
gtk_application_set_app_menu (application, G_MENU_MODEL (menu));
menu = gtk_builder_get_object (priv->menus_builder, "menubar");
if (menu != NULL && G_IS_MENU_MODEL (menu))
gtk_application_set_menubar (application, G_MENU_MODEL (menu));
@@ -438,6 +447,10 @@ gtk_application_get_property (GObject *object,
g_value_set_boolean (value, priv->screensaver_active);
break;
case PROP_APP_MENU:
g_value_set_object (value, gtk_application_get_app_menu (application));
break;
case PROP_MENUBAR:
g_value_set_object (value, gtk_application_get_menubar (application));
break;
@@ -467,6 +480,10 @@ gtk_application_set_property (GObject *object,
priv->register_session = g_value_get_boolean (value);
break;
case PROP_APP_MENU:
gtk_application_set_app_menu (application, g_value_get_object (value));
break;
case PROP_MENUBAR:
gtk_application_set_menubar (application, g_value_get_object (value));
break;
@@ -484,6 +501,7 @@ gtk_application_finalize (GObject *object)
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_clear_object (&priv->menus_builder);
g_clear_object (&priv->app_menu);
g_clear_object (&priv->menubar);
g_clear_object (&priv->muxer);
g_clear_object (&priv->accels);
@@ -611,6 +629,21 @@ gtk_application_class_init (GtkApplicationClass *class)
FALSE,
G_PARAM_READABLE|G_PARAM_STATIC_STRINGS);
/**
* GtkApplication:app-menu: (attributes org.gtk.Property.get=gtk_application_get_app_menu org.gtk.Property.set=gtk_application_set_app_menu)
*
* The `GMenuModel` to be used for the application's app menu.
*
* This is mainly relevant on macOS, where GTK will provide a
* standard app menu, unless it is overwritten by setting this property.
*
* Since: 4.16
*/
gtk_application_props[PROP_APP_MENU] =
g_param_spec_object ("app-menu", NULL, NULL,
G_TYPE_MENU_MODEL,
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS);
/**
* GtkApplication:menubar: (attributes org.gtk.Property.get=gtk_application_get_menubar org.gtk.Property.set=gtk_application_set_menubar)
*
@@ -833,6 +866,75 @@ gtk_application_update_accels (GtkApplication *application)
_gtk_window_notify_keys_changed (l->data);
}
/**
* gtk_application_set_app_menu:
* @application: a #GtkApplication
* @app_menu: (allow-none): a #GMenuModel, or %NULL
*
* Sets or unsets the application menu for @application.
*
* This can only be done in the primary instance of the application,
* after it has been registered. #GApplication::startup is a good place
* to call this.
*
* The application menu is a single menu containing items that typically
* impact the application as a whole, rather than acting on a specific
* window or document. For example, you would expect to see
* Preferences or Quit in an application menu, but not Save or
* Print.
*
* If supported, the application menu will be rendered by the desktop
* environment.
*
* Use the base #GActionMap interface to add actions, to respond to the user
* selecting these menu items.
*
* Note that setting an app menu is mainly relevant on macOS, where GTK
* provides a standard app menu unless overwritten by this function.
*
* Since: 4.16
*/
void
gtk_application_set_app_menu (GtkApplication *application,
GMenuModel *app_menu)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
g_return_if_fail (app_menu == NULL || G_IS_MENU_MODEL (app_menu));
if (g_set_object (&priv->app_menu, app_menu))
{
gtk_application_impl_set_app_menu (priv->impl, app_menu);
g_object_notify_by_pspec (G_OBJECT (application), gtk_application_props[PROP_APP_MENU]
);
}
}
/**
* gtk_application_get_app_menu:
* @application: a #GtkApplication
*
* Returns the menu model that has been set with gtk_application_set_app_menu().
*
* Returns: (transfer none) (nullable): the application menu of @application
* or %NULL if no application menu has been set.
*
* Since: 4.16
*/
GMenuModel *
gtk_application_get_app_menu (GtkApplication *application)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_return_val_if_fail (GTK_IS_APPLICATION (application), NULL);
return priv->app_menu;
}
/**
* gtk_application_set_menubar: (attributes org.gtk.Method.set_property=menubar)
* @application: a `GtkApplication`
+6
View File
@@ -84,6 +84,12 @@ void gtk_application_remove_window (GtkApplication *application,
GDK_AVAILABLE_IN_ALL
GList * gtk_application_get_windows (GtkApplication *application);
GDK_AVAILABLE_IN_4_16
GMenuModel * gtk_application_get_app_menu (GtkApplication *application);
GDK_AVAILABLE_IN_4_16
void gtk_application_set_app_menu (GtkApplication *application,
GMenuModel *app_menu);
GDK_AVAILABLE_IN_ALL
GMenuModel * gtk_application_get_menubar (GtkApplication *application);
GDK_AVAILABLE_IN_ALL
+4 -2
View File
@@ -2695,8 +2695,10 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
{
GtkShortcutAction *action = gtk_shortcut_action_parse_builder (builder, string, error);
/* Works for success and failure (NULL) case */
g_value_take_object (value, action);
if (action)
g_value_take_object (value, action);
else
ret = FALSE;
}
else
{
+1
View File
@@ -29,6 +29,7 @@
#include "gsk/gskcairoblurprivate.h"
#include "gsk/gskroundedrectprivate.h"
#include "gdk/gdkrgbaprivate.h"
#include <math.h>
+9
View File
@@ -1222,6 +1222,15 @@ gtk_editable_delegate_get_property (GObject *object,
* }
* ```
*
* Note that the widget which is the delegate *must* be a direct child of
* this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state]
* might not even be called, as the platform change will originate from
* the parent of the delegate, and, as a result, will not work properly.
*
* So, if you can't ensure the direct child condition, you should give the
* delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can
* change your tree to allow this function to work.
*
* Since: 4.10
*/
gboolean
+25
View File
@@ -1852,4 +1852,29 @@ typedef enum { /*< prefix=GTK_POPOVER_MENU >*/
GTK_POPOVER_MENU_NESTED = 1 << 0
} GtkPopoverMenuFlags;
/**
* GtkFontRendering:
* @GTK_FONT_RENDERING_AUTOMATIC: Set up font rendering automatically,
* taking factors like screen resolution and scale into account
* @GTK_FONT_RENDERING_MANUAL: Follow low-level font-related settings
* when configuring font rendering
*
* Values for the [property@Gtk.Settings:gtk-font-rendering] setting
* that influence how GTK renders fonts.
*
* The @GTK_FONT_RENDERING_AUTOMATIC value allows GTK to disregard the
* low-level font-related settings:
* [property@Gtk.Settings:gtk-hint-font-metrics],
* [property@Gtk.Settings:gtk-xft-antialias],
* [property@Gtk.Settings:gtk-xft-hinting],
* [property@Gtk.Settings:gtk-xft-hintstyle] and
* [property@Gtk.Settings:gtk-xft-rgba].
*
* Since: 4.16
*/
typedef enum {
GTK_FONT_RENDERING_AUTOMATIC,
GTK_FONT_RENDERING_MANUAL,
} GtkFontRendering;
G_END_DECLS
+35 -26
View File
@@ -156,7 +156,8 @@
typedef struct {
GdkGLTextureBuilder *builder;
GdkTexture *holder;
GdkTexture *gl_texture;
GdkTexture *dmabuf_texture;
} Texture;
typedef struct {
@@ -415,16 +416,20 @@ delete_one_texture (gpointer data)
Texture *texture = data;
guint id;
if (texture->holder)
gdk_gl_texture_release (GDK_GL_TEXTURE (texture->holder));
if (texture->gl_texture)
{
gdk_gl_texture_release (GDK_GL_TEXTURE (texture->gl_texture));
texture->gl_texture = NULL;
}
id = gdk_gl_texture_builder_get_id (texture->builder);
if (id != 0)
glDeleteTextures (1, &id);
g_object_unref (texture->builder);
g_clear_object (&texture->builder);
g_free (texture);
if (texture->gl_texture == NULL && texture->dmabuf_texture == NULL)
g_free (texture);
}
static void
@@ -449,7 +454,7 @@ gtk_gl_area_ensure_texture (GtkGLArea *area)
link = l;
l = l->next;
if (texture->holder)
if (texture->gl_texture)
continue;
priv->textures = g_list_delete_link (priv->textures, link);
@@ -466,7 +471,8 @@ gtk_gl_area_ensure_texture (GtkGLArea *area)
GLuint id;
priv->texture = g_new (Texture, 1);
priv->texture->holder = NULL;
priv->texture->gl_texture = NULL;
priv->texture->dmabuf_texture = NULL;
priv->texture->builder = gdk_gl_texture_builder_new ();
gdk_gl_texture_builder_set_context (priv->texture->builder, priv->context);
@@ -524,7 +530,7 @@ gtk_gl_area_allocate_texture (GtkGLArea *area)
if (priv->texture == NULL)
return;
g_assert (priv->texture->holder == NULL);
g_assert (priv->texture->gl_texture == NULL);
scale = gtk_widget_get_scale_factor (widget);
width = gtk_widget_get_width (widget) * scale;
@@ -706,7 +712,7 @@ gtk_gl_area_draw_error_screen (GtkGLArea *area,
}
static void
release_texture (gpointer data)
release_gl_texture (gpointer data)
{
Texture *texture = data;
gpointer sync;
@@ -718,7 +724,7 @@ release_texture (gpointer data)
gdk_gl_texture_builder_set_sync (texture->builder, NULL);
}
texture->holder = NULL;
texture->gl_texture = NULL;
}
static void
@@ -735,10 +741,14 @@ release_dmabuf_texture (gpointer data)
{
Texture *texture = data;
release_dmabuf (gdk_dmabuf_texture_get_dmabuf (GDK_DMABUF_TEXTURE (texture->holder)));
g_object_set_data (G_OBJECT (texture->holder), "gltexture", NULL);
g_clear_object (&texture->gl_texture);
texture->holder = NULL;
if (texture->dmabuf_texture == NULL)
return;
release_dmabuf (gdk_dmabuf_texture_get_dmabuf (GDK_DMABUF_TEXTURE (texture->dmabuf_texture )));
texture->dmabuf_texture = NULL;
}
static void
@@ -784,8 +794,8 @@ gtk_gl_area_snapshot (GtkWidget *widget,
{
Texture *texture;
gpointer sync = NULL;
GdkTexture *gltexture;
GdkDmabuf dmabuf;
GdkTexture *holder;
if (priv->needs_render || priv->auto_render)
{
@@ -809,9 +819,10 @@ gtk_gl_area_snapshot (GtkWidget *widget,
gdk_gl_texture_builder_set_sync (texture->builder, sync);
gltexture = gdk_gl_texture_builder_build (texture->builder,
release_texture,
texture);
texture->gl_texture = gdk_gl_texture_builder_build (texture->builder,
release_gl_texture,
texture);
holder = texture->gl_texture;
if (gdk_gl_context_export_dmabuf (priv->context,
gdk_gl_texture_builder_get_id (texture->builder),
@@ -820,22 +831,20 @@ gtk_gl_area_snapshot (GtkWidget *widget,
GdkDmabufTextureBuilder *builder = gdk_dmabuf_texture_builder_new ();
gdk_dmabuf_texture_builder_set_display (builder, gdk_gl_context_get_display (priv->context));
gdk_dmabuf_texture_builder_set_width (builder, gdk_texture_get_width (gltexture));
gdk_dmabuf_texture_builder_set_height (builder, gdk_texture_get_height (gltexture));
gdk_dmabuf_texture_builder_set_width (builder, gdk_texture_get_width (texture->gl_texture));
gdk_dmabuf_texture_builder_set_height (builder, gdk_texture_get_height (texture->gl_texture));
gdk_dmabuf_texture_builder_set_premultiplied (builder, TRUE);
gdk_dmabuf_texture_builder_set_dmabuf (builder, &dmabuf);
texture->holder = gdk_dmabuf_texture_builder_build (builder, release_dmabuf_texture, texture, NULL);
texture->dmabuf_texture = gdk_dmabuf_texture_builder_build (builder, release_dmabuf_texture, texture, NULL);
g_object_unref (builder);
if (texture->holder != NULL)
g_object_set_data_full (G_OBJECT (texture->holder), "gltexture", gltexture, g_object_unref);
if (texture->dmabuf_texture != NULL)
holder = texture->dmabuf_texture;
else
release_dmabuf (&dmabuf);
}
else
texture->holder = gltexture;
/* Our texture is rendered by OpenGL, so it is upside down,
* compared to what GSK expects, so flip it back.
@@ -844,13 +853,13 @@ gtk_gl_area_snapshot (GtkWidget *widget,
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (0, gtk_widget_get_height (widget)));
gtk_snapshot_scale (snapshot, 1, -1);
gtk_snapshot_append_texture (snapshot,
texture->holder,
holder,
&GRAPHENE_RECT_INIT (0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget)));
gtk_snapshot_restore (snapshot);
g_object_unref (texture->holder);
g_object_unref (holder);
}
else
{
+82 -2
View File
@@ -28,6 +28,7 @@
#include "gtkprivate.h"
#include "gdk/gdksurfaceprivate.h"
#include "gdk/gdksubsurfaceprivate.h"
#include "gdk/gdkrgbaprivate.h"
#include "gtktypebuiltins.h"
/**
@@ -82,6 +83,7 @@ struct _GtkGraphicsOffload
GdkSubsurface *subsurface;
GtkGraphicsOffloadEnabled enabled;
gboolean black_background;
};
struct _GtkGraphicsOffloadClass
@@ -94,6 +96,7 @@ enum
PROP_0,
PROP_CHILD,
PROP_ENABLED,
PROP_BLACK_BACKGROUND,
LAST_PROP,
};
@@ -135,6 +138,10 @@ gtk_graphics_offload_set_property (GObject *object,
gtk_graphics_offload_set_enabled (self, g_value_get_enum (value));
break;
case PROP_BLACK_BACKGROUND:
gtk_graphics_offload_set_black_background (self, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -158,6 +165,10 @@ gtk_graphics_offload_get_property (GObject *object,
g_value_set_enum (value, gtk_graphics_offload_get_enabled (self));
break;
case PROP_BLACK_BACKGROUND:
g_value_set_boolean (value, gtk_graphics_offload_get_black_background (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -208,9 +219,9 @@ gtk_graphics_offload_snapshot (GtkWidget *widget,
if (self->subsurface)
gtk_snapshot_push_subsurface (snapshot, self->subsurface);
if (self->enabled == GTK_GRAPHICS_OFFLOAD_ENABLED_WITH_LIGHTBOX)
if (self->black_background)
gtk_snapshot_append_color (snapshot,
&(GdkRGBA) { 0, 0, 0, 1 },
&GDK_RGBA_BLACK,
&GRAPHENE_RECT_INIT (0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget)));
@@ -258,6 +269,17 @@ gtk_graphics_offload_class_init (GtkGraphicsOffloadClass *class)
GTK_GRAPHICS_OFFLOAD_ENABLED,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* GtkGraphicsOffload:black_background: (attributes org.gtk.Property.get=gtk_graphics_offload_get_black_background org.gtk.Property.set=gtk_graphics_offload_set_black_background)
*
* Whether to draw a black background.
*
* Since: 4.16
*/
properties[PROP_BLACK_BACKGROUND] = g_param_spec_boolean ("black-background", NULL, NULL,
FALSE,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, LAST_PROP, properties);
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
@@ -374,3 +396,61 @@ gtk_graphics_offload_get_enabled (GtkGraphicsOffload *self)
return self->enabled;
}
/**
* gtk_graphics_offload_set_black_background:
* @self: a `GtkGraphicsOffload`
* @value: whether to draw a black background behind the content
*
* Sets whether this GtkGraphicsOffload widget will draw a black
* background.
*
* A main use case for this is **_letterboxing_** where black bars are
* visible next to the content if the aspect ratio of the content does
* not match the dimensions of the monitor.
*
* Using this property for letterboxing instead of CSS allows compositors
* to show content with maximum efficiency, using direct scanout to avoid
* extra copies in the compositor.
*
* On Wayland, this is implemented using the
* [single-pixel buffer](https://wayland.app/protocols/single-pixel-buffer-v1)
* protocol.
*
* Since: 4.16
*/
void
gtk_graphics_offload_set_black_background (GtkGraphicsOffload *self,
gboolean value)
{
g_return_if_fail (GTK_IS_GRAPHICS_OFFLOAD (self));
if (self->black_background == value)
return;
self->black_background = value;
gtk_widget_queue_draw (GTK_WIDGET (self));
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_BLACK_BACKGROUND]);
}
/**
* gtk_graphics_offload_get_black_background:
* @self: a `GtkGraphicsOffload`
*
* Returns whether the widget draws a black background.
*
* See [method@Gtk.GraphicsOffload.set_black_background].
*
* Returns: `TRUE` if black background is drawn
*
* Since: 4.16
*/
gboolean
gtk_graphics_offload_get_black_background (GtkGraphicsOffload *self)
{
g_return_val_if_fail (GTK_IS_GRAPHICS_OFFLOAD (self), FALSE);
return self->black_background;
}
+8 -2
View File
@@ -49,7 +49,7 @@ GtkWidget * gtk_graphics_offload_get_child (GtkGraphicsOffload *
* @GTK_GRAPHICS_OFFLOAD_ENABLED: Graphics offloading is enabled.
* @GTK_GRAPHICS_OFFLOAD_DISABLED: Graphics offloading is disabled.
*
* Represents the state of graphics offlodading.
* Represents the state of graphics offloading.
*
* Since: 4.14
*/
@@ -57,7 +57,6 @@ typedef enum
{
GTK_GRAPHICS_OFFLOAD_ENABLED,
GTK_GRAPHICS_OFFLOAD_DISABLED,
GTK_GRAPHICS_OFFLOAD_ENABLED_WITH_LIGHTBOX,
} GtkGraphicsOffloadEnabled;
GDK_AVAILABLE_IN_4_14
@@ -68,4 +67,11 @@ GDK_AVAILABLE_IN_4_14
GtkGraphicsOffloadEnabled
gtk_graphics_offload_get_enabled (GtkGraphicsOffload *self);
GDK_AVAILABLE_IN_4_16
void gtk_graphics_offload_set_black_background (GtkGraphicsOffload *self,
gboolean value);
GDK_AVAILABLE_IN_4_16
gboolean gtk_graphics_offload_get_black_background (GtkGraphicsOffload *self);
G_END_DECLS
+12 -5
View File
@@ -743,7 +743,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
int baseline)
{
GtkGridView *self = GTK_GRID_VIEW (widget);
GtkListTile *tile, *start;
GtkListTile *tile, *start, *footer;
GArray *heights;
int min_row_height, unknown_row_height, row_height, col_min, col_nat;
GtkOrientation orientation;
@@ -880,11 +880,11 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
i = 0;
}
}
/* Add a filler tile for empty space in the bottom right */
footer = gtk_list_item_manager_get_last (self->item_manager);
g_assert (gtk_list_tile_is_footer (footer));
/* Make the footer tile fill the empty space in the bottom right */
if (i > 0)
{
GtkListTile *footer = gtk_list_item_manager_get_last (self->item_manager);
g_assert (gtk_list_tile_is_footer (footer));
tile = gtk_rb_tree_node_get_previous (footer);
gtk_list_tile_set_area_position (self->item_manager,
footer,
@@ -895,8 +895,15 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
column_end (self, xspacing, self->n_columns - 1) - footer->area.x,
tile->area.height);
}
else
{
gtk_list_tile_set_area_size (self->item_manager,
footer,
0,
0);
}
/* step 4: allocate the rest */
/* step 5: allocate the rest */
gtk_list_base_allocate (GTK_LIST_BASE (self));
}
+28 -2
View File
@@ -28,6 +28,7 @@
#include "gtkscrollbar.h"
#include "gtkrange.h"
#include "gtkaccessiblerange.h"
#include "gtkadjustment.h"
#include "gtkorientable.h"
#include "gtkprivate.h"
@@ -107,13 +108,38 @@ enum {
LAST_PROP = PROP_ORIENTATION
};
static void gtk_scrollbar_accessible_range_init (GtkAccessibleRangeInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_WIDGET,
G_ADD_PRIVATE (GtkScrollbar)
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL)
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE_RANGE,
gtk_scrollbar_accessible_range_init))
static GParamSpec *props[LAST_PROP] = { NULL, };
static gboolean
accessible_range_set_current_value (GtkAccessibleRange *range,
double value)
{
GtkScrollbar *self = GTK_SCROLLBAR (range);
GtkAdjustment *adjustment = gtk_scrollbar_get_adjustment (self);
if (adjustment)
{
gtk_adjustment_set_value (adjustment, value);
return TRUE;
}
return FALSE;
}
static void
gtk_scrollbar_accessible_range_init (GtkAccessibleRangeInterface *iface)
{
iface->set_current_value = accessible_range_set_current_value;
}
static void
gtk_scrollbar_get_property (GObject *object,
guint property_id,
+18 -5
View File
@@ -202,6 +202,7 @@ enum {
PROP_LONG_PRESS_TIME,
PROP_KEYNAV_USE_CARET,
PROP_OVERLAY_SCROLLING,
PROP_FONT_RENDERING,
NUM_PROPERTIES
};
@@ -507,7 +508,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
* Since: 4.6
*/
pspecs[PROP_HINT_FONT_METRICS] = g_param_spec_boolean ("gtk-hint-font-metrics", NULL, NULL,
FALSE,
TRUE,
GTK_PARAM_READWRITE);
/**
@@ -955,6 +956,18 @@ gtk_settings_class_init (GtkSettingsClass *class)
TRUE,
GTK_PARAM_READWRITE);
/**
* GtkSettings:gtk-font-rendering:
*
* How GTK font rendering is set up.
*
* Since: 4.16
*/
pspecs[PROP_FONT_RENDERING] = g_param_spec_enum ("gtk-font-rendering", NULL, NULL,
GTK_TYPE_FONT_RENDERING,
GTK_FONT_RENDERING_AUTOMATIC,
GTK_PARAM_READWRITE);
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, pspecs);
}
@@ -1260,6 +1273,9 @@ gtk_settings_notify (GObject *object,
if (settings_update_fontconfig (settings))
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_FONT_CONFIG);
break;
case PROP_FONT_RENDERING:
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_FONT_CONFIG);
break;
case PROP_ENABLE_ANIMATIONS:
settings_invalidate_style (settings);
break;
@@ -1773,7 +1789,6 @@ settings_update_xsetting (GtkSettings *settings,
gboolean force)
{
GType value_type;
GType fundamental_type;
gboolean retval = FALSE;
if (settings->property_values[pspec->param_id - 1].source == GTK_SETTINGS_SOURCE_APPLICATION)
@@ -1783,10 +1798,8 @@ settings_update_xsetting (GtkSettings *settings,
return FALSE;
value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
fundamental_type = G_TYPE_FUNDAMENTAL (value_type);
if ((g_value_type_transformable (G_TYPE_INT, value_type) &&
!(fundamental_type == G_TYPE_ENUM || fundamental_type == G_TYPE_FLAGS)) ||
if (g_value_type_transformable (G_TYPE_INT, value_type) ||
g_value_type_transformable (G_TYPE_STRING, value_type) ||
g_value_type_transformable (GDK_TYPE_RGBA, value_type))
{
+82 -55
View File
@@ -74,6 +74,7 @@
#include "gdk/gdkeventsprivate.h"
#include "gdk/gdkprofilerprivate.h"
#include "gdk/gdkmonitorprivate.h"
#include "gsk/gskdebugprivate.h"
#include "gsk/gskrendererprivate.h"
@@ -6463,10 +6464,8 @@ gtk_widget_update_pango_context (GtkWidget *widget,
GtkCssStyle *style = gtk_css_node_get_style (priv->cssnode);
PangoFontDescription *font_desc;
GtkSettings *settings;
cairo_font_options_t *font_options;
guint old_serial;
gboolean hint_font_metrics = FALSE;
int scale;
GtkFontRendering font_rendering;
old_serial = pango_context_get_serial (context);
@@ -6474,20 +6473,6 @@ gtk_widget_update_pango_context (GtkWidget *widget,
pango_context_set_font_description (context, font_desc);
pango_font_description_free (font_desc);
scale = gtk_widget_get_scale_factor (widget);
settings = gtk_widget_get_settings (widget);
if (settings)
{
g_object_get (settings, "gtk-hint-font-metrics", &hint_font_metrics, NULL);
/* Override the user setting on non-HiDPI */
if (scale == 1)
hint_font_metrics = TRUE;
pango_context_set_round_glyph_positions (context, hint_font_metrics);
}
if (direction != GTK_TEXT_DIR_NONE)
pango_context_set_base_dir (context, direction == GTK_TEXT_DIR_LTR
? PANGO_DIRECTION_LTR
@@ -6495,36 +6480,77 @@ gtk_widget_update_pango_context (GtkWidget *widget,
pango_cairo_context_set_resolution (context, _gtk_css_number_value_get (style->core->dpi, 100));
font_options = (cairo_font_options_t*)g_object_get_qdata (G_OBJECT (widget), quark_font_options);
if (settings && font_options)
{
cairo_font_options_t *options;
options = cairo_font_options_copy (gtk_settings_get_font_options (settings));
cairo_font_options_merge (options, font_options);
cairo_font_options_set_hint_metrics (options,
hint_font_metrics == 1 ? CAIRO_HINT_METRICS_ON
: CAIRO_HINT_METRICS_OFF);
pango_cairo_context_set_font_options (context, options);
cairo_font_options_destroy (options);
}
else if (settings)
{
cairo_font_options_t *options;
options = cairo_font_options_copy (gtk_settings_get_font_options (settings));
cairo_font_options_set_hint_metrics (options,
hint_font_metrics == 1 ? CAIRO_HINT_METRICS_ON
: CAIRO_HINT_METRICS_OFF);
pango_cairo_context_set_font_options (context, options);
cairo_font_options_destroy (options);
}
pango_context_set_font_map (context, gtk_widget_get_effective_font_map (widget));
settings = gtk_widget_get_settings (widget);
if (settings)
g_object_get (settings, "gtk-font-rendering", &font_rendering, NULL);
else
font_rendering = GTK_FONT_RENDERING_AUTOMATIC;
if (font_rendering == GTK_FONT_RENDERING_MANUAL)
{
gboolean hint_font_metrics;
cairo_font_options_t *font_options, *options;
g_object_get (settings, "gtk-hint-font-metrics", &hint_font_metrics, NULL);
options = cairo_font_options_copy (gtk_settings_get_font_options (settings));
font_options = (cairo_font_options_t*)g_object_get_qdata (G_OBJECT (widget), quark_font_options);
if (font_options)
cairo_font_options_merge (options, font_options);
cairo_font_options_set_hint_metrics (options,
hint_font_metrics == 1 ? CAIRO_HINT_METRICS_ON
: CAIRO_HINT_METRICS_OFF);
pango_context_set_round_glyph_positions (context, hint_font_metrics);
pango_cairo_context_set_font_options (context, options);
cairo_font_options_destroy (options);
}
else
{
cairo_font_options_t *options;
double dpi = 96.;
GdkSurface *surface;
surface = gtk_widget_get_surface (widget);
if (surface)
{
GdkDisplay *display;
GdkMonitor *monitor;
display = gdk_surface_get_display (surface);
monitor = gdk_display_get_monitor_at_surface (display, surface);
if (monitor)
dpi = gdk_monitor_get_dpi (monitor);
}
options = cairo_font_options_create ();
cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY);
if (dpi < 200.)
{
/* Not high-dpi. Prefer sharpness by enabling hinting */
cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_ON);
cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);
}
else
{
/* High-dpi. Prefer precise positioning */
cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
}
pango_context_set_round_glyph_positions (context, FALSE);
pango_cairo_context_set_font_options (context, options);
cairo_font_options_destroy (options);
}
return old_serial != pango_context_get_serial (context);
}
@@ -6551,6 +6577,8 @@ gtk_widget_update_default_pango_context (GtkWidget *widget)
*
* When not set, the default font options for the `GdkDisplay`
* will be used.
*
* Deprecated: 4.16
*/
void
gtk_widget_set_font_options (GtkWidget *widget,
@@ -6580,8 +6608,9 @@ gtk_widget_set_font_options (GtkWidget *widget,
*
* Seee [method@Gtk.Widget.set_font_options].
*
* Returns: (transfer none) (nullable): the `cairo_font_options_t`
* of widget
* Returns: (transfer none) (nullable): the `cairo_font_options_t` of widget
*
* Deprecated: 4.16
*/
const cairo_font_options_t *
gtk_widget_get_font_options (GtkWidget *widget)
@@ -8638,28 +8667,26 @@ gtk_widget_accessible_get_bounds (GtkAccessible *self,
parent = gtk_widget_get_parent (widget);
if (parent != NULL)
{
graphene_point_t p;
if (!gtk_widget_compute_point (widget, parent, &GRAPHENE_POINT_INIT (0, 0), &p))
graphene_point_init (&p, 0, 0);
*x = floorf (p.x);
*y = floorf (p.y);
bounds_relative_to = parent;
}
else
{
*x = *y = 0;
bounds_relative_to = widget;
}
if (!gtk_widget_compute_bounds (widget, bounds_relative_to, &bounds))
{
*x = 0;
*y = 0;
*width = 0;
*height = 0;
}
else
{
*width = ceilf (graphene_rect_get_width (&bounds));
*height = ceilf (graphene_rect_get_height (&bounds));
*x = floorf (graphene_rect_get_x (&bounds));
*y = floorf (graphene_rect_get_y (&bounds));
*width = ceil (*x + graphene_rect_get_width (&bounds)) - *x;
*height = ceil (*y + graphene_rect_get_height (&bounds)) - *y;
}
return TRUE;
+2 -2
View File
@@ -636,10 +636,10 @@ GDK_AVAILABLE_IN_ALL
PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_16
void gtk_widget_set_font_options (GtkWidget *widget,
const cairo_font_options_t *options);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_16
const cairo_font_options_t *gtk_widget_get_font_options (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
+6
View File
@@ -37,6 +37,7 @@
#include "gdk/gdkdebugprivate.h"
#include "gdk/gdkdisplayprivate.h"
#include "gdk/gdkmonitorprivate.h"
#include "profile_conf.h"
@@ -693,6 +694,7 @@ add_wayland_protocols (GdkDisplay *display,
append_wayland_protocol_row (gen, (struct wl_proxy *)d->fractional_scale);
append_wayland_protocol_row (gen, (struct wl_proxy *)d->viewporter);
append_wayland_protocol_row (gen, (struct wl_proxy *)d->presentation);
append_wayland_protocol_row (gen, (struct wl_proxy *)d->single_pixel_buffer);
}
}
#endif
@@ -800,6 +802,10 @@ add_monitor (GtkInspectorGeneral *gen,
add_label_row (gen, list, "Size", value, 10);
g_free (value);
value = g_strdup_printf ("%.1f dpi", gdk_monitor_get_dpi (monitor));
add_label_row (gen, list, "Resolution", value, 10);
g_free (value);
if (gdk_monitor_get_refresh_rate (monitor) != 0)
{
value = g_strdup_printf ("%.2fHz",
+28 -16
View File
@@ -97,16 +97,16 @@ object_property_finalize (GObject *object)
g_free (self->name);
g_free (self->value);
g_object_unref (self->texture);
g_clear_object (&self->texture);
G_OBJECT_CLASS (object_property_parent_class)->finalize (object);
}
static void
object_property_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
guint property_id,
GValue *value,
GParamSpec *pspec)
{
ObjectProperty *self = OBJECT_PROPERTY (object);
@@ -117,7 +117,7 @@ object_property_get_property (GObject *object,
break;
case OBJECT_PROPERTY_PROP_VALUE:
g_value_set_string (value, self->value);
g_value_set_string (value, self->value ? self->value : "");
break;
case OBJECT_PROPERTY_PROP_TEXTURE:
@@ -853,12 +853,23 @@ get_linear_gradient_texture (gsize n_stops, const GskColorStop *stops)
return texture;
}
static void
list_store_add_object_property (GListStore *store,
const char *name,
const char *value,
GdkTexture *texture)
{
gpointer object = object_property_new (name, value, texture);
g_list_store_append (store, object);
g_object_unref (object);
}
static void
add_text_row (GListStore *store,
const char *name,
const char *text)
{
g_list_store_append (store, object_property_new (name, text, NULL));
list_store_add_object_property (store, name, text, NULL);
}
static void
@@ -871,7 +882,7 @@ add_color_row (GListStore *store,
text = gdk_rgba_to_string (color);
texture = get_color_texture (color);
g_list_store_append (store, object_property_new (name, text, texture));
list_store_add_object_property (store, name, text, texture);
g_free (text);
g_object_unref (texture);
}
@@ -971,22 +982,23 @@ populate_render_node_properties (GListStore *store,
texture = gdk_texture_new_for_surface (drawn_surface);
cairo_surface_destroy (drawn_surface);
g_list_store_append (store, object_property_new ("Surface", "", texture));
list_store_add_object_property (store, "Surface", NULL, texture);
g_object_unref (texture);
}
break;
case GSK_TEXTURE_NODE:
{
GdkTexture *texture = g_object_ref (gsk_texture_node_get_texture (node));
g_list_store_append (store, object_property_new ("Texture", "", texture));
GdkTexture *texture = gsk_texture_node_get_texture (node);
list_store_add_object_property (store, "Texture", NULL, texture);
}
break;
case GSK_TEXTURE_SCALE_NODE:
{
GdkTexture *texture = g_object_ref (gsk_texture_scale_node_get_texture (node));
GdkTexture *texture = gsk_texture_scale_node_get_texture (node);
GskScalingFilter filter = gsk_texture_scale_node_get_filter (node);
g_list_store_append (store, object_property_new ("Texture", "", texture));
list_store_add_object_property (store, "Texture", NULL, texture);
tmp = g_enum_to_string (GSK_TYPE_SCALING_FILTER, filter);
add_text_row (store, "Filter", tmp);
@@ -1022,7 +1034,7 @@ populate_render_node_properties (GListStore *store,
}
texture = get_linear_gradient_texture (n_stops, stops);
g_list_store_append (store, object_property_new ("Color Stops", s->str, texture));
list_store_add_object_property (store, "Color Stops", s->str, texture);
g_object_unref (texture);
g_string_free (s, TRUE);
@@ -1064,7 +1076,7 @@ populate_render_node_properties (GListStore *store,
}
texture = get_linear_gradient_texture (n_stops, stops);
g_list_store_append (store, object_property_new ("Color Stops", s->str, texture));
list_store_add_object_property (store, "Color Stops", s->str, texture);
g_object_unref (texture);
g_string_free (s, TRUE);
@@ -1098,7 +1110,7 @@ populate_render_node_properties (GListStore *store,
}
texture = get_linear_gradient_texture (n_stops, stops);
g_list_store_append (store, object_property_new ("Color Stops", s->str, texture));
list_store_add_object_property (store, "Color Stops", s->str, texture);
g_object_unref (texture);
g_string_free (s, TRUE);
@@ -1147,7 +1159,7 @@ populate_render_node_properties (GListStore *store,
text = gdk_rgba_to_string (&colors[i]);
tmp = g_strdup_printf ("%.2f, %s", widths[i], text);
texture = get_color_texture (&colors[i]);
g_list_store_append (store, object_property_new (name[i], tmp, texture));
list_store_add_object_property (store, name[i], tmp, texture);
g_object_unref (texture);
g_free (text);
+11 -10
View File
@@ -5,6 +5,7 @@
#include "gtknative.h"
#include "gdksurfaceprivate.h"
#include "gdksubsurfaceprivate.h"
#include "gdkrgbaprivate.h"
struct _GtkSubsurfaceOverlay
{
@@ -39,26 +40,26 @@ gtk_subsurface_overlay_snapshot (GtkInspectorOverlay *overlay,
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
{
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
graphene_rect_t dest;
graphene_rect_t rect;
GdkRGBA color;
if (gdk_subsurface_get_texture (subsurface) == NULL)
continue;
if (gdk_subsurface_is_above_parent (subsurface))
gdk_rgba_parse (&color, "goldenrod");
else
gdk_rgba_parse (&color, "magenta");
gdk_subsurface_get_texture_rect (subsurface, &rect);
gdk_subsurface_get_dest (subsurface, &dest);
if (gdk_subsurface_is_above_parent (subsurface))
color = GDK_RGBA ("DAA520"); /* goldenrod */
else
color = GDK_RGBA ("FF00FF"); /* magenta */
/* Use 4 color nodes since a border node overlaps and prevents
* the subsurface from being raised.
*/
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (dest.origin.x - 2, dest.origin.y - 2, 2, dest.size.height + 4));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (dest.origin.x - 2, dest.origin.y - 2, dest.size.width + 4, 2));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (dest.origin.x - 2, dest.origin.y + dest.size.height, dest.size.width + 4, 2));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (dest.origin.x + dest.size.width, dest.origin.y - 2, 2, dest.size.height + 4));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (rect.origin.x - 2, rect.origin.y - 2, 2, rect.size.height + 4));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (rect.origin.x - 2, rect.origin.y - 2, rect.size.width + 4, 2));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (rect.origin.x - 2, rect.origin.y + rect.size.height, rect.size.width + 4, 2));
gtk_snapshot_append_color (snapshot, &color, &GRAPHENE_RECT_INIT (rect.origin.x + rect.size.width, rect.origin.y - 2, 2, rect.size.height + 4));
}
gtk_snapshot_restore (snapshot);
+41 -135
View File
@@ -81,9 +81,7 @@ struct _GtkInspectorVisual
GtkWidget *cursor_size_spin;
GtkWidget *direction_combo;
GtkWidget *font_button;
GtkWidget *font_aa_switch;
GtkWidget *font_hinting_combo;
GtkWidget *metrics_hinting_switch;
GtkWidget *font_rendering_combo;
GtkWidget *animation_switch;
GtkWidget *font_scale_entry;
GtkAdjustment *font_scale_adjustment;
@@ -110,6 +108,7 @@ struct _GtkInspectorVisual
GtkInspectorOverlay *subsurface_overlay;
GdkDisplay *display;
GtkSettings *settings;
};
typedef struct _GtkInspectorVisualClass
@@ -197,27 +196,22 @@ get_dpi_ratio (GtkInspectorVisual *vis)
static double
get_font_scale (GtkInspectorVisual *vis)
{
double ratio = get_dpi_ratio (vis);
int dpi_int;
g_object_get (gtk_settings_get_for_display (vis->display),
"gtk-xft-dpi", &dpi_int,
NULL);
g_object_get (vis->settings, "gtk-xft-dpi", &dpi_int, NULL);
return dpi_int / ratio;
return dpi_int / get_dpi_ratio (vis);
}
static void
update_font_scale (GtkInspectorVisual *vis,
double factor,
gboolean update_adjustment,
gboolean update_entry)
gboolean update_entry,
gboolean write_back)
{
double ratio = get_dpi_ratio (vis);
g_object_set (gtk_settings_get_for_display (vis->display),
"gtk-xft-dpi", (int)(factor * ratio),
NULL);
if (write_back)
g_object_set (vis->settings, "gtk-xft-dpi", (int)(factor * get_dpi_ratio (vis)), NULL);
if (update_adjustment)
gtk_adjustment_set_value (vis->font_scale_adjustment, factor);
@@ -238,98 +232,29 @@ font_scale_adjustment_changed (GtkAdjustment *adjustment,
double factor;
factor = gtk_adjustment_get_value (adjustment);
update_font_scale (vis, factor, FALSE, TRUE);
update_font_scale (vis, factor, FALSE, TRUE, TRUE);
}
static gboolean
get_font_aa (GtkInspectorVisual *vis)
static GtkFontRendering
get_font_rendering (GtkInspectorVisual *vis)
{
int aa;
GtkFontRendering font_rendering;
g_object_get (gtk_settings_get_for_display (vis->display),
"gtk-xft-antialias", &aa,
NULL);
g_object_get (vis->settings, "gtk-font-rendering", &font_rendering, NULL);
return aa != 0;
}
static gboolean
get_metrics_hinting (GtkInspectorVisual *vis)
{
gboolean hinting;
g_object_get (gtk_settings_get_for_display (vis->display),
"gtk-hint-font-metrics", &hinting,
NULL);
return hinting;
}
static unsigned int
get_font_hinting (GtkInspectorVisual *vis)
{
int hinting;
char *hint_style_str;
unsigned int hint_style;
g_object_get (gtk_settings_get_for_display (vis->display),
"gtk-xft-hinting", &hinting,
"gtk-xft-hintstyle", &hint_style_str,
NULL);
hint_style = 1;
if (hinting == 0)
{
hint_style = 0;
}
else
{
if (strcmp (hint_style_str, "hintnone") == 0)
hint_style = 0;
else if (strcmp (hint_style_str, "hintslight") == 0)
hint_style = 1;
else if (strcmp (hint_style_str, "hintmedium") == 0)
hint_style = 2;
else if (strcmp (hint_style_str, "hintfull") == 0)
hint_style = 3;
}
g_free (hint_style_str);
return hint_style;
return font_rendering;
}
static void
update_font_hinting (GtkInspectorVisual *vis,
unsigned int hint_style)
update_font_rendering (GtkInspectorVisual *vis,
GtkFontRendering font_rendering)
{
const char *styles[] = { "hintnone", "hintslight", "hintmedium", "hintfull" };
if (get_font_rendering (vis) == font_rendering)
return;
g_object_set (gtk_settings_get_for_display (vis->display),
"gtk-xft-hinting", hint_style != 0,
"gtk-xft-hintstyle", styles[hint_style],
NULL);
g_object_set (vis->settings, "gtk-font-rendering", font_rendering, NULL);
}
static void
font_aa_activate (GtkSwitch *sw,
GParamSpec *pspec,
GtkInspectorVisual *vis)
{
g_object_set (gtk_settings_get_for_display (vis->display),
"gtk-xft-antialias", gtk_switch_get_active (sw) ? 1 : 0,
NULL);
}
static void
metrics_hinting_activate (GtkSwitch *sw,
GParamSpec *pspec,
GtkInspectorVisual *vis)
{
g_object_set (gtk_settings_get_for_display (vis->display),
"gtk-hint-font-metrics", gtk_switch_get_active (sw),
NULL);
}
static void
font_scale_entry_activated (GtkEntry *entry,
GtkInspectorVisual *vis)
@@ -339,7 +264,7 @@ font_scale_entry_activated (GtkEntry *entry,
factor = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL)
update_font_scale (vis, factor, TRUE, FALSE);
update_font_scale (vis, factor, TRUE, FALSE, TRUE);
}
static void
@@ -750,7 +675,7 @@ init_theme (GtkInspectorVisual *vis)
gtk_drop_down_set_model (GTK_DROP_DOWN (vis->theme_combo), G_LIST_MODEL (names));
g_object_bind_property_full (gtk_settings_get_for_display (vis->display), "gtk-theme-name",
g_object_bind_property_full (vis->settings, "gtk-theme-name",
vis->theme_combo, "selected",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
theme_to_pos, pos_to_theme, names, (GDestroyNotify)g_object_unref);
@@ -769,8 +694,7 @@ init_theme (GtkInspectorVisual *vis)
static void
init_dark (GtkInspectorVisual *vis)
{
g_object_bind_property (gtk_settings_get_for_display (vis->display),
"gtk-application-prefer-dark-theme",
g_object_bind_property (vis->settings, "gtk-application-prefer-dark-theme",
vis->dark_switch, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -854,7 +778,7 @@ init_icons (GtkInspectorVisual *vis)
gtk_drop_down_set_model (GTK_DROP_DOWN (vis->icon_combo), G_LIST_MODEL (names));
g_object_bind_property_full (gtk_settings_get_for_display (vis->display), "gtk-icon-theme-name",
g_object_bind_property_full (vis->settings, "gtk-icon-theme-name",
vis->icon_combo, "selected",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
theme_to_pos, pos_to_theme, names, (GDestroyNotify)g_object_unref);
@@ -928,7 +852,7 @@ init_cursors (GtkInspectorVisual *vis)
gtk_drop_down_set_model (GTK_DROP_DOWN (vis->cursor_combo), G_LIST_MODEL (names));
g_object_bind_property_full (gtk_settings_get_for_display (vis->display), "gtk-cursor-theme-name",
g_object_bind_property_full (vis->settings, "gtk-cursor-theme-name",
vis->cursor_combo, "selected",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
theme_to_pos, pos_to_theme, names, (GDestroyNotify)g_object_unref);
@@ -940,7 +864,7 @@ cursor_size_changed (GtkAdjustment *adjustment, GtkInspectorVisual *vis)
int size;
size = gtk_adjustment_get_value (adjustment);
g_object_set (gtk_settings_get_for_display (vis->display), "gtk-cursor-theme-size", size, NULL);
g_object_set (vis->settings, "gtk-cursor-theme-size", size, NULL);
}
static void
@@ -948,7 +872,7 @@ init_cursor_size (GtkInspectorVisual *vis)
{
int size;
g_object_get (gtk_settings_get_for_display (vis->display), "gtk-cursor-theme-size", &size, NULL);
g_object_get (vis->settings, "gtk-cursor-theme-size", &size, NULL);
if (size == 0)
size = 32;
@@ -994,8 +918,7 @@ name_from_desc (GBinding *binding,
static void
init_font (GtkInspectorVisual *vis)
{
g_object_bind_property_full (gtk_settings_get_for_display (vis->display),
"gtk-font-name",
g_object_bind_property_full (vis->settings, "gtk-font-name",
vis->font_button, "font-desc",
G_BINDING_BIDIRECTIONAL|G_BINDING_SYNC_CREATE,
name_to_desc,
@@ -1009,7 +932,7 @@ init_font_scale (GtkInspectorVisual *vis)
double scale;
scale = get_font_scale (vis);
update_font_scale (vis, scale, TRUE, TRUE);
update_font_scale (vis, scale, TRUE, TRUE, FALSE);
g_signal_connect (vis->font_scale_adjustment, "value-changed",
G_CALLBACK (font_scale_adjustment_changed), vis);
g_signal_connect (vis->font_scale_entry, "activate",
@@ -1017,35 +940,23 @@ init_font_scale (GtkInspectorVisual *vis)
}
static void
init_font_aa (GtkInspectorVisual *vis)
font_rendering_changed (GtkDropDown *combo,
GParamSpec *pspec,
GtkInspectorVisual *vis)
{
gtk_switch_set_active (GTK_SWITCH (vis->font_aa_switch), get_font_aa (vis));
update_font_rendering (vis, gtk_drop_down_get_selected (combo));
}
static void
font_hinting_changed (GtkDropDown *combo,
GParamSpec *pspec,
GtkInspectorVisual *vis)
init_font_rendering (GtkInspectorVisual *vis)
{
update_font_hinting (vis, gtk_drop_down_get_selected (combo));
}
static void
init_font_hinting (GtkInspectorVisual *vis)
{
gtk_drop_down_set_selected (GTK_DROP_DOWN (vis->font_hinting_combo), get_font_hinting (vis));
}
static void
init_metrics_hinting (GtkInspectorVisual *vis)
{
gtk_switch_set_active (GTK_SWITCH (vis->metrics_hinting_switch), get_metrics_hinting (vis));
gtk_drop_down_set_selected (GTK_DROP_DOWN (vis->font_rendering_combo), get_font_rendering (vis));
}
static void
init_animation (GtkInspectorVisual *vis)
{
g_object_bind_property (gtk_settings_get_for_display (vis->display), "gtk-enable-animations",
g_object_bind_property (vis->settings, "gtk-enable-animations",
vis->animation_switch, "active",
G_BINDING_BIDIRECTIONAL|G_BINDING_SYNC_CREATE);
}
@@ -1290,9 +1201,7 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_adjustment);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_entry);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, visual_box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_aa_switch);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_hinting_combo);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, metrics_hinting_switch);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_rendering_combo);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, debug_box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_button);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_scale_entry);
@@ -1310,9 +1219,7 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
gtk_widget_class_bind_template_callback (widget_class, updates_activate);
gtk_widget_class_bind_template_callback (widget_class, cairo_activate);
gtk_widget_class_bind_template_callback (widget_class, direction_changed);
gtk_widget_class_bind_template_callback (widget_class, font_aa_activate);
gtk_widget_class_bind_template_callback (widget_class, font_hinting_changed);
gtk_widget_class_bind_template_callback (widget_class, metrics_hinting_activate);
gtk_widget_class_bind_template_callback (widget_class, font_rendering_changed);
gtk_widget_class_bind_template_callback (widget_class, baselines_activate);
gtk_widget_class_bind_template_callback (widget_class, layout_activate);
gtk_widget_class_bind_template_callback (widget_class, focus_activate);
@@ -1324,10 +1231,11 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
}
void
gtk_inspector_visual_set_display (GtkInspectorVisual *vis,
GdkDisplay *display)
gtk_inspector_visual_set_display (GtkInspectorVisual *vis,
GdkDisplay *display)
{
vis->display = display;
vis->settings = gtk_settings_get_for_display (display);
init_direction (vis);
init_theme (vis);
@@ -1337,9 +1245,7 @@ gtk_inspector_visual_set_display (GtkInspectorVisual *vis,
init_cursor_size (vis);
init_font (vis);
init_font_scale (vis);
init_font_aa (vis);
init_font_hinting (vis);
init_metrics_hinting (vis);
init_font_rendering (vis);
init_animation (vis);
init_slowdown (vis);
init_gl (vis);
+8 -62
View File
@@ -358,51 +358,24 @@
<object class="GtkBox">
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="font_aa_label">
<property name="label" translatable="yes">Antialiasing</property>
<object class="GtkLabel" id="font_rendering_label">
<property name="label" translatable="yes">Rendering</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="font_aa_switch">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
<signal name="notify::active" handler="font_aa_activate"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkBox">
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="font_hinting_label">
<property name="label" translatable="yes">Hinting</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkDropDown" id="font_hinting_combo">
<object class="GtkDropDown" id="font_rendering_combo">
<property name="halign">end</property>
<property name="valign">baseline-center</property>
<property name="hexpand">1</property>
<signal name="notify::selected" handler="font_hinting_changed"/>
<signal name="notify::selected" handler="font_rendering_changed"/>
<property name="model">
<object class="GtkStringList">
<items>
<item translatable="yes" context="Font hinting style">None</item>
<item translatable="yes" context="Font hinting style">Slight</item>
<item translatable="yes" context="Font hinting style">Medium</item>
<item translatable="yes" context="Font hinting style">Full</item>
<item translatable="yes" context="Font rendering">Automatic</item>
<item translatable="yes" context="Font rendering">Manual</item>
</items>
</object>
</property>
@@ -412,31 +385,6 @@
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkBox">
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="metrics_hinting_label">
<property name="label" translatable="yes">Metrics Hinting</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="metrics_hinting_switch">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
<signal name="notify::active" handler="metrics_hinting_activate"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
@@ -787,9 +735,7 @@
<widget name="cursor_label"/>
<widget name="cursor_size_label"/>
<widget name="font_label"/>
<widget name="font_aa_label"/>
<widget name="font_hinting_label"/>
<widget name="metrics_hinting_label"/>
<widget name="font_rendering_label"/>
<widget name="direction_label"/>
<widget name="animation_label"/>
<widget name="updates_label"/>
@@ -813,7 +759,7 @@
<widget name="cursor_combo"/>
<widget name="font_button"/>
<widget name="direction_combo"/>
<widget name="font_hinting_combo"/>
<widget name="font_rendering_combo"/>
</widgets>
</object>
<object class="GtkSizeGroup">
+6 -45
View File
@@ -636,49 +636,6 @@ install_headers(gtk_print_headers, subdir: 'gtk-4.0/gtk/print')
gtk_sources = gtk_public_sources + gtk_private_sources
proto_sources = [
['text-input', 'unstable', 'v3', ],
]
im_wayland_sources = files('gtkimcontextwayland.c')
foreach p: proto_sources
proto_name = p.get(0)
proto_stability = p.get(1)
if wayland_enabled
if proto_stability == 'stable'
output_base = proto_name
input = files('@0@.xml'.format(proto_name))
else
proto_version = p.get(2)
output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version)
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
endif
# wayland_scanner is defined in gdk/wayland/meson.build
im_wayland_sources += custom_target('@0@ client header'.format(output_base),
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
],
)
im_wayland_sources += custom_target('@0@ source'.format(output_base),
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
],
)
endif
endforeach
if os_unix and tracker3_dep.found()
gtk_sources += 'gtksearchenginetracker3.c'
endif
@@ -708,8 +665,12 @@ if x11_enabled
endif
if wayland_enabled
gtk_sources += ['gtkapplication-wayland.c']
gtk_sources += im_wayland_sources
xml = wlmod.find_protocol('text-input', state: 'unstable', version: 3)
gtk_sources += [
wlmod.scan_xml(xml),
'gtkimcontextwayland.c',
'gtkapplication-wayland.c',
]
endif
if x11_enabled or wayland_enabled
-1
View File
@@ -3940,7 +3940,6 @@ video {
min-height: 64px;
border-radius: 32px;
}
background: black;
}
/************
+1
View File
@@ -6,6 +6,7 @@
<child>
<object class="GtkGraphicsOffload" id="graphics_offload">
<property name="enabled">disabled</property>
<property name="black-background">1</property>
<property name="child"><object class="GtkPicture" id="video_picture"/></property>
</object>
</child>
-2
View File
@@ -490,8 +490,6 @@ if wayland_enabled
wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req)
wlegldep = dependency('wayland-egl')
wlproto_dir = wlprotocolsdep.get_variable('pkgdatadir')
wayland_pkgs = [
'wayland-client @0@'.format(wayland_req),
'xkbcommon @0@'.format(xkbcommon_req),
+202 -159
View File
@@ -11,9 +11,9 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2024-03-04 21:36+0000\n"
"PO-Revision-Date: 2024-03-05 11:34+0000\n"
"Last-Translator: Bruce Cowan <bruce@bcowan.me.uk>\n"
"POT-Creation-Date: 2024-04-04 17:02+0000\n"
"PO-Revision-Date: 2024-04-06 11:58+0100\n"
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
"Language-Team: English - United Kingdom <en@li.org>\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
@@ -35,7 +35,7 @@ msgstr "This clipboard cannot store data."
msgid "Cannot read from empty clipboard."
msgstr "Cannot read from empty clipboard."
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:606
msgid "No compatible formats to transfer clipboard contents."
msgstr "No compatible formats to transfer clipboard contents."
@@ -50,11 +50,11 @@ msgstr "Cannot provide contents as “%s”"
msgid "Cannot provide contents as %s"
msgstr "Cannot provide contents as %s"
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:464
msgid "The current backend does not support OpenGL"
msgstr "The current backend does not support OpenGL"
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1601
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1600
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Vulkan support disabled via GDK_DEBUG"
@@ -62,46 +62,46 @@ msgstr "Vulkan support disabled via GDK_DEBUG"
msgid "GL support disabled via GDK_DEBUG"
msgstr "GL support disabled via GDK_DEBUG"
#: gdk/gdkdisplay.c:1665
#: gdk/gdkdisplay.c:1675
msgid "No EGL configuration available"
msgstr "No EGL configuration available"
#: gdk/gdkdisplay.c:1673
#: gdk/gdkdisplay.c:1683
msgid "Failed to get EGL configurations"
msgstr "Failed to get EGL configurations"
#: gdk/gdkdisplay.c:1703
#: gdk/gdkdisplay.c:1713
msgid "No EGL configuration with required features found"
msgstr "No EGL configuration with required features found"
#: gdk/gdkdisplay.c:1710
#: gdk/gdkdisplay.c:1720
msgid "No perfect EGL configuration found"
msgstr "No perfect EGL configuration found"
#: gdk/gdkdisplay.c:1752
#: gdk/gdkdisplay.c:1762
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "EGL implementation is missing extension %s"
msgstr[1] "EGL implementation is missing %2$d extensions: %1$s"
#: gdk/gdkdisplay.c:1801
#: gdk/gdkdisplay.c:1811
msgid "libEGL not available in this sandbox"
msgstr "libEGL not available in this sandbox"
#: gdk/gdkdisplay.c:1802
#: gdk/gdkdisplay.c:1812
msgid "libEGL not available"
msgstr "libEGL not available"
#: gdk/gdkdisplay.c:1812
#: gdk/gdkdisplay.c:1822
msgid "Failed to create EGL display"
msgstr "Failed to create EGL display"
#: gdk/gdkdisplay.c:1821
#: gdk/gdkdisplay.c:1831
msgid "Could not initialize EGL display"
msgstr "Could not initialise EGL display"
#: gdk/gdkdisplay.c:1831
#: gdk/gdkdisplay.c:1841
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL version %d.%d is too old. GTK requires %d.%d"
@@ -114,32 +114,32 @@ msgstr "Dragndrop from other applications is not supported."
msgid "No compatible formats to transfer contents."
msgstr "No compatible formats to transfer contents."
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
#: gdk/gdkglcontext.c:424 gdk/x11/gdkglcontext-glx.c:645
msgid "No GL API allowed."
msgstr "No GL API allowed."
#: gdk/gdkglcontext.c:442 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/gdkglcontext.c:447 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/win32/gdkglcontext-win32-wgl.c:538
#: gdk/win32/gdkglcontext-win32-wgl.c:582 gdk/x11/gdkglcontext-glx.c:691
msgid "Unable to create a GL context"
msgstr "Unable to create a GL context"
#: gdk/gdkglcontext.c:1304
#: gdk/gdkglcontext.c:1310
msgid "OpenGL ES disabled via GDK_DEBUG"
msgstr "OpenGL ES disabled via GDK_DEBUG"
#: gdk/gdkglcontext.c:1316
#: gdk/gdkglcontext.c:1322
msgid "OpenGL disabled via GDK_DEBUG"
msgstr "OpenGL disabled via GDK_DEBUG"
#: gdk/gdkglcontext.c:1327
#: gdk/gdkglcontext.c:1333
#, c-format
msgid "Application does not support %s API"
msgstr "Application does not support %s API"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:2113
#: gdk/gdkglcontext.c:2123
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "Trying to use %s, but %s is already in use"
@@ -1075,7 +1075,7 @@ msgid "Pick a Font"
msgstr "Pick a Font"
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3815
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:285
msgid "Font"
msgstr "Font"
@@ -2330,7 +2330,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "If you delete an item, it will be permanently lost."
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
msgid "_Delete"
msgstr "_Delete"
@@ -2540,7 +2540,7 @@ msgid "_Time"
msgstr "_Time"
#: gtk/gtkfilechooserwidget.c:7375 gtk/gtkplacessidebar.c:2306
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:19
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:18
#: gtk/inspector/css-node-tree.ui:22 gtk/inspector/prop-list.ui:24
#: gtk/ui/gtkfilechooserwidget.ui:385 gtk/print/ui/gtkprintunixdialog.ui:80
msgid "Name"
@@ -2669,19 +2669,19 @@ msgstr "Close"
msgid "Close the infobar"
msgstr "Close the infobar"
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
msgid "Cu_t"
msgstr "Cu_t"
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
msgid "_Copy"
msgstr "_Copy"
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
msgid "_Paste"
msgstr "_Paste"
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
msgid "Select _All"
msgstr "Select _All"
@@ -2693,7 +2693,7 @@ msgstr "_Open Link"
msgid "Copy _Link Address"
msgstr "Copy _Link Address"
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
msgid "Context menu"
msgstr "Context menu"
@@ -3384,7 +3384,7 @@ msgstr "Out of paper"
#. Translators: this is a printer status.
#: gtk/print/gtkprintoperation-win32.c:640
#: modules/printbackends/gtkprintbackendcpdb.c:1528
#: modules/printbackends/gtkprintbackendcpdb.c:1533
#: modules/printbackends/gtkprintbackendcups.c:2639
msgid "Paused"
msgstr "Paused"
@@ -3455,42 +3455,42 @@ msgstr "Getting printer information…"
#. * multiple pages on a sheet when printing
#.
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, top to bottom"
msgstr "Left to right, top to bottom"
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, bottom to top"
msgstr "Left to right, bottom to top"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, top to bottom"
msgstr "Right to left, top to bottom"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, bottom to top"
msgstr "Right to left, bottom to top"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, left to right"
msgstr "Top to bottom, left to right"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, right to left"
msgstr "Top to bottom, right to left"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, left to right"
msgstr "Bottom to top, left to right"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, right to left"
msgstr "Bottom to top, right to left"
@@ -3628,15 +3628,15 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Sidebar"
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
#: gtk/gtktext.c:6208 gtk/gtktextview.c:9125
msgid "Insert _Emoji"
msgstr "Insert _Emoji"
#: gtk/gtktextview.c:9088
#: gtk/gtktextview.c:9107
msgid "_Undo"
msgstr "_Undo"
#: gtk/gtktextview.c:9092
#: gtk/gtktextview.c:9111
msgid "_Redo"
msgstr "_Redo"
@@ -3864,7 +3864,7 @@ msgctxt "Vulkan version"
msgid "None"
msgstr "None"
#: gtk/inspector/general.c:922
#: gtk/inspector/general.c:924
msgid "IM Context is hardcoded by GTK_IM_MODULE"
msgstr "IM Context is hardcoded by GTK_IM_MODULE"
@@ -4050,7 +4050,7 @@ msgstr "Frame Count"
msgid "Frame Rate"
msgstr "Frame Rate"
#: gtk/inspector/misc-info.ui:527
#: gtk/inspector/misc-info.ui:527 gtk/inspector/visual.ui:315
msgid "Scale"
msgstr "Scale"
@@ -4235,27 +4235,27 @@ msgstr "Size:"
msgid "Trigger"
msgstr "Trigger"
#: gtk/inspector/size-groups.c:225
#: gtk/inspector/size-groups.c:228
msgctxt "sizegroup mode"
msgid "None"
msgstr "None"
#: gtk/inspector/size-groups.c:226
#: gtk/inspector/size-groups.c:229
msgctxt "sizegroup mode"
msgid "Horizontal"
msgstr "Horizontal"
#: gtk/inspector/size-groups.c:227
#: gtk/inspector/size-groups.c:230
msgctxt "sizegroup mode"
msgid "Vertical"
msgstr "Vertical"
#: gtk/inspector/size-groups.c:228
#: gtk/inspector/size-groups.c:231
msgctxt "sizegroup mode"
msgid "Both"
msgstr "Both"
#: gtk/inspector/size-groups.c:240
#: gtk/inspector/size-groups.c:243
msgid "Mode"
msgstr "Mode"
@@ -4312,14 +4312,10 @@ msgstr "Hierarchy"
msgid "Implements"
msgstr "Implements"
#: gtk/inspector/visual.c:674 gtk/inspector/visual.c:693
#: gtk/inspector/visual.c:765 gtk/inspector/visual.c:784
msgid "Theme is hardcoded by GTK_THEME"
msgstr "Theme is hardcoded by GTK_THEME"
#: gtk/inspector/visual.c:942
msgid "Backend does not support window scaling"
msgstr "Backend does not support window scaling"
#: gtk/inspector/visual.ui:34
msgid "GTK Theme"
msgstr "GTK Theme"
@@ -4340,43 +4336,76 @@ msgstr "Cursor Size"
msgid "Icon Theme"
msgstr "Icon Theme"
#: gtk/inspector/visual.ui:194
msgid "Font Scale"
msgstr "Font Scale"
#: gtk/inspector/visual.ui:239
#: gtk/inspector/visual.ui:169
msgid "Text Direction"
msgstr "Text Direction"
#: gtk/inspector/visual.ui:254
#: gtk/inspector/visual.ui:184
msgid "Left-to-Right"
msgstr "Left-to-Right"
#: gtk/inspector/visual.ui:255
#: gtk/inspector/visual.ui:185
msgid "Right-to-Left"
msgstr "Right-to-Left"
#: gtk/inspector/visual.ui:273
msgid "Window Scaling"
msgstr "Window Scaling"
#: gtk/inspector/visual.ui:306
#: gtk/inspector/visual.ui:202
msgid "Animations"
msgstr "Animations"
#: gtk/inspector/visual.ui:331
#: gtk/inspector/visual.ui:227
msgid "Slowdown"
msgstr "Slowdown"
#: gtk/inspector/visual.ui:385
#: gtk/inspector/visual.ui:362
msgid "Antialiasing"
msgstr "Antialiasing"
#: gtk/inspector/visual.ui:387
#| msgctxt "print operation status"
#| msgid "Printing"
msgid "Hinting"
msgstr "Hinting"
#: gtk/inspector/visual.ui:402
#| msgctxt "font"
#| msgid "None"
msgctxt "Font hinting style"
msgid "None"
msgstr "None"
#: gtk/inspector/visual.ui:403
#| msgctxt "keyboard label"
#| msgid "Right"
msgctxt "Font hinting style"
msgid "Slight"
msgstr "Slight"
#: gtk/inspector/visual.ui:404
#| msgid "Medium"
msgctxt "Font hinting style"
msgid "Medium"
msgstr "Medium"
#: gtk/inspector/visual.ui:405
msgctxt "Font hinting style"
msgid "Full"
msgstr "Full"
#: gtk/inspector/visual.ui:422
#| msgctxt "OpenType layout"
#| msgid "Vertical Writing"
msgid "Metrics Hinting"
msgstr "Metrics Hinting"
#: gtk/inspector/visual.ui:457
msgid "Show Framerate"
msgstr "Show Framerate"
#: gtk/inspector/visual.ui:410
#: gtk/inspector/visual.ui:482
msgid "Show Graphic Updates"
msgstr "Show Graphic Updates"
#: gtk/inspector/visual.ui:430
#: gtk/inspector/visual.ui:502
msgid ""
"Tints all the places where the current renderer uses Cairo instead of the "
"GPU."
@@ -4384,47 +4413,47 @@ msgstr ""
"Tints all the places where the current renderer uses Cairo instead of the "
"GPU."
#: gtk/inspector/visual.ui:436
#: gtk/inspector/visual.ui:508
msgid "Show Cairo Rendering"
msgstr "Show Cairo Rendering"
#: gtk/inspector/visual.ui:461
#: gtk/inspector/visual.ui:533
msgid "Show Baselines"
msgstr "Show Baselines"
#: gtk/inspector/visual.ui:489
#: gtk/inspector/visual.ui:561
msgid "Show Layout Borders"
msgstr "Show Layout Borders"
#: gtk/inspector/visual.ui:546
#: gtk/inspector/visual.ui:618
msgid "CSS Padding"
msgstr "CSS Padding"
#: gtk/inspector/visual.ui:556
#: gtk/inspector/visual.ui:628
msgid "CSS Border"
msgstr "CSS Border"
#: gtk/inspector/visual.ui:566
#: gtk/inspector/visual.ui:638
msgid "CSS Margin"
msgstr "CSS Margin"
#: gtk/inspector/visual.ui:576
#: gtk/inspector/visual.ui:648
msgid "Widget Margin"
msgstr "Widget Margin"
#: gtk/inspector/visual.ui:611
#: gtk/inspector/visual.ui:683
msgid "Show Focus"
msgstr "Show Focus"
#: gtk/inspector/visual.ui:636
#: gtk/inspector/visual.ui:708
msgid "Show Accessibility warnings"
msgstr "Show Accessibility warnings"
#: gtk/inspector/visual.ui:661
#: gtk/inspector/visual.ui:733
msgid "Show Graphics Offload"
msgstr "Show Graphics Offload"
#: gtk/inspector/visual.ui:693
#: gtk/inspector/visual.ui:765
msgid "Inspect Inspector"
msgstr "Inspect Inspector"
@@ -6550,34 +6579,39 @@ msgstr "Advanced"
msgid "Some of the settings in the dialog conflict"
msgstr "Some of the settings in the dialogue conflict"
#. Translators: These strings name the possible values of the
#. * job priority option in the print dialog
#.
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:542
#: modules/printbackends/gtkprintbackendcups.c:5668
#| msgid "Urgent"
msgctxt "Print job priority"
msgid "Urgent"
msgstr "Urgent"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:543
#: modules/printbackends/gtkprintbackendcups.c:5669
#| msgid "High"
msgctxt "Print job priority"
msgid "High"
msgstr "High"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:544
#: modules/printbackends/gtkprintbackendcups.c:5670
#| msgid "Medium"
msgctxt "Print job priority"
msgid "Medium"
msgstr "Medium"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:545
#: modules/printbackends/gtkprintbackendcups.c:5671
#| msgid "Low"
msgctxt "Print job priority"
msgid "Low"
msgstr "Low"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the front cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:562
#: modules/printbackends/gtkprintbackendcups.c:5782
#: modules/printbackends/gtkprintbackendcpdb.c:567
#: modules/printbackends/gtkprintbackendcups.c:5814
msgctxt "printer option"
msgid "Before"
msgstr "Before"
@@ -6585,33 +6619,33 @@ msgstr "Before"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the back cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:569
#: modules/printbackends/gtkprintbackendcups.c:5797
#: modules/printbackends/gtkprintbackendcpdb.c:574
#: modules/printbackends/gtkprintbackendcups.c:5829
msgctxt "printer option"
msgid "After"
msgstr "After"
#: modules/printbackends/gtkprintbackendcpdb.c:592
#: modules/printbackends/gtkprintbackendcpdb.c:597
msgid "Print at"
msgstr "Print at"
#: modules/printbackends/gtkprintbackendcpdb.c:602
#: modules/printbackends/gtkprintbackendcpdb.c:607
msgid "Print at time"
msgstr "Print at time"
#: modules/printbackends/gtkprintbackendcpdb.c:665
#: modules/printbackends/gtkprintbackendcpdb.c:670
msgctxt "print option"
msgid "Borderless"
msgstr "Borderless"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1525
#: modules/printbackends/gtkprintbackendcpdb.c:1530
#: modules/printbackends/gtkprintbackendcups.c:2636
msgid "Paused; Rejecting Jobs"
msgstr "Paused; Rejecting Jobs"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1531
#: modules/printbackends/gtkprintbackendcpdb.c:1536
#: modules/printbackends/gtkprintbackendcups.c:2642
msgid "Rejecting Jobs"
msgstr "Rejecting Jobs"
@@ -6762,266 +6796,266 @@ msgstr "There is a problem on printer “%s”."
msgid "; "
msgstr "; "
#: modules/printbackends/gtkprintbackendcups.c:4582
#: modules/printbackends/gtkprintbackendcups.c:4649
#: modules/printbackends/gtkprintbackendcups.c:4609
#: modules/printbackends/gtkprintbackendcups.c:4676
msgctxt "printing option"
msgid "Two Sided"
msgstr "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4583
#: modules/printbackends/gtkprintbackendcups.c:4610
msgctxt "printing option"
msgid "Paper Type"
msgstr "Paper Type"
#: modules/printbackends/gtkprintbackendcups.c:4584
#: modules/printbackends/gtkprintbackendcups.c:4611
msgctxt "printing option"
msgid "Paper Source"
msgstr "Paper Source"
#: modules/printbackends/gtkprintbackendcups.c:4585
#: modules/printbackends/gtkprintbackendcups.c:4650
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4677
msgctxt "printing option"
msgid "Output Tray"
msgstr "Output Tray"
#: modules/printbackends/gtkprintbackendcups.c:4586
#: modules/printbackends/gtkprintbackendcups.c:4613
msgctxt "printing option"
msgid "Resolution"
msgstr "Resolution"
#: modules/printbackends/gtkprintbackendcups.c:4587
#: modules/printbackends/gtkprintbackendcups.c:4614
msgctxt "printing option"
msgid "GhostScript pre-filtering"
msgstr "GhostScript pre-filtering"
#: modules/printbackends/gtkprintbackendcups.c:4596
#: modules/printbackends/gtkprintbackendcups.c:4623
msgctxt "printing option value"
msgid "One Sided"
msgstr "One Sided"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4598
#: modules/printbackends/gtkprintbackendcups.c:4625
msgctxt "printing option value"
msgid "Long Edge (Standard)"
msgstr "Long Edge (Standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4600
#: modules/printbackends/gtkprintbackendcups.c:4627
msgctxt "printing option value"
msgid "Short Edge (Flip)"
msgstr "Short Edge (Flip)"
#. Translators: this is an option of "Paper Source"
#: modules/printbackends/gtkprintbackendcups.c:4602
#: modules/printbackends/gtkprintbackendcups.c:4604
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4629
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4639
msgctxt "printing option value"
msgid "Auto Select"
msgstr "Auto Select"
#. Translators: this is an option of "Paper Source"
#. Translators: this is an option of "Resolution"
#: modules/printbackends/gtkprintbackendcups.c:4606
#: modules/printbackends/gtkprintbackendcups.c:4608
#: modules/printbackends/gtkprintbackendcups.c:4610
#: modules/printbackends/gtkprintbackendcups.c:4614
#: modules/printbackends/gtkprintbackendcups.c:4633
#: modules/printbackends/gtkprintbackendcups.c:4635
#: modules/printbackends/gtkprintbackendcups.c:4637
#: modules/printbackends/gtkprintbackendcups.c:4641
msgctxt "printing option value"
msgid "Printer Default"
msgstr "Printer Default"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4616
#: modules/printbackends/gtkprintbackendcups.c:4643
msgctxt "printing option value"
msgid "Embed GhostScript fonts only"
msgstr "Embed GhostScript fonts only"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4618
#: modules/printbackends/gtkprintbackendcups.c:4645
msgctxt "printing option value"
msgid "Convert to PS level 1"
msgstr "Convert to PS level 1"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4620
#: modules/printbackends/gtkprintbackendcups.c:4647
msgctxt "printing option value"
msgid "Convert to PS level 2"
msgstr "Convert to PS level 2"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4622
#: modules/printbackends/gtkprintbackendcups.c:4649
msgctxt "printing option value"
msgid "No pre-filtering"
msgstr "No pre-filtering"
#. Translators: "Miscellaneous" is the label for a button, that opens
#. up an extra panel of settings in a print dialog.
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4658
msgctxt "printing option group"
msgid "Miscellaneous"
msgstr "Miscellaneous"
#: modules/printbackends/gtkprintbackendcups.c:4658
#: modules/printbackends/gtkprintbackendcups.c:4685
msgctxt "sides"
msgid "One Sided"
msgstr "One Sided"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4660
#: modules/printbackends/gtkprintbackendcups.c:4687
msgctxt "sides"
msgid "Long Edge (Standard)"
msgstr "Long Edge (Standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4662
#: modules/printbackends/gtkprintbackendcups.c:4689
msgctxt "sides"
msgid "Short Edge (Flip)"
msgstr "Short Edge (Flip)"
#. Translators: Top output bin
#: modules/printbackends/gtkprintbackendcups.c:4665
#: modules/printbackends/gtkprintbackendcups.c:4692
msgctxt "output-bin"
msgid "Top Bin"
msgstr "Top Bin"
#. Translators: Middle output bin
#: modules/printbackends/gtkprintbackendcups.c:4667
#: modules/printbackends/gtkprintbackendcups.c:4694
msgctxt "output-bin"
msgid "Middle Bin"
msgstr "Middle Bin"
#. Translators: Bottom output bin
#: modules/printbackends/gtkprintbackendcups.c:4669
#: modules/printbackends/gtkprintbackendcups.c:4696
msgctxt "output-bin"
msgid "Bottom Bin"
msgstr "Bottom Bin"
#. Translators: Side output bin
#: modules/printbackends/gtkprintbackendcups.c:4671
#: modules/printbackends/gtkprintbackendcups.c:4698
msgctxt "output-bin"
msgid "Side Bin"
msgstr "Side Bin"
#. Translators: Left output bin
#: modules/printbackends/gtkprintbackendcups.c:4673
#: modules/printbackends/gtkprintbackendcups.c:4700
msgctxt "output-bin"
msgid "Left Bin"
msgstr "Left Bin"
#. Translators: Right output bin
#: modules/printbackends/gtkprintbackendcups.c:4675
#: modules/printbackends/gtkprintbackendcups.c:4702
msgctxt "output-bin"
msgid "Right Bin"
msgstr "Right Bin"
#. Translators: Center output bin
#: modules/printbackends/gtkprintbackendcups.c:4677
#: modules/printbackends/gtkprintbackendcups.c:4704
msgctxt "output-bin"
msgid "Center Bin"
msgstr "Centre Bin"
#. Translators: Rear output bin
#: modules/printbackends/gtkprintbackendcups.c:4679
#: modules/printbackends/gtkprintbackendcups.c:4706
msgctxt "output-bin"
msgid "Rear Bin"
msgstr "Rear Bin"
#. Translators: Output bin where one sided output is oriented in the face-up position
#: modules/printbackends/gtkprintbackendcups.c:4681
#: modules/printbackends/gtkprintbackendcups.c:4708
msgctxt "output-bin"
msgid "Face Up Bin"
msgstr "Face Up Bin"
#. Translators: Output bin where one sided output is oriented in the face-down position
#: modules/printbackends/gtkprintbackendcups.c:4683
#: modules/printbackends/gtkprintbackendcups.c:4710
msgctxt "output-bin"
msgid "Face Down Bin"
msgstr "Face Down Bin"
#. Translators: Large capacity output bin
#: modules/printbackends/gtkprintbackendcups.c:4685
#: modules/printbackends/gtkprintbackendcups.c:4712
msgctxt "output-bin"
msgid "Large Capacity Bin"
msgstr "Large Capacity Bin"
#. Translators: Output stacker number %d
#: modules/printbackends/gtkprintbackendcups.c:4707
#: modules/printbackends/gtkprintbackendcups.c:4734
#, c-format
msgctxt "output-bin"
msgid "Stacker %d"
msgstr "Stacker %d"
#. Translators: Output mailbox number %d
#: modules/printbackends/gtkprintbackendcups.c:4711
#: modules/printbackends/gtkprintbackendcups.c:4738
#, c-format
msgctxt "output-bin"
msgid "Mailbox %d"
msgstr "Mailbox %d"
#. Translators: Private mailbox
#: modules/printbackends/gtkprintbackendcups.c:4715
#: modules/printbackends/gtkprintbackendcups.c:4742
msgctxt "output-bin"
msgid "My Mailbox"
msgstr "My Mailbox"
#. Translators: Output tray number %d
#: modules/printbackends/gtkprintbackendcups.c:4719
#: modules/printbackends/gtkprintbackendcups.c:4746
#, c-format
msgctxt "output-bin"
msgid "Tray %d"
msgstr "Tray %d"
#: modules/printbackends/gtkprintbackendcups.c:5196
#: modules/printbackends/gtkprintbackendcups.c:5223
msgid "Printer Default"
msgstr "Printer Default"
#. Translators, this string is used to label the job priority option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5670
#: modules/printbackends/gtkprintbackendcups.c:5702
msgid "Job Priority"
msgstr "Job Priority"
#. Translators, this string is used to label the billing info entry
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5681
#: modules/printbackends/gtkprintbackendcups.c:5713
msgid "Billing Info"
msgstr "Billing Info"
#. Translators, these strings are names for various 'standard' cover
#. * pages that the printing system may support.
#.
#: modules/printbackends/gtkprintbackendcups.c:5705
#: modules/printbackends/gtkprintbackendcups.c:5737
msgctxt "cover page"
msgid "None"
msgstr "None"
#: modules/printbackends/gtkprintbackendcups.c:5706
#: modules/printbackends/gtkprintbackendcups.c:5738
msgctxt "cover page"
msgid "Classified"
msgstr "Classified"
#: modules/printbackends/gtkprintbackendcups.c:5707
#: modules/printbackends/gtkprintbackendcups.c:5739
msgctxt "cover page"
msgid "Confidential"
msgstr "Confidential"
#: modules/printbackends/gtkprintbackendcups.c:5708
#: modules/printbackends/gtkprintbackendcups.c:5740
msgctxt "cover page"
msgid "Secret"
msgstr "Secret"
#: modules/printbackends/gtkprintbackendcups.c:5709
#: modules/printbackends/gtkprintbackendcups.c:5741
msgctxt "cover page"
msgid "Standard"
msgstr "Standard"
#: modules/printbackends/gtkprintbackendcups.c:5710
#: modules/printbackends/gtkprintbackendcups.c:5742
msgctxt "cover page"
msgid "Top Secret"
msgstr "Top Secret"
#: modules/printbackends/gtkprintbackendcups.c:5711
#: modules/printbackends/gtkprintbackendcups.c:5743
msgctxt "cover page"
msgid "Unclassified"
msgstr "Unclassified"
@@ -7029,7 +7063,7 @@ msgstr "Unclassified"
#. Translators, this string is used to label the pages-per-sheet option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5723
#: modules/printbackends/gtkprintbackendcups.c:5755
msgctxt "printer option"
msgid "Pages per Sheet"
msgstr "Pages per Sheet"
@@ -7037,7 +7071,7 @@ msgstr "Pages per Sheet"
#. Translators, this string is used to label the option in the print
#. * dialog that controls in what order multiple pages are arranged
#.
#: modules/printbackends/gtkprintbackendcups.c:5740
#: modules/printbackends/gtkprintbackendcups.c:5772
msgctxt "printer option"
msgid "Page Ordering"
msgstr "Page Ordering"
@@ -7046,7 +7080,7 @@ msgstr "Page Ordering"
#. * a print job is printed. Possible values are 'now', a specified time,
#. * or 'on hold'
#.
#: modules/printbackends/gtkprintbackendcups.c:5817
#: modules/printbackends/gtkprintbackendcups.c:5849
msgctxt "printer option"
msgid "Print at"
msgstr "Print at"
@@ -7054,7 +7088,7 @@ msgstr "Print at"
#. Translators: this is the name of the option that allows the user
#. * to specify a time when a print job will be printed.
#.
#: modules/printbackends/gtkprintbackendcups.c:5828
#: modules/printbackends/gtkprintbackendcups.c:5860
msgctxt "printer option"
msgid "Print at time"
msgstr "Print at time"
@@ -7064,19 +7098,19 @@ msgstr "Print at time"
#. * the width and height in points. E.g: "Custom
#. * 230.4x142.9"
#.
#: modules/printbackends/gtkprintbackendcups.c:5875
#: modules/printbackends/gtkprintbackendcups.c:5907
#, c-format
msgid "Custom %s×%s"
msgstr "Custom %s×%s"
#. TRANSLATORS: this is the ICC color profile to use for this job
#: modules/printbackends/gtkprintbackendcups.c:5986
#: modules/printbackends/gtkprintbackendcups.c:6018
msgctxt "printer option"
msgid "Printer Profile"
msgstr "Printer Profile"
#. TRANSLATORS: this is when color profile information is unavailable
#: modules/printbackends/gtkprintbackendcups.c:5993
#: modules/printbackends/gtkprintbackendcups.c:6025
msgctxt "printer option value"
msgid "Unavailable"
msgstr "Unavailable"
@@ -8059,6 +8093,15 @@ msgstr ""
"No theme index file in “%s”.\n"
"If you really want to create an icon cache here, use --ignore-theme-index.\n"
#~ msgid "Backend does not support window scaling"
#~ msgstr "Backend does not support window scaling"
#~ msgid "Font Scale"
#~ msgstr "Font Scale"
#~ msgid "Window Scaling"
#~ msgstr "Window Scaling"
#~ msgid "Show _Size Column"
#~ msgstr "Show _Size Column"
+190 -160
View File
@@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2024-03-05 13:23+0000\n"
"PO-Revision-Date: 2024-03-06 18:48+0100\n"
"POT-Creation-Date: 2024-04-04 16:15+0000\n"
"PO-Revision-Date: 2024-04-04 19:48+0200\n"
"Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
@@ -35,7 +35,7 @@ msgstr "Detta urklipp kan inte lagra data."
msgid "Cannot read from empty clipboard."
msgstr "Kan inte läsa från tomt urklipp."
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:606
msgid "No compatible formats to transfer clipboard contents."
msgstr "Inga kompatibla format för att överföra urklippsinnehåll."
@@ -50,11 +50,11 @@ msgstr "Kan inte tillhandahålla innehåll som ”%s”"
msgid "Cannot provide contents as %s"
msgstr "Kan inte tillhandahålla innehåll som %s"
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:464
msgid "The current backend does not support OpenGL"
msgstr "Den aktuella bakänden stöder inte OpenGL"
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1601
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1600
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Vulkan-stöd inaktiverat via GDK_DEBUG"
@@ -62,46 +62,46 @@ msgstr "Vulkan-stöd inaktiverat via GDK_DEBUG"
msgid "GL support disabled via GDK_DEBUG"
msgstr "GL-stöd inaktiverat via GDK_DEBUG"
#: gdk/gdkdisplay.c:1665
#: gdk/gdkdisplay.c:1675
msgid "No EGL configuration available"
msgstr "Ingen EGL-konfiguration tillgänglig"
#: gdk/gdkdisplay.c:1673
#: gdk/gdkdisplay.c:1683
msgid "Failed to get EGL configurations"
msgstr "Misslyckades med att hämta EGL-konfigurationer"
#: gdk/gdkdisplay.c:1703
#: gdk/gdkdisplay.c:1713
msgid "No EGL configuration with required features found"
msgstr "Ingen EGL-konfiguration med funktionerna som krävdes hittades"
#: gdk/gdkdisplay.c:1710
#: gdk/gdkdisplay.c:1720
msgid "No perfect EGL configuration found"
msgstr "Ingen perfekt EGL-konfiguration hittades"
#: gdk/gdkdisplay.c:1752
#: gdk/gdkdisplay.c:1762
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "EGL-implementationen saknar tillägget %s"
msgstr[1] "EGL-implementationen saknar %2$d tillägg: %1$s"
#: gdk/gdkdisplay.c:1801
#: gdk/gdkdisplay.c:1811
msgid "libEGL not available in this sandbox"
msgstr "libEGL är inte tillgängligt i denna sandlåda"
#: gdk/gdkdisplay.c:1802
#: gdk/gdkdisplay.c:1812
msgid "libEGL not available"
msgstr "libEGL inte tillgängligt"
#: gdk/gdkdisplay.c:1812
#: gdk/gdkdisplay.c:1822
msgid "Failed to create EGL display"
msgstr "Misslyckades med att skapa EGL-display"
#: gdk/gdkdisplay.c:1821
#: gdk/gdkdisplay.c:1831
msgid "Could not initialize EGL display"
msgstr "Kunde inte initiera EGL-display"
#: gdk/gdkdisplay.c:1831
#: gdk/gdkdisplay.c:1841
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL-version %d.%d är för gammal. GTK kräver %d.%d"
@@ -114,32 +114,32 @@ msgstr "Dra-och-släpp från andra program stöds inte."
msgid "No compatible formats to transfer contents."
msgstr "Inga kompatibla format för att överföra innehåll."
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
#: gdk/gdkglcontext.c:424 gdk/x11/gdkglcontext-glx.c:645
msgid "No GL API allowed."
msgstr "Inget GL-API tillåtet."
#: gdk/gdkglcontext.c:442 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/gdkglcontext.c:447 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/win32/gdkglcontext-win32-wgl.c:538
#: gdk/win32/gdkglcontext-win32-wgl.c:582 gdk/x11/gdkglcontext-glx.c:691
msgid "Unable to create a GL context"
msgstr "Kan inte skapa en GL-kontext"
#: gdk/gdkglcontext.c:1304
#: gdk/gdkglcontext.c:1310
msgid "OpenGL ES disabled via GDK_DEBUG"
msgstr "OpenGL ES inaktiverat via GDK_DEBUG"
#: gdk/gdkglcontext.c:1316
#: gdk/gdkglcontext.c:1322
msgid "OpenGL disabled via GDK_DEBUG"
msgstr "OpenGL inaktiverat via GDK_DEBUG"
#: gdk/gdkglcontext.c:1327
#: gdk/gdkglcontext.c:1333
#, c-format
msgid "Application does not support %s API"
msgstr "Programmet stöder inte %s-API"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:2113
#: gdk/gdkglcontext.c:2123
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "Försöker använda %s, men %s används redan"
@@ -1095,7 +1095,7 @@ msgid "Pick a Font"
msgstr "Välj ett typsnitt"
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3815
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:285
msgid "Font"
msgstr "Typsnitt"
@@ -2353,7 +2353,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Om du tar bort ett objekt är det borta för alltid."
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6193 gtk/gtktextview.c:9079
#: gtk/gtklabel.c:5723 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
msgid "_Delete"
msgstr "_Ta bort"
@@ -2564,7 +2564,7 @@ msgid "_Time"
msgstr "_Tid"
#: gtk/gtkfilechooserwidget.c:7375 gtk/gtkplacessidebar.c:2306
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:19
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:18
#: gtk/inspector/css-node-tree.ui:22 gtk/inspector/prop-list.ui:24
#: gtk/ui/gtkfilechooserwidget.ui:385 gtk/print/ui/gtkprintunixdialog.ui:80
msgid "Name"
@@ -2694,31 +2694,31 @@ msgstr "Stäng"
msgid "Close the infobar"
msgstr "Stäng inforaden"
#: gtk/gtklabel.c:5708 gtk/gtktext.c:6181 gtk/gtktextview.c:9067
#: gtk/gtklabel.c:5720 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
msgid "Cu_t"
msgstr "Klipp _ut"
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6185 gtk/gtktextview.c:9071
#: gtk/gtklabel.c:5721 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
msgid "_Copy"
msgstr "_Kopiera"
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6189 gtk/gtktextview.c:9075
#: gtk/gtklabel.c:5722 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
msgid "_Paste"
msgstr "Klistra _in"
#: gtk/gtklabel.c:5716 gtk/gtktext.c:6202 gtk/gtktextview.c:9100
#: gtk/gtklabel.c:5728 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
msgid "Select _All"
msgstr "Markera _allt"
#: gtk/gtklabel.c:5721
#: gtk/gtklabel.c:5733
msgid "_Open Link"
msgstr "_Öppna länk"
#: gtk/gtklabel.c:5725
#: gtk/gtklabel.c:5737
msgid "Copy _Link Address"
msgstr "Kopiera _länkadress"
#: gtk/gtklabel.c:5769 gtk/gtktext.c:2724 gtk/gtktextview.c:9149
#: gtk/gtklabel.c:5781 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
msgid "Context menu"
msgstr "Snabbvalsmeny"
@@ -3408,7 +3408,7 @@ msgstr "Slut på papper"
#. Translators: this is a printer status.
#: gtk/print/gtkprintoperation-win32.c:640
#: modules/printbackends/gtkprintbackendcpdb.c:1528
#: modules/printbackends/gtkprintbackendcpdb.c:1533
#: modules/printbackends/gtkprintbackendcups.c:2639
msgid "Paused"
msgstr "Pausad"
@@ -3479,42 +3479,42 @@ msgstr "Hämtar skrivarinformation…"
#. * multiple pages on a sheet when printing
#.
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, top to bottom"
msgstr "Vänster till höger, topp till botten"
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, bottom to top"
msgstr "Vänster till höger, botten till topp"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, top to bottom"
msgstr "Höger till vänster, topp till botten"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, bottom to top"
msgstr "Höger till vänster, botten till topp"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, left to right"
msgstr "Topp till botten, vänster till höger"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, right to left"
msgstr "Topp till botten, höger till vänster"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, left to right"
msgstr "Botten till topp, vänster till höger"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, right to left"
msgstr "Botten till topp, höger till vänster"
@@ -3653,15 +3653,15 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Sidopanel"
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9105
#: gtk/gtktext.c:6208 gtk/gtktextview.c:9125
msgid "Insert _Emoji"
msgstr "Infoga _emoji"
#: gtk/gtktextview.c:9087
#: gtk/gtktextview.c:9107
msgid "_Undo"
msgstr "_Ångra"
#: gtk/gtktextview.c:9091
#: gtk/gtktextview.c:9111
msgid "_Redo"
msgstr "_Gör om"
@@ -3890,7 +3890,7 @@ msgctxt "Vulkan version"
msgid "None"
msgstr "Ingen"
#: gtk/inspector/general.c:922
#: gtk/inspector/general.c:924
msgid "IM Context is hardcoded by GTK_IM_MODULE"
msgstr "IM-kontext är hårdkodad med GTK_IM_MODULE"
@@ -4076,7 +4076,7 @@ msgstr "Antal bildrutor"
msgid "Frame Rate"
msgstr "Bildfrekvens"
#: gtk/inspector/misc-info.ui:527
#: gtk/inspector/misc-info.ui:527 gtk/inspector/visual.ui:315
msgid "Scale"
msgstr "Skala"
@@ -4261,27 +4261,27 @@ msgstr "Storlek:"
msgid "Trigger"
msgstr "Utlösare"
#: gtk/inspector/size-groups.c:225
#: gtk/inspector/size-groups.c:228
msgctxt "sizegroup mode"
msgid "None"
msgstr "Inget"
#: gtk/inspector/size-groups.c:226
#: gtk/inspector/size-groups.c:229
msgctxt "sizegroup mode"
msgid "Horizontal"
msgstr "Horisontellt"
#: gtk/inspector/size-groups.c:227
#: gtk/inspector/size-groups.c:230
msgctxt "sizegroup mode"
msgid "Vertical"
msgstr "Vertikalt"
#: gtk/inspector/size-groups.c:228
#: gtk/inspector/size-groups.c:231
msgctxt "sizegroup mode"
msgid "Both"
msgstr "Båda"
#: gtk/inspector/size-groups.c:240
#: gtk/inspector/size-groups.c:243
msgid "Mode"
msgstr "Läge"
@@ -4338,14 +4338,10 @@ msgstr "Hierarki"
msgid "Implements"
msgstr "Implementerar"
#: gtk/inspector/visual.c:674 gtk/inspector/visual.c:693
#: gtk/inspector/visual.c:765 gtk/inspector/visual.c:784
msgid "Theme is hardcoded by GTK_THEME"
msgstr "Temat är hårdkodat med GTK_THEME"
#: gtk/inspector/visual.c:942
msgid "Backend does not support window scaling"
msgstr "Bakände stöder inte fönsterskalning"
#: gtk/inspector/visual.ui:34
msgid "GTK Theme"
msgstr "GTK-tema"
@@ -4366,43 +4362,67 @@ msgstr "Markörstorlek"
msgid "Icon Theme"
msgstr "Ikontema"
#: gtk/inspector/visual.ui:194
msgid "Font Scale"
msgstr "Typsnittsskalning"
#: gtk/inspector/visual.ui:239
#: gtk/inspector/visual.ui:169
msgid "Text Direction"
msgstr "Textriktning"
#: gtk/inspector/visual.ui:254
#: gtk/inspector/visual.ui:184
msgid "Left-to-Right"
msgstr "Vänster-till-höger"
#: gtk/inspector/visual.ui:255
#: gtk/inspector/visual.ui:185
msgid "Right-to-Left"
msgstr "Höger-till-vänster"
#: gtk/inspector/visual.ui:273
msgid "Window Scaling"
msgstr "Fönsterskalning"
#: gtk/inspector/visual.ui:306
#: gtk/inspector/visual.ui:202
msgid "Animations"
msgstr "Animationer"
#: gtk/inspector/visual.ui:331
#: gtk/inspector/visual.ui:227
msgid "Slowdown"
msgstr "Nedsaktning"
#: gtk/inspector/visual.ui:385
#: gtk/inspector/visual.ui:362
msgid "Antialiasing"
msgstr "Kantutjämning"
#: gtk/inspector/visual.ui:387
msgid "Hinting"
msgstr "Hintning"
#: gtk/inspector/visual.ui:402
msgctxt "Font hinting style"
msgid "None"
msgstr "Ingen"
#: gtk/inspector/visual.ui:403
msgctxt "Font hinting style"
msgid "Slight"
msgstr "Lite"
#: gtk/inspector/visual.ui:404
msgctxt "Font hinting style"
msgid "Medium"
msgstr "Medel"
#: gtk/inspector/visual.ui:405
msgctxt "Font hinting style"
msgid "Full"
msgstr "Fullständig"
#: gtk/inspector/visual.ui:422
msgid "Metrics Hinting"
msgstr "Metrikhintning"
#: gtk/inspector/visual.ui:457
msgid "Show Framerate"
msgstr "Visa bildfrekvens"
#: gtk/inspector/visual.ui:410
#: gtk/inspector/visual.ui:482
msgid "Show Graphic Updates"
msgstr "Visa grafikuppdateringar"
#: gtk/inspector/visual.ui:430
#: gtk/inspector/visual.ui:502
msgid ""
"Tints all the places where the current renderer uses Cairo instead of the "
"GPU."
@@ -4410,47 +4430,47 @@ msgstr ""
"Tonar alla ställen där den aktuella renderaren använder Cairo i stället för "
"GPU."
#: gtk/inspector/visual.ui:436
#: gtk/inspector/visual.ui:508
msgid "Show Cairo Rendering"
msgstr "Visa Cairo-rendering"
#: gtk/inspector/visual.ui:461
#: gtk/inspector/visual.ui:533
msgid "Show Baselines"
msgstr "Visa baslinjer"
#: gtk/inspector/visual.ui:489
#: gtk/inspector/visual.ui:561
msgid "Show Layout Borders"
msgstr "Visa layoutkanter"
#: gtk/inspector/visual.ui:546
#: gtk/inspector/visual.ui:618
msgid "CSS Padding"
msgstr "CSS-utfyllnad"
#: gtk/inspector/visual.ui:556
#: gtk/inspector/visual.ui:628
msgid "CSS Border"
msgstr "CSS-kant"
#: gtk/inspector/visual.ui:566
#: gtk/inspector/visual.ui:638
msgid "CSS Margin"
msgstr "CSS-marginal"
#: gtk/inspector/visual.ui:576
#: gtk/inspector/visual.ui:648
msgid "Widget Margin"
msgstr "Komponentmarginal"
#: gtk/inspector/visual.ui:611
#: gtk/inspector/visual.ui:683
msgid "Show Focus"
msgstr "Visa fokus"
#: gtk/inspector/visual.ui:636
#: gtk/inspector/visual.ui:708
msgid "Show Accessibility warnings"
msgstr "Visa hjälpmedelsvarningar"
#: gtk/inspector/visual.ui:661
#: gtk/inspector/visual.ui:733
msgid "Show Graphics Offload"
msgstr "Visa grafikavlastning"
#: gtk/inspector/visual.ui:693
#: gtk/inspector/visual.ui:765
msgid "Inspect Inspector"
msgstr "Inspektera Inspector"
@@ -6578,34 +6598,35 @@ msgstr "Avancerat"
msgid "Some of the settings in the dialog conflict"
msgstr "Vissa av inställningarna i dialogen är i konflikt"
#. Translators: These strings name the possible values of the
#. * job priority option in the print dialog
#.
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:542
#: modules/printbackends/gtkprintbackendcups.c:5668
msgctxt "Print job priority"
msgid "Urgent"
msgstr "Viktigt"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:543
#: modules/printbackends/gtkprintbackendcups.c:5669
msgctxt "Print job priority"
msgid "High"
msgstr "Hög"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:544
#: modules/printbackends/gtkprintbackendcups.c:5670
msgctxt "Print job priority"
msgid "Medium"
msgstr "Medel"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:545
#: modules/printbackends/gtkprintbackendcups.c:5671
msgctxt "Print job priority"
msgid "Low"
msgstr "Låg"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the front cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:562
#: modules/printbackends/gtkprintbackendcups.c:5782
#: modules/printbackends/gtkprintbackendcpdb.c:567
#: modules/printbackends/gtkprintbackendcups.c:5814
msgctxt "printer option"
msgid "Before"
msgstr "Före"
@@ -6613,33 +6634,33 @@ msgstr "Före"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the back cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:569
#: modules/printbackends/gtkprintbackendcups.c:5797
#: modules/printbackends/gtkprintbackendcpdb.c:574
#: modules/printbackends/gtkprintbackendcups.c:5829
msgctxt "printer option"
msgid "After"
msgstr "Efter"
#: modules/printbackends/gtkprintbackendcpdb.c:592
#: modules/printbackends/gtkprintbackendcpdb.c:597
msgid "Print at"
msgstr "Utskriftstid"
#: modules/printbackends/gtkprintbackendcpdb.c:602
#: modules/printbackends/gtkprintbackendcpdb.c:607
msgid "Print at time"
msgstr "Skriv ut klockan"
#: modules/printbackends/gtkprintbackendcpdb.c:665
#: modules/printbackends/gtkprintbackendcpdb.c:670
msgctxt "print option"
msgid "Borderless"
msgstr "Kantlöst"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1525
#: modules/printbackends/gtkprintbackendcpdb.c:1530
#: modules/printbackends/gtkprintbackendcups.c:2636
msgid "Paused; Rejecting Jobs"
msgstr "Pausad; Avvisar jobb"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1531
#: modules/printbackends/gtkprintbackendcpdb.c:1536
#: modules/printbackends/gtkprintbackendcups.c:2642
msgid "Rejecting Jobs"
msgstr "Avvisar jobb"
@@ -6791,266 +6812,266 @@ msgstr "Det har uppstått ett problem med skrivaren ”%s”."
msgid "; "
msgstr "; "
#: modules/printbackends/gtkprintbackendcups.c:4582
#: modules/printbackends/gtkprintbackendcups.c:4649
#: modules/printbackends/gtkprintbackendcups.c:4609
#: modules/printbackends/gtkprintbackendcups.c:4676
msgctxt "printing option"
msgid "Two Sided"
msgstr "Tvåsidigt"
#: modules/printbackends/gtkprintbackendcups.c:4583
#: modules/printbackends/gtkprintbackendcups.c:4610
msgctxt "printing option"
msgid "Paper Type"
msgstr "Papperstyp"
#: modules/printbackends/gtkprintbackendcups.c:4584
#: modules/printbackends/gtkprintbackendcups.c:4611
msgctxt "printing option"
msgid "Paper Source"
msgstr "Papperskälla"
#: modules/printbackends/gtkprintbackendcups.c:4585
#: modules/printbackends/gtkprintbackendcups.c:4650
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4677
msgctxt "printing option"
msgid "Output Tray"
msgstr "Utskriftsfack"
#: modules/printbackends/gtkprintbackendcups.c:4586
#: modules/printbackends/gtkprintbackendcups.c:4613
msgctxt "printing option"
msgid "Resolution"
msgstr "Upplösning"
#: modules/printbackends/gtkprintbackendcups.c:4587
#: modules/printbackends/gtkprintbackendcups.c:4614
msgctxt "printing option"
msgid "GhostScript pre-filtering"
msgstr "GhostScript-förfiltrering"
#: modules/printbackends/gtkprintbackendcups.c:4596
#: modules/printbackends/gtkprintbackendcups.c:4623
msgctxt "printing option value"
msgid "One Sided"
msgstr "Ensidigt"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4598
#: modules/printbackends/gtkprintbackendcups.c:4625
msgctxt "printing option value"
msgid "Long Edge (Standard)"
msgstr "Lång kant (Standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4600
#: modules/printbackends/gtkprintbackendcups.c:4627
msgctxt "printing option value"
msgid "Short Edge (Flip)"
msgstr "Kort kant (Vänd)"
#. Translators: this is an option of "Paper Source"
#: modules/printbackends/gtkprintbackendcups.c:4602
#: modules/printbackends/gtkprintbackendcups.c:4604
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4629
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4639
msgctxt "printing option value"
msgid "Auto Select"
msgstr "Välj automatiskt"
#. Translators: this is an option of "Paper Source"
#. Translators: this is an option of "Resolution"
#: modules/printbackends/gtkprintbackendcups.c:4606
#: modules/printbackends/gtkprintbackendcups.c:4608
#: modules/printbackends/gtkprintbackendcups.c:4610
#: modules/printbackends/gtkprintbackendcups.c:4614
#: modules/printbackends/gtkprintbackendcups.c:4633
#: modules/printbackends/gtkprintbackendcups.c:4635
#: modules/printbackends/gtkprintbackendcups.c:4637
#: modules/printbackends/gtkprintbackendcups.c:4641
msgctxt "printing option value"
msgid "Printer Default"
msgstr "Skrivarens standard"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4616
#: modules/printbackends/gtkprintbackendcups.c:4643
msgctxt "printing option value"
msgid "Embed GhostScript fonts only"
msgstr "Endast inbäddade GhostScript-typsnitt"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4618
#: modules/printbackends/gtkprintbackendcups.c:4645
msgctxt "printing option value"
msgid "Convert to PS level 1"
msgstr "Konvertera till PS nivå 1"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4620
#: modules/printbackends/gtkprintbackendcups.c:4647
msgctxt "printing option value"
msgid "Convert to PS level 2"
msgstr "Konvertera till PS nivå 2"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4622
#: modules/printbackends/gtkprintbackendcups.c:4649
msgctxt "printing option value"
msgid "No pre-filtering"
msgstr "Ingen förfiltrering"
#. Translators: "Miscellaneous" is the label for a button, that opens
#. up an extra panel of settings in a print dialog.
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4658
msgctxt "printing option group"
msgid "Miscellaneous"
msgstr "Diverse"
#: modules/printbackends/gtkprintbackendcups.c:4658
#: modules/printbackends/gtkprintbackendcups.c:4685
msgctxt "sides"
msgid "One Sided"
msgstr "Ensidigt"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4660
#: modules/printbackends/gtkprintbackendcups.c:4687
msgctxt "sides"
msgid "Long Edge (Standard)"
msgstr "Lång kant (Standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4662
#: modules/printbackends/gtkprintbackendcups.c:4689
msgctxt "sides"
msgid "Short Edge (Flip)"
msgstr "Kort kant (Vänd)"
#. Translators: Top output bin
#: modules/printbackends/gtkprintbackendcups.c:4665
#: modules/printbackends/gtkprintbackendcups.c:4692
msgctxt "output-bin"
msgid "Top Bin"
msgstr "Toppfack"
#. Translators: Middle output bin
#: modules/printbackends/gtkprintbackendcups.c:4667
#: modules/printbackends/gtkprintbackendcups.c:4694
msgctxt "output-bin"
msgid "Middle Bin"
msgstr "Mittenfack"
#. Translators: Bottom output bin
#: modules/printbackends/gtkprintbackendcups.c:4669
#: modules/printbackends/gtkprintbackendcups.c:4696
msgctxt "output-bin"
msgid "Bottom Bin"
msgstr "Bottenfack"
#. Translators: Side output bin
#: modules/printbackends/gtkprintbackendcups.c:4671
#: modules/printbackends/gtkprintbackendcups.c:4698
msgctxt "output-bin"
msgid "Side Bin"
msgstr "Sidofack"
#. Translators: Left output bin
#: modules/printbackends/gtkprintbackendcups.c:4673
#: modules/printbackends/gtkprintbackendcups.c:4700
msgctxt "output-bin"
msgid "Left Bin"
msgstr "Fack till vänster"
#. Translators: Right output bin
#: modules/printbackends/gtkprintbackendcups.c:4675
#: modules/printbackends/gtkprintbackendcups.c:4702
msgctxt "output-bin"
msgid "Right Bin"
msgstr "Fack till höger"
#. Translators: Center output bin
#: modules/printbackends/gtkprintbackendcups.c:4677
#: modules/printbackends/gtkprintbackendcups.c:4704
msgctxt "output-bin"
msgid "Center Bin"
msgstr "Centerfack"
#. Translators: Rear output bin
#: modules/printbackends/gtkprintbackendcups.c:4679
#: modules/printbackends/gtkprintbackendcups.c:4706
msgctxt "output-bin"
msgid "Rear Bin"
msgstr "Bakre fack"
#. Translators: Output bin where one sided output is oriented in the face-up position
#: modules/printbackends/gtkprintbackendcups.c:4681
#: modules/printbackends/gtkprintbackendcups.c:4708
msgctxt "output-bin"
msgid "Face Up Bin"
msgstr "Fack för uppåtvänd framsida"
#. Translators: Output bin where one sided output is oriented in the face-down position
#: modules/printbackends/gtkprintbackendcups.c:4683
#: modules/printbackends/gtkprintbackendcups.c:4710
msgctxt "output-bin"
msgid "Face Down Bin"
msgstr "Fack för nedåtvänd framsida"
#. Translators: Large capacity output bin
#: modules/printbackends/gtkprintbackendcups.c:4685
#: modules/printbackends/gtkprintbackendcups.c:4712
msgctxt "output-bin"
msgid "Large Capacity Bin"
msgstr "Högkapacitetsfack"
#. Translators: Output stacker number %d
#: modules/printbackends/gtkprintbackendcups.c:4707
#: modules/printbackends/gtkprintbackendcups.c:4734
#, c-format
msgctxt "output-bin"
msgid "Stacker %d"
msgstr "Staplare %d"
#. Translators: Output mailbox number %d
#: modules/printbackends/gtkprintbackendcups.c:4711
#: modules/printbackends/gtkprintbackendcups.c:4738
#, c-format
msgctxt "output-bin"
msgid "Mailbox %d"
msgstr "Postlåda %d"
#. Translators: Private mailbox
#: modules/printbackends/gtkprintbackendcups.c:4715
#: modules/printbackends/gtkprintbackendcups.c:4742
msgctxt "output-bin"
msgid "My Mailbox"
msgstr "Min postlåda"
#. Translators: Output tray number %d
#: modules/printbackends/gtkprintbackendcups.c:4719
#: modules/printbackends/gtkprintbackendcups.c:4746
#, c-format
msgctxt "output-bin"
msgid "Tray %d"
msgstr "Fack %d"
#: modules/printbackends/gtkprintbackendcups.c:5196
#: modules/printbackends/gtkprintbackendcups.c:5223
msgid "Printer Default"
msgstr "Skrivarens standard"
#. Translators, this string is used to label the job priority option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5670
#: modules/printbackends/gtkprintbackendcups.c:5702
msgid "Job Priority"
msgstr "Jobbprioritet"
#. Translators, this string is used to label the billing info entry
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5681
#: modules/printbackends/gtkprintbackendcups.c:5713
msgid "Billing Info"
msgstr "Faktureringsinformation"
#. Translators, these strings are names for various 'standard' cover
#. * pages that the printing system may support.
#.
#: modules/printbackends/gtkprintbackendcups.c:5705
#: modules/printbackends/gtkprintbackendcups.c:5737
msgctxt "cover page"
msgid "None"
msgstr "Inget"
#: modules/printbackends/gtkprintbackendcups.c:5706
#: modules/printbackends/gtkprintbackendcups.c:5738
msgctxt "cover page"
msgid "Classified"
msgstr "Klassificerat"
#: modules/printbackends/gtkprintbackendcups.c:5707
#: modules/printbackends/gtkprintbackendcups.c:5739
msgctxt "cover page"
msgid "Confidential"
msgstr "Konfidentiellt"
#: modules/printbackends/gtkprintbackendcups.c:5708
#: modules/printbackends/gtkprintbackendcups.c:5740
msgctxt "cover page"
msgid "Secret"
msgstr "Hemligt"
#: modules/printbackends/gtkprintbackendcups.c:5709
#: modules/printbackends/gtkprintbackendcups.c:5741
msgctxt "cover page"
msgid "Standard"
msgstr "Standard"
#: modules/printbackends/gtkprintbackendcups.c:5710
#: modules/printbackends/gtkprintbackendcups.c:5742
msgctxt "cover page"
msgid "Top Secret"
msgstr "Topphemligt"
#: modules/printbackends/gtkprintbackendcups.c:5711
#: modules/printbackends/gtkprintbackendcups.c:5743
msgctxt "cover page"
msgid "Unclassified"
msgstr "Inte klassificerat"
@@ -7058,7 +7079,7 @@ msgstr "Inte klassificerat"
#. Translators, this string is used to label the pages-per-sheet option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5723
#: modules/printbackends/gtkprintbackendcups.c:5755
msgctxt "printer option"
msgid "Pages per Sheet"
msgstr "Sidor per blad"
@@ -7066,7 +7087,7 @@ msgstr "Sidor per blad"
#. Translators, this string is used to label the option in the print
#. * dialog that controls in what order multiple pages are arranged
#.
#: modules/printbackends/gtkprintbackendcups.c:5740
#: modules/printbackends/gtkprintbackendcups.c:5772
msgctxt "printer option"
msgid "Page Ordering"
msgstr "Sidordning"
@@ -7075,7 +7096,7 @@ msgstr "Sidordning"
#. * a print job is printed. Possible values are 'now', a specified time,
#. * or 'on hold'
#.
#: modules/printbackends/gtkprintbackendcups.c:5817
#: modules/printbackends/gtkprintbackendcups.c:5849
msgctxt "printer option"
msgid "Print at"
msgstr "Utskriftstid"
@@ -7083,7 +7104,7 @@ msgstr "Utskriftstid"
#. Translators: this is the name of the option that allows the user
#. * to specify a time when a print job will be printed.
#.
#: modules/printbackends/gtkprintbackendcups.c:5828
#: modules/printbackends/gtkprintbackendcups.c:5860
msgctxt "printer option"
msgid "Print at time"
msgstr "Skriv ut klockan"
@@ -7093,19 +7114,19 @@ msgstr "Skriv ut klockan"
#. * the width and height in points. E.g: "Custom
#. * 230.4x142.9"
#.
#: modules/printbackends/gtkprintbackendcups.c:5875
#: modules/printbackends/gtkprintbackendcups.c:5907
#, c-format
msgid "Custom %s×%s"
msgstr "Anpassad %s×%s"
#. TRANSLATORS: this is the ICC color profile to use for this job
#: modules/printbackends/gtkprintbackendcups.c:5986
#: modules/printbackends/gtkprintbackendcups.c:6018
msgctxt "printer option"
msgid "Printer Profile"
msgstr "Skrivarprofil"
#. TRANSLATORS: this is when color profile information is unavailable
#: modules/printbackends/gtkprintbackendcups.c:5993
#: modules/printbackends/gtkprintbackendcups.c:6025
msgctxt "printer option value"
msgid "Unavailable"
msgstr "Inte tillgänglig"
@@ -8092,6 +8113,15 @@ msgstr ""
"Ingen temaindexfil i ”%s”.\n"
"Om du verkligen vill skapa en ikoncache här, använd --ignore-theme-index.\n"
#~ msgid "Backend does not support window scaling"
#~ msgstr "Bakände stöder inte fönsterskalning"
#~ msgid "Font Scale"
#~ msgstr "Typsnittsskalning"
#~ msgid "Window Scaling"
#~ msgstr "Fönsterskalning"
#, c-format
#~ msgid "Unspecified error decoding media"
#~ msgstr "Ospecificerat fel vid avkodning av media"
+194 -164
View File
@@ -31,16 +31,16 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2024-03-03 01:26+0000\n"
"PO-Revision-Date: 2024-03-03 19:15+0800\n"
"POT-Creation-Date: 2024-04-07 17:24+0000\n"
"PO-Revision-Date: 2024-04-09 10:26+0800\n"
"Last-Translator: lumingzh <lumingzh@qq.com>\n"
"Language-Team: Chinese - China <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"X-Generator: Gtranslator 45.3\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.4.2\n"
#: gdk/broadway/gdkbroadway-server.c:135
#, c-format
@@ -55,7 +55,7 @@ msgstr "剪贴板无法存放数据。"
msgid "Cannot read from empty clipboard."
msgstr "无法读取空剪贴板。"
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:606
msgid "No compatible formats to transfer clipboard contents."
msgstr "无兼容格式可用于传输剪贴板内容。"
@@ -70,11 +70,11 @@ msgstr "无法以“%s”提供内容"
msgid "Cannot provide contents as %s"
msgstr "无法以 %s 提供内容"
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:459
#: gdk/gdkdisplay.c:176 gdk/gdkglcontext.c:464
msgid "The current backend does not support OpenGL"
msgstr "当前后端不支持 OpenGL"
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1601
#: gdk/gdkdisplay.c:1315 gdk/gdkvulkancontext.c:1600
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "已通过 GDK_DEBUG 停用 Vulkan 支持"
@@ -82,45 +82,45 @@ msgstr "已通过 GDK_DEBUG 停用 Vulkan 支持"
msgid "GL support disabled via GDK_DEBUG"
msgstr "已通过 GDK_DEBUG 停用 GL 支持"
#: gdk/gdkdisplay.c:1665
#: gdk/gdkdisplay.c:1675
msgid "No EGL configuration available"
msgstr "没有可用的 EGL 配置"
#: gdk/gdkdisplay.c:1673
#: gdk/gdkdisplay.c:1683
msgid "Failed to get EGL configurations"
msgstr "获取 EGL 配置失败"
#: gdk/gdkdisplay.c:1703
#: gdk/gdkdisplay.c:1713
msgid "No EGL configuration with required features found"
msgstr "未找到带有所需功能的 EGL 配置"
#: gdk/gdkdisplay.c:1710
#: gdk/gdkdisplay.c:1720
msgid "No perfect EGL configuration found"
msgstr "未找到完全符合的 EGL 配置"
#: gdk/gdkdisplay.c:1752
#: gdk/gdkdisplay.c:1762
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "EGL 实现缺失 %2$d 项扩展:%1$s"
#: gdk/gdkdisplay.c:1801
#: gdk/gdkdisplay.c:1811
msgid "libEGL not available in this sandbox"
msgstr "libEGL 在此沙盒内不可用"
#: gdk/gdkdisplay.c:1802
#: gdk/gdkdisplay.c:1812
msgid "libEGL not available"
msgstr "libEGL 不可用"
#: gdk/gdkdisplay.c:1812
#: gdk/gdkdisplay.c:1822
msgid "Failed to create EGL display"
msgstr "创建 EGL 显示失败"
#: gdk/gdkdisplay.c:1821
#: gdk/gdkdisplay.c:1831
msgid "Could not initialize EGL display"
msgstr "无法初始化 EGL 显示"
#: gdk/gdkdisplay.c:1831
#: gdk/gdkdisplay.c:1841
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL %d.%d 版太旧。GTK 需要 %d.%d"
@@ -133,32 +133,32 @@ msgstr "不支持从其他应用拖放。"
msgid "No compatible formats to transfer contents."
msgstr "无兼容格式可用于传输内容。"
#: gdk/gdkglcontext.c:419 gdk/x11/gdkglcontext-glx.c:645
#: gdk/gdkglcontext.c:424 gdk/x11/gdkglcontext-glx.c:645
msgid "No GL API allowed."
msgstr "无允许的 GL API。"
#: gdk/gdkglcontext.c:442 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/gdkglcontext.c:447 gdk/win32/gdkglcontext-win32-wgl.c:395
#: gdk/win32/gdkglcontext-win32-wgl.c:538
#: gdk/win32/gdkglcontext-win32-wgl.c:582 gdk/x11/gdkglcontext-glx.c:691
msgid "Unable to create a GL context"
msgstr "无法创建 GL 上下文"
#: gdk/gdkglcontext.c:1304
#: gdk/gdkglcontext.c:1310
msgid "OpenGL ES disabled via GDK_DEBUG"
msgstr "已通过 GDK_DEBUG 停用 OpenGL ES"
#: gdk/gdkglcontext.c:1316
#: gdk/gdkglcontext.c:1322
msgid "OpenGL disabled via GDK_DEBUG"
msgstr "已通过 GDK_DEBUG 停用 OpenGL"
#: gdk/gdkglcontext.c:1327
#: gdk/gdkglcontext.c:1333
#, c-format
msgid "Application does not support %s API"
msgstr "应用程序不支持 %s API"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:2113
#: gdk/gdkglcontext.c:2123
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "尝试使用 %s,但 %s 已在使用"
@@ -841,7 +841,7 @@ msgstr "不支持的编码“%s”"
msgid "This GLES %d.%d implementation does not support half-float vertex data"
msgstr "该 GLES %d.%d 实现不支持半浮点顶点数据"
#: gsk/gpu/gskgldevice.c:245
#: gsk/gpu/gskgldevice.c:246
#, c-format
msgid "OpenGL ES 3.0 is not supported by this renderer."
msgstr "此渲染器不支持 OpenGL ES 3.0。"
@@ -1089,7 +1089,7 @@ msgid "Pick a Font"
msgstr "选择字体"
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3815
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:285
msgid "Font"
msgstr "字体"
@@ -2344,7 +2344,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "如果您删除一个项目,它将永久丢失。"
#: gtk/gtkfilechooserwidget.c:1188 gtk/gtkfilechooserwidget.c:1786
#: gtk/gtklabel.c:5712 gtk/gtktext.c:6193 gtk/gtktextview.c:9080
#: gtk/gtklabel.c:5723 gtk/gtktext.c:6194 gtk/gtktextview.c:9099
msgid "_Delete"
msgstr "删除(_D)"
@@ -2553,7 +2553,7 @@ msgid "_Time"
msgstr "时间(_T)"
#: gtk/gtkfilechooserwidget.c:7375 gtk/gtkplacessidebar.c:2306
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:19
#: gtk/inspector/a11y.ui:43 gtk/inspector/actions.ui:18
#: gtk/inspector/css-node-tree.ui:22 gtk/inspector/prop-list.ui:24
#: gtk/ui/gtkfilechooserwidget.ui:385 gtk/print/ui/gtkprintunixdialog.ui:80
msgid "Name"
@@ -2669,7 +2669,7 @@ msgstr "样式变体"
msgid "Character Variations"
msgstr "字符变体"
#: gtk/gtkglarea.c:309
#: gtk/gtkglarea.c:315
msgid "OpenGL context creation failed"
msgstr "OpenGL 上下文创建失败"
@@ -2682,31 +2682,31 @@ msgstr "关闭"
msgid "Close the infobar"
msgstr "关闭信息栏"
#: gtk/gtklabel.c:5709 gtk/gtktext.c:6181 gtk/gtktextview.c:9068
#: gtk/gtklabel.c:5720 gtk/gtktext.c:6182 gtk/gtktextview.c:9087
msgid "Cu_t"
msgstr "剪切(_T)"
#: gtk/gtklabel.c:5710 gtk/gtktext.c:6185 gtk/gtktextview.c:9072
#: gtk/gtklabel.c:5721 gtk/gtktext.c:6186 gtk/gtktextview.c:9091
msgid "_Copy"
msgstr "复制(_C)"
#: gtk/gtklabel.c:5711 gtk/gtktext.c:6189 gtk/gtktextview.c:9076
#: gtk/gtklabel.c:5722 gtk/gtktext.c:6190 gtk/gtktextview.c:9095
msgid "_Paste"
msgstr "粘贴(_P)"
#: gtk/gtklabel.c:5717 gtk/gtktext.c:6202 gtk/gtktextview.c:9101
#: gtk/gtklabel.c:5728 gtk/gtktext.c:6203 gtk/gtktextview.c:9120
msgid "Select _All"
msgstr "全选(_A)"
#: gtk/gtklabel.c:5722
#: gtk/gtklabel.c:5733
msgid "_Open Link"
msgstr "打开链接(_O)"
#: gtk/gtklabel.c:5726
#: gtk/gtklabel.c:5737
msgid "Copy _Link Address"
msgstr "复制链接地址(_L)"
#: gtk/gtklabel.c:5770 gtk/gtktext.c:2724 gtk/gtktextview.c:9150
#: gtk/gtklabel.c:5781 gtk/gtktext.c:2723 gtk/gtktextview.c:9169
msgid "Context menu"
msgstr "右键菜单"
@@ -3395,7 +3395,7 @@ msgstr "缺纸"
#. Translators: this is a printer status.
#: gtk/print/gtkprintoperation-win32.c:640
#: modules/printbackends/gtkprintbackendcpdb.c:1528
#: modules/printbackends/gtkprintbackendcpdb.c:1533
#: modules/printbackends/gtkprintbackendcups.c:2639
msgid "Paused"
msgstr "已暂停"
@@ -3466,42 +3466,42 @@ msgstr "正在获取打印机信息…"
#. * multiple pages on a sheet when printing
#.
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, top to bottom"
msgstr "从左到右,从上到下"
#: gtk/print/gtkprintunixdialog.c:2753
#: modules/printbackends/gtkprintbackendcups.c:5645
#: modules/printbackends/gtkprintbackendcups.c:5677
msgid "Left to right, bottom to top"
msgstr "从左到右,从下到上"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, top to bottom"
msgstr "从右到左,从上到下"
#: gtk/print/gtkprintunixdialog.c:2754
#: modules/printbackends/gtkprintbackendcups.c:5646
#: modules/printbackends/gtkprintbackendcups.c:5678
msgid "Right to left, bottom to top"
msgstr "从右到左,从下到上"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, left to right"
msgstr "从上到下,从左到右"
#: gtk/print/gtkprintunixdialog.c:2755
#: modules/printbackends/gtkprintbackendcups.c:5647
#: modules/printbackends/gtkprintbackendcups.c:5679
msgid "Top to bottom, right to left"
msgstr "从上到下,从右到左"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, left to right"
msgstr "从下到上,从左到右"
#: gtk/print/gtkprintunixdialog.c:2756
#: modules/printbackends/gtkprintbackendcups.c:5648
#: modules/printbackends/gtkprintbackendcups.c:5680
msgid "Bottom to top, right to left"
msgstr "从下到上,从右到左"
@@ -3639,15 +3639,15 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "侧边栏"
#: gtk/gtktext.c:6207 gtk/gtktextview.c:9106
#: gtk/gtktext.c:6208 gtk/gtktextview.c:9125
msgid "Insert _Emoji"
msgstr "插入表情符号(_E)"
#: gtk/gtktextview.c:9088
#: gtk/gtktextview.c:9107
msgid "_Undo"
msgstr "撤消(_U)"
#: gtk/gtktextview.c:9092
#: gtk/gtktextview.c:9111
msgid "_Redo"
msgstr "重做(_R)"
@@ -3874,7 +3874,7 @@ msgctxt "Vulkan version"
msgid "None"
msgstr "无"
#: gtk/inspector/general.c:922
#: gtk/inspector/general.c:924
msgid "IM Context is hardcoded by GTK_IM_MODULE"
msgstr "输入法上下文由 GTK_IM_MODULE 硬编码"
@@ -4060,7 +4060,7 @@ msgstr "帧数"
msgid "Frame Rate"
msgstr "帧率"
#: gtk/inspector/misc-info.ui:527
#: gtk/inspector/misc-info.ui:527 gtk/inspector/visual.ui:315
msgid "Scale"
msgstr "缩放"
@@ -4245,27 +4245,27 @@ msgstr "尺寸:"
msgid "Trigger"
msgstr "触发"
#: gtk/inspector/size-groups.c:225
#: gtk/inspector/size-groups.c:228
msgctxt "sizegroup mode"
msgid "None"
msgstr "无"
#: gtk/inspector/size-groups.c:226
#: gtk/inspector/size-groups.c:229
msgctxt "sizegroup mode"
msgid "Horizontal"
msgstr "水平"
#: gtk/inspector/size-groups.c:227
#: gtk/inspector/size-groups.c:230
msgctxt "sizegroup mode"
msgid "Vertical"
msgstr "垂直"
#: gtk/inspector/size-groups.c:228
#: gtk/inspector/size-groups.c:231
msgctxt "sizegroup mode"
msgid "Both"
msgstr "两者"
#: gtk/inspector/size-groups.c:240
#: gtk/inspector/size-groups.c:243
msgid "Mode"
msgstr "模式"
@@ -4322,14 +4322,10 @@ msgstr "层级"
msgid "Implements"
msgstr "实现"
#: gtk/inspector/visual.c:674 gtk/inspector/visual.c:693
#: gtk/inspector/visual.c:765 gtk/inspector/visual.c:784
msgid "Theme is hardcoded by GTK_THEME"
msgstr "主题由 GTK_THEME 控制"
#: gtk/inspector/visual.c:942
msgid "Backend does not support window scaling"
msgstr "后端不支持窗口缩放"
#: gtk/inspector/visual.ui:34
msgid "GTK Theme"
msgstr "GTK 主题"
@@ -4350,89 +4346,113 @@ msgstr "光标大小"
msgid "Icon Theme"
msgstr "图标主题"
#: gtk/inspector/visual.ui:194
msgid "Font Scale"
msgstr "字体缩放"
#: gtk/inspector/visual.ui:239
#: gtk/inspector/visual.ui:169
msgid "Text Direction"
msgstr "文本方向"
#: gtk/inspector/visual.ui:254
#: gtk/inspector/visual.ui:184
msgid "Left-to-Right"
msgstr "从左至右"
#: gtk/inspector/visual.ui:255
#: gtk/inspector/visual.ui:185
msgid "Right-to-Left"
msgstr "从右至左"
#: gtk/inspector/visual.ui:273
msgid "Window Scaling"
msgstr "窗口缩放"
#: gtk/inspector/visual.ui:306
#: gtk/inspector/visual.ui:202
msgid "Animations"
msgstr "动画"
#: gtk/inspector/visual.ui:331
#: gtk/inspector/visual.ui:227
msgid "Slowdown"
msgstr "减速"
#: gtk/inspector/visual.ui:385
#: gtk/inspector/visual.ui:362
msgid "Antialiasing"
msgstr "抗锯齿"
#: gtk/inspector/visual.ui:387
msgid "Hinting"
msgstr "微调"
#: gtk/inspector/visual.ui:402
msgctxt "Font hinting style"
msgid "None"
msgstr "无"
#: gtk/inspector/visual.ui:403
msgctxt "Font hinting style"
msgid "Slight"
msgstr "轻微"
#: gtk/inspector/visual.ui:404
msgctxt "Font hinting style"
msgid "Medium"
msgstr "中等"
#: gtk/inspector/visual.ui:405
msgctxt "Font hinting style"
msgid "Full"
msgstr "完全"
#: gtk/inspector/visual.ui:422
msgid "Metrics Hinting"
msgstr "度量微调"
#: gtk/inspector/visual.ui:457
msgid "Show Framerate"
msgstr "显示帧率"
#: gtk/inspector/visual.ui:410
#: gtk/inspector/visual.ui:482
msgid "Show Graphic Updates"
msgstr "显示图形更新"
#: gtk/inspector/visual.ui:430
#: gtk/inspector/visual.ui:502
msgid ""
"Tints all the places where the current renderer uses Cairo instead of the "
"GPU."
msgstr "为当前渲染器使用 Cairo 而不是 GPU 的所有位置进行着色。"
#: gtk/inspector/visual.ui:436
#: gtk/inspector/visual.ui:508
msgid "Show Cairo Rendering"
msgstr "显示 Cairo 渲染"
#: gtk/inspector/visual.ui:461
#: gtk/inspector/visual.ui:533
msgid "Show Baselines"
msgstr "显示基线"
#: gtk/inspector/visual.ui:489
#: gtk/inspector/visual.ui:561
msgid "Show Layout Borders"
msgstr "显示布局边框"
#: gtk/inspector/visual.ui:546
#: gtk/inspector/visual.ui:618
msgid "CSS Padding"
msgstr "CSS 填充"
#: gtk/inspector/visual.ui:556
#: gtk/inspector/visual.ui:628
msgid "CSS Border"
msgstr "CSS 边框"
#: gtk/inspector/visual.ui:566
#: gtk/inspector/visual.ui:638
msgid "CSS Margin"
msgstr "CSS 边距"
#: gtk/inspector/visual.ui:576
#: gtk/inspector/visual.ui:648
msgid "Widget Margin"
msgstr "部件边距"
#: gtk/inspector/visual.ui:611
#: gtk/inspector/visual.ui:683
msgid "Show Focus"
msgstr "显示焦点"
#: gtk/inspector/visual.ui:636
#: gtk/inspector/visual.ui:708
msgid "Show Accessibility warnings"
msgstr "显示辅助功能警告"
#: gtk/inspector/visual.ui:661
#: gtk/inspector/visual.ui:733
msgid "Show Graphics Offload"
msgstr "显示图形离屏渲染"
#: gtk/inspector/visual.ui:693
#: gtk/inspector/visual.ui:765
msgid "Inspect Inspector"
msgstr "检阅本检查器"
@@ -6559,34 +6579,35 @@ msgstr "高级"
msgid "Some of the settings in the dialog conflict"
msgstr "对话框中的某些设置冲突"
#. Translators: These strings name the possible values of the
#. * job priority option in the print dialog
#.
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:542
#: modules/printbackends/gtkprintbackendcups.c:5668
msgctxt "Print job priority"
msgid "Urgent"
msgstr "紧急"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:543
#: modules/printbackends/gtkprintbackendcups.c:5669
msgctxt "Print job priority"
msgid "High"
msgstr "高"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:544
#: modules/printbackends/gtkprintbackendcups.c:5670
msgctxt "Print job priority"
msgid "Medium"
msgstr "中"
#: modules/printbackends/gtkprintbackendcpdb.c:541
#: modules/printbackends/gtkprintbackendcups.c:5640
#: modules/printbackends/gtkprintbackendcpdb.c:545
#: modules/printbackends/gtkprintbackendcups.c:5671
msgctxt "Print job priority"
msgid "Low"
msgstr "低"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the front cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:562
#: modules/printbackends/gtkprintbackendcups.c:5782
#: modules/printbackends/gtkprintbackendcpdb.c:567
#: modules/printbackends/gtkprintbackendcups.c:5814
msgctxt "printer option"
msgid "Before"
msgstr "封面"
@@ -6594,33 +6615,33 @@ msgstr "封面"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the back cover page.
#.
#: modules/printbackends/gtkprintbackendcpdb.c:569
#: modules/printbackends/gtkprintbackendcups.c:5797
#: modules/printbackends/gtkprintbackendcpdb.c:574
#: modules/printbackends/gtkprintbackendcups.c:5829
msgctxt "printer option"
msgid "After"
msgstr "封底"
#: modules/printbackends/gtkprintbackendcpdb.c:592
#: modules/printbackends/gtkprintbackendcpdb.c:597
msgid "Print at"
msgstr "打印于"
#: modules/printbackends/gtkprintbackendcpdb.c:602
#: modules/printbackends/gtkprintbackendcpdb.c:607
msgid "Print at time"
msgstr "在指定时间打印"
#: modules/printbackends/gtkprintbackendcpdb.c:665
#: modules/printbackends/gtkprintbackendcpdb.c:670
msgctxt "print option"
msgid "Borderless"
msgstr "无边框"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1525
#: modules/printbackends/gtkprintbackendcpdb.c:1530
#: modules/printbackends/gtkprintbackendcups.c:2636
msgid "Paused; Rejecting Jobs"
msgstr "暂停,拒绝任务"
#. Translators: this is a printer status.
#: modules/printbackends/gtkprintbackendcpdb.c:1531
#: modules/printbackends/gtkprintbackendcpdb.c:1536
#: modules/printbackends/gtkprintbackendcups.c:2642
msgid "Rejecting Jobs"
msgstr "拒绝任务"
@@ -6771,266 +6792,266 @@ msgstr "打印机“%s”可能有问题。"
msgid "; "
msgstr ""
#: modules/printbackends/gtkprintbackendcups.c:4582
#: modules/printbackends/gtkprintbackendcups.c:4649
#: modules/printbackends/gtkprintbackendcups.c:4609
#: modules/printbackends/gtkprintbackendcups.c:4676
msgctxt "printing option"
msgid "Two Sided"
msgstr "双面"
#: modules/printbackends/gtkprintbackendcups.c:4583
#: modules/printbackends/gtkprintbackendcups.c:4610
msgctxt "printing option"
msgid "Paper Type"
msgstr "纸张类型"
#: modules/printbackends/gtkprintbackendcups.c:4584
#: modules/printbackends/gtkprintbackendcups.c:4611
msgctxt "printing option"
msgid "Paper Source"
msgstr "纸张来源"
#: modules/printbackends/gtkprintbackendcups.c:4585
#: modules/printbackends/gtkprintbackendcups.c:4650
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4677
msgctxt "printing option"
msgid "Output Tray"
msgstr "出纸器"
#: modules/printbackends/gtkprintbackendcups.c:4586
#: modules/printbackends/gtkprintbackendcups.c:4613
msgctxt "printing option"
msgid "Resolution"
msgstr "分辨率"
#: modules/printbackends/gtkprintbackendcups.c:4587
#: modules/printbackends/gtkprintbackendcups.c:4614
msgctxt "printing option"
msgid "GhostScript pre-filtering"
msgstr "GhostScript 预过滤"
#: modules/printbackends/gtkprintbackendcups.c:4596
#: modules/printbackends/gtkprintbackendcups.c:4623
msgctxt "printing option value"
msgid "One Sided"
msgstr "单面"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4598
#: modules/printbackends/gtkprintbackendcups.c:4625
msgctxt "printing option value"
msgid "Long Edge (Standard)"
msgstr "长边(标准)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4600
#: modules/printbackends/gtkprintbackendcups.c:4627
msgctxt "printing option value"
msgid "Short Edge (Flip)"
msgstr "短边(翻转)"
#. Translators: this is an option of "Paper Source"
#: modules/printbackends/gtkprintbackendcups.c:4602
#: modules/printbackends/gtkprintbackendcups.c:4604
#: modules/printbackends/gtkprintbackendcups.c:4612
#: modules/printbackends/gtkprintbackendcups.c:4629
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4639
msgctxt "printing option value"
msgid "Auto Select"
msgstr "自动选择"
#. Translators: this is an option of "Paper Source"
#. Translators: this is an option of "Resolution"
#: modules/printbackends/gtkprintbackendcups.c:4606
#: modules/printbackends/gtkprintbackendcups.c:4608
#: modules/printbackends/gtkprintbackendcups.c:4610
#: modules/printbackends/gtkprintbackendcups.c:4614
#: modules/printbackends/gtkprintbackendcups.c:4633
#: modules/printbackends/gtkprintbackendcups.c:4635
#: modules/printbackends/gtkprintbackendcups.c:4637
#: modules/printbackends/gtkprintbackendcups.c:4641
msgctxt "printing option value"
msgid "Printer Default"
msgstr "打印机默认"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4616
#: modules/printbackends/gtkprintbackendcups.c:4643
msgctxt "printing option value"
msgid "Embed GhostScript fonts only"
msgstr "只嵌入 GhostScript 字体"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4618
#: modules/printbackends/gtkprintbackendcups.c:4645
msgctxt "printing option value"
msgid "Convert to PS level 1"
msgstr "转换到 PS 1 级"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4620
#: modules/printbackends/gtkprintbackendcups.c:4647
msgctxt "printing option value"
msgid "Convert to PS level 2"
msgstr "转换到 PS 2 级"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/gtkprintbackendcups.c:4622
#: modules/printbackends/gtkprintbackendcups.c:4649
msgctxt "printing option value"
msgid "No pre-filtering"
msgstr "无预过滤"
#. Translators: "Miscellaneous" is the label for a button, that opens
#. up an extra panel of settings in a print dialog.
#: modules/printbackends/gtkprintbackendcups.c:4631
#: modules/printbackends/gtkprintbackendcups.c:4658
msgctxt "printing option group"
msgid "Miscellaneous"
msgstr "杂项"
#: modules/printbackends/gtkprintbackendcups.c:4658
#: modules/printbackends/gtkprintbackendcups.c:4685
msgctxt "sides"
msgid "One Sided"
msgstr "单面"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4660
#: modules/printbackends/gtkprintbackendcups.c:4687
msgctxt "sides"
msgid "Long Edge (Standard)"
msgstr "长边(标准)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/gtkprintbackendcups.c:4662
#: modules/printbackends/gtkprintbackendcups.c:4689
msgctxt "sides"
msgid "Short Edge (Flip)"
msgstr "短边(翻转)"
#. Translators: Top output bin
#: modules/printbackends/gtkprintbackendcups.c:4665
#: modules/printbackends/gtkprintbackendcups.c:4692
msgctxt "output-bin"
msgid "Top Bin"
msgstr "顶纸盒"
#. Translators: Middle output bin
#: modules/printbackends/gtkprintbackendcups.c:4667
#: modules/printbackends/gtkprintbackendcups.c:4694
msgctxt "output-bin"
msgid "Middle Bin"
msgstr "中纸盒"
#. Translators: Bottom output bin
#: modules/printbackends/gtkprintbackendcups.c:4669
#: modules/printbackends/gtkprintbackendcups.c:4696
msgctxt "output-bin"
msgid "Bottom Bin"
msgstr "底纸盒"
#. Translators: Side output bin
#: modules/printbackends/gtkprintbackendcups.c:4671
#: modules/printbackends/gtkprintbackendcups.c:4698
msgctxt "output-bin"
msgid "Side Bin"
msgstr "侧纸盒"
#. Translators: Left output bin
#: modules/printbackends/gtkprintbackendcups.c:4673
#: modules/printbackends/gtkprintbackendcups.c:4700
msgctxt "output-bin"
msgid "Left Bin"
msgstr "左纸盒"
#. Translators: Right output bin
#: modules/printbackends/gtkprintbackendcups.c:4675
#: modules/printbackends/gtkprintbackendcups.c:4702
msgctxt "output-bin"
msgid "Right Bin"
msgstr "右纸盒"
#. Translators: Center output bin
#: modules/printbackends/gtkprintbackendcups.c:4677
#: modules/printbackends/gtkprintbackendcups.c:4704
msgctxt "output-bin"
msgid "Center Bin"
msgstr "中纸盒"
#. Translators: Rear output bin
#: modules/printbackends/gtkprintbackendcups.c:4679
#: modules/printbackends/gtkprintbackendcups.c:4706
msgctxt "output-bin"
msgid "Rear Bin"
msgstr "后纸盒"
#. Translators: Output bin where one sided output is oriented in the face-up position
#: modules/printbackends/gtkprintbackendcups.c:4681
#: modules/printbackends/gtkprintbackendcups.c:4708
msgctxt "output-bin"
msgid "Face Up Bin"
msgstr "面朝上纸盒"
#. Translators: Output bin where one sided output is oriented in the face-down position
#: modules/printbackends/gtkprintbackendcups.c:4683
#: modules/printbackends/gtkprintbackendcups.c:4710
msgctxt "output-bin"
msgid "Face Down Bin"
msgstr "面朝下纸盒"
#. Translators: Large capacity output bin
#: modules/printbackends/gtkprintbackendcups.c:4685
#: modules/printbackends/gtkprintbackendcups.c:4712
msgctxt "output-bin"
msgid "Large Capacity Bin"
msgstr "大容量纸盒"
#. Translators: Output stacker number %d
#: modules/printbackends/gtkprintbackendcups.c:4707
#: modules/printbackends/gtkprintbackendcups.c:4734
#, c-format
msgctxt "output-bin"
msgid "Stacker %d"
msgstr "贴纸 %d"
#. Translators: Output mailbox number %d
#: modules/printbackends/gtkprintbackendcups.c:4711
#: modules/printbackends/gtkprintbackendcups.c:4738
#, c-format
msgctxt "output-bin"
msgid "Mailbox %d"
msgstr "邮箱 %d"
#. Translators: Private mailbox
#: modules/printbackends/gtkprintbackendcups.c:4715
#: modules/printbackends/gtkprintbackendcups.c:4742
msgctxt "output-bin"
msgid "My Mailbox"
msgstr "我的邮箱"
#. Translators: Output tray number %d
#: modules/printbackends/gtkprintbackendcups.c:4719
#: modules/printbackends/gtkprintbackendcups.c:4746
#, c-format
msgctxt "output-bin"
msgid "Tray %d"
msgstr "托盘 %d"
#: modules/printbackends/gtkprintbackendcups.c:5196
#: modules/printbackends/gtkprintbackendcups.c:5223
msgid "Printer Default"
msgstr "打印机默认"
#. Translators, this string is used to label the job priority option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5670
#: modules/printbackends/gtkprintbackendcups.c:5702
msgid "Job Priority"
msgstr "任务优先级"
#. Translators, this string is used to label the billing info entry
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5681
#: modules/printbackends/gtkprintbackendcups.c:5713
msgid "Billing Info"
msgstr "计费信息"
#. Translators, these strings are names for various 'standard' cover
#. * pages that the printing system may support.
#.
#: modules/printbackends/gtkprintbackendcups.c:5705
#: modules/printbackends/gtkprintbackendcups.c:5737
msgctxt "cover page"
msgid "None"
msgstr "无"
#: modules/printbackends/gtkprintbackendcups.c:5706
#: modules/printbackends/gtkprintbackendcups.c:5738
msgctxt "cover page"
msgid "Classified"
msgstr "保密"
#: modules/printbackends/gtkprintbackendcups.c:5707
#: modules/printbackends/gtkprintbackendcups.c:5739
msgctxt "cover page"
msgid "Confidential"
msgstr "机密"
#: modules/printbackends/gtkprintbackendcups.c:5708
#: modules/printbackends/gtkprintbackendcups.c:5740
msgctxt "cover page"
msgid "Secret"
msgstr "秘密"
#: modules/printbackends/gtkprintbackendcups.c:5709
#: modules/printbackends/gtkprintbackendcups.c:5741
msgctxt "cover page"
msgid "Standard"
msgstr "标准"
#: modules/printbackends/gtkprintbackendcups.c:5710
#: modules/printbackends/gtkprintbackendcups.c:5742
msgctxt "cover page"
msgid "Top Secret"
msgstr "绝密"
#: modules/printbackends/gtkprintbackendcups.c:5711
#: modules/printbackends/gtkprintbackendcups.c:5743
msgctxt "cover page"
msgid "Unclassified"
msgstr "非保密"
@@ -7038,7 +7059,7 @@ msgstr "非保密"
#. Translators, this string is used to label the pages-per-sheet option
#. * in the print dialog
#.
#: modules/printbackends/gtkprintbackendcups.c:5723
#: modules/printbackends/gtkprintbackendcups.c:5755
msgctxt "printer option"
msgid "Pages per Sheet"
msgstr "每张页数"
@@ -7046,7 +7067,7 @@ msgstr "每张页数"
#. Translators, this string is used to label the option in the print
#. * dialog that controls in what order multiple pages are arranged
#.
#: modules/printbackends/gtkprintbackendcups.c:5740
#: modules/printbackends/gtkprintbackendcups.c:5772
msgctxt "printer option"
msgid "Page Ordering"
msgstr "页面顺序"
@@ -7055,7 +7076,7 @@ msgstr "页面顺序"
#. * a print job is printed. Possible values are 'now', a specified time,
#. * or 'on hold'
#.
#: modules/printbackends/gtkprintbackendcups.c:5817
#: modules/printbackends/gtkprintbackendcups.c:5849
msgctxt "printer option"
msgid "Print at"
msgstr "打印于"
@@ -7063,7 +7084,7 @@ msgstr "打印于"
#. Translators: this is the name of the option that allows the user
#. * to specify a time when a print job will be printed.
#.
#: modules/printbackends/gtkprintbackendcups.c:5828
#: modules/printbackends/gtkprintbackendcups.c:5860
msgctxt "printer option"
msgid "Print at time"
msgstr "在指定时间打印"
@@ -7073,19 +7094,19 @@ msgstr "在指定时间打印"
#. * the width and height in points. E.g: "Custom
#. * 230.4x142.9"
#.
#: modules/printbackends/gtkprintbackendcups.c:5875
#: modules/printbackends/gtkprintbackendcups.c:5907
#, c-format
msgid "Custom %s×%s"
msgstr "自定义 %s×%s"
#. TRANSLATORS: this is the ICC color profile to use for this job
#: modules/printbackends/gtkprintbackendcups.c:5986
#: modules/printbackends/gtkprintbackendcups.c:6018
msgctxt "printer option"
msgid "Printer Profile"
msgstr "打印机配置"
#. TRANSLATORS: this is when color profile information is unavailable
#: modules/printbackends/gtkprintbackendcups.c:5993
#: modules/printbackends/gtkprintbackendcups.c:6025
msgctxt "printer option value"
msgid "Unavailable"
msgstr "不可用"
@@ -8068,6 +8089,15 @@ msgstr ""
"“%s”中没有主题索引文件。\n"
"如果您确实想要在此创建图标缓存,请使用 --ignore-theme-index 参数。\n"
#~ msgid "Backend does not support window scaling"
#~ msgstr "后端不支持窗口缩放"
#~ msgid "Font Scale"
#~ msgstr "字体缩放"
#~ msgid "Window Scaling"
#~ msgstr "窗口缩放"
#, c-format
#~ msgid "Unspecified error decoding media"
#~ msgstr "解码媒体时发生未指明的错误"
+56 -5
View File
@@ -1,6 +1,7 @@
#include <gtk/gtk.h>
#include "gdk/gdksurfaceprivate.h"
#include "gdk/gdksubsurfaceprivate.h"
#include "gdk/gdkdebugprivate.h"
#ifdef GDK_WINDOWING_WAYLAND
#include "gdk/wayland/gdkwayland.h"
@@ -11,6 +12,53 @@
gdk_texture_get_width (t), \
gdk_texture_get_height (t))
static void
test_subsurface_basics (void)
{
GdkSurface *surface;
GdkSubsurface *sub;
GdkTexture *texture;
graphene_rect_t rect;
#ifdef GDK_WINDOWING_WAYLAND
if (!GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
#endif
{
g_test_skip ("No subsurface support");
return;
}
surface = gdk_surface_new_toplevel (gdk_display_get_default ());
g_assert_true (surface->subsurfaces_below == NULL);
g_assert_true (surface->subsurfaces_above == NULL);
sub = gdk_surface_create_subsurface (surface);
g_assert_true (gdk_subsurface_get_parent (sub) == surface);
g_assert_null (gdk_subsurface_get_texture (sub));
g_assert_false (gdk_subsurface_is_above_parent (sub));
g_assert_true (gdk_subsurface_get_transform (sub) == GDK_TEXTURE_TRANSFORM_NORMAL);
texture = gdk_texture_new_from_resource ("/org/gtk/libgtk/icons/16x16/actions/media-eject.png");
gdk_subsurface_attach (sub, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_90, &GRAPHENE_RECT_INIT (0, 0, 20, 20), TRUE, NULL);
g_assert_true (gdk_subsurface_get_texture (sub) == texture);
g_assert_true (gdk_subsurface_is_above_parent (sub));
g_assert_true (gdk_subsurface_get_transform (sub) == GDK_TEXTURE_TRANSFORM_90);
gdk_subsurface_get_source_rect (sub, &rect);
g_assert_true (graphene_rect_equal (&rect, &TEXTURE_RECT (texture)));
gdk_subsurface_get_texture_rect (sub, &rect);
g_assert_true (graphene_rect_equal (&rect, &GRAPHENE_RECT_INIT (0, 0, 10, 10)));
gdk_subsurface_get_background_rect (sub, &rect);
g_assert_true (graphene_rect_equal (&rect, &GRAPHENE_RECT_INIT (0, 0, 20, 20)));
g_object_unref (sub);
g_object_unref (texture);
gdk_surface_destroy (surface);
}
static void
test_subsurface_stacking (void)
{
@@ -42,9 +90,9 @@ test_subsurface_stacking (void)
texture = gdk_texture_new_from_resource ("/org/gtk/libgtk/icons/16x16/actions/media-eject.png");
gdk_subsurface_attach (sub0, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, FALSE, TRUE, NULL);
gdk_subsurface_attach (sub1, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, FALSE, TRUE, NULL);
gdk_subsurface_attach (sub2, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, FALSE, TRUE, NULL);
gdk_subsurface_attach (sub0, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, NULL, TRUE, NULL);
gdk_subsurface_attach (sub1, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, NULL, TRUE, NULL);
gdk_subsurface_attach (sub2, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, NULL, TRUE, NULL);
g_assert_true (surface->subsurfaces_above == sub2);
g_assert_true (sub2->sibling_below == NULL);
@@ -67,7 +115,7 @@ test_subsurface_stacking (void)
g_assert_true (sub0->sibling_above == NULL);
g_assert_true (sub0->above_parent);
gdk_subsurface_attach (sub2, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, FALSE, FALSE, NULL);
gdk_subsurface_attach (sub2, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, NULL, FALSE, NULL);
g_assert_true (surface->subsurfaces_above == sub0);
g_assert_true (sub0->sibling_below == NULL);
@@ -79,7 +127,7 @@ test_subsurface_stacking (void)
g_assert_true (sub2->sibling_above == NULL);
g_assert_false (sub2->above_parent);
gdk_subsurface_attach (sub1, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, FALSE, TRUE, sub2);
gdk_subsurface_attach (sub1, texture, &TEXTURE_RECT (texture), &GRAPHENE_RECT_INIT (0, 0, 10, 10), GDK_TEXTURE_TRANSFORM_NORMAL, NULL, TRUE, sub2);
g_assert_true (surface->subsurfaces_below == sub1);
g_assert_true (sub1->sibling_above == NULL);
@@ -103,6 +151,9 @@ main (int argc, char *argv[])
{
gtk_test_init (&argc, &argv, NULL);
gdk_display_set_debug_flags (gdk_display_get_default (), GDK_DEBUG_FORCE_OFFLOAD);
g_test_add_func ("/subsurface/basics", test_subsurface_basics);
g_test_add_func ("/subsurface/stacking", test_subsurface_stacking);
return g_test_run ();
+4 -2
View File
@@ -478,6 +478,8 @@ if os_linux
'clipped.node',
'not-clipped.node',
'complex-clip.node',
'background.node',
'background2.node',
]
foreach test : offload_tests
@@ -487,10 +489,10 @@ if os_linux
join_paths(meson.current_source_dir(), 'offload', test)
],
env: [
'GSK_RENDERER=opengl',
'GTK_A11Y=test',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GDK_DEBUG=force-offload',
],
protocol: 'exitcode',
suite: ['gsk', 'offload'],
+18 -7
View File
@@ -210,11 +210,16 @@ collect_offload_info (GdkSurface *surface,
gdk_texture_get_width (info->texture),
gdk_texture_get_height (info->texture));
g_string_append_printf (s, "source: %g %g %g %g, ",
info->source.origin.x, info->source.origin.y,
info->source.size.width, info->source.size.height);
g_string_append_printf (s, "dest: %g %g %g %g\n",
info->dest.origin.x, info->dest.origin.y,
info->dest.size.width, info->dest.size.height);
info->source_rect.origin.x, info->source_rect.origin.y,
info->source_rect.size.width, info->source_rect.size.height);
g_string_append_printf (s, "dest: %g %g %g %g",
info->texture_rect.origin.x, info->texture_rect.origin.y,
info->texture_rect.size.width, info->texture_rect.size.height);
if (info->has_background)
g_string_append_printf (s, ", background: %g %g %g %g",
info->background_rect.origin.x, info->background_rect.origin.y,
info->background_rect.size.width, info->background_rect.size.height);
g_string_append (s, "\n");
}
else
g_string_append_printf (s, "%u: %snot offloaded\n",
@@ -416,8 +421,11 @@ parse_node_file (GFile *file, const char *generate)
g_assert_no_error (error);
if (diff && g_bytes_get_size (diff) > 0)
{
g_print ("Resulting .offload file doesn't match reference:\n%s\n",
char *basename = g_path_get_basename (reference_file);
g_print ("Resulting file doesn't match reference (%s):\n%s\n",
basename,
(const char *) g_bytes_get_data (diff, NULL));
g_free (basename);
result = FALSE;
}
@@ -452,8 +460,11 @@ parse_node_file (GFile *file, const char *generate)
g_assert_no_error (error);
if (diff && g_bytes_get_size (diff) > 0)
{
g_print ("Resulting .offload2 file doesn't match reference:\n%s\n",
char *basename = g_path_get_basename (reference_file);
g_print ("Resulting file doesn't match reference (%s):\n%s\n",
basename,
(const char *) g_bytes_get_data (diff, NULL));
g_free (basename);
result = FALSE;
}
+71
View File
@@ -0,0 +1,71 @@
container {
transform {
child: subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: black;
}
texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
}
debug {
message: "Non-black background doesn't work";
child: subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: red;
}
texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
}
debug {
message: "Can't have too much content";
child: subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: black;
}
color {
bounds: 0 0 20 20;
color: red;
}
texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
}
debug {
message: "Texture can be deeper in";
child: subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: black;
}
container {
debug {
message: "bla";
child: texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
}
}
}
}
+4
View File
@@ -0,0 +1,4 @@
0: offloaded, above: -, texture: 13x17, source: 0 0 13 17, dest: 0 0 50 50, background: 0 0 100 100
1: not offloaded
2: not offloaded
3: offloaded, raised, above: 0, texture: 13x17, source: 0 0 13 17, dest: 0 0 50 50, background: 0 0 100 100
+1
View File
@@ -0,0 +1 @@
0 0 50 50
+15
View File
@@ -0,0 +1,15 @@
container {
subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: black;
}
texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
}
+22
View File
@@ -0,0 +1,22 @@
container {
subsurface {
child: container {
color {
bounds: 0 0 100 100;
color: black;
}
texture {
texture: url('data:image/svg+xml;utf-8,<svg width="13" height="17"></svg>');
}
}
}
debug {
message: "Put something on top, so we switch from above to below";
child: color {
bounds: 0 0 10 10;
color: red;
}
}
}
@@ -0,0 +1 @@
0: offloaded, raised, above: -, texture: 13x17, source: 0 0 13 17, dest: 0 0 50 50, background: 0 0 100 100
@@ -0,0 +1 @@
0: offloaded, was offloaded, above: -, texture: 13x17, source: 0 0 13 17, dest: 0 0 50 50, background: 0 0 100 100
+1 -1
View File
@@ -43,7 +43,7 @@ subsurface {
}
subsurface {
child: debug {
message: "Clips (regardless how large) are not ok";
message: "Clips are ok";
child: clip {
clip: 0 0 400 400;
child: texture { }
+1 -1
View File
@@ -1 +1 @@
0: offloaded, raised, above: -, texture: 16x16, source: 0 0 16 16, dest: 40 40 20 20
0: offloaded, was offloaded, raised, above: -, texture: 16x16, source: 0 0 16 16, dest: 40 40 20 20
@@ -1,2 +1 @@
0 0 16 16
16 16 16 16
@@ -1 +1 @@
0: not offloaded
0: was offloaded, not offloaded
+7 -3
View File
@@ -84,7 +84,9 @@ test_parse (gconstpointer d)
GError *error = NULL;
GString *string;
g_test_message ("filename: %s", filename);
if (g_test_verbose ())
g_test_message ("filename: %s", filename);
expected_file = get_expected_filename (filename);
string = g_string_sized_new (0);
@@ -129,12 +131,14 @@ main (int argc, char *argv[])
g_assert_no_error (error);
while ((name = g_dir_read_name (dir)) != NULL)
{
char *filename;
if (!g_str_has_suffix (name, ".ui"))
continue;
path = g_strdup_printf ("/builder/parse/%s", name);
g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "ui", name, NULL),
test_parse, g_free);
filename = g_test_build_filename (G_TEST_DIST, "ui", name, NULL);
g_test_add_data_func_full (path, filename, test_parse, g_free);
g_free (path);
}
g_dir_close (dir);
+1
View File
@@ -0,0 +1 @@
SUCCESS
+10
View File
@@ -0,0 +1,10 @@
<interface>
<object class="GtkInscription">
<property name="attributes">
0 10 foreground red
5 15 weight bold
0 100 font-desc "Sans 10px"
</property>
<property name="text">Behind the wheel of a large automobile</property>
</object>
</interface>
+1 -1
View File
@@ -10,7 +10,7 @@ echo "1..1"
name=gtk-query-settings
result=$TEST_RESULT_DIR/$name.out
$GTK_QUERY_SETTINGS 2>/dev/null >$result
EXPECTED=51
EXPECTED=52
SEEN=$(wc -l $result | cut -f1 -d' ')
if [ $SEEN -eq $EXPECTED ]; then
+60 -1
View File
@@ -31,6 +31,9 @@
#ifdef CAIRO_HAS_SVG_SURFACE
#include <cairo-svg.h>
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
#include <cairo-pdf.h>
#endif
static char *
get_save_filename (const char *filename)
@@ -51,7 +54,7 @@ get_save_filename (const char *filename)
return result;
}
#ifdef CAIRO_HAS_SVG_SURFACE
#if defined(CAIRO_HAS_SVG_SURFACE) || defined(CAIRO_HAS_PDF_SURFACE)
static cairo_status_t
cairo_serializer_write (gpointer user_data,
const unsigned char *data,
@@ -61,7 +64,9 @@ cairo_serializer_write (gpointer user_data,
return CAIRO_STATUS_SUCCESS;
}
#endif
#ifdef CAIRO_HAS_SVG_SURFACE
static GBytes *
create_svg (GskRenderNode *node,
GError **error)
@@ -103,6 +108,48 @@ create_svg (GskRenderNode *node,
}
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
static GBytes *
create_pdf (GskRenderNode *node,
GError **error)
{
cairo_surface_t *surface;
cairo_t *cr;
graphene_rect_t bounds;
GByteArray *array;
gsk_render_node_get_bounds (node, &bounds);
array = g_byte_array_new ();
surface = cairo_pdf_surface_create_for_stream (cairo_serializer_write,
array,
bounds.size.width,
bounds.size.height);
cairo_surface_set_device_offset (surface, -bounds.origin.x, -bounds.origin.y);
cr = cairo_create (surface);
gsk_render_node_draw (node, cr);
cairo_show_page (cr);
cairo_destroy (cr);
cairo_surface_finish (surface);
if (cairo_surface_status (surface) == CAIRO_STATUS_SUCCESS)
{
cairo_surface_destroy (surface);
return g_byte_array_free_to_bytes (array);
}
else
{
g_set_error (error,
G_IO_ERROR, G_IO_ERROR_FAILED,
"%s", cairo_status_to_string (cairo_surface_status (surface)));
cairo_surface_destroy (surface);
g_byte_array_unref (array);
return NULL;
}
}
#endif
static void
render_file (const char *filename,
const char *renderer_name,
@@ -139,6 +186,18 @@ render_file (const char *filename,
}
}
else
#endif
#ifdef CAIRO_HAS_PDF_SURFACE
if (g_str_has_suffix (save_to, ".pdf"))
{
bytes = create_pdf (node, &error);
if (bytes == NULL)
{
g_printerr (_("Failed to generate SVG: %s\n"), error->message);
exit (1);
}
}
else
#endif
{
GdkTexture *texture;