Compare commits

...

99 Commits

Author SHA1 Message Date
Matthias Clasen 10d075ee47 Steal enough Weston test code to show a yuv surface
This isn't mean to be mergable. It is just a quick hack
to get a yuv surface onscreen. It only runs under weston
atm, since mutter does not support yuv yet.
2022-06-08 15:36:11 -04:00
Matthias Clasen 9ec662dbba Flesh this out a bit 2022-06-08 14:53:34 -04:00
Matthias Clasen 5b6297e00f Add a quick subsurface test
Add a subsurface to a GTK toplevel,
and paint it green.
2022-06-08 14:53:34 -04:00
Matthias Clasen 27db4b5c2f node-editor: Add a zoom button
This is a bit more convenient than manually
adding a transform node in the text editor.
2022-06-07 13:39:22 -04:00
Hugo Carvalho 5abaee4f02 Update Portuguese translation 2022-06-07 13:54:09 +00:00
Yuri Chornoivan d2b6fef1f8 Update Ukrainian translation 2022-06-07 06:15:52 +00:00
Benjamin Otte a639aaefae Merge branch 'wip/otte/for-main' into 'main'
listview: cull listitems that are out of view

See merge request GNOME/gtk!4799
2022-06-07 01:36:06 +00:00
Benjamin Otte 39645d3258 listview: cull listitems that are out of view
Use set_child_visible(FALSE) on those widgets and don't allocate them.

This should usually be the majority of items, so it's quite a worthwhile
addition.

Idea by Ivan Molodetskikh.

Related: #3334
2022-06-07 03:20:11 +02:00
Matthias Clasen 526b62e0be Merge branch 'fix-ui-file-translation-main' into 'main'
Fix ui files to work for translations

Closes #4957

See merge request GNOME/gtk!4798
2022-06-06 22:45:44 +00:00
Matthias Clasen 19fb336c39 Fix ui files to work for translations
We need to keep using translatable="yes", since
that is what the installed its file is looking
for.

Fixes: #4957
2022-06-06 18:29:14 -04:00
Matthias Clasen 1f3674cf3e Merge branch 'matthiasc/for-main' into 'main'
gdk: Improve GdkTimeCoord docs

See merge request GNOME/gtk!4795
2022-06-06 13:12:15 +00:00
Matthias Clasen c76069389c gdk: Improve GdkTimeCoord docs 2022-06-06 08:55:51 -04:00
Danial Behzadi eef0c81be9 Update Persian translation 2022-06-06 08:13:32 +00:00
Aleksandr Melman c78eeaa874 Update Russian translation 2022-06-05 12:34:50 +00:00
Yuri Chornoivan 2766f61abc Update Ukrainian translation 2022-06-05 08:26:34 +00:00
Benjamin Otte 45422f7b61 Merge branch 'gl-api-es-fix' into 'main'
glcontext: Respect ES API when getting gl version from shared context

Closes #4763

See merge request GNOME/gtk!4687
2022-06-04 20:26:58 +00:00
Pablo Correa Gómez c4feca1311 glcontext: Simplify get_required_version api
Simplify the API to just return the requirements that the user
has asked for. The rest of the code was undocumented and previously
used as a buggy source for a default value from internal code.
Since the buggy code is now fixed, remove all unnecessary cruft.
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez 9426b20759 glcontext: Do not check for correctness in set_required_version
There are two reasons for this:
 * First, the refactored realize code now makes sure that no
   context with unsupported version is ever created.
 * Second, this code could bump into false possitives and negatives, since
   the user is not requested, nor expected to set_required_version
   in any specific order relative to set_allowed_apis. Therefore,
   some version could be rejected or accepted based on a set of
   allowed apis that the user has not yet correctly configured.
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez f97cff1454 glcontext-glx: Refactor realize function
Mimic the behavior of the egl context creation by stablishing
some sane logic for the api and version used. Split the decision
of the type of context (api, legacy) and the creation of a context
of a certain version and all its properties.
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez 549a2b4c86 glcontext: Refactor realize function, fix interaction with shared context 2022-06-04 20:48:40 +02:00
Pablo Correa Gómez f4f0daa113 macosglcontext: Do not rely on default from get_required_version
get_required_version cannot warranty to return any default. Instead,
fetch the user requisites clipped by the requirements in our backend.
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez d4f8a80f2a glcontext-win32-wgl: Respect user required version, use display as minimum
By setting and then getting the required version in a context, the code
was not respecting user requirements. Instead, simply get the requested
version by the user clipped by the requirements (display version)
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez 8d175801d7 glcontext: Add internal get_clipped_version function
It is useful for backends to get user set preferences while
ensuring the correctness of the result, which will be always
greater or equal than the minimum version provided
2022-06-04 20:48:40 +02:00
Pablo Correa Gómez 6bc3ecbe56 glcontext: Improve get_version documentation 2022-06-04 20:48:29 +02:00
Matthias Clasen 31da5f7e2a Merge branch 'expand-builtin-icontheme' into 'main'
Add more directories to the builtin hicolor index

Closes #4960

See merge request GNOME/gtk!4786
2022-06-04 10:44:48 +00:00
Matthias Clasen 48228efe42 Merge branch 'wip/carlosg/activation-roundtrip-fix' into 'main'
gdk/wayland: Check the GdkSurface wl_surface before using it for activation

Closes gnome-control-center#1862

See merge request GNOME/gtk!4789
2022-06-02 21:24:10 +00:00
Carlos Garnacho 4b41d4f78c gdk/wayland: Check the GdkSurface wl_surface before using it for activation
Double check the GdkSurface has a wl_surface before using it as the activation
token source, since we cannot use NULL surfaces here.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1862
2022-06-02 23:08:40 +02:00
Carlos Garnacho fb68600d88 gdk/wayland: Dispatch GdkAppLaunchContext activation token in its own queue
Use a separate queue to dispatch the token object exclusively, just like we
do on the GdkSurface activation paths.
2022-06-02 23:08:40 +02:00
Matthias Clasen 0e6a3ab397 Merge branch 'ebassi/a11y-text-extents' into 'main'
a11y: Implement atspi.Text.GetCharacterExtents for GtkTextView

See merge request GNOME/gtk!4754
2022-06-02 17:13:53 +00:00
Carlos Garnacho e895f7dd70 a11y: Transform GetCharacterExtents coords to native surface ones
These coordinates are "window"-relative, so transform textview coordinates
to the coordinate system of the GtkNative containing it.
2022-06-02 14:35:53 +02:00
Matthias Clasen dae892d8f6 Add more directories to the builtin hicolor index
We haven't had any scalable directories in this list.
Add some. Since we seem to have settled on including
just actions and status as subdirectories for each
size, add scalable/actions and scalable/status.

Fixes: #4960
2022-06-02 06:38:12 -04:00
Matthias Clasen ad5c3168a9 Merge branch 'wip/chergert/GTK_DEBUG_TEXT_DIR' into 'main'
main: add GTK_DEBUG_TEXT_DIR environment variable

See merge request GNOME/gtk!4768
2022-06-01 18:54:54 +00:00
Christian Hergert 8f1db27b6b gtkmain: add support for GTK_DEBUG=invert-text-dir
This allows inverting the default text-direction in an application for
debugging, testing, and QA purposes. IDEs such as Builder may automate this
to encourage more application developers to test with a text-direction
different than their own.
2022-06-01 11:26:44 -07:00
Matthias Clasen 56a1cbe217 Merge branch 'wip/chergert/fix-lookup-with-interfaces' into 'main'
builderparser: fix <lookup/> with interface types

See merge request GNOME/gtk!4782
2022-06-01 00:13:44 +00:00
Christian Hergert 63e9e7e899 builderparser: fix <lookup/> with interface types
If we have a <lookup name="foo" type="SomeInterface"> a runtime warning
would be emitted and the expression would fail to be created. This is
because the interfaces will likely be a GObject as well, meaning we check
the object type branch instead of the interface.

Instead, we need to use the fundamental type like other parts of the
expression system use.
2022-05-31 15:58:21 -07:00
Matthias Clasen 480a933546 Merge branch 'matthiasc/for-main' into 'main'
shortcutcontroller: Fix a typo

See merge request GNOME/gtk!4778
2022-05-30 21:05:34 +00:00
Matthias Clasen 2623c396cb shortcutcontroller: Fix a typo 2022-05-30 16:27:03 -04:00
Pablo Correa Gómez 826fdc4a80 glcontext: Improve documentation on get_use_es api 2022-05-30 20:48:47 +02:00
Carlos Garnacho 3b088281ca Merge branch 'gesture-click-unpaired-release-nullable-sequence' into 'main'
Mark sequence parameter in GtkGestureClick::unpaired-release signal as nullable

See merge request GNOME/gtk!4777
2022-05-30 09:55:29 +00:00
Sebastian Dröge e61aecd67e Mark sequence parameter in GtkGestureClick::unpaired-release signal as nullable 2022-05-30 11:33:59 +03:00
Aurimas Černius bd68339390 Updated Lithuanian translation 2022-05-29 23:05:31 +03:00
Matthias Clasen 491d1f67c7 Merge branch 'fix-tests-with-recent-glib' into 'main'
Avoid g_log_set_writer_func in tests

See merge request GNOME/gtk!4772
2022-05-28 15:34:13 +00:00
Matthias Clasen 73dc741a82 Avoid g_log_set_writer_func in tests
It is not usable anymore since GLib 2.72.
2022-05-28 10:43:26 -04:00
Luming Zh 38ec040fce Update Chinese (China) translation 2022-05-28 01:52:42 +00:00
Matthias Clasen 6bb1873183 Merge branch 'headerbar-demo-upgrade' into 'main'
Make our demos more likable

See merge request GNOME/gtk!4769
2022-05-27 22:18:26 +00:00
Matthias Clasen 5ba5693efd Make our demos more likable
Nobody likes Facebook.
Everybody loves the Eagles.
2022-05-27 17:34:55 -04:00
Matthias Clasen 797cc2e91b Merge branch 'wayland-cursor-scale2' into 'main'
wayland: scale cursors to the right size

See merge request GNOME/gtk!4766
2022-05-27 16:47:38 +00:00
Matthias Clasen 5507b3f8c1 wayland: scale cursors to the right size
When loading cursors at scale, we expect the
cursor images to have a size of scale * size.
If we don't find such images, load them at their
unscaled size and scale them up ourselves.

Without this, cursors will appear in unexpected
sizes depending on scales and themes.

Related: #4746
2022-05-27 12:26:45 -04:00
Matthias Clasen f9a3f13702 Merge branch 'main' into 'main'
GtkIMContextSimple: array bounds was not correctly checked

Closes #4771

See merge request GNOME/gtk!4748
2022-05-27 14:24:54 +00:00
Matthias Clasen b4c72ac508 Merge branch 'use-flathub-link' into 'main'
Make the formatted link more neutral

See merge request GNOME/gtk!4765
2022-05-27 14:10:47 +00:00
Matthias Clasen bcad305136 Make the formatted link more neutral
There have been complaints about company names in
our demos. Lets use something else.

Part of: #4716
2022-05-27 08:43:06 -04:00
Matthias Clasen 00d45c6743 Merge branch 'update-initial-layout' into 'main'
vulkan: Set initial layout to undefined

See merge request GNOME/gtk!4706
2022-05-27 12:26:24 +00:00
Matthias Clasen 38b393ff5d Merge branch 'update-command-buffer-freeing' into 'main'
vulkan: Don't attempt to free 0 command buffers

See merge request GNOME/gtk!4705
2022-05-27 12:25:48 +00:00
Matthias Clasen 23f92ca1c2 Merge branch 'wayland-cursor-scale' into 'main'
wayland: Sanity check cursor image size

Closes #4746

See merge request GNOME/gtk!4761
2022-05-27 10:58:12 +00:00
Matthias Clasen 34a9bc4632 wayland: Make cursors have the right size
The Wayland protocol requires that width and height
of cursor surfaces is an integer multiple of the
surface scale. Make it so.

Fixes: #4746
2022-05-26 22:29:37 -04:00
Matthias Clasen d603164ec2 wayland: Sanity check cursor image size
On Wayland it is a protocol violation to upload buffers with
dimensions that are not an integer multiple of the buffer scale.

Until recently, Mutter did not enforce this. When it started
doing so, some users started seeing crashes in GTK apps because the
cursor theme ended up with e.g. a 15x16 pixel image at scale of 2.

Add a small sanity check for this case.
2022-05-26 22:29:37 -04:00
Matthias Clasen a033e838b2 Merge branch 'TTMaZa-LGPL-vs-GPL' into 'main'
GDK is LGPL-2.1-or-later not GPL-2.1-or-later, right?

See merge request GNOME/gtk!4755
2022-05-26 12:23:56 +00:00
Matthias Clasen 511a2f4d03 Merge branch 'wip/chergert/fix-sysprof-wrapper' into 'main'
build: fix sysprof default options

See merge request GNOME/gtk!4759
2022-05-26 11:43:56 +00:00
Matthias Clasen c089912a52 Merge branch 'wip/otte/for-main' into 'main'
x11: Always update shadow size

Closes #4136

See merge request GNOME/gtk!4758
2022-05-26 10:03:39 +00:00
Christian Hergert 2694d81d63 build: fix sysprof default options
Sysprof just recently cleaned up it's meson_options.txt and this makes
the tracking of the master branch match the new values.
2022-05-25 22:52:34 -07:00
Benjamin Otte 213490099b x11: Always update shadow size
Not updating shadow size unconditionally would lead to shadow size not
being set on map, which would lead mutter to think that we are a Window
without extents and then become confused when we suddenly set some.

Make sure that doesn't happen by always having shadows set on map, just
like GTK3.

Fixes #4136
2022-05-26 04:38:29 +02:00
Emmanuele Bassi 166af48904 Merge branch 'fix-stack-page-at-spi-parent' into 'main'
a11y: Realize GtkStackPage parent context before trying to get a ref

Closes #4944

See merge request GNOME/gtk!4757
2022-05-25 14:29:41 +00:00
Sebastian Keller 6e3dbc42a8 a11y: Realize GtkStackPage parent context before trying to get a ref
If a context is not realized, calling gtk_at_spi_context_to_ref() will
return a null ref, because its path has not been initialized yet. This
was already done for all other cases in get_parent_context_ref(), but
was missing for the GtkStackPage case.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4944
2022-05-25 14:56:05 +02:00
Matthias Clasen 36fbbfc5c7 Merge branch 'pkgconfig' into 'main'
Meson: Simplify pkgconfig file generator

See merge request GNOME/gtk!4756
2022-05-24 16:46:18 +00:00
Luca Bacci 9bfc89e23d Merge branch 'remove-emulated-scroll-events' into 'main'
Drop pointer_emulated discrete scroll events

See merge request GNOME/gtk!4694
2022-05-24 15:26:24 +00:00
Xavier Claessens 802bf41999 Meson: Simplify pkgconfig file generator
Meson knows all private dependencies itself when passing the library as
first positional argument, no need to specify them manually. Also
simplify backend specific files by simply requiring gtk4, just like
unix-print already did.

This should fix generated gtk4-uninstalled.pc, see Meson bug report:
https://github.com/mesonbuild/meson/issues/10415
2022-05-24 10:30:58 -04:00
Manuel Zabelt 93636d4c5a Update docs/reference/gdk/gdk4-x11.toml.in 2022-05-24 13:37:43 +00:00
Manuel Zabelt 88f761f2c8 GDK is LGPL-2.1-or-later not GPL-2.1-or-later, right? 2022-05-24 13:36:07 +00:00
Luca Bacci 7752467847 Drop pointer_emulated discrete scroll events
GTK4 has had smooth scroll events since the beginning, so we
prefer not to emit emulated discrete scroll events at all
2022-05-24 12:30:49 +00:00
Luca Bacci 8514457d0f Wayland: Only send smooth scroll events for tablet tools 2022-05-24 12:30:49 +00:00
Luca Bacci c0d79aa1ef Merge branch 'scroll-surface-unit-dpi-scale' into 'main'
DirectManipulation: Account for DPI scale

See merge request GNOME/gtk!4749
2022-05-24 12:19:39 +00:00
Luca Bacci 8a6d6fe6b1 DirectManipulation: Account for DPI scale 2022-05-24 11:37:06 +02:00
Emmanuele Bassi 7750a2c423 a11y: Implement atspi.Text.GetCharacterExtents for GtkTextView
Retrieve the location of a given offset in window-relative coordinate
space.
2022-05-23 15:54:13 +01:00
Matthias Clasen 393893b8db Merge branch 'blink-assertion' into 'main'
Remove an assertion that we hit

See merge request GNOME/gtk!4753
2022-05-23 14:08:43 +00:00
Matthias Clasen 4f16242807 Merge branch 'otte-main-patch-30652' into 'main'
gesturedrag: Fix docs

See merge request GNOME/gtk!4752
2022-05-23 12:43:25 +00:00
Matthias Clasen e82fb8e894 Merge branch 'ci-meson-bump' into 'main'
CI: bump meson version from 0.59 to 0.60.3

See merge request GNOME/gtk!4751
2022-05-23 12:33:30 +00:00
Matthias Clasen b3e65bfdc1 Remove an assertion that we hit
It appears that we mess up accounting for blinking
cursors sometimes, and can hit blink_cb when there
is a nonempty selection.

Instead of asserting, warn and stop blinking.

Related: #4767
2022-05-23 08:28:00 -04:00
Aleksandr Melman 111daecd3b Update Russian translation 2022-05-23 12:25:59 +00:00
Benjamin Otte 72fe406c4d gesturedrag: Fix docs
Leftover from GTK3. Coordinates are widget relative everywhere now.
2022-05-22 12:45:28 +00:00
Christian Kirbach 0f01629ce3 Update German translation
(cherry picked from commit 7703aa5cd3)
2022-05-22 10:41:21 +00:00
Christoph Reiter 2f695388e9 CI: bump meson version from 0.59 to 0.60.3
We pull in glib main via a submodule in CI and glib has recently
bumped its meson requirement to >= 0.60:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2641

Install 0.60.3 where needed to make things build again.
2022-05-22 11:46:54 +02:00
Víctor Marzo 3955633aa8 GtkIMContextSimple: array bounds was not correctly checked
Fixes #4771
2022-05-19 11:35:14 +02:00
Luca Bacci f77f941401 Merge branch 'fix-memory-leak' into 'main'
GdkWin32: Plug memory leak

See merge request GNOME/gtk!4747
2022-05-19 09:05:50 +00:00
Luca Bacci 288dd406e0 GdkWin32: Plug memory leak 2022-05-19 08:49:05 +02:00
Benjamin Otte 8667b7a46c Merge branch 'wip/otte/for-main' into 'main'
nodeparser: Fix parsing of color-matrix node

See merge request GNOME/gtk!4745
2022-05-18 21:08:46 +00:00
Benjamin Otte 0410125f20 nodeparser: Fix parsing of color-matrix node
Negative offsets in the color matrix were inverted because it used the
rect parser.
2022-05-18 21:16:33 +02:00
Benjamin Otte 1ea0de61e1 Merge branch 'wip/otte/for-main' into 'main'
CI: Include reftest nodes in artifacts

See merge request GNOME/gtk!4743
2022-05-18 18:27:29 +00:00
Benjamin Otte e8eb96ae0c CI: Include reftest nodes in artifacts 2022-05-18 19:54:34 +02:00
Hugo Carvalho 04f924c13e Update Portuguese translation 2022-05-18 14:54:31 +00:00
Matthias Clasen 1fbca7a76a Merge branch 'let_selectable_label_mnemonic_self_focus' into 'main'
Allow selectable labels contents to be selected by mnemonic

See merge request GNOME/gtk!4741
2022-05-18 13:55:33 +00:00
Caolán McNamara 3f49d335d1 Allow selectable labels contents to be selected by mnemonic
expecially by the mnemonic of another label that targets it.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4927

see also https://bugs.documentfoundation.org/show_bug.cgi?id=137748
2022-05-18 12:40:40 +01:00
Jordi Mas 3882e14053 Update Catalan translation 2022-05-18 13:32:32 +02:00
Matthias Clasen 5f5fda911d Merge branch 'wip/chergert/fix-4934' into 'main'
checkbutton: fix critical when setting use-underline

Closes #4934

See merge request GNOME/gtk!4740
2022-05-18 01:34:47 +00:00
Christian Hergert b9574e119b checkbutton: fix critical when setting use-underline
This needs to make sure that we've created the label before applying the
setting on a child widget.

Fixes #4934
2022-05-17 12:28:25 -07:00
Benjamin Otte 5f469a0d2d Merge branch 'wip/otte/for-main' into 'main'
testsuite: Add tests for label overdraw

See merge request GNOME/gtk!4737
2022-05-17 00:19:01 +00:00
Benjamin Otte ffd3801b1d testsuite: Add tests for label overdraw
This brings back a subset of what quit-mnemonic.ui tested for, but
trying a lot harder to trigger the label overdrawing its allocation,
which will cause the text to be cut off when clipping is happening.

It should not be an issue at all with GTK4, but keeping that test around
is a good idea.
2022-05-17 00:14:19 +02:00
Pablo Correa Gómez 0f21f6c273 glcontext: Make the creation of EGL context more obvious
By splitting it into its own function it becomes more that the
EGL code is a shared implementation.
2022-05-10 12:29:08 +02:00
TestingPlant 1c587c7d7f vulkan: Set initial layout to undefined
Having the initial layout set to VK_IMAGE_LAYOUT_GENERAL causes issues
when going from the final layout to the initial layout since the image
layout is expected to be the general layout. Setting the initial layout
to undefined doesn't have this restriction.
2022-05-08 05:39:36 +00:00
TestingPlant 2f98de06bc vulkan: Don't attempt to free 0 command buffers
vkFreeCommandBuffers can't be called with commandBufferCount set to 0.
2022-05-08 05:37:14 +00:00
82 changed files with 5386 additions and 5056 deletions
+2 -1
View File
@@ -58,6 +58,7 @@ style-check-diff:
- "${CI_PROJECT_DIR}/_build/report*.xml"
- "${CI_PROJECT_DIR}/_build/report*.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
@@ -172,7 +173,7 @@ macos:
needs: []
before_script:
- bash .gitlab-ci/show-info-osx.sh
- pip3 install --user meson==0.59
- pip3 install --user meson==0.60.3
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1
+4
View File
@@ -185,6 +185,8 @@ ul.images li {
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
<li><a href="{{ failure.image_data.refnode }}">ref node</a></li>
<li><a href="{{ failure.image_data.outnode }}">out node</a></li>
</ul>
{% endif %}
</li>
@@ -311,6 +313,8 @@ for line in args.infile:
image_data = {
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
'refnode': os.path.join(args.reftest_output_dir, '{}.ref.node'.format(basename)),
'outnode': os.path.join(args.reftest_output_dir, '{}.out.node'.format(basename)),
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
}
+1 -1
View File
@@ -5,7 +5,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
@echo on
:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.59 || goto :error
pip3 install --upgrade --user meson==0.60.3 || goto :error
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error
+2 -1
View File
@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_widget)
{
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Welcome to Facebook - Log in, sign up or learn more");
gtk_window_set_title (GTK_WINDOW (window), "Welcome to the Hotel California");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
@@ -31,6 +31,7 @@ do_headerbar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
gtk_widget_set_tooltip_text (button, "Check out");
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+3 -5
View File
@@ -66,11 +66,9 @@ do_links (GtkWidget *do_widget)
"as hyperlinks, which can be clicked "
"or activated via <a href=\"keynav\">keynav</a> "
"and they work fine with other markup, like when "
"searching on <a href=\"http://www.google.com/\">"
"<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
"<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
"</a>.");
"linking to <a href=\"http://www.flathub.org/\"><b>"
"<span letter_spacing=\"1024\" underline=\"none\" color=\"pink\" background=\"darkslategray\">Flathub</span>"
"</b></a>.");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
+23
View File
@@ -57,6 +57,7 @@ struct _NodeEditorWindow
GtkWidget *testcase_cairo_checkbutton;
GtkWidget *testcase_name_entry;
GtkWidget *testcase_save_button;
GtkWidget *scale_scale;
GtkWidget *renderer_listbox;
GListStore *renderers;
@@ -171,6 +172,7 @@ text_changed (GtkTextBuffer *buffer,
GBytes *bytes;
GtkTextIter iter;
GtkTextIter start, end;
float scale;
g_array_remove_range (self->errors, 0, self->errors->len);
text = get_current_text (self->text_buffer);
@@ -181,6 +183,17 @@ text_changed (GtkTextBuffer *buffer,
/* If this is too slow, go fix the parser performance */
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
scale = gtk_scale_button_get_value (GTK_SCALE_BUTTON (self->scale_scale));
if (self->node && scale != 1.0)
{
GskRenderNode *node;
node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
gsk_render_node_unref (self->node);
self->node = node;
}
g_bytes_unref (bytes);
if (self->node)
{
@@ -277,6 +290,14 @@ text_changed (GtkTextBuffer *buffer,
&start, &end);
}
static void
scale_changed (GObject *object,
GParamSpec *pspec,
NodeEditorWindow *self)
{
text_changed (self->text_buffer, self);
}
static gboolean
text_view_query_tooltip_cb (GtkWidget *widget,
int x,
@@ -962,6 +983,7 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button);
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, scale_scale);
gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb);
gtk_widget_class_bind_template_callback (widget_class, open_cb);
@@ -1068,6 +1090,7 @@ node_editor_window_init (NodeEditorWindow *self)
self->text_buffer = gtk_text_buffer_new (self->tag_table);
g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self);
g_signal_connect (self->scale_scale, "notify::value", G_CALLBACK (scale_changed), self);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer);
/* Default */
+17
View File
@@ -157,6 +157,23 @@
<signal name="notify::active" handler="dark_mode_cb" swapped="0"/>
</object>
</child>
<child type="end">
<object class="GtkScaleButton" id="scale_scale">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">1</property>
<property name="value">1</property>
<property name="upper">10</property>
<property name="step-increment">0.1</property>
<property name="page-increment">0.5</property>
</object>
</property>
<property name="icons">zoom-in-symbolic</property>
<property name="tooltip-text" translatable="yes">Scale the image</property>
</object>
</child>
</object>
</child>
<child>
+1 -1
View File
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
license = "LGPL-2.1-or-later"
description = "The GTK toolkit"
devhelp = true
+1 -1
View File
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
license = "LGPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = ["Gdk-4.0"]
devhelp = true
+1 -2
View File
@@ -189,8 +189,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
message->pointer.state,
message->scroll.dir == 0
? GDK_SCROLL_UP
: GDK_SCROLL_DOWN,
FALSE);
: GDK_SCROLL_DOWN);
node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial);
+7 -2
View File
@@ -66,10 +66,15 @@ typedef enum
/**
* GdkTimeCoord:
* @time: The timestamp for this event
* @flags: Flags indicating what axes are present
* @axes: (array fixed-size=12): axis values
* @flags: Flags indicating what axes are present, see [flags@Gdk.AxisFlags]
* @axes: (array fixed-size=12): axis values, indexed by [enum@Gdk.AxisUse]
*
* A `GdkTimeCoord` stores a single event in a motion history.
*
* To check whether an axis is present, check whether the corresponding
* flag from the [flags@Gdk.AxisFlags] enumeration is set in the @flags
* To access individual axis values, use the values of the values of
* the [enum@Gdk.AxisUse] enumerations as indices.
*/
struct _GdkTimeCoord
{
+1 -11
View File
@@ -920,14 +920,6 @@ gdk_event_get_pointer_emulated (GdkEvent *event)
return tevent->pointer_emulated;
}
case GDK_SCROLL:
case GDK_SCROLL_SMOOTH:
{
GdkScrollEvent *sevent = (GdkScrollEvent *) event;
return sevent->pointer_emulated;
}
default:
break;
}
@@ -2373,15 +2365,13 @@ gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
GdkScrollDirection direction,
gboolean emulated)
GdkScrollDirection direction)
{
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
self->state = state;
self->direction = direction;
self->pointer_emulated = emulated;
self->unit = GDK_SCROLL_UNIT_WHEEL;
return (GdkEvent *) self;
+1 -5
View File
@@ -206,8 +206,6 @@ struct _GdkTouchEvent
* %GDK_SCROLL_SMOOTH).
* @delta_x: the x coordinate of the scroll delta
* @delta_y: the y coordinate of the scroll delta
* @pointer_emulated: whether the scroll event was the result of
* a pointer emulation
* @tool: a `GdkDeviceTool`
* @history: (element-type GdkTimeCoord): array of times and deltas
* for other scroll events that were compressed before delivering the
@@ -231,7 +229,6 @@ struct _GdkScrollEvent
GdkScrollDirection direction;
double delta_x;
double delta_y;
gboolean pointer_emulated;
gboolean is_stop;
GdkDeviceTool *tool;
GArray *history; /* <GdkTimeCoord> */
@@ -496,8 +493,7 @@ GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
GdkScrollDirection direction,
gboolean emulated);
GdkScrollDirection direction);
GdkEvent * gdk_touch_event_new (GdkEventType type,
GdkEventSequence *sequence,
+242 -238
View File
@@ -256,181 +256,179 @@ gdk_gl_context_get_property (GObject *object,
}
}
#define N_EGL_ATTRS 16
#define N_EGL_ATTRS 16
#ifdef HAVE_EGL
static inline EGLenum
gdk_api_to_egl_api (GdkGLAPI api)
{
switch (api)
{
case GDK_GL_API_GLES:
return EGL_OPENGL_ES_API;
case GDK_GL_API_GL:
default:
return EGL_OPENGL_API;
}
}
static GdkGLAPI
gdk_gl_context_real_realize (GdkGLContext *context,
GError **error)
gdk_gl_context_create_egl_context (GdkGLContext *context,
GdkGLAPI api,
gboolean legacy)
{
#ifdef HAVE_EGL
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
EGLDisplay egl_display = gdk_display_get_egl_display (display);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
EGLConfig egl_config;
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;
gboolean debug_bit, forward_bit;
int min_major, min_minor, major = 0, minor = 0;
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
if (egl_display)
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
return 0;
/* We will use the default version matching the context status
* unless the user requested a version which makes sense */
gdk_gl_context_get_matching_version (api, legacy,
display->have_egl_win32_libangle,
&min_major, &min_minor);
gdk_gl_context_get_clipped_version (context,
min_major, min_minor,
&major, &minor);
if (!eglBindAPI (gdk_api_to_egl_api (api)))
return 0;
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
if (display->have_egl_no_config_context)
egl_config = NULL;
else
egl_config = gdk_display_get_egl_config (display);
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (forward_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
if (api == GDK_GL_API_GL)
{
EGLConfig egl_config;
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS];
int major, minor, flags;
gboolean debug_bit, forward_bit, legacy_bit;
GdkGLAPI api;
int i = 0;
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
if (share != NULL)
gdk_gl_context_get_required_version (share, &major, &minor);
else
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share));
if (display->have_egl_no_config_context)
egl_config = NULL;
else
egl_config = gdk_display_get_egl_config (display);
flags = 0;
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (forward_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) &&
eglBindAPI (EGL_OPENGL_API))
{
/* We want a core profile, unless in legacy mode */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = legacy_bit
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
/* Specify the version */
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
context_attribs[i++] = legacy_bit ? 3 : major;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
context_attribs[i++] = legacy_bit ? 0 : minor;
api = GDK_GL_API_GL;
}
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) &&
eglBindAPI (EGL_OPENGL_ES_API))
{
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
if (major == 3)
context_attribs[i++] = 3;
else
context_attribs[i++] = 2;
api = GDK_GL_API_GLES;
}
else
{
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
_("The EGL implementation does not support any allowed APIs"));
return 0;
}
/* Specify the flags */
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy_bit ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
/* If context creation failed without the ES bit, let's try again with it */
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) && eglBindAPI (EGL_OPENGL_ES_API))
{
i = 0;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = 2;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = 0;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
legacy_bit = FALSE;
api = GDK_GL_API_GLES;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("eglCreateContext failed, switching to OpenGL ES"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
}
/* If context creation failed without the legacy bit, let's try again with it */
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) && eglBindAPI (EGL_OPENGL_API))
{
i = 0;
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = 3;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = 0;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
legacy_bit = TRUE;
api = GDK_GL_API_GL;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("eglCreateContext failed, switching to legacy"));
ctx = eglCreateContext (egl_display,
egl_config,
share != NULL ? share_priv->egl_context
: EGL_NO_CONTEXT,
context_attribs);
}
if (ctx == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy_bit);
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
return api;
/* We want a core profile, unless in legacy mode */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK;
context_attribs[i++] = legacy
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT;
}
if (legacy || api == GDK_GL_API_GLES)
flags &= ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = major;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
context_attribs[i++] = minor;
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
ctx = eglCreateContext (egl_display,
egl_config,
share ? share_priv->egl_context : EGL_NO_CONTEXT,
context_attribs);
if (ctx == NULL)
return 0;
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
return api;
}
static GdkGLAPI
gdk_gl_context_realize_egl (GdkGLContext *context,
GError **error)
{
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkGLAPI api, preferred_api;
gboolean prefer_legacy;
if (share && gdk_gl_context_is_api_allowed (context,
gdk_gl_context_get_api (share),
NULL))
preferred_api = gdk_gl_context_get_api (share);
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
preferred_api = GDK_GL_API_GL;
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
preferred_api = GDK_GL_API_GLES;
else
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL API allowed."));
return 0;
}
prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share)));
if (preferred_api == GDK_GL_API_GL)
{
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
else
{
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
#endif /* HAVE_EGL */
static GdkGLAPI
gdk_gl_context_default_realize (GdkGLContext *context,
GError **error)
{
#ifdef HAVE_EGL
GdkDisplay *display = gdk_gl_context_get_display (context);
if (gdk_display_get_egl_display (display))
return gdk_gl_context_realize_egl (context, error);
#endif
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
@@ -667,7 +665,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
klass->realize = gdk_gl_context_real_realize;
klass->realize = gdk_gl_context_default_realize;
klass->get_damage = gdk_gl_context_real_get_damage;
klass->is_shared = gdk_gl_context_real_is_shared;
klass->make_current = gdk_gl_context_real_make_current;
@@ -954,6 +952,48 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
return priv->forward_compatible;
}
void
gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor)
{
int maj, min;
if (api == GDK_GL_API_GL)
{
if (legacy)
{
maj = GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR;
min = GDK_GL_MIN_GL_LEGACY_VERSION_MINOR;
}
else
{
maj = GDK_GL_MIN_GL_VERSION_MAJOR;
min = GDK_GL_MIN_GL_VERSION_MINOR;
}
}
else
{
if (win32_libangle)
{
maj = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR;
min = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR;
}
else
{
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
min = GDK_GL_MIN_GLES_VERSION_MINOR;
}
}
if (major != NULL)
*major = maj;
if (minor != NULL)
*minor = min;
}
/**
* gdk_gl_context_set_required_version:
* @context: a `GdkGLContext`
@@ -964,7 +1004,10 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
*
* Setting @major and @minor to zero will use the default values.
*
* The `GdkGLContext` must not be realized or made current prior to calling
* Setting @major and @minor lower than the minimum versions required
* by GTK will result in the context choosing the minimum version.
*
* The @context must not be realized or made current prior to calling
* this function.
*/
void
@@ -973,44 +1016,12 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean force_gles = FALSE;
int version, min_ver;
#ifdef G_ENABLE_DEBUG
GdkDisplay *display;
#endif
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!gdk_gl_context_is_realized (context));
/* this will take care of the default */
if (major == 0 && minor == 0)
{
priv->major = 0;
priv->minor = 0;
return;
}
version = (major * 100) + minor;
#ifdef G_ENABLE_DEBUG
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
#endif
/* Enforce a minimum context version number of 3.2 for desktop GL,
* and 2.0 for GLES
*/
if (gdk_gl_context_get_use_es (context) || force_gles)
min_ver = 200;
else
min_ver = 302;
if (version < min_ver)
{
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
version = min_ver;
}
priv->major = version / 100;
priv->minor = version % 100;
priv->major = major;
priv->minor = minor;
}
gboolean
@@ -1049,7 +1060,10 @@ gdk_gl_context_check_version (GdkGLContext *self,
* @major: (out) (nullable): return location for the major version to request
* @minor: (out) (nullable): return location for the minor version to request
*
* Retrieves required OpenGL version.
* Retrieves required OpenGL version set as a requirement for the @context
* realization. It will not change even if a greater OpenGL version is supported
* and used after the @context is realized. See
* [method@Gdk.GLContext.get_version] for the real version in use.
*
* See [method@Gdk.GLContext.set_required_version].
*/
@@ -1059,47 +1073,32 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean force_gles = FALSE;
GdkDisplay *display;
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
if (major != NULL)
*major = priv->major;
if (minor != NULL)
*minor = priv->minor;
}
#ifdef G_ENABLE_DEBUG
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
#endif
void
gdk_gl_context_get_clipped_version (GdkGLContext *context,
int min_major,
int min_minor,
int *major,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
int maj = min_major, min = min_minor;
/* libANGLE on Windows at least requires GLES 3.0+ */
if (display->have_egl_win32_libangle)
force_gles = TRUE;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
/* Default fallback values for uninitialised contexts; we
* enforce a context version number of 3.2 for desktop GL,
* and 2.0 for GLES
*/
if (gdk_gl_context_get_use_es (context) || force_gles)
if (priv->major > maj || (priv->major == maj && priv->minor > min))
{
default_major = display->have_egl_win32_libangle ? 3 : 2;
default_minor = 0;
maj = priv->major;
min = priv->minor;
}
else
{
default_major = 3;
default_minor = 2;
}
if (priv->major > 0)
maj = priv->major;
else
maj = default_major;
if (priv->minor > 0)
min = priv->minor;
else
min = default_minor;
if (major != NULL)
*major = maj;
@@ -1336,7 +1335,9 @@ gdk_gl_context_set_use_es (GdkGLContext *context,
*
* Checks whether the @context is using an OpenGL or OpenGL ES profile.
*
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile;
* %FALSE if other profile is in use of if the @context has not yet
* been realized.
*/
gboolean
gdk_gl_context_get_use_es (GdkGLContext *context)
@@ -1667,6 +1668,10 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
* Retrieves the OpenGL version of the @context.
*
* The @context must be realized prior to calling this function.
*
* If the @context has never been made current, the version cannot
* be known and it will return 0 for both @major and @minor.
*
*/
void
gdk_gl_context_get_version (GdkGLContext *context,
@@ -1845,4 +1850,3 @@ gdk_gl_backend_use (GdkGLBackend backend_type)
g_assert (the_gl_backend_type == backend_type);
}
+26
View File
@@ -33,6 +33,22 @@ G_BEGIN_DECLS
#define GDK_EGL_MIN_VERSION_MAJOR (1)
#define GDK_EGL_MIN_VERSION_MINOR (4)
/* Minimum OpenGL versions supported by GTK.
* Backends should make sure to never create a context of a previous version.
*
* The macros refer to OpenGL; OpenGL with OPENGL_COMPATIBILITY_PROFILE_BIT as
* OPENGL_PROFILE_MASK; OpenGL ES; and OpenGL ES win32 Angle implementation,
* respectively
*/
#define GDK_GL_MIN_GL_VERSION_MAJOR (3)
#define GDK_GL_MIN_GL_VERSION_MINOR (2)
#define GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR (3)
#define GDK_GL_MIN_GL_LEGACY_VERSION_MINOR (0)
#define GDK_GL_MIN_GLES_VERSION_MAJOR (2)
#define GDK_GL_MIN_GLES_VERSION_MINOR (0)
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR (3)
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR (0)
typedef enum {
GDK_GL_NONE = 0,
GDK_GL_EGL,
@@ -117,6 +133,16 @@ gboolean gdk_gl_context_check_version (GdkGLContext
int required_gl_minor,
int required_gles_major,
int required_gles_minor);
void gdk_gl_context_get_clipped_version (GdkGLContext *context,
int min_major,
int min_minor,
int *major,
int *minor);
void gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor);
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
void gdk_gl_context_push_debug_group (GdkGLContext *context,
+1 -2
View File
@@ -700,8 +700,7 @@ fill_scroll_event (GdkMacosDisplay *self,
NULL,
get_time_from_ns_event (nsevent),
state,
direction,
FALSE);
direction);
}
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled)
+4 -1
View File
@@ -378,7 +378,10 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context,
existing = CGLGetCurrentContext ();
gdk_gl_context_get_required_version (context, &major, &minor);
gdk_gl_context_get_clipped_version (context,
GDK_GL_MIN_GL_VERSION_MAJOR,
GDK_GL_MIN_GL_VERSION_MINOR,
&major, &minor);
display = gdk_gl_context_get_display (context);
shared = gdk_display_get_gl_context (display);
+66 -28
View File
@@ -200,23 +200,51 @@ wl_cursor_destroy(struct wl_cursor *cursor)
}
static struct wl_cursor *
wl_cursor_create_from_xcursor_images(XcursorImages *images,
struct wl_cursor_theme *theme,
wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
const char *name,
unsigned int load_size)
unsigned int size,
unsigned int scale)
{
char *path;
XcursorImages *images;
struct cursor *cursor;
struct cursor_image *image;
int i, size;
int i, nbytes;
unsigned int load_size;
int load_scale = 1;
load_size = size * scale;
path = g_strconcat (theme->path, "/", name, NULL);
images = xcursor_load_images (path, load_size);
if (!images)
{
g_free (path);
return NULL;
}
if (images->images[0]->width != load_size ||
images->images[0]->height != load_size)
{
xcursor_images_destroy (images);
images = xcursor_load_images (path, size);
load_scale = scale;
}
g_free (path);
cursor = malloc(sizeof *cursor);
if (!cursor)
if (!cursor) {
xcursor_images_destroy (images);
return NULL;
}
cursor->cursor.images =
malloc(images->nimage * sizeof cursor->cursor.images[0]);
if (!cursor->cursor.images) {
free(cursor);
xcursor_images_destroy (images);
return NULL;
}
@@ -232,22 +260,37 @@ wl_cursor_create_from_xcursor_images(XcursorImages *images,
image->theme = theme;
image->buffer = NULL;
image->image.width = images->images[i]->width;
image->image.height = images->images[i]->height;
image->image.hotspot_x = images->images[i]->xhot;
image->image.hotspot_y = images->images[i]->yhot;
image->image.width = images->images[i]->width * load_scale;
image->image.height = images->images[i]->height * load_scale;
image->image.hotspot_x = images->images[i]->xhot * load_scale;
image->image.hotspot_y = images->images[i]->yhot * load_scale;
image->image.delay = images->images[i]->delay;
size = image->image.width * image->image.height * 4;
image->offset = shm_pool_allocate(theme->pool, size);
nbytes = image->image.width * image->image.height * 4;
image->offset = shm_pool_allocate(theme->pool, nbytes);
if (image->offset < 0) {
free(image);
break;
}
/* copy pixels to shm pool */
memcpy(theme->pool->data + image->offset,
images->images[i]->pixels, size);
if (load_scale == 1) {
/* copy pixels to shm pool */
memcpy(theme->pool->data + image->offset,
images->images[i]->pixels, nbytes);
}
else {
/* scale image up while copying it */
for (int y = 0; y < image->image.height; y++) {
char *p = theme->pool->data + image->offset + y * image->image.width * 4;
char *q = ((char *)images->images[i]->pixels) + (y / load_scale) * images->images[i]->width * 4;
for (int x = 0; x < image->image.width; x++) {
p[4 * x] = q[4 * (x/load_scale)];
p[4 * x + 1] = q[4 * (x/load_scale) + 1];
p[4 * x + 2] = q[4 * (x/load_scale) + 2];
p[4 * x + 3] = q[4 * (x/load_scale) + 3];
}
}
}
cursor->total_delay += image->image.delay;
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
}
@@ -257,27 +300,24 @@ wl_cursor_create_from_xcursor_images(XcursorImages *images,
free(cursor->cursor.name);
free(cursor->cursor.images);
free(cursor);
xcursor_images_destroy (images);
return NULL;
}
xcursor_images_destroy (images);
return &cursor->cursor;
}
static void
load_cursor(struct wl_cursor_theme *theme, const char *name, unsigned int size)
load_cursor(struct wl_cursor_theme *theme,
const char *name,
unsigned int size,
unsigned int scale)
{
XcursorImages *images;
struct wl_cursor *cursor;
char *path;
path = g_strconcat (theme->path, "/", name, NULL);
images = xcursor_load_images (path, size);
g_free (path);
if (!images)
return;
cursor = wl_cursor_create_from_xcursor_images(images, theme, name, size);
cursor = wl_cursor_create_from_xcursor_images(theme, name, size, scale);
if (cursor) {
theme->cursor_count++;
@@ -292,8 +332,6 @@ load_cursor(struct wl_cursor_theme *theme, const char *name, unsigned int size)
theme->cursors[theme->cursor_count - 1] = cursor;
}
}
xcursor_images_destroy (images);
}
/** Load a cursor theme to memory shared with the compositor
@@ -373,7 +411,7 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
return theme->cursors[i];
}
load_cursor (theme, name, size);
load_cursor (theme, name, theme->size, scale);
if (i < theme->cursor_count) {
if (size == theme->cursors[i]->size &&
+13 -4
View File
@@ -59,13 +59,17 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
if (display->xdg_activation)
{
struct xdg_activation_token_v1 *token;
struct wl_event_queue *event_queue;
struct wl_surface *wl_surface = NULL;
GdkWaylandSeat *seat;
GdkSurface *focus_surface;
AppLaunchData app_launch_data = { 0 };
event_queue = wl_display_create_queue (display->wl_display);
seat = GDK_WAYLAND_SEAT (gdk_display_get_default_seat (GDK_DISPLAY (display)));
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
token = xdg_activation_v1_get_activation_token (display->xdg_activation);
wl_proxy_set_queue ((struct wl_proxy *) token, event_queue);
xdg_activation_token_v1_add_listener (token,
&token_listener,
@@ -73,16 +77,21 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
xdg_activation_token_v1_set_serial (token,
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
if (focus_surface)
xdg_activation_token_v1_set_surface (token,
gdk_wayland_surface_get_wl_surface (focus_surface));
wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
if (wl_surface)
xdg_activation_token_v1_set_surface (token, wl_surface);
xdg_activation_token_v1_commit (token);
while (app_launch_data.token == NULL)
wl_display_roundtrip (display->wl_display);
wl_display_dispatch_queue (display->wl_display, event_queue);
xdg_activation_token_v1_destroy (token);
id = app_launch_data.token;
wl_event_queue_destroy (event_queue);
}
else if (display->gtk_shell_version >= 3)
{
+16 -5
View File
@@ -178,6 +178,7 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
if (c)
{
struct wl_cursor_image *image;
int cursor_scale;
if (image_index >= c->image_count)
{
@@ -189,12 +190,22 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
image = c->images[image_index];
*hotspot_x = image->hotspot_x / desired_scale;
*hotspot_y = image->hotspot_y / desired_scale;
cursor_scale = desired_scale;
if ((image->width % cursor_scale != 0) ||
(image->height % cursor_scale != 0))
{
g_warning (G_STRLOC " cursor image size (%dx%d) not an integer"
"multiple of scale (%d)", image->width, image->height,
cursor_scale);
cursor_scale = 1;
}
*width = image->width / desired_scale;
*height = image->height / desired_scale;
*scale = desired_scale;
*hotspot_x = image->hotspot_x / cursor_scale;
*hotspot_y = image->hotspot_y / cursor_scale;
*width = image->width / cursor_scale;
*height = image->height / cursor_scale;
*scale = cursor_scale;
return wl_cursor_image_get_buffer (image);
}
+1 -13
View File
@@ -1394,8 +1394,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
NULL,
seat->pointer_info.time,
device_get_modifiers (seat->logical_pointer),
direction,
TRUE);
direction);
_gdk_wayland_display_deliver_event (seat->display, event);
}
@@ -3999,17 +3998,6 @@ tablet_tool_handle_wheel (void *data,
GDK_SCROLL_UNIT_WHEEL);
_gdk_wayland_display_deliver_event (seat->display, event);
/* Send discrete event */
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
clicks > 0 ? GDK_SCROLL_DOWN : GDK_SCROLL_UP,
TRUE);
_gdk_wayland_display_deliver_event (seat->display, event);
}
static void
+5 -11
View File
@@ -548,17 +548,12 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
* wglCreateContextAttribsARB() may only give us the GL context version
* that we ask for here, and nothing more. So, improve things here by
* asking for the GL version that is reported to us via epoxy_gl_version(),
* rather than the default GL core 3.2 context. Save this up in our
* GdkGLContext so that subsequent contexts that are shared with this
* context are created likewise too.
* rather than the default GL core 3.2 context.
*/
if (share != NULL)
gdk_gl_context_get_required_version (share, &major, &minor);
else
{
major = display_win32->gl_version / 10;
minor = display_win32->gl_version % 10;
}
gdk_gl_context_get_clipped_version (context,
display_win32->gl_version / 10,
display_win32->gl_version % 10,
&major, &minor);
if (surface != NULL)
hdc = GDK_WIN32_SURFACE (surface)->hdc;
@@ -626,7 +621,6 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
gdk_gl_context_set_required_version (context, major, minor);
return GDK_GL_API_GL;
}
+8 -2
View File
@@ -167,8 +167,10 @@ DManipEventHandler_OnContentUpdated (IDirectManipulationViewportEventHandler *se
{
case GESTURE_PAN:
{
GdkWin32Surface *surface_win32;
GdkModifierType state;
uint32_t time;
int scale;
float pan_x;
float pan_y;
GdkEvent *event;
@@ -176,14 +178,16 @@ DManipEventHandler_OnContentUpdated (IDirectManipulationViewportEventHandler *se
pan_x = transform[4];
pan_y = transform[5];
surface_win32 = GDK_WIN32_SURFACE (self->surface);
scale = surface_win32->surface_scale;
state = util_get_modifier_state ();
time = (uint32_t) GetMessageTime ();
event = gdk_scroll_event_new (self->surface,
self->device,
NULL, time, state,
self->pan_x - pan_x,
self->pan_y - pan_y,
(self->pan_x - pan_x) / scale,
(self->pan_y - pan_y) / scale,
FALSE,
GDK_SCROLL_UNIT_SURFACE);
_gdk_win32_append_event (event);
@@ -355,6 +359,8 @@ reset_viewport (IDirectManipulationViewport *viewport)
hr = IDirectManipulationContent_SyncContentTransform (content, identity,
G_N_ELEMENTS (identity));
HR_CHECK (hr);
IUnknown_Release (content);
}
static void
+2 -4
View File
@@ -1655,8 +1655,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
NULL,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
direction,
FALSE);
direction);
}
else
@@ -1758,8 +1757,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
NULL,
xev->time,
state,
direction,
FALSE);
direction);
}
else
{
+143 -168
View File
@@ -213,7 +213,7 @@ gdk_x11_gl_context_glx_clear_current (GdkGLContext *context)
static gboolean
gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
gboolean surfaceless)
{
GdkX11GLContextGLX *self = GDK_X11_GL_CONTEXT_GLX (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
@@ -302,68 +302,6 @@ gdk_x11_gl_context_glx_get_damage (GdkGLContext *context)
return GDK_GL_CONTEXT_CLASS (gdk_x11_gl_context_glx_parent_class)->get_damage (context);
}
static GLXContext
create_gl3_context (GdkDisplay *display,
GLXFBConfig config,
GdkGLContext *share,
int profile,
int flags,
int major,
int minor)
{
int attrib_list[] = {
GLX_CONTEXT_PROFILE_MASK_ARB, profile,
GLX_CONTEXT_MAJOR_VERSION_ARB, major,
GLX_CONTEXT_MINOR_VERSION_ARB, minor,
GLX_CONTEXT_FLAGS_ARB, flags,
None,
};
GLXContext res;
GdkX11GLContextGLX *share_glx = NULL;
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
res = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
config,
share_glx != NULL ? share_glx->glx_context : NULL,
True,
attrib_list);
if (gdk_x11_display_error_trap_pop (display))
return NULL;
return res;
}
static GLXContext
create_legacy_context (GdkDisplay *display,
GLXFBConfig config,
GdkGLContext *share)
{
GdkX11GLContextGLX *share_glx = NULL;
GLXContext res;
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
res = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
config,
GLX_RGBA_TYPE,
share_glx != NULL ? share_glx->glx_context : NULL,
TRUE);
if (gdk_x11_display_error_trap_pop (display))
return NULL;
return res;
}
#ifdef HAVE_XDAMAGE
static void
bind_context_for_frame_fence (GdkX11GLContextGLX *self)
@@ -507,134 +445,111 @@ on_surface_state_changed (GdkGLContext *context)
*/
finish_frame (context);
}
#endif
#endif /* HAVE_XDAMAGE */
#define N_GLX_ATTRS 16
static GdkGLAPI
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
GError **error)
gdk_x11_context_create_glx_context (GdkGLContext *context,
GdkGLAPI api,
gboolean legacy)
{
GdkX11Display *display_x11;
GdkDisplay *display;
GdkX11GLContextGLX *context_glx;
Display *dpy;
GdkSurface *surface;
GdkGLContext *share;
gboolean debug_bit, compat_bit, legacy_bit;
int major, minor, flags;
GdkGLAPI api = 0;
GdkX11GLContextGLX *context_glx = GDK_X11_GL_CONTEXT_GLX (context);;
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
Display *dpy = gdk_x11_display_get_xdisplay (display);
GdkGLContext *share = gdk_display_get_gl_context (display);
GdkX11GLContextGLX *share_glx = NULL;
GdkSurface *surface = gdk_gl_context_get_surface (context);
GLXContext ctx;
int context_attribs[N_GLX_ATTRS], i = 0, flags = 0;
int min_major, min_minor, major, minor;
gboolean debug_bit, compat_bit;
display = gdk_gl_context_get_display (context);
dpy = gdk_x11_display_get_xdisplay (display);
context_glx = GDK_X11_GL_CONTEXT_GLX (context);
display_x11 = GDK_X11_DISPLAY (display);
share = gdk_display_get_gl_context (display);
surface = gdk_gl_context_get_surface (context);
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
return 0;
if (api == GDK_GL_API_GLES && legacy)
return 0;
/* We will use the default version matching the context status
* unless the user requested a version which makes sense */
gdk_gl_context_get_matching_version (api, legacy, 0,
&min_major, &min_minor);
gdk_gl_context_get_clipped_version (context, min_major, min_minor,
&major, &minor);
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
compat_bit = gdk_gl_context_get_forward_compatible (context);
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
legacy_bit = !display_x11->has_glx_create_context || GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY);
/* We cannot share legacy contexts with core profile ones, so the
* shared context is the one that decides if we're going to create
* a legacy context or not.
*/
if (share != NULL && gdk_gl_context_is_legacy (share))
legacy_bit = TRUE;
flags = 0;
if (debug_bit)
flags |= GLX_CONTEXT_DEBUG_BIT_ARB;
if (compat_bit)
flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
context_attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
if (api == GDK_GL_API_GL)
if (legacy)
context_attribs[i++] = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
else
context_attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
else if (api == GDK_GL_API_GLES)
context_attribs[i++] = GLX_CONTEXT_ES2_PROFILE_BIT_EXT;
context_attribs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
context_attribs[i++] = major;
context_attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
context_attribs[i++] = minor;
context_attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
context_attribs[i++] = flags;
context_attribs[i++] = None;
g_assert (i < N_GLX_ATTRS);
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating GLX context (GL version:%d.%d, debug:%s, forward:%s, legacy:%s, GL:%s, GLES:%s)",
major, minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no",
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) ? "yes" : "no",
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) ? "yes" : "no"));
g_message ("Creating GLX context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy ? "yes" : "no",
api == GDK_GL_API_GLES ? "yes" : "no"));
/* If we have access to GLX_ARB_create_context_profile then we can ask for
* a compatibility profile; if we don't, then we have to fall back to the
* old GLX 1.3 API.
if (share != NULL)
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
gdk_x11_display_error_trap_push (display);
/* If we don't have access to GLX_ARB_create_context_profile, then
* we have to fall back to the old GLX 1.3 API.
*/
if (legacy_bit && !GDK_X11_DISPLAY (display)->has_glx_create_context)
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating legacy GL context on request"));
/* do it below */
}
if (legacy && !display_x11->has_glx_create_context)
ctx = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
display_x11->glx_config,
GLX_RGBA_TYPE,
share_glx != NULL ? share_glx->glx_context : NULL,
TRUE);
else
{
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
{
int profile = legacy_bit ? GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
: GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
ctx = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
display_x11->glx_config,
share_glx != NULL ? share_glx->glx_context : NULL,
True,
context_attribs);
/* We need to tweak the version, otherwise we may end up requesting
* a compatibility context with a minimum version of 3.2, which is
* an error
*/
if (legacy_bit)
{
major = 3;
minor = 0;
}
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 context"));
context_glx->glx_context = create_gl3_context (display,
display_x11->glx_config,
share,
profile,
flags, major, minor);
api = GDK_GL_API_GL;
}
if (context_glx->glx_context == NULL && !legacy_bit &&
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 GLES context"));
context_glx->glx_context = create_gl3_context (display,
display_x11->glx_config,
share,
GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
flags, major, minor);
api = GDK_GL_API_GLES;
}
}
/* Fall back to legacy in case the GL3 context creation failed */
if (context_glx->glx_context == NULL &&
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
{
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating fallback legacy context"));
context_glx->glx_context = create_legacy_context (display, display_x11->glx_config, share);
legacy_bit = TRUE;
api = GDK_GL_API_GL;
}
if (context_glx->glx_context == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
if (gdk_x11_display_error_trap_pop (display) || ctx == NULL)
return 0;
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Realized GLX context[%p], %s, version: %d.%d",
context_glx->glx_context,
glXIsDirect (dpy, context_glx->glx_context) ? "direct" : "indirect",
display_x11->glx_version / 10,
display_x11->glx_version % 10));
context_glx->glx_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
#ifdef HAVE_XDAMAGE
if (display_x11->have_damage &&
display_x11->has_async_glx_swap_buffers)
@@ -663,10 +578,70 @@ gdk_x11_gl_context_glx_realize (GdkGLContext *context,
}
}
#endif
return api;
}
static GdkGLAPI
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
GError **error)
{
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_display_get_gl_context (display);
gboolean legacy;
GdkGLAPI api, preferred_api;
if (share && gdk_gl_context_is_api_allowed (context,
gdk_gl_context_get_api (share),
NULL))
preferred_api = gdk_gl_context_get_api (share);
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
preferred_api = GDK_GL_API_GL;
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
preferred_api = GDK_GL_API_GLES;
else
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL API allowed."));
return 0;
}
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
legacy = !GDK_X11_DISPLAY (display)->has_glx_create_context;
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY))
legacy = TRUE;
/* We cannot share legacy contexts with core profile ones, so the
* shared context is the one that decides if we're going to create
* a legacy context or not.
*/
if (share != NULL && gdk_gl_context_is_legacy (share))
legacy = TRUE;
if (preferred_api == GDK_GL_API_GL)
{
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
else
{
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, FALSE)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
return api;
}
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return 0;
}
#undef N_GLX_ATTRS
static void
gdk_x11_gl_context_glx_dispose (GObject *gobject)
{
@@ -820,7 +795,7 @@ gdk_x11_display_create_glx_config (GdkX11Display *self,
XFree (visinfo);
continue;
}
if (!visual_is_rgba (visinfo))
{
if (best_features < NO_ALPHA_VISUAL)
@@ -894,7 +869,7 @@ gdk_x11_display_get_glx_version (GdkDisplay *display,
/*< private >
* gdk_x11_display_init_glx:
* @display_x11: an X11 display that has not been inited yet.
* @display_x11: an X11 display that has not been inited yet.
* @out_visual: set to the Visual to be used with the returned config
* @out_depth: set to the depth to be used with the returned config
* @error: Return location for error
+1 -1
View File
@@ -280,7 +280,7 @@ compute_toplevel_size (GdkSurface *surface,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (GDK_TOPLEVEL (surface), &size);
if (size.shadow.is_valid && update_geometry)
if (size.shadow.is_valid)
{
update_shadow_size (surface,
size.shadow.left,
+20 -6
View File
@@ -68,6 +68,23 @@ parse_rect (GtkCssParser *parser,
return TRUE;
}
static gboolean
parse_vec4 (GtkCssParser *parser,
gpointer out_vec4)
{
double numbers[4];
if (!gtk_css_parser_consume_number (parser, &numbers[0]) ||
!gtk_css_parser_consume_number (parser, &numbers[1]) ||
!gtk_css_parser_consume_number (parser, &numbers[2]) ||
!gtk_css_parser_consume_number (parser, &numbers[3]))
return FALSE;
graphene_vec4_init (out_vec4, numbers[0], numbers[1], numbers[2], numbers[3]);
return TRUE;
}
static gboolean
parse_texture (GtkCssParser *parser,
gpointer out_data)
@@ -1490,23 +1507,20 @@ parse_color_matrix_node (GtkCssParser *parser)
GskRenderNode *child = NULL;
graphene_matrix_t matrix;
GskTransform *transform = NULL;
graphene_rect_t offset_rect = GRAPHENE_RECT_INIT (0, 0, 0, 0);
graphene_vec4_t offset;
const Declaration declarations[] = {
{ "matrix", parse_transform, clear_transform, &transform },
{ "offset", parse_rect, NULL, &offset_rect },
{ "offset", parse_vec4, NULL, &offset },
{ "child", parse_node, clear_node, &child }
};
GskRenderNode *result;
graphene_vec4_init (&offset, 0, 0, 0, 0);
parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
if (child == NULL)
child = create_default_render_node ();
graphene_vec4_init (&offset,
offset_rect.origin.x, offset_rect.origin.y,
offset_rect.size.width, offset_rect.size.height);
gsk_transform_to_matrix (transform, &matrix);
result = gsk_color_matrix_node_new (child, &matrix, &offset);
+5 -4
View File
@@ -37,10 +37,11 @@ gsk_vulkan_command_pool_new (GdkVulkanContext *context)
static void
gsk_vulkan_command_pool_free_buffers (GskVulkanCommandPool *self)
{
vkFreeCommandBuffers (gdk_vulkan_context_get_device (self->vulkan),
self->vk_command_pool,
self->buffers->len,
(VkCommandBuffer *) self->buffers->pdata);
if (self->buffers->len != 0)
vkFreeCommandBuffers (gdk_vulkan_context_get_device (self->vulkan),
self->vk_command_pool,
self->buffers->len,
(VkCommandBuffer *) self->buffers->pdata);
g_ptr_array_set_size (self->buffers, 0);
}
+1 -1
View File
@@ -170,7 +170,7 @@ gsk_vulkan_render_pass_new (GdkVulkanContext *context,
.samples = VK_SAMPLE_COUNT_1_BIT,
.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.finalLayout = final_layout
}
},
+5 -1
View File
@@ -436,7 +436,11 @@ get_parent_context_ref (GtkAccessible *accessible)
gtk_accessible_get_at_context (GTK_ACCESSIBLE (parent));
if (parent_context != NULL)
res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context));
{
gtk_at_context_realize (parent_context);
res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context));
}
}
if (res == NULL)
+41 -1
View File
@@ -1098,7 +1098,47 @@ text_view_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetCharacterExtents") == 0)
{
g_dbus_method_invocation_return_error_literal (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, "");
int offset = 0;
guint coords_type;
g_variant_get (parameters, "(iu)", &offset, &coords_type);
if (coords_type != ATSPI_COORD_TYPE_WINDOW)
{
g_dbus_method_invocation_return_error_literal (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_NOT_SUPPORTED,
"Unsupported coordinate space");
return;
}
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
GtkTextIter iter;
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
GdkRectangle rect = { 0, };
gtk_text_view_get_iter_location (GTK_TEXT_VIEW (widget), &iter, &rect);
int x, y;
gtk_text_view_buffer_to_window_coords (GTK_TEXT_VIEW (widget),
GTK_TEXT_WINDOW_WIDGET,
rect.x, rect.y,
&x, &y);
double dx, dy;
gtk_widget_translate_coordinates (widget,
GTK_WIDGET (gtk_widget_get_native (widget)),
(double) x, (double) y, &dx, &dy);
x = floor (dx);
y = floor (dy);
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(iiii)",
x,
y,
rect.width,
rect.height));
}
else if (g_strcmp0 (method_name, "GetRangeExtents") == 0)
{
+2 -2
View File
@@ -1409,13 +1409,13 @@ expression_info_construct (GtkBuilder *builder,
return NULL;
}
if (g_type_is_a (type, G_TYPE_OBJECT))
if (g_type_fundamental (type) == G_TYPE_OBJECT)
{
GObjectClass *class = g_type_class_ref (type);
pspec = g_object_class_find_property (class, info->property.property_name);
g_type_class_unref (class);
}
else if (g_type_is_a (type, G_TYPE_INTERFACE))
else if (g_type_fundamental (type) == G_TYPE_INTERFACE)
{
GTypeInterface *iface = g_type_default_interface_ref (type);
pspec = g_object_interface_find_property (iface, info->property.property_name);
+2 -2
View File
@@ -959,7 +959,7 @@ gtk_check_button_set_label (GtkCheckButton *self,
gtk_label_set_use_underline (GTK_LABEL (child), priv->use_underline);
gtk_check_button_real_set_child (self, GTK_WIDGET (child), LABEL_CHILD);
}
gtk_widget_add_css_class (GTK_WIDGET (self), "text-button");
gtk_label_set_label (GTK_LABEL (priv->child), label);
}
@@ -1099,7 +1099,7 @@ gtk_check_button_set_use_underline (GtkCheckButton *self,
return;
priv->use_underline = setting;
if (priv->child_type == LABEL_CHILD)
if (priv->child_type == LABEL_CHILD && priv->child != NULL)
gtk_label_set_use_underline (GTK_LABEL (priv->child), priv->use_underline);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_USE_UNDERLINE]);
+1
View File
@@ -82,6 +82,7 @@ typedef enum {
GTK_DEBUG_BUILDER_OBJECTS = 1 << 16,
GTK_DEBUG_A11Y = 1 << 17,
GTK_DEBUG_ICONFALLBACK = 1 << 18,
GTK_DEBUG_INVERT_TEXT_DIR = 1 << 19,
} GtkDebugFlags;
#ifdef G_ENABLE_DEBUG
+1 -1
View File
@@ -411,7 +411,7 @@ gtk_gesture_click_class_init (GtkGestureClickClass *klass)
* @x: X coordinate of the event
* @y: Y coordinate of the event
* @button: Button being released
* @sequence: Sequence being released
* @sequence: (nullable): Sequence being released
*
* Emitted whenever the gesture receives a release
* event that had no previous corresponding press.
+1 -1
View File
@@ -230,7 +230,7 @@ gtk_gesture_drag_new (void)
*
* If the @gesture is active, this function returns %TRUE
* and fills in @x and @y with the drag start coordinates,
* in surface-relative coordinates.
* in widget-relative coordinates.
*
* Returns: %TRUE if the gesture is active
*/
+12 -2
View File
@@ -1709,7 +1709,7 @@ static const char builtin_hicolor_index[] =
"[Icon Theme]\n"
"Name=Hicolor\n"
"Hidden=True\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions,scalable/status,scalable/actions\n"
"[16x16/actions]\n"
"Size=16\n"
"Type=Threshold\n"
@@ -1736,7 +1736,17 @@ static const char builtin_hicolor_index[] =
"Type=Threshold\n"
"[64x64/actions]\n"
"Size=64\n"
"Type=Threshold\n";
"Type=Threshold\n"
"[scalable/status]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n"
"[scalable/actions]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n";
static void
insert_theme (GtkIconTheme *self,
+1 -1
View File
@@ -813,7 +813,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
gboolean compose_match;
guint keyval, state;
while (priv->compose_buffer[n_compose] != 0 && n_compose < priv->compose_buffer_len)
while (n_compose < priv->compose_buffer_len && priv->compose_buffer[n_compose] != 0)
n_compose++;
keyval = gdk_key_event_get_keyval (event);
+6
View File
@@ -2020,6 +2020,12 @@ gtk_label_mnemonic_activate (GtkWidget *widget,
if (self->mnemonic_widget)
return gtk_widget_mnemonic_activate (self->mnemonic_widget, group_cycling);
/* Not a label for something else, but is selectable, so set focus into
* the label itself.
*/
if (gtk_label_get_selectable (self) && gtk_widget_get_focusable (widget))
return gtk_label_grab_focus (widget);
/* Try to find the widget to activate by traversing the
* widget's ancestry.
*/
+25 -6
View File
@@ -37,6 +37,13 @@
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
/* Allow shadows to overdraw without immediately culling the widget at the viewport
* boundary.
* Choose this so that roughly 1 extra widget gets drawn on each side of the viewport,
* but not more. Icons are 16px, text height is somewhere there, too.
*/
#define GTK_LIST_BASE_CHILD_MAX_OVERDRAW 10
typedef struct _RubberbandData RubberbandData;
struct _RubberbandData
@@ -1351,6 +1358,22 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
int height)
{
GtkAllocation child_allocation;
int self_width, self_height;
self_width = gtk_widget_get_width (GTK_WIDGET (self));
self_height = gtk_widget_get_height (GTK_WIDGET (self));
if (y + height + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
y - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_height ||
x + width + GTK_LIST_BASE_CHILD_MAX_OVERDRAW <= 0 ||
x - GTK_LIST_BASE_CHILD_MAX_OVERDRAW >= self_width)
{
/* child is fully outside the viewport, hide it and don't allocate it */
gtk_widget_set_child_visible (child, FALSE);
return;
}
gtk_widget_set_child_visible (child, TRUE);
if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
{
@@ -1363,9 +1386,7 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
}
else
{
int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
child_allocation.x = mirror_point - x - width;
child_allocation.x = self_width - x - width;
child_allocation.y = y;
child_allocation.width = width;
child_allocation.height = height;
@@ -1382,9 +1403,7 @@ gtk_list_base_size_allocate_child (GtkListBase *self,
}
else
{
int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
child_allocation.x = mirror_point - y - height;
child_allocation.x = self_width - y - height;
child_allocation.y = x;
child_allocation.width = height;
child_allocation.height = width;
+12 -1
View File
@@ -203,6 +203,7 @@ static const GdkDebugKey gtk_debug_keys[] = {
{ "snapshot", GTK_DEBUG_SNAPSHOT, "Generate debug render nodes" },
{ "accessibility", GTK_DEBUG_A11Y, "Information about accessibility state changes" },
{ "iconfallback", GTK_DEBUG_ICONFALLBACK, "Information about icon fallback" },
{ "invert-text-dir", GTK_DEBUG_INVERT_TEXT_DIR, "Invert the default text direction" },
};
/* This checks to see if the process is running suid or sgid
@@ -523,6 +524,7 @@ static void
do_post_parse_initialization (void)
{
GdkDisplayManager *display_manager;
GtkTextDirection text_dir;
gint64 before G_GNUC_UNUSED;
if (gtk_initialized)
@@ -536,7 +538,16 @@ do_post_parse_initialization (void)
signal (SIGPIPE, SIG_IGN);
#endif
gtk_widget_set_default_direction (gtk_get_locale_direction ());
text_dir = gtk_get_locale_direction ();
/* We always allow inverting the text direction, even in
* production builds, as SDK/IDE tooling may provide the
* ability for developers to test rtl/ltr inverted.
*/
if (gtk_get_debug_flags () & GTK_DEBUG_INVERT_TEXT_DIR)
text_dir = (text_dir == GTK_TEXT_DIR_LTR) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR;
gtk_widget_set_default_direction (text_dir);
gdk_event_init_types ();
+1 -1
View File
@@ -871,7 +871,7 @@ gtk_shortcut_controller_get_scope (GtkShortcutController *self)
}
/**
* gtk_shortcut_controller_set_mnemonics_modifiers: (attributes org.gtk.MEthod.set_property=mnemonic-modifiers)
* gtk_shortcut_controller_set_mnemonics_modifiers: (attributes org.gtk.Method.set_property=mnemonic-modifiers)
* @self: a `GtkShortcutController`
* @modifiers: the new mnemonics_modifiers to use
*
+7 -1
View File
@@ -6535,7 +6535,13 @@ blink_cb (GtkWidget *widget,
return G_SOURCE_REMOVE;
}
g_assert (priv->selection_bound == priv->current_pos);
if (priv->selection_bound != priv->current_pos)
{
g_warning ("GtkText - unexpected blinking selection. Removing");
gtk_text_check_cursor_blink (self);
return G_SOURCE_REMOVE;
}
blink_timeout = get_cursor_blink_timeout (self);
blink_time = get_cursor_time (self);
+4 -4
View File
@@ -59,7 +59,7 @@
<child>
<object class="GtkStackPage">
<property name="name">main</property>
<property name="title" translatable="1">About</property>
<property name="title" translatable="yes">About</property>
<property name="child">
<object class="GtkBox" id="page_vbox">
<property name="orientation">1</property>
@@ -120,7 +120,7 @@
<object class="GtkStackPage">
<property name="name">credits</property>
<property name="visible">0</property>
<property name="title" translatable="1">Credits</property>
<property name="title" translatable="yes">Credits</property>
<property name="child">
<object class="GtkBox" id="credits_page">
<property name="orientation">1</property>
@@ -160,7 +160,7 @@
<object class="GtkStackPage">
<property name="name">license</property>
<property name="visible">0</property>
<property name="title" translatable="1">License</property>
<property name="title" translatable="yes">License</property>
<property name="child">
<object class="GtkBox" id="license_page">
<property name="orientation">1</property>
@@ -203,7 +203,7 @@
<object class="GtkStackPage">
<property name="name">system</property>
<property name="visible">0</property>
<property name="title" translatable="1">System</property>
<property name="title" translatable="yes">System</property>
<property name="child">
<object class="GtkBox" id="system_page">
<property name="orientation">1</property>
+5 -5
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkAppChooserDialog" parent="GtkDialog">
<property name="title" translatable="1">Select Application</property>
<property name="title" translatable="yes">Select Application</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -42,12 +42,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="1">_Cancel</property>
<property name="label" translatable="yes">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="ok_button">
<property name="label" translatable="1">_Select</property>
<property name="label" translatable="yes">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
@@ -57,13 +57,13 @@
</action-widgets>
</template>
<object class="GtkButton" id="show_more_button">
<property name="label" translatable="1">_View All Applications</property>
<property name="label" translatable="yes">_View All Applications</property>
<property name="use-underline">1</property>
<property name="receives-default">1</property>
<signal name="clicked" handler="show_more_button_clicked_cb" swapped="no"/>
</object>
<object class="GtkButton" id="software_button">
<property name="label" translatable="1">_Find New Applications</property>
<property name="label" translatable="yes">_Find New Applications</property>
<property name="use-underline">1</property>
<property name="receives-default">1</property>
<signal name="clicked" handler="software_button_clicked_cb" swapped="no"/>
+1 -1
View File
@@ -97,7 +97,7 @@
</child>
<child>
<object class="GtkLabel" id="no_apps_label">
<property name="label" translatable="1">No applications found.</property>
<property name="label" translatable="yes">No applications found.</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="wrap">1</property>
+6 -6
View File
@@ -37,7 +37,7 @@
<child>
<object class="GtkButton" id="close">
<property name="visible">0</property>
<property name="label" translatable="1">_Close</property>
<property name="label" translatable="yes">_Close</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -49,7 +49,7 @@
<child>
<object class="GtkButton" id="cancel">
<property name="visible">0</property>
<property name="label" translatable="1">_Cancel</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -61,7 +61,7 @@
<child>
<object class="GtkButton" id="last">
<property name="visible">0</property>
<property name="label" translatable="1">_Finish</property>
<property name="label" translatable="yes">_Finish</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -72,7 +72,7 @@
</child>
<child>
<object class="GtkButton" id="back">
<property name="label" translatable="1">_Back</property>
<property name="label" translatable="yes">_Back</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -83,7 +83,7 @@
</child>
<child>
<object class="GtkButton" id="forward">
<property name="label" translatable="1">_Next</property>
<property name="label" translatable="yes">_Next</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
@@ -95,7 +95,7 @@
<child>
<object class="GtkButton" id="apply">
<property name="visible">0</property>
<property name="label" translatable="1">_Apply</property>
<property name="label" translatable="yes">_Apply</property>
<property name="receives-default">1</property>
<property name="use-underline">1</property>
<style>
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkColorChooserDialog" parent="GtkDialog">
<property name="title" translatable="1">Select a Color</property>
<property name="title" translatable="yes">Select a Color</property>
<property name="resizable">0</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
@@ -30,12 +30,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="1">_Cancel</property>
<property name="label" translatable="yes">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="ok_button">
<property name="label" translatable="1">_Select</property>
<property name="label" translatable="yes">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
+10 -10
View File
@@ -40,7 +40,7 @@
<property name="icon-name">color-select-symbolic</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="tooltip-text" translatable="1">Pick a color from the screen</property>
<property name="tooltip-text" translatable="yes">Pick a color from the screen</property>
<signal name="clicked" handler="pick_color"/>
<style>
<class name="circular"/>
@@ -50,7 +50,7 @@
<property name="row">0</property>
</layout>
<accessibility>
<property name="label" translatable="1">Pick a color from the screen</property>
<property name="label" translatable="yes">Pick a color from the screen</property>
</accessibility>
</object>
</child>
@@ -77,7 +77,7 @@
<property name="row">0</property>
</layout>
<accessibility>
<property name="label" translatable="1">Hexadecimal color or color name</property>
<property name="label" translatable="yes">Hexadecimal color or color name</property>
</accessibility>
</object>
</child>
@@ -92,7 +92,7 @@
<property name="row">1</property>
</layout>
<accessibility>
<property name="label" translatable="1">Hue</property>
<property name="label" translatable="yes">Hue</property>
</accessibility>
</object>
</child>
@@ -108,7 +108,7 @@
<property name="column-span">2</property>
</layout>
<accessibility>
<property name="label" translatable="1">Alpha value</property>
<property name="label" translatable="yes">Alpha value</property>
</accessibility>
</object>
</child>
@@ -126,7 +126,7 @@
<property name="column-span">2</property>
</layout>
<accessibility>
<property name="label" translatable="1">Saturation and value</property>
<property name="label" translatable="yes">Saturation and value</property>
</accessibility>
</object>
</child>
@@ -150,7 +150,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label4">
<property name="label" translatable="1" context="Color channel">A</property>
<property name="label" translatable="yes" context="Color channel">A</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -186,7 +186,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label3">
<property name="label" translatable="1" context="Color channel">H</property>
<property name="label" translatable="yes" context="Color channel">H</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -223,7 +223,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="label" translatable="1" context="Color Channel">S</property>
<property name="label" translatable="yes" context="Color Channel">S</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
@@ -232,7 +232,7 @@
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="label" translatable="1" context="Color Channel">V</property>
<property name="label" translatable="yes" context="Color Channel">V</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
+2 -2
View File
@@ -16,7 +16,7 @@
<property name="name">empty</property>
<property name="child">
<object class="GtkLabel">
<property name="label" translatable="1">(None)</property>
<property name="label" translatable="yes">(None)</property>
<property name="xalign">0</property>
</object>
</property>
@@ -65,7 +65,7 @@
<property name="hexpand">1</property>
<property name="max-width-chars">6</property>
<property name="width-chars">6</property>
<property name="placeholder-text" translatable="1">Search…</property>
<property name="placeholder-text" translatable="yes">Search…</property>
</object>
</child>
</object>
+21 -21
View File
@@ -66,7 +66,7 @@
</child>
<child>
<object class="GtkLabel" id="people.heading">
<property name="label" translatable="1" context="emoji category">Smileys &amp; People</property>
<property name="label" translatable="yes" context="emoji category">Smileys &amp; People</property>
<property name="xalign">0</property>
</object>
</child>
@@ -91,7 +91,7 @@
</child>
<child>
<object class="GtkLabel" id="body.heading">
<property name="label" translatable="1" context="emoji category">Body &amp; Clothing</property>
<property name="label" translatable="yes" context="emoji category">Body &amp; Clothing</property>
<property name="xalign">0</property>
</object>
</child>
@@ -116,7 +116,7 @@
</child>
<child>
<object class="GtkLabel" id="nature.heading">
<property name="label" translatable="1" context="emoji category">Animals &amp; Nature</property>
<property name="label" translatable="yes" context="emoji category">Animals &amp; Nature</property>
<property name="xalign">0</property>
</object>
</child>
@@ -130,7 +130,7 @@
</child>
<child>
<object class="GtkLabel" id="food.heading">
<property name="label" translatable="1" context="emoji category">Food &amp; Drink</property>
<property name="label" translatable="yes" context="emoji category">Food &amp; Drink</property>
<property name="xalign">0</property>
</object>
</child>
@@ -144,7 +144,7 @@
</child>
<child>
<object class="GtkLabel" id="travel.heading">
<property name="label" translatable="1" context="emoji category">Travel &amp; Places</property>
<property name="label" translatable="yes" context="emoji category">Travel &amp; Places</property>
<property name="xalign">0</property>
</object>
</child>
@@ -158,7 +158,7 @@
</child>
<child>
<object class="GtkLabel" id="activities.heading">
<property name="label" translatable="1" context="emoji category">Activities</property>
<property name="label" translatable="yes" context="emoji category">Activities</property>
<property name="xalign">0</property>
</object>
</child>
@@ -172,7 +172,7 @@
</child>
<child>
<object class="GtkLabel" id="objects.heading">
<property name="label" translatable="1" context="emoji category">Objects</property>
<property name="label" translatable="yes" context="emoji category">Objects</property>
<property name="xalign">0</property>
</object>
</child>
@@ -186,7 +186,7 @@
</child>
<child>
<object class="GtkLabel" id="symbols.heading">
<property name="label" translatable="1" context="emoji category">Symbols</property>
<property name="label" translatable="yes" context="emoji category">Symbols</property>
<property name="xalign">0</property>
</object>
</child>
@@ -200,7 +200,7 @@
</child>
<child>
<object class="GtkLabel" id="flags.heading">
<property name="label" translatable="1" context="emoji category">Flags</property>
<property name="label" translatable="yes" context="emoji category">Flags</property>
<property name="xalign">0</property>
</object>
</child>
@@ -227,7 +227,7 @@
<child>
<object class="GtkButton" id="recent.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Recent</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Recent</property>
<style>
<class name="emoji-section"/>
</style>
@@ -236,7 +236,7 @@
<child>
<object class="GtkButton" id="people.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Smileys &amp; People</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Smileys &amp; People</property>
<style>
<class name="emoji-section"/>
</style>
@@ -245,7 +245,7 @@
<child>
<object class="GtkButton" id="body.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Body &amp; Clothing</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Body &amp; Clothing</property>
<style>
<class name="emoji-section"/>
</style>
@@ -254,7 +254,7 @@
<child>
<object class="GtkButton" id="nature.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Animals &amp; Nature</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Animals &amp; Nature</property>
<style>
<class name="emoji-section"/>
</style>
@@ -263,7 +263,7 @@
<child>
<object class="GtkButton" id="food.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Food &amp; Drink</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Food &amp; Drink</property>
<style>
<class name="emoji-section"/>
</style>
@@ -272,7 +272,7 @@
<child>
<object class="GtkButton" id="travel.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Travel &amp; Places</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Travel &amp; Places</property>
<style>
<class name="emoji-section"/>
</style>
@@ -281,7 +281,7 @@
<child>
<object class="GtkButton" id="activities.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Activities</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Activities</property>
<style>
<class name="emoji-section"/>
</style>
@@ -290,7 +290,7 @@
<child>
<object class="GtkButton" id="objects.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Objects</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Objects</property>
<style>
<class name="emoji-section"/>
</style>
@@ -299,7 +299,7 @@
<child>
<object class="GtkButton" id="symbols.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Symbols</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Symbols</property>
<style>
<class name="emoji-section"/>
</style>
@@ -308,7 +308,7 @@
<child>
<object class="GtkButton" id="flags.button">
<property name="has-frame">0</property>
<property name="tooltip-text" translatable="1" context="emoji category">Flags</property>
<property name="tooltip-text" translatable="yes" context="emoji category">Flags</property>
<style>
<class name="emoji-section"/>
</style>
@@ -346,7 +346,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">No Results Found</property>
<property name="label" translatable="yes">No Results Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -359,7 +359,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Try a different search</property>
<property name="label" translatable="yes">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
+14 -14
View File
@@ -61,7 +61,7 @@
</child>
<child>
<object class="GtkMenuButton" id="browse_new_folder_button">
<property name="tooltip-text" translatable="1">Create Folder</property>
<property name="tooltip-text" translatable="yes">Create Folder</property>
<property name="popover">new_folder_popover</property>
<property name="icon-name">folder-new-symbolic</property>
</object>
@@ -165,7 +165,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_name_column">
<property name="title" translatable="1">Name</property>
<property name="title" translatable="yes">Name</property>
<property name="resizable">1</property>
<property name="expand">1</property>
<child>
@@ -183,7 +183,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_location_column">
<property name="title" translatable="1">Location</property>
<property name="title" translatable="yes">Location</property>
<property name="resizable">1</property>
<property name="visible">0</property>
<property name="expand">1</property>
@@ -199,7 +199,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_size_column">
<property name="title" translatable="1">Size</property>
<property name="title" translatable="yes">Size</property>
<property name="sizing">2</property>
<child>
<object class="GtkCellRendererText" id="list_size_renderer">
@@ -211,7 +211,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_type_column">
<property name="title" translatable="1">Type</property>
<property name="title" translatable="yes">Type</property>
<property name="resizable">1</property>
<child>
<object class="GtkCellRendererText" id="list_type_renderer">
@@ -223,7 +223,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="list_time_column">
<property name="title" translatable="1">Modified</property>
<property name="title" translatable="yes">Modified</property>
<property name="sizing">2</property>
<child>
<object class="GtkCellRendererText" id="list_date_renderer">
@@ -246,7 +246,7 @@
<property name="visible">0</property>
<child type="center">
<object class="GtkLabel">
<property name="label" translatable="1">Remote location — only searching the current folder</property>
<property name="label" translatable="yes">Remote location — only searching the current folder</property>
</object>
</child>
</object>
@@ -294,7 +294,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">No Results Found</property>
<property name="label" translatable="yes">No Results Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -307,7 +307,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Try a different search</property>
<property name="label" translatable="yes">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
@@ -343,7 +343,7 @@
<object class="GtkBox" id="filter_combo_hbox">
<child>
<object class="GtkDropDown" id="filter_combo">
<property name="tooltip-text" translatable="1">Select which types of files are shown</property>
<property name="tooltip-text" translatable="yes">Select which types of files are shown</property>
<property name="focus-on-click">0</property>
<property name="valign">1</property>
<signal name="notify::selected" handler="filter_combo_changed" swapped="no"/>
@@ -375,7 +375,7 @@
<property name="row-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Folder Name</property>
<property name="label" translatable="yes">Folder Name</property>
<property name="halign">1</property>
<property name="mnemonic-widget">new_folder_name_entry</property>
<attributes>
@@ -401,7 +401,7 @@
<child>
<object class="GtkButton" id="new_folder_create_button">
<property name="sensitive">0</property>
<property name="label" translatable="1">_Create</property>
<property name="label" translatable="yes">_Create</property>
<property name="use-underline">1</property>
<signal name="clicked" handler="new_folder_create_clicked"/>
<style>
@@ -437,7 +437,7 @@
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Name</property>
<property name="label" translatable="yes">Name</property>
<property name="halign">1</property>
<property name="mnemonic-widget">rename_file_name_entry</property>
<attributes>
@@ -462,7 +462,7 @@
<child>
<object class="GtkButton" id="rename_file_rename_button">
<property name="sensitive">0</property>
<property name="label" translatable="1">_Rename</property>
<property name="label" translatable="yes">_Rename</property>
<property name="use-underline">1</property>
<signal name="clicked" handler="rename_file_rename_clicked"/>
<style>
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<template class="GtkFontChooserDialog" parent="GtkDialog">
<property name="title" translatable="1">Select Font</property>
<property name="title" translatable="yes">Select Font</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -21,12 +21,12 @@
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">1</property>
<property name="label" translatable="1">_Cancel</property>
<property name="label" translatable="yes">_Cancel</property>
</object>
</child>
<child type="action">
<object class="GtkButton" id="select_button">
<property name="label" translatable="1">_Select</property>
<property name="label" translatable="yes">_Select</property>
<property name="use-underline">1</property>
</object>
</child>
+11 -11
View File
@@ -61,7 +61,7 @@
<object class="GtkSearchEntry" id="search_entry">
<property name="hexpand">1</property>
<property name="activates-default">1</property>
<property name="placeholder-text" translatable="1">Search font name</property>
<property name="placeholder-text" translatable="yes">Search font name</property>
<signal name="stop-search" handler="stop_search_cb" swapped="no"/>
</object>
</child>
@@ -76,7 +76,7 @@
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Filter by</property>
<property name="label" translatable="yes">Filter by</property>
<property name="width-chars">20</property>
<property name="margin-bottom">10</property>
<style>
@@ -86,13 +86,13 @@
</child>
<child>
<object class="GtkCheckButton" id="monospace_button">
<property name="label" translatable="1">Monospace</property>
<property name="label" translatable="yes">Monospace</property>
<signal name="notify::active" handler="monospace_check_changed"/>
</object>
</child>
<child>
<object class="GtkCheckButton" id="language_button">
<property name="label" translatable="1">Language</property>
<property name="label" translatable="yes">Language</property>
<signal name="notify::active" handler="language_check_changed"/>
</object>
</child>
@@ -185,10 +185,10 @@
</child>
<child>
<object class="GtkEntry" id="preview">
<property name="placeholder-text" translatable="1">Preview text</property>
<property name="placeholder-text" translatable="yes">Preview text</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="1">horizontal</property>
<property name="flags" translatable="yes">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>
@@ -201,7 +201,7 @@
</child>
<child>
<object class="GtkLabel" id="size_label">
<property name="label" translatable="1">Size</property>
<property name="label" translatable="yes">Size</property>
<property name="xalign">0</property>
<property name="valign">4</property>
<layout>
@@ -217,7 +217,7 @@
<property name="round-digits">0</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="1">horizontal</property>
<property name="flags" translatable="yes">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>
@@ -267,7 +267,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">No Fonts Found</property>
<property name="label" translatable="yes">No Fonts Found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.2"></attribute>
@@ -321,7 +321,7 @@
</child>
<child>
<object class="GtkEntry" id="preview2">
<property name="placeholder-text" translatable="1">Preview text</property>
<property name="placeholder-text" translatable="yes">Preview text</property>
<property name="text" bind-source="preview" bind-property="text" bind-flags="bidirectional"/>
<property name="attributes" bind-source="preview" bind-property="attributes" bind-flags="bidirectional"/>
</object>
@@ -348,7 +348,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="size_label2">
<property name="label" translatable="1">Size</property>
<property name="label" translatable="yes">Size</property>
<property name="xalign">0</property>
<property name="valign">4</property>
<layout>
+2 -2
View File
@@ -17,13 +17,13 @@
<child>
<object class="GtkLabel" id="label_lock">
<property name="xalign">0</property>
<property name="label" translatable="1">Lock</property>
<property name="label" translatable="yes">Lock</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label_unlock">
<property name="xalign">0</property>
<property name="label" translatable="1">Unlock</property>
<property name="label" translatable="yes">Unlock</property>
</object>
</child>
</object>
+8 -8
View File
@@ -2,7 +2,7 @@
<interface domain="gtk40">
<template class="GtkPageSetupUnixDialog" parent="GtkDialog">
<property name="resizable">0</property>
<property name="title" translatable="1">Page Setup</property>
<property name="title" translatable="yes">Page Setup</property>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">1</property>
@@ -24,7 +24,7 @@
<object class="GtkLabel" id="printer_combo_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">_Format for:</property>
<property name="label" translatable="yes">_Format for:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">printer_combo</property>
<layout>
@@ -48,7 +48,7 @@
<object class="GtkLabel" id="paper_size_combo_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">_Paper size:</property>
<property name="label" translatable="yes">_Paper size:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_size_combo</property>
<layout>
@@ -83,7 +83,7 @@
<object class="GtkLabel" id="orientation_label">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">_Orientation:</property>
<property name="label" translatable="yes">_Orientation:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">portrait_radio</property>
<layout>
@@ -95,7 +95,7 @@
<child>
<object class="GtkCheckButton" id="portrait_radio">
<property name="active">1</property>
<property name="label" translatable="1">Portrait</property>
<property name="label" translatable="yes">Portrait</property>
<layout>
<property name="column">1</property>
<property name="row">3</property>
@@ -106,7 +106,7 @@
<object class="GtkCheckButton" id="reverse_portrait_radio">
<property name="active">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="1">Reverse portrait</property>
<property name="label" translatable="yes">Reverse portrait</property>
<layout>
<property name="column">2</property>
<property name="row">3</property>
@@ -118,7 +118,7 @@
<property name="hexpand">1</property>
<property name="active">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="1">Landscape</property>
<property name="label" translatable="yes">Landscape</property>
<layout>
<property name="column">1</property>
<property name="row">4</property>
@@ -129,7 +129,7 @@
<object class="GtkCheckButton" id="reverse_landscape_radio">
<property name="hexpand">1</property>
<property name="group">portrait_radio</property>
<property name="label" translatable="1">Reverse landscape</property>
<property name="label" translatable="yes">Reverse landscape</property>
<layout>
<property name="column">2</property>
<property name="row">4</property>
+11 -11
View File
@@ -25,7 +25,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="1">Server Addresses</property>
<property name="label" translatable="yes">Server Addresses</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -37,7 +37,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="1">Server addresses are made up of a protocol prefix and an address. Examples:</property>
<property name="label" translatable="yes">Server addresses are made up of a protocol prefix and an address. Examples:</property>
<property name="wrap">1</property>
<property name="width-chars">40</property>
<property name="max-width-chars">40</property>
@@ -63,7 +63,7 @@
<child>
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="label" translatable="1">Available Protocols</property>
<property name="label" translatable="yes">Available Protocols</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
@@ -76,7 +76,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Prefix</property>
<property name="label" translatable="yes">Prefix</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
@@ -115,7 +115,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1" comments="Translators: Server as any successfully connected network address">No recent servers found</property>
<property name="label" translatable="yes" comments="Translators: Server as any successfully connected network address">No recent servers found</property>
<style>
<class name="dim-label"/>
</style>
@@ -138,7 +138,7 @@
<property name="margin-bottom">12</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Recent Servers</property>
<property name="label" translatable="yes">Recent Servers</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -218,7 +218,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">No results found</property>
<property name="label" translatable="yes">No results found</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
<attribute name="scale" value="1.44"></attribute>
@@ -227,7 +227,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Try a different search</property>
<property name="label" translatable="yes">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
@@ -249,7 +249,7 @@
<object class="GtkLabel">
<property name="hexpand">1</property>
<property name="xalign">0</property>
<property name="label" translatable="1">Connect to _Server</property>
<property name="label" translatable="yes">Connect to _Server</property>
<property name="mnemonic-widget">address_entry</property>
<property name="use-underline">1</property>
<attributes>
@@ -259,7 +259,7 @@
</child>
<child type="end">
<object class="GtkButton" id="connect_button">
<property name="label" translatable="1">Con_nect</property>
<property name="label" translatable="yes">Con_nect</property>
<property name="use-underline">1</property>
<property name="sensitive">0</property>
<property name="receives-default">1</property>
@@ -274,7 +274,7 @@
<object class="GtkEntry" id="address_entry">
<property name="hexpand">1</property>
<property name="width-chars">20</property>
<property name="placeholder-text" translatable="1">Enter server address…</property>
<property name="placeholder-text" translatable="yes">Enter server address…</property>
<property name="secondary-icon-name">dialog-question-symbolic</property>
<property name="completion">address_entry_completion</property>
<signal name="notify::text" handler="on_address_entry_text_changed" object="GtkPlacesView" swapped="yes"/>
+1 -1
View File
@@ -50,7 +50,7 @@
<property name="visible">0</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="tooltip-text" translatable="1">Unmount</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<child>
<object class="GtkImage" id="eject_icon">
<property name="icon-name">media-eject-symbolic</property>
+50 -50
View File
@@ -80,7 +80,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="1">Name</property>
<property name="title" translatable="yes">Name</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
@@ -111,7 +111,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="1" comments="this is the header for the location column in the print dialog">Location</property>
<property name="title" translatable="yes" comments="this is the header for the location column in the print dialog">Location</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
@@ -142,7 +142,7 @@
</child>
<child>
<object class="GtkColumnViewColumn">
<property name="title" translatable="1" comments="this is the header for the printer status column in the print dialog">Status</property>
<property name="title" translatable="yes" comments="this is the header for the printer status column in the print dialog">Status</property>
<property name="expand">1</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
@@ -196,7 +196,7 @@
<object class="GtkLabel" id="label_widget1">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Range</property>
<property name="label" translatable="yes">Range</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -209,7 +209,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkCheckButton" id="all_pages_radio">
<property name="label" translatable="1">_All Pages</property>
<property name="label" translatable="yes">_All Pages</property>
<property name="use-underline">1</property>
<property name="active">1</property>
<layout>
@@ -221,7 +221,7 @@
</child>
<child>
<object class="GtkCheckButton" id="current_page_radio">
<property name="label" translatable="1">C_urrent Page</property>
<property name="label" translatable="yes">C_urrent Page</property>
<property name="sensitive">0</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -234,7 +234,7 @@
</child>
<child>
<object class="GtkCheckButton" id="selection_radio">
<property name="label" translatable="1">Se_lection</property>
<property name="label" translatable="yes">Se_lection</property>
<property name="sensitive">0</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -247,8 +247,8 @@
</child>
<child>
<object class="GtkCheckButton" id="page_range_radio">
<property name="label" translatable="1">Pag_es:</property>
<property name="tooltip-text" translatable="1">Specify one or more page ranges,
<property name="label" translatable="yes">Pag_es:</property>
<property name="tooltip-text" translatable="yes">Specify one or more page ranges,
e.g. 13, 7, 11</property>
<property name="use-underline">1</property>
<property name="group">all_pages_radio</property>
@@ -261,7 +261,7 @@
</child>
<child>
<object class="GtkEntry" id="page_range_entry">
<property name="tooltip-text" translatable="1">Specify one or more page ranges,
<property name="tooltip-text" translatable="yes">Specify one or more page ranges,
e.g. 13, 7, 11</property>
<property name="activates-default">1</property>
<signal name="notify::has-focus" handler="page_range_entry_focus_changed" swapped="no"/>
@@ -284,7 +284,7 @@
<object class="GtkLabel" id="label_widget2">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Copies</property>
<property name="label" translatable="yes">Copies</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -299,7 +299,7 @@
<object class="GtkLabel" id="label4">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Copie_s:</property>
<property name="label" translatable="yes">Copie_s:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">copies_spin</property>
<layout>
@@ -322,7 +322,7 @@
</child>
<child>
<object class="GtkCheckButton" id="collate_check">
<property name="label" translatable="1">C_ollate</property>
<property name="label" translatable="yes">C_ollate</property>
<property name="use-underline">1</property>
<signal name="toggled" handler="update_collate_icon" swapped="no"/>
<layout>
@@ -333,7 +333,7 @@
</child>
<child>
<object class="GtkCheckButton" id="reverse_check">
<property name="label" translatable="1">_Reverse</property>
<property name="label" translatable="yes">_Reverse</property>
<property name="use-underline">1</property>
<signal name="toggled" handler="update_collate_icon" swapped="no"/>
<layout>
@@ -363,7 +363,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label1">
<property name="label" translatable="1">General</property>
<property name="label" translatable="yes">General</property>
</object>
</property>
</object>
@@ -390,7 +390,7 @@
<object class="GtkLabel" id="label_widget3">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Layout</property>
<property name="label" translatable="yes">Layout</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -405,7 +405,7 @@
<object class="GtkLabel" id="label5">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">T_wo-sided:</property>
<property name="label" translatable="yes">T_wo-sided:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">duplex</property>
<layout>
@@ -427,7 +427,7 @@
<object class="GtkLabel" id="label6">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Pages per _side:</property>
<property name="label" translatable="yes">Pages per _side:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">pages_per_sheet</property>
<layout>
@@ -451,7 +451,7 @@
<object class="GtkLabel" id="label7">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Page or_dering:</property>
<property name="label" translatable="yes">Page or_dering:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">number_up_layout</property>
<layout>
@@ -474,7 +474,7 @@
<object class="GtkLabel" id="label8">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">_Only print:</property>
<property name="label" translatable="yes">_Only print:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">page_set_combo</property>
<layout>
@@ -506,7 +506,7 @@
<object class="GtkLabel" id="label9">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Sc_ale:</property>
<property name="label" translatable="yes">Sc_ale:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">scale_spin</property>
<layout>
@@ -551,7 +551,7 @@
<object class="GtkLabel" id="label_widget4">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Paper</property>
<property name="label" translatable="yes">Paper</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -566,7 +566,7 @@
<object class="GtkLabel" id="label11">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Paper _type:</property>
<property name="label" translatable="yes">Paper _type:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_type</property>
<layout>
@@ -588,7 +588,7 @@
<object class="GtkLabel" id="label12">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Paper _source:</property>
<property name="label" translatable="yes">Paper _source:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_source</property>
<layout>
@@ -610,7 +610,7 @@
<object class="GtkLabel" id="label13">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Output t_ray:</property>
<property name="label" translatable="yes">Output t_ray:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">output_tray</property>
<layout>
@@ -632,7 +632,7 @@
<object class="GtkLabel" id="paper_size_combo_label">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">_Paper size:</property>
<property name="label" translatable="yes">_Paper size:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">paper_size_combo</property>
<layout>
@@ -655,7 +655,7 @@
<object class="GtkLabel" id="orientation_combo_label">
<property name="halign">1</property>
<property name="valign">4</property>
<property name="label" translatable="1">Or_ientation:</property>
<property name="label" translatable="yes">Or_ientation:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">orientation_combo</property>
<layout>
@@ -706,7 +706,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label2">
<property name="label" translatable="1">Page Setup</property>
<property name="label" translatable="yes">Page Setup</property>
</object>
</property>
</object>
@@ -729,7 +729,7 @@
<object class="GtkLabel" id="label_widget5">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Job Details</property>
<property name="label" translatable="yes">Job Details</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -744,7 +744,7 @@
<object class="GtkLabel" id="label16">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Pri_ority:</property>
<property name="label" translatable="yes">Pri_ority:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">job_prio</property>
<layout>
@@ -765,7 +765,7 @@
<object class="GtkLabel" id="label17">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">_Billing info:</property>
<property name="label" translatable="yes">_Billing info:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">billing_info</property>
<layout>
@@ -798,7 +798,7 @@
<object class="GtkLabel" id="label_widget6">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Print Document</property>
<property name="label" translatable="yes">Print Document</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -811,7 +811,7 @@
<property name="column-spacing">12</property>
<child>
<object class="GtkCheckButton" id="print_now_radio">
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog">_Now</property>
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog">_Now</property>
<property name="use-underline">1</property>
<property name="active">1</property>
<signal name="toggled" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
@@ -825,11 +825,11 @@
<child>
<object class="GtkCheckButton" id="print_at_radio">
<property name="sensitive">0</property>
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog. It also serves as the label for an entry that allows the user to enter a time.">A_t:</property>
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog. It also serves as the label for an entry that allows the user to enter a time.">A_t:</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="1">Specify the time of print,
<property name="tooltip-markup" translatable="yes">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="tooltip-text" translatable="1" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
<property name="tooltip-text" translatable="yes" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="use-underline">1</property>
<property name="group">print_now_radio</property>
@@ -845,9 +845,9 @@
<object class="GtkEntry" id="print_at_entry">
<property name="sensitive">0</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="1">Specify the time of print,
<property name="tooltip-markup" translatable="yes">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<property name="tooltip-text" translatable="1" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
<property name="tooltip-text" translatable="yes" comments="Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.">Specify the time of print,
e.g. 1530, 235 pm, 141520, 114630 am, 4 pm</property>
<signal name="changed" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
<layout>
@@ -859,10 +859,10 @@
<child>
<object class="GtkCheckButton" id="print_hold_radio">
<property name="sensitive">0</property>
<property name="label" translatable="1" comments="this is one of the choices for the print at option in the print dialog. It means that the print job will not be printed until it explicitly gets &apos;released&apos;.">On _hold</property>
<property name="label" translatable="yes" comments="this is one of the choices for the print at option in the print dialog. It means that the print job will not be printed until it explicitly gets &apos;released&apos;.">On _hold</property>
<property name="has-tooltip">1</property>
<property name="tooltip-markup" translatable="1">Hold the job until it is explicitly released</property>
<property name="tooltip-text" translatable="1">Hold the job until it is explicitly released</property>
<property name="tooltip-markup" translatable="yes">Hold the job until it is explicitly released</property>
<property name="tooltip-text" translatable="yes">Hold the job until it is explicitly released</property>
<property name="use-underline">1</property>
<property name="group">print_now_radio</property>
<signal name="toggled" handler="update_print_at_option" object="GtkPrintUnixDialog" swapped="yes"/>
@@ -889,7 +889,7 @@
<object class="GtkLabel" id="label_widget7">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1">Add Cover Page</property>
<property name="label" translatable="yes">Add Cover Page</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
@@ -904,7 +904,7 @@
<object class="GtkLabel" id="label18">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1" comments="this is the label used for the option in the print dialog that controls the front cover page.">Be_fore:</property>
<property name="label" translatable="yes" comments="this is the label used for the option in the print dialog that controls the front cover page.">Be_fore:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">cover_before</property>
<layout>
@@ -925,7 +925,7 @@
<object class="GtkLabel" id="label19">
<property name="halign">1</property>
<property name="valign">3</property>
<property name="label" translatable="1" comments="this is the label used for the option in the print dialog that controls the back cover page.">_After:</property>
<property name="label" translatable="yes" comments="this is the label used for the option in the print dialog that controls the back cover page.">_After:</property>
<property name="use-underline">1</property>
<property name="mnemonic-widget">cover_after</property>
<layout>
@@ -954,7 +954,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label3">
<property name="label" translatable="1">Job</property>
<property name="label" translatable="yes">Job</property>
</object>
</property>
</object>
@@ -984,7 +984,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label20">
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog.">Image Quality</property>
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog.">Image Quality</property>
</object>
</property>
</object>
@@ -1013,7 +1013,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label21">
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog.">Color</property>
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog.">Color</property>
</object>
</property>
</object>
@@ -1042,7 +1042,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label22">
<property name="label" translatable="1" comments="This will appear as a tab label in the print dialog. It&apos;s a typographical term, as in &quot;Binding and finishing&quot;">Finishing</property>
<property name="label" translatable="yes" comments="This will appear as a tab label in the print dialog. It&apos;s a typographical term, as in &quot;Binding and finishing&quot;">Finishing</property>
</object>
</property>
</object>
@@ -1071,7 +1071,7 @@
</property>
<property name="tab">
<object class="GtkLabel" id="label23">
<property name="label" translatable="1">Advanced</property>
<property name="label" translatable="yes">Advanced</property>
</object>
</property>
</object>
@@ -1087,7 +1087,7 @@
</child>
<child>
<object class="GtkLabel" id="label24">
<property name="label" translatable="1">Some of the settings in the dialog conflict</property>
<property name="label" translatable="yes">Some of the settings in the dialog conflict</property>
</object>
</child>
</object>
+1 -1
View File
@@ -47,7 +47,7 @@
<property name="valign">3</property>
<property name="margin-start">4px</property>
<property name="icon-name">media-eject-symbolic</property>
<property name="tooltip-text" translatable="1">Unmount</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<style>
<class name="sidebar-button"/>
</style>
+24 -43
View File
@@ -471,9 +471,6 @@ if not os_win32
endif
endif
pc_gdk_extra_libs = []
cairo_backends = []
foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled],
['cairo-win32', cairo_req, win32_enabled],
@@ -604,26 +601,14 @@ if x11_enabled
cdata.set('HAVE_RANDR15', xrandr15_dep.found())
endif
if broadway_enabled
pc_gdk_extra_libs += ['-lz']
endif
if macos_enabled
pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon']
endif
extra_demo_ldflags = []
if win32_enabled
pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32']
if cc.get_id() == 'msvc'
# Since the demo programs are now built as pure GUI programs, we
# need to pass in /entry:mainCRTStartup so that they will properly
# link on Visual Studio builds
extra_demo_ldflags = ['/entry:mainCRTStartup']
else
pc_gdk_extra_libs += ['-Wl,-luuid']
endif
pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32', '-lhid']
# Check whether libepoxy is built with EGL support on Windows
endif
@@ -685,12 +670,12 @@ if not get_option('sysprof').disabled()
libsysprof_capture_dep = dependency('sysprof-capture-4', version: sysprof_req,
required: get_option('sysprof'),
default_options: [
'enable_examples=false',
'enable_gtk=false',
'enable_tests=false',
'enable_tools=false',
'examples=false',
'gtk=false',
'tests=false',
'tools=false',
'libsysprof=true',
'with_sysprofd=none',
'sysprofd=none',
'help=false',
],
fallback: ['sysprof', 'libsysprof_capture_dep'],
@@ -699,12 +684,12 @@ if not get_option('sysprof').disabled()
libsysprof_dep = dependency('sysprof-4',
required: false,
default_options: [
'enable_examples=false',
'enable_gtk=false',
'enable_tests=false',
'enable_tools=false',
'examples=false',
'gtk=false',
'tests=false',
'tools=false',
'libsysprof=true',
'with_sysprofd=none',
'sysprofd=none',
'help=false',
],
fallback: ['sysprof', 'libsysprof_dep'],
@@ -841,16 +826,7 @@ gsk_private_packages = [] # all already in gdk_private_packages
pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : []
gtk_private_packages = pangoft2_pkgs
gdk_extra_libs = pc_gdk_extra_libs
gsk_extra_libs = []
gtk_extra_libs = []
gdk_extra_cflags = []
gsk_extra_cflags = []
gtk_extra_cflags = []
pkgs = [ 'gtk4' ]
pkgs = []
pkg_targets = []
display_backends = []
foreach backend: [ 'broadway', 'macos', 'wayland', 'win32', 'x11', ]
@@ -867,18 +843,23 @@ common_pc_variables = [
'gtk_host=@0@-@1@'.format(host_machine.cpu_family(), host_machine.system()), # FIXME
]
pkg_config.generate(libgtk,
filebase: 'gtk4',
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Graphical UI Library',
requires: gdk_packages + gsk_packages + gtk_packages,
subdirs: ['gtk-@0@'.format(gtk_api_version)],
)
meson.override_dependency('gtk4', libgtk_dep)
foreach pkg: pkgs
pkg_config.generate(
filebase: pkg,
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Graphical UI Library',
requires: gdk_packages + gsk_packages + gtk_packages,
requires_private: gdk_private_packages + gsk_private_packages + gtk_private_packages,
libraries: ['-L${libdir}', '-lgtk-4'],
libraries_private: gdk_extra_libs + gsk_extra_libs + gtk_extra_libs,
subdirs: ['gtk-@0@'.format(gtk_api_version)],
extra_cflags: gdk_extra_cflags + gsk_extra_cflags + gtk_extra_cflags,
requires: 'gtk4',
)
meson.override_dependency(pkg, libgtk_dep)
endforeach
@@ -889,10 +870,10 @@ if os_unix
unescaped_variables: common_pc_variables,
name: 'GTK',
description: 'GTK Unix print support',
requires: ['gtk4'] + gtk_packages,
libraries: [],
requires: 'gtk4',
subdirs: ['gtk-@0@/unix-print'.format(gtk_api_version)],
)
meson.override_dependency('gtk4-unix-print', libgtk_dep)
endif
subdir('po')
+488 -1493
View File
File diff suppressed because it is too large Load Diff
+191 -190
View File
File diff suppressed because it is too large Load Diff
+26 -23
View File
@@ -12,8 +12,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.6\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-05-15 06:30+0000\n"
"PO-Revision-Date: 2022-05-16 12:06+0430\n"
"POT-Creation-Date: 2022-06-05 12:35+0000\n"
"PO-Revision-Date: 2022-06-06 12:42+0430\n"
"Last-Translator: Danial Behzadi <dani.behzi@ubuntu.com>\n"
"Language-Team: Persian <>\n"
"Language: fa\n"
@@ -53,7 +53,7 @@ msgstr "نمی‌توان محتوا را به شکل «%s» فراهم کرد"
msgid "Cannot provide contents as %s"
msgstr "نمی‌توان محتوا را به شکل %s فراهم کرد"
#: gdk/gdkdisplay.c:154 gdk/gdkglcontext.c:437
#: gdk/gdkdisplay.c:154 gdk/gdkglcontext.c:435
msgid "The current backend does not support OpenGL"
msgstr "پسانه در حال حاضر از OpenGL پشتیبانی نمی‌کند"
@@ -112,27 +112,27 @@ msgstr "کشیدن و رها کردن از دیگر برنامه‌ها پشتی
msgid "No compatible formats to transfer contents."
msgstr "هیچ قالب سازگاری برای انتقال محتویات وجود ندارد."
#: gdk/gdkglcontext.c:334
msgid "The EGL implementation does not support any allowed APIs"
msgstr "پشتیبانی EGL از هیچ API مجازی پیشتیبانی نمی‌کند"
#: gdk/gdkglcontext.c:394 gdk/x11/gdkglcontext-glx.c:605
msgid "No GL API allowed."
msgstr "هیچ رابط برنامه‌نویسی GLای مجاز نیست."
#: gdk/gdkglcontext.c:415 gdk/win32/gdkglcontext-win32-wgl.c:616
#: gdk/x11/gdkglcontext-glx.c:624
#: gdk/gdkglcontext.c:418 gdk/win32/gdkglcontext-win32-wgl.c:611
#: gdk/x11/gdkglcontext-glx.c:639
msgid "Unable to create a GL context"
msgstr "امکان ساخت زمینه مناسب برای GL نبود"
#: gdk/gdkglcontext.c:1274
#: gdk/gdkglcontext.c:1273
msgid "Anything but OpenGL ES disabled via GDK_DEBUG"
msgstr "هر چیزی جز OpenGL Es به دست GDK_DEBUG از کار افتاده"
#: gdk/gdkglcontext.c:1283
#: gdk/gdkglcontext.c:1282
#, c-format
msgid "Application does not support %s API"
msgstr "برنامه از API مربوط به %s پشتبانی نمی‌کند"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:1817
#: gdk/gdkglcontext.c:1822
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "تلاش شد از %s استفاده شود، ولی %s از پیش در حال استفاده است"
@@ -698,7 +698,7 @@ msgstr "شکست در تغییر شکل قالب W32 دادهٔ ک‌ور 0x%x
msgid "No GL implementation is available"
msgstr "هیچ پیاده‌سازی GLای پیدا نشد"
#: gdk/win32/gdkglcontext-win32-wgl.c:582
#: gdk/win32/gdkglcontext-win32-wgl.c:577
msgid "No available configurations for the given pixel format"
msgstr "هیچ پیکربندی برای قالب نقطه‌ای ارائه شده موجود نیست"
@@ -760,15 +760,15 @@ msgstr "مدیر تخته‌گیره نتوانست گزینش را ذخیره
msgid "Cannot store clipboard. No clipboard manager is active."
msgstr "نتوانست تخته‌گیره را ذخیره کند. هیچ مدیر تخته‌گیره‌ای فعّال نیست."
#: gdk/x11/gdkglcontext-glx.c:780
#: gdk/x11/gdkglcontext-glx.c:755
msgid "No GLX configurations available"
msgstr "هیچ پیکربندی‌ای برای GLX موجود نیست"
#: gdk/x11/gdkglcontext-glx.c:853
#: gdk/x11/gdkglcontext-glx.c:828
msgid "No GLX configuration with required features found"
msgstr "هیچ پیکربندی‌ای با ویژگی‌های موردنیاز برای GLX موجود نیست"
#: gdk/x11/gdkglcontext-glx.c:927
#: gdk/x11/gdkglcontext-glx.c:902
msgid "GLX is not supported"
msgstr "GLX پشتیبانی نمی‌شود"
@@ -2169,7 +2169,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "اگر موردی را پاک کنید، برای همیشه از دست خواهد رفت."
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827
#: gtk/gtklabel.c:5621 gtk/gtktext.c:6041 gtk/gtktextview.c:8914
#: gtk/gtklabel.c:5627 gtk/gtktext.c:6041 gtk/gtktextview.c:8914
msgid "_Delete"
msgstr "_حذف"
@@ -2441,27 +2441,27 @@ msgstr "دگرگونه‌های نویسه"
msgid "OpenGL context creation failed"
msgstr "ساخت زمینه OpenGL شکست خورد"
#: gtk/gtklabel.c:5618 gtk/gtktext.c:6029 gtk/gtktextview.c:8902
#: gtk/gtklabel.c:5624 gtk/gtktext.c:6029 gtk/gtktextview.c:8902
msgid "Cu_t"
msgstr "_برش"
#: gtk/gtklabel.c:5619 gtk/gtktext.c:6033 gtk/gtktextview.c:8906
#: gtk/gtklabel.c:5625 gtk/gtktext.c:6033 gtk/gtktextview.c:8906
msgid "_Copy"
msgstr "_رونوشت"
#: gtk/gtklabel.c:5620 gtk/gtktext.c:6037 gtk/gtktextview.c:8910
#: gtk/gtklabel.c:5626 gtk/gtktext.c:6037 gtk/gtktextview.c:8910
msgid "_Paste"
msgstr "_چسباندن"
#: gtk/gtklabel.c:5626 gtk/gtktext.c:6050 gtk/gtktextview.c:8935
#: gtk/gtklabel.c:5632 gtk/gtktext.c:6050 gtk/gtktextview.c:8935
msgid "Select _All"
msgstr "انتخاب _همه"
#: gtk/gtklabel.c:5631
#: gtk/gtklabel.c:5637
msgid "_Open Link"
msgstr "_گشودن پیوند"
#: gtk/gtklabel.c:5635
#: gtk/gtklabel.c:5641
msgid "Copy _Link Address"
msgstr "_رونوشت از نشانی پیوند"
@@ -2510,7 +2510,7 @@ msgstr ""
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: gtk/gtkmain.c:775
#: gtk/gtkmain.c:786
msgid "default:LTR"
msgstr "default:RTL"
@@ -6906,6 +6906,9 @@ msgstr ""
"اگر به‌راستی می‌خواهید این‌جا انبارهٔ نقشکی ایجاد کنید، از --ignore-theme-index "
"استفاده کنید.\n"
#~ msgid "The EGL implementation does not support any allowed APIs"
#~ msgstr "پشتیبانی EGL از هیچ API مجازی پیشتیبانی نمی‌کند"
#~ msgctxt "Script"
#~ msgid "Arabic"
#~ msgstr "عربی"
+514 -445
View File
File diff suppressed because it is too large Load Diff
+945 -771
View File
File diff suppressed because it is too large Load Diff
+503 -449
View File
File diff suppressed because it is too large Load Diff
+486 -363
View File
File diff suppressed because it is too large Load Diff
+484 -439
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

+4 -1
View File
@@ -1,5 +1,6 @@
gtk_tests = [
# testname, optional extra sources
['subsurface'],
['input'],
['testpopup'],
['testupload'],
@@ -127,6 +128,8 @@ if x11_enabled
gtk_tests += [['testerrors']]
endif
libpixman = cc.find_library('pixman-1', required: true)
# Pass the source dir here so programs can change into the source directory
# and find .ui files and .png files and such that they load at runtime
test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())]
@@ -138,7 +141,7 @@ foreach t: gtk_tests
sources: test_srcs,
include_directories: [confinc, gdkinc],
c_args: test_args + common_cflags,
dependencies: [libgtk_dep, libm],
dependencies: [libgtk_dep, libm, libpixman],
)
endforeach
+606
View File
@@ -0,0 +1,606 @@
/* simple.c
* Copyright (C) 2017 Red Hat, Inc
* Author: Benjamin Otte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include <gdk/wayland/gdkwayland.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <pixman.h>
#include <drm/drm_fourcc.h>
static struct wl_compositor *wl_compositor;
static struct wl_subcompositor *wl_subcompositor;
static struct wl_shm *wl_shm;
struct yuv_buffer {
void *data;
size_t bytes;
struct wl_buffer *proxy;
int width;
int height;
};
static struct yuv_buffer *
yuv_buffer_create(size_t bytes,
int width,
int height,
int stride_bytes,
uint32_t drm_format)
{
struct wl_shm_pool *pool;
struct yuv_buffer *buf;
int fd;
const char *xdg_runtime_dir;
buf = g_malloc(sizeof *buf);
buf->bytes = bytes;
buf->width = width;
buf->height = height;
xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR");
fd = open (xdg_runtime_dir, O_TMPFILE|O_RDWR|O_EXCL, 0600);
ftruncate (fd, buf->bytes);
g_assert(fd >= 0);
buf->data = mmap(NULL, buf->bytes,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (buf->data == MAP_FAILED) {
close(fd);
g_assert(buf->data != MAP_FAILED);
}
pool = wl_shm_create_pool(wl_shm, fd, buf->bytes);
buf->proxy = wl_shm_pool_create_buffer(pool, 0, buf->width, buf->height,
stride_bytes, drm_format);
wl_shm_pool_destroy(pool);
close(fd);
return buf;
}
/*
* Based on Rec. ITU-R BT.601-7
*
* This is intended to be obvious and accurate, not fast.
*/
static void
x8r8g8b8_to_ycbcr8_bt601(uint32_t xrgb,
uint8_t *y_out, uint8_t *cb_out, uint8_t *cr_out)
{
double y, cb, cr;
double r = (xrgb >> 16) & 0xff;
double g = (xrgb >> 8) & 0xff;
double b = (xrgb >> 0) & 0xff;
/* normalize to [0.0, 1.0] */
r /= 255.0;
g /= 255.0;
b /= 255.0;
/* Y normalized to [0.0, 1.0], Cb and Cr [-0.5, 0.5] */
y = 0.299 * r + 0.587 * g + 0.114 * b;
cr = (r - y) / 1.402;
cb = (b - y) / 1.772;
/* limited range quantization to 8 bit */
*y_out = round(219.0 * y + 16.0);
if (cr_out)
*cr_out = round(224.0 * cr + 128.0);
if (cb_out)
*cb_out = round(224.0 * cb + 128.0);
}
static struct yuv_buffer *
yuv420_create_buffer(pixman_image_t *rgb_image)
{
struct yuv_buffer *buf;
size_t bytes;
int width;
int height;
int x, y;
void *rgb_pixels;
int rgb_stride_bytes;
uint32_t *rgb_row;
uint8_t *y_base;
uint8_t *u_base;
uint8_t *v_base;
uint8_t *y_row;
uint8_t *u_row;
uint8_t *v_row;
uint32_t argb;
uint32_t drm_format = DRM_FORMAT_YUV420;
g_assert(drm_format == DRM_FORMAT_YUV420);
width = pixman_image_get_width(rgb_image);
height = pixman_image_get_height(rgb_image);
rgb_pixels = pixman_image_get_data(rgb_image);
rgb_stride_bytes = pixman_image_get_stride(rgb_image);
/* Full size Y, quarter U and V */
bytes = width * height + (width / 2) * (height / 2) * 2;
buf = yuv_buffer_create(bytes, width, height, width, drm_format);
y_base = buf->data;
u_base = y_base + width * height;
v_base = u_base + (width / 2) * (height / 2);
for (y = 0; y < height; y++) {
rgb_row = rgb_pixels + (y / 2 * 2) * rgb_stride_bytes;
y_row = y_base + y * width;
u_row = u_base + (y / 2) * (width / 2);
v_row = v_base + (y / 2) * (width / 2);
for (x = 0; x < width; x++) {
/*
* Sub-sample the source image instead, so that U and V
* sub-sampling does not require proper
* filtering/averaging/siting.
*/
argb = *(rgb_row + x / 2 * 2);
/*
* A stupid way of "sub-sampling" chroma. This does not
* do the necessary filtering/averaging/siting or
* alternate Cb/Cr rows.
*/
if ((y & 1) == 0 && (x & 1) == 0) {
x8r8g8b8_to_ycbcr8_bt601(argb, y_row + x,
u_row + x / 2,
v_row + x / 2);
} else {
x8r8g8b8_to_ycbcr8_bt601(argb, y_row + x,
NULL, NULL);
}
}
}
return buf;
}
static void
destroy_cairo_surface(pixman_image_t *image, void *data)
{
cairo_surface_t *surface = data;
cairo_surface_destroy(surface);
}
struct format_map_entry {
cairo_format_t cairo;
pixman_format_code_t pixman;
};
static const struct format_map_entry format_map[] = {
{ CAIRO_FORMAT_ARGB32, PIXMAN_a8r8g8b8 },
{ CAIRO_FORMAT_RGB24, PIXMAN_x8r8g8b8 },
{ CAIRO_FORMAT_A8, PIXMAN_a8 },
{ CAIRO_FORMAT_RGB16_565, PIXMAN_r5g6b5 },
};
static pixman_format_code_t
format_cairo2pixman(cairo_format_t fmt)
{
unsigned i;
for (i = 0; i < G_N_ELEMENTS(format_map); i++)
if (format_map[i].cairo == fmt)
return format_map[i].pixman;
g_assert_not_reached ();
}
static pixman_image_t *
image_convert_to_a8r8g8b8(pixman_image_t *image)
{
pixman_image_t *ret;
int width;
int height;
if (pixman_image_get_format(image) == PIXMAN_a8r8g8b8)
return pixman_image_ref(image);
width = pixman_image_get_width(image);
height = pixman_image_get_height(image);
ret = pixman_image_create_bits_no_clear(PIXMAN_a8r8g8b8, width, height,
NULL, 0);
g_assert(ret);
pixman_image_composite32(PIXMAN_OP_SRC, image, NULL, ret,
0, 0, 0, 0, 0, 0, width, height);
return ret;
}
static pixman_image_t *
load_image_from_png(const char *fname)
{
pixman_image_t *image;
pixman_image_t *converted;
cairo_format_t cairo_fmt;
pixman_format_code_t pixman_fmt;
cairo_surface_t *reference_cairo_surface;
cairo_status_t status;
int width;
int height;
int stride;
void *data;
reference_cairo_surface = cairo_image_surface_create_from_png(fname);
cairo_surface_flush(reference_cairo_surface);
status = cairo_surface_status(reference_cairo_surface);
if (status != CAIRO_STATUS_SUCCESS) {
g_error ("Could not open %s: %s\n", fname,
cairo_status_to_string(status));
cairo_surface_destroy(reference_cairo_surface);
return NULL;
}
cairo_fmt = cairo_image_surface_get_format(reference_cairo_surface);
pixman_fmt = format_cairo2pixman(cairo_fmt);
width = cairo_image_surface_get_width(reference_cairo_surface);
height = cairo_image_surface_get_height(reference_cairo_surface);
stride = cairo_image_surface_get_stride(reference_cairo_surface);
data = cairo_image_surface_get_data(reference_cairo_surface);
/* The Cairo surface will own the data, so we keep it around. */
image = pixman_image_create_bits_no_clear(pixman_fmt,
width, height, data, stride);
g_assert(image);
pixman_image_set_destroy_function(image, destroy_cairo_surface,
reference_cairo_surface);
converted = image_convert_to_a8r8g8b8(image);
pixman_image_unref(image);
return converted;
}
static void
gdk_registry_handle_global (void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version)
{
//g_print ("global: %s %u, id %u\n", interface, version, id);
if (strcmp (interface, "wl_compositor") == 0)
wl_compositor = wl_registry_bind (registry, id, &wl_compositor_interface, version);
if (strcmp (interface, "wl_subcompositor") == 0)
wl_subcompositor = wl_registry_bind (registry, id, &wl_subcompositor_interface, version);
if (strcmp (interface, "wl_shm") == 0)
wl_shm = wl_registry_bind (registry, id, &wl_shm_interface, version);
}
static void
gdk_registry_handle_global_remove (void *data,
struct wl_registry *registry,
uint32_t id)
{
}
static const struct wl_registry_listener registry_listener = {
gdk_registry_handle_global,
gdk_registry_handle_global_remove
};
static void
set_up_registry (struct wl_display *wl_display)
{
struct wl_registry *wl_registry;
wl_registry = wl_display_get_registry (wl_display);
wl_registry_add_listener (wl_registry, &registry_listener, NULL);
if (wl_display_roundtrip (wl_display) < 0)
exit (1);
g_assert (wl_compositor != NULL);
g_assert (wl_subcompositor != NULL);
g_assert (wl_shm != NULL);
}
static void
create_subsurface (struct wl_surface *parent,
struct wl_surface **child,
struct wl_subsurface **subsurface)
{
struct wl_region *region;
*child = wl_compositor_create_surface (wl_compositor);
*subsurface = wl_subcompositor_get_subsurface (wl_subcompositor, *child, parent);
wl_subsurface_set_desync (*subsurface);
region = wl_compositor_create_region (wl_compositor);
wl_surface_set_input_region (*child, region);
wl_region_destroy (region);
}
static void
surface_fill (struct wl_surface *surface,
int width,
int height,
const GdkRGBA *c)
{
size_t size;
const char *xdg_runtime_dir;
int fd;
guint32 *data;
guint32 pixel;
struct wl_shm_pool *pool;
struct wl_buffer *buffer;
#if 0
size = width * height * 4;
xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR");
fd = open (xdg_runtime_dir, O_TMPFILE|O_RDWR|O_EXCL, 0600);
ftruncate (fd, size);
data = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
pixel = 0xff000000 | ((int)(c->red * 255) << 16) | ((int)(c->green * 255) << 8) | ((int)c->blue * 255);
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++)
data[i * width + j] = pixel;
pool = wl_shm_create_pool (wl_shm, fd, size);
buffer = wl_shm_pool_create_buffer (pool, 0, width, height, width * 4, WL_SHM_FORMAT_XRGB8888);
wl_shm_pool_destroy (pool);
close (fd);
#else
pixman_image_t *img = load_image_from_png ("tests/chocolate-cake.png");
struct yuv_buffer *buf = yuv420_create_buffer (img);
buffer = buf->proxy;
#endif
wl_surface_attach (surface, buffer, 0, 0);
wl_surface_commit (surface);
}
#define DEMO_TYPE_WIDGET (demo_widget_get_type ())
G_DECLARE_FINAL_TYPE (DemoWidget, demo_widget, DEMO, WIDGET, GtkWidget)
GtkWidget * demo_widget_new (void);
void demo_widget_add_child (DemoWidget *self,
GtkWidget *child);
struct _DemoWidget
{
GtkWidget parent_instance;
struct wl_display *wl_display;
struct wl_surface *parent;
struct wl_surface *child;
struct wl_subsurface *subsurface;
GdkRGBA color1;
GdkRGBA color2;
guint64 time2;
float t;
guint tick_cb;
GtkPopover *popover;
};
struct _DemoWidgetClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE (DemoWidget, demo_widget, GTK_TYPE_WIDGET)
#define TIME_SPAN (3.0 * G_TIME_SPAN_SECOND)
static gboolean
change_color (GtkWidget *widget,
GdkFrameClock *frame_clock,
gpointer data)
{
DemoWidget *demo = DEMO_WIDGET (widget);
gint64 time;
time = gdk_frame_clock_get_frame_time (frame_clock);
if (time >= demo->time2)
{
demo->time2 = time + TIME_SPAN;
demo->color1 = demo->color2;
demo->color2.red = g_random_double_range (0, 1);
demo->color2.green = g_random_double_range (0, 1);
demo->color2.blue = g_random_double_range (0, 1);
demo->color2.alpha = 1;
}
demo->t = 1 - (demo->time2 - time) / TIME_SPAN;
gtk_widget_queue_draw (widget);
return G_SOURCE_CONTINUE;
}
static void
pressed_cb (GtkGesture *gesture,
int n_press,
double x,
double y,
gpointer data)
{
DemoWidget *demo = data;
gtk_popover_set_pointing_to (demo->popover, &(GdkRectangle){ x, y, 1, 1 });
gtk_popover_popup (demo->popover);
}
static void
clicked_cb (GtkButton *button,
gpointer data)
{
DemoWidget *demo = data;
gtk_popover_popdown (demo->popover);
}
static void
demo_widget_init (DemoWidget *demo)
{
GtkWidget *button;
GtkGesture *controller;
gtk_widget_add_tick_callback (GTK_WIDGET (demo), change_color, NULL, NULL);
demo->popover = GTK_POPOVER (gtk_popover_new ());
gtk_widget_set_parent (GTK_WIDGET (demo->popover), GTK_WIDGET (demo));
button = gtk_button_new_with_label ("OK");
g_signal_connect (button, "clicked", G_CALLBACK (clicked_cb), demo);
gtk_popover_set_child (demo->popover, button);
controller = gtk_gesture_click_new ();
g_signal_connect (controller, "pressed", G_CALLBACK (pressed_cb), demo);
gtk_widget_add_controller (GTK_WIDGET (demo), GTK_EVENT_CONTROLLER (controller));
}
static void
demo_widget_dispose (GObject *object)
{
//DemoWidget *demo = DEMO_WIDGET (object);
G_OBJECT_CLASS (demo_widget_parent_class)->dispose (object);
}
static void
demo_widget_realize (GtkWidget *widget)
{
DemoWidget *demo = DEMO_WIDGET (widget);
GdkSurface *surface;
GTK_WIDGET_CLASS (demo_widget_parent_class)->realize (widget);
demo->wl_display = gdk_wayland_display_get_wl_display (gtk_widget_get_display (widget));
surface = gtk_native_get_surface (gtk_widget_get_native (widget));
demo->parent = gdk_wayland_surface_get_wl_surface (surface);
set_up_registry (demo->wl_display);
create_subsurface (demo->parent, &demo->child, &demo->subsurface);
}
static void
demo_widget_unrealize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (demo_widget_parent_class)->unrealize (widget);
/* FIXME */
}
static void
demo_widget_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum_size,
int *natural_size,
int *minimum_baseline,
int *natural_baseline)
{
*minimum_size = 100;
*natural_size = 200;
}
static void
demo_widget_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
DemoWidget *demo = DEMO_WIDGET (widget);
GtkNative *native;
double x0, y0, x, y;
native = gtk_widget_get_native (widget);
gtk_native_get_surface_transform (native, &x0, &y0);
gtk_widget_translate_coordinates (widget,
GTK_WIDGET (native),
0, 0,
&x, &y);
wl_subsurface_set_position (demo->subsurface, x0 + x + 40, y0 + y + 40);
gtk_popover_present (demo->popover);
}
static void
demo_widget_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
DemoWidget *demo = DEMO_WIDGET (widget);
int width, height;
GdkRGBA c;
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
c.red = (1 - demo->t) * demo->color1.red + demo->t * demo->color2.red;
c.green = (1 - demo->t) * demo->color1.green + demo->t * demo->color2.green;
c.blue = (1 - demo->t) * demo->color1.blue + demo->t * demo->color2.blue;
c.alpha = 1;
surface_fill (demo->child, width - 80, height - 80, &c);
}
static void
demo_widget_class_init (DemoWidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = demo_widget_dispose;
widget_class->realize = demo_widget_realize;
widget_class->unrealize = demo_widget_unrealize;
widget_class->measure = demo_widget_measure;
widget_class->size_allocate = demo_widget_size_allocate;
widget_class->snapshot = demo_widget_snapshot;
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *child;
gtk_init ();
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "hello subsurface");
child = g_object_new (demo_widget_get_type (), NULL);
gtk_window_set_child (GTK_WINDOW (window), child);
gtk_widget_show (window);
while (TRUE)
g_main_context_iteration (NULL, TRUE);
return 0;
}
@@ -0,0 +1,10 @@
color-matrix {
matrix: matrix3d(255, 0, 0, 0,
0, 255, 0, 0,
0, 0, 255, 0,
0, 0, 0, 1);
offset: -127 -127 -127 0;
child: color {
color: #80007f;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

+1
View File
@@ -36,6 +36,7 @@ compare_render_tests = [
'clip-nested1',
'color-blur0',
'color-matrix-identity',
'color-matrix-parsing',
'cross-fade-in-opacity',
'css-background',
'empty-blend',
+139 -131
View File
@@ -136,6 +136,7 @@ assert_icon_lookup_fails (const char *icon_name,
}
static GList *lookups = NULL;
static gboolean collecting_lookups = FALSE;
static GLogWriterOutput
log_writer (GLogLevelFlags log_level,
@@ -147,6 +148,9 @@ log_writer (GLogLevelFlags log_level,
const char *msg = NULL;
int i;
if (!collecting_lookups)
return g_log_writer_default (log_level, fields, n_fields, user_data);
for (i = 0; i < n_fields; i++)
{
if (strcmp (fields[i].key, "GLIB_DOMAIN") == 0)
@@ -177,22 +181,13 @@ assert_lookup_order (const char *icon_name,
const char *first,
...)
{
guint debug_flags;
va_list args;
const char *s;
GtkIconPaintable *info;
GList *l;
/* this hack is only usable in debug builds */
#ifndef G_ENABLE_DEBUG
g_assert_not_reached ();
#endif
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
g_log_set_writer_func (log_writer, NULL, NULL);
g_assert_null (lookups);
collecting_lookups = TRUE;
if (fallbacks)
{
@@ -208,7 +203,9 @@ assert_lookup_order (const char *icon_name,
if (info)
g_object_unref (info);
collecting_lookups = FALSE;
va_start (args, first);
s = first;
l = lookups;
@@ -224,9 +221,6 @@ assert_lookup_order (const char *icon_name,
g_list_free_full (lookups, g_free);
lookups = NULL;
g_log_set_writer_func (g_log_writer_default, NULL, NULL);
gtk_set_debug_flags (debug_flags);
}
#ifdef G_ENABLE_DEBUG
@@ -237,6 +231,136 @@ assert_lookup_order (const char *icon_name,
return;
#endif
static void
test_lookup_order (void)
{
require_debug ();
if (g_test_subprocess ())
{
guint debug_flags;
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
g_log_set_writer_func (log_writer, NULL, NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz",
"foo-bar",
"foo",
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
"foo-bar-baz-rtl",
"foo-bar-baz",
"foo-bar-rtl",
"foo-bar",
"foo-rtl",
"foo",
"foo-bar-baz-symbolic-rtl",
"foo-bar-baz-symbolic",
"foo-bar-symbolic-rtl",
"foo-bar-symbolic",
"foo-symbolic-rtl",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
"foo-bar-baz-rtl",
"foo-bar-baz",
NULL);
assert_lookup_order ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
"foo-bar-baz",
"foo-bar",
"foo",
NULL);
assert_lookup_order ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
return;
}
g_test_trap_subprocess (NULL, 0, 0);
g_test_trap_has_passed ();
}
static void
test_basics (void)
@@ -245,122 +369,6 @@ test_basics (void)
assert_icon_lookup ("simple", 16, GTK_TEXT_DIR_NONE, 0, FALSE, "/icons/16x16/simple.png");
}
static void
test_lookup_order (void)
{
require_debug ();
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz",
"foo-bar",
"foo",
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
"foo-bar-baz-rtl",
"foo-bar-baz",
"foo-bar-rtl",
"foo-bar",
"foo-rtl",
"foo",
"foo-bar-baz-symbolic-rtl",
"foo-bar-baz-symbolic",
"foo-bar-symbolic-rtl",
"foo-bar-symbolic",
"foo-symbolic-rtl",
"foo-symbolic",
NULL);
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
"foo-bar-baz-rtl",
"foo-bar-baz",
NULL);
assert_lookup_order ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz-symbolic",
"foo-bar-symbolic",
"foo-symbolic",
"foo-bar-baz",
"foo-bar",
"foo",
NULL);
assert_lookup_order ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bla-bla-symbolic",
"bla-symbolic",
"bla-bla-symbolic", /* awkward */
"bla-symbolic", /* awkward */
"bla-bla",
"bla",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-rtl",
"bar-baz-symbolic",
"bar-symbolic-rtl",
"bar-symbolic",
"bar-baz-symbolic-rtl", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-rtl", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-rtl",
"bar-baz",
"bar-rtl",
"bar",
NULL);
assert_lookup_order ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
assert_lookup_order ("bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
"bar-baz-symbolic-ltr",
"bar-baz-symbolic",
"bar-symbolic-ltr",
"bar-symbolic",
"bar-baz-symbolic-ltr", /* awkward */
"bar-baz-symbolic", /* awkward */
"bar-symbolic-ltr", /* awkward */
"bar-symbolic", /* awkward */
"bar-baz-ltr",
"bar-baz",
"bar-ltr",
"bar",
NULL);
}
static void
test_generic_fallback (void)
{
@@ -804,7 +812,6 @@ main (int argc, char *argv[])
gtk_test_init (&argc, &argv);
g_test_add_func ("/icontheme/basics", test_basics);
g_test_add_func ("/icontheme/lookup-order", test_lookup_order);
g_test_add_func ("/icontheme/generic-fallback", test_generic_fallback);
g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic);
g_test_add_func ("/icontheme/force-regular", test_force_regular);
@@ -815,6 +822,7 @@ main (int argc, char *argv[])
g_test_add_func ("/icontheme/list", test_list);
g_test_add_func ("/icontheme/inherit", test_inherit);
g_test_add_func ("/icontheme/nonsquare-symbolic", test_nonsquare_symbolic);
g_test_add_func ("/icontheme/lookup-order", test_lookup_order);
return g_test_run();
}
+13 -17
View File
@@ -1049,30 +1049,26 @@ specific_bug_77977 (void)
g_object_unref (tree_store);
}
static GLogWriterOutput
log_writer_drop_warnings (GLogLevelFlags log_level,
const GLogField *fields,
gsize n_fields,
gpointer user_data)
{
return G_LOG_WRITER_HANDLED;
}
static void
specific_bug_698396 (void)
{
GtkTreeStore *tree_store;
int new_order[1] = { 0 };
/*http://bugzilla.gnome.org/show_bug.cgi?id=698396 */
tree_store = gtk_tree_store_new (1, G_TYPE_STRING);
if (g_test_subprocess ())
{
GtkTreeStore *tree_store;
int new_order[1] = { 0 };
g_log_set_writer_func (log_writer_drop_warnings, NULL, NULL);
gtk_tree_store_reorder (tree_store, NULL, new_order);
g_log_set_writer_func (g_log_writer_default, NULL, NULL);
tree_store = gtk_tree_store_new (1, G_TYPE_STRING);
gtk_tree_store_reorder (tree_store, NULL, new_order);
g_object_unref (tree_store);
g_object_unref (tree_store);
return;
}
g_test_trap_subprocess (NULL, 0, 0);
g_test_trap_assert_stderr ("*Cannot reorder, parent has no children*");
g_test_trap_assert_failed ();
}
/* main */
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="width-request">100</property>
<child>
<object class="GtkLabel">
<property name="label">letter is off</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic" start="0" end="-1"></attribute>
</attributes>
</object>
</child>
</object>
</interface>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="width-request">100</property>
<child>
<object class="GtkLabel">
<property name="label">letter is off</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic" start="0" end="-1"></attribute>
</attributes>
</object>
</child>
</object>
</interface>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="height-request">100</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">T̰̰̰hree tildes below
</property>
<property name="valign">start</property>
</object>
</child>
</object>
</interface>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<property name="decorated">0</property>
<property name="height-request">100</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">T̰̰̰hree tildes below</property>
<property name="valign">start</property>
</object>
</child>
</object>
</interface>
+4
View File
@@ -392,6 +392,10 @@ testdata = [
'label-huge-max-width-chars.ui',
'label-max-width-chars-and-halign-and-infinite-width.ui',
'label-max-width-chars-and-halign-and-infinite-width.ref.ui',
'label-overdraw-horizontal.ref.ui',
'label-overdraw-horizontal.ui',
'label-overdraw-vertical.ref.ui',
'label-overdraw-vertical.ui',
'label-shadows.css',
'label-shadows.ref.ui',
'label-shadows.ui',