Compare commits

...

268 Commits

Author SHA1 Message Date
Balázs Úr 7f604f26c8 Update Hungarian translation 2024-09-09 05:26:39 +00:00
Matthias Clasen 8fac19ab52 Merge branch 'wip/dont-leak-egl-surface-10' into 'gtk-4-10'
[10] gdk/surface: Don't leak the EGLSurface

See merge request GNOME/gtk!7574
2024-08-07 16:26:03 +00:00
Jonas Ådahl 3147b76116 gdk/surface: Don't leak the EGLSurface
Each time we create a new window, we create a new EGLSurface. Each time
we destroy a window, we failed to destroy the EGLSurface, due to passing
a GdkDisplay instead of a EGLDisplay to eglDestroySurface().

This effectively leaked not only the EGL surface metadata, but also the
associated DMA buffers. For applications where one opens and closes many
windows over the lifetime of the application, and where the application
runs for a long time; for example a terminal emulator server, this
causes a significant memory leak, as the memory will only ever be freed
once once the application process itself exits, if ever.

Fix this passing an actual EGLDisplay instead of an GdkDisplay, to
eglDestroySurface().
2024-08-07 16:05:07 +02:00
Artur S0 66431ae1e5 Update Russian translation 2023-11-27 16:11:08 +00:00
Sveinn í Felli e608a18043 Update Icelandic translation 2023-11-17 10:36:04 +00:00
Florentina Mușat d8266bb4e3 Update Romanian translation 2023-10-22 13:40:13 +00:00
Bruce Cowan c71f8d0838 Update British English translation 2023-09-06 11:39:15 +00:00
Davide Ferracin 043c89dbe2 Update Italian translation 2023-08-30 08:35:53 +00:00
Nathan Follens 78233d56cf Update Dutch translation 2023-08-27 12:12:45 +00:00
Jürgen Benvenuti f237c85c8f Update German translation 2023-08-20 17:47:30 +00:00
Daniel Rusek 87b2fe6de3 Update Czech translation 2023-08-16 19:42:51 +00:00
Matthias Clasen 370b1fe3d5 Post release version bump 2023-08-05 06:02:25 -04:00
Matthias Clasen f5516845d4 4.10.5 2023-08-05 05:50:38 -04:00
Benjamin Otte bfb069ea5a Merge branch 'cherry-pick-f0f7613a' into 'gtk-4-10'
Merge branch 'zbrown/pending' into 'main'

See merge request GNOME/gtk!6214
2023-07-26 05:33:04 +00:00
Benjamin Otte 3c1a300e17 Merge branch 'zbrown/pending' into 'main'
filterlistmodel: emit ::notify::pending after ::items-changed

See merge request GNOME/gtk!6213

(cherry picked from commit f0f7613adb)

72a1bd64 filterlistmodel: emit ::notify::pending after ::items-changed
2023-07-26 00:52:02 -04:00
Balázs Meskó 7a3a82749b Update Hungarian translation 2023-07-25 23:43:05 +00:00
Ngọc Quân Trần e944cd8916 Update Vietnamese translation 2023-07-22 08:16:20 +00:00
Efstathios Iosifidis 9d633773b0 Update Greek translation 2023-07-21 22:29:43 +00:00
Daniel Mustieles 9ccff25c15 Update Spanish translation 2023-07-19 12:36:24 +00:00
Daniel Mustieles 384deb5da7 Revert "Updated Spanish translation"
This reverts commit f0c27b7c8e.
2023-07-19 14:34:43 +02:00
Daniel Mustieles f0c27b7c8e Updated Spanish translation 2023-07-19 14:24:40 +02:00
Leônidas Araújo 98a2aae5ac Update Brazilian Portuguese translation 2023-06-26 13:08:44 +00:00
Carlos Garnacho fa1c48adda Merge branch 'wip/carlosg/clear-resize-cursor-4-10' into 'gtk-4-10'
window: Clear resize_cursor on leave notify events (4.10)

See merge request GNOME/gtk!6143
2023-06-25 19:04:58 +00:00
Michel Dänzer 8362e18891 window: Clear resize_cursor on leave notify events
When the pointer leaves the window surface, gtk_window_capture_motion
will not be called anymore, so priv->resize_cursor may remain non-NULL
indefinitely without this.

If update_cursor is later called (via gtk_window_maybe_update_cursor) on
a virtual enter notify event (e.g. because the pointer entered a
descendant surface), it would previously re-set the window surface
cursor to priv->resize_cursor, which could result in the wrong cursor
shape being shown for descendant surfaces.

This affected mutter-x11-frames, see
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1557.

One could also say that if the pointer leaves the window surface, it's
trivially not over any window edge.

(cherry-picked from commit f8fd04402e)
2023-06-25 20:40:34 +02:00
Benjamin Otte 08d4d63446 Merge branch 'unaligned-access-for-gtk-4-10' into 'gtk-4-10'
gtk: Align key_size up to key_align (for gtk-4-10)

See merge request GNOME/gtk!6124
2023-06-20 16:06:09 +00:00
Matt Turner a358203157 gtk: Align key_size up to key_align
Avoids unaligned accesses when e.g. the key_size is 12 and key_align is
8. We need to round the key size up to 16 to ensure that all keys are
appropriately aligned.

This manifested as a failure in the `gtk:gtk / sorter` unit test on
sparc.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5907
(cherry picked from commit 3f360aa883)
2023-06-19 21:42:19 -04:00
Matt Turner 00cdaba5a8 gtk: Pass G_ALIGNOF (...) to gtk_sort_keys_new
The sizeof and G_ALIGNOF are often, but not always, identical.

(cherry picked from commit a444045386)
2023-06-19 21:23:41 -04:00
Matthias Clasen 63bd793004 Merge branch 'forgotten-410-backport' into 'gtk-4-10'
Revert "css: Simplify default values"

See merge request GNOME/gtk!6092
2023-06-13 14:41:10 +00:00
Matthias Clasen 97e6c7228a Revert "css: Simplify default values"
This reverts commit 1efa39672b.

We want to use corner values for corner properties.

Fixes: #5892
2023-06-13 09:10:30 -04:00
Daniel Rusek 9ffbeb2f21 Update Czech translation 2023-06-12 13:14:40 +00:00
Matthias Clasen ce86609f42 Post-release version bump 2023-06-05 11:38:52 -04:00
Matthias Clasen 55bc7808cc 4.10.4 2023-06-05 11:27:22 -04:00
Matthias Clasen b77a5fedd2 Merge branch 'gtk-4-10-backports' into 'gtk-4-10'
tests: Stop copying the tool tests

See merge request GNOME/gtk!6062
2023-06-05 12:35:40 +00:00
Benjamin Otte afea4a8da5 stringsorter: Handle NULL strings
NULL is a valid string GValue, so we need to handle it.
The utf8 normalizing and collating functions do not, so we better catch
it early.
2023-06-05 08:12:54 -04:00
Matthias Clasen 03df96bace searchentry: Improve size allocation
We want to always reserve space for the clear icon,
but let the text widget use that space when the icon
isn't shown. A plain box layout can't do that, so
do our own size allocation.
2023-06-05 08:12:54 -04:00
Matthias Clasen e16f71304f text: Make the placeholder non-intrusive
We never want to let the placeholder cause
the widget to grow, so set its max-width-chars
to a small value to make it ellipsize.
2023-06-05 08:06:46 -04:00
Benjamin Otte 18482ac484 renderer: return_if_fail() if the given texture size is 0
All renderers SEGV currently when that happens.
2023-06-05 08:06:13 -04:00
Matthias Clasen c9d6074198 wayland: Don't leak cursor structs
Found by gcc's -fanalyzer.
2023-06-05 08:05:57 -04:00
Matthias Clasen f647d7e687 Revert "gdk/x11: Also grab keyboard during XDnD grabs"
This reverts commit ae94417f80.
2023-06-05 08:05:41 -04:00
Matthias Clasen 2f6d374fe2 x11: Stop using passive grabs
The keynav that this implements is half-broken under
xwayland anyway, and it confused and complicates things
on the compositor side.
2023-06-05 08:05:33 -04:00
Marco Trevisan (Treviño) bd906560dd x11: Trap XRandr errors when getting outputs during init and update
We may try to update the XRR outputs and Crtcs when they're changing in
the server, and so we may get BadRROutput that we're currently not
handling properly.

As per this, use traps and check whether we got errors, and if we did
let's ignore the current output.

It's not required to call init_randr13() again because if we got errors
it's very likely that there's a change coming that will be notified at
next iteration during which we'll repeat the init actions.
2023-06-05 08:05:01 -04:00
Daniel Boles e86d18d77c Window: Copy caveats from :*visible to the setters 2023-06-05 08:04:50 -04:00
Daniel Boles c709a8d668 Window: Fix wrong case in property attribute which
rendered the literal text `org.gtk.MEthod.set_property	focus-visible`.
2023-06-05 08:04:42 -04:00
Erik Schilling ecfb2b8cdf label: Fix crashes when executing a11y actions 2023-06-05 08:03:55 -04:00
Alice Mikhaylenko dfc66ffd93 actionmuxer: Correctly notify actions after reparenting
When registering an observer, we send a notification and for that we need
to query the action's state and param type. When setting up a muxer parent,
same thing happens, except the action is queried on the parent instead.

This means that the muxer will notify observers about the parent's actions,
but not about its own.

Add a test to verify it works.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5861
2023-06-05 08:02:33 -04:00
Marco Trevisan (Treviño) 7513fd5d64 gdkselectioninputstream-x11: Explicitly handle stream ownership in signal
The display xevent signal connection takes the ownership of the stream
until we get a valid event, so it should manage the stream lifetime.

So make this clearer, by automatically removing the stream reference
when we disconnect from the xevent signal handler.
2023-06-05 08:01:55 -04:00
Marco Trevisan (Treviño) 6c9a1c51ba gdkselectioninputstream-x11: Make it clearer how we manage the stream ownership
It gets unreffed during gdk_x11_selection_input_stream_complete, so use
APIs that make this clearer.
2023-06-05 08:01:49 -04:00
Marco Trevisan (Treviño) 8de231131c gtkselectioninputstream-x11: Do not add an extra reference to the returned stream
We create a new stream during gdk_x11_selection_input_stream_new_async()
then such stream is referenced when passed to the task via
g_task_return_pointer(), so there's no need to reference it again before
returning it, or we'd end up leaking.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4892
2023-06-05 08:01:40 -04:00
Marco Trevisan (Treviño) 25f8793a35 gtkselectioninputstream-x11: Do not add unreffed bytes to the chunks queue
This should never happen, but we may exit the loop because of count value
with an unreffed bytes pointer being added back to the chunks queue.
2023-06-05 08:01:30 -04:00
Marco Trevisan (Treviño) f02b739f4c gtkselectioninputstream-x11: Do not add EOF marker twice to the chunks queue
We were adding the same EOF marker two times back to the chunks queue,
one implicitly, and the other time could happen when exiting the loop.
2023-06-05 08:01:22 -04:00
Luca Bacci a55b84f524 Check for NULL groups in gtk_action_muxer_get_group ()
The groups hash table is initialized lazily when inserting
the first GActionGroup (gtk_action_muxer_insert ()). Do as
all surrounding code does and check for NULL before using
groups.

This avoids triggering a warning
2023-06-05 08:00:43 -04:00
Daniel Boles ba69a30d27 MenuButton: Always mention child@always-show-arrow
get_always_show_arrow() did not mention at all that the custom child is
relevant. set_always_show_arrow() only did in the blurb, not for the arg
2023-06-05 07:59:47 -04:00
FineFindus 5abff9e22a docs: add HSL to Gdk.RGBA.parse
Update the Gdk.RGBA.parse docs to reflect the ability to parse HSL, which has been added in 4.5.0.
2023-06-05 07:58:47 -04:00
Jason Francis 6a172090aa win32: Invalidate inactive monitors
Without this, there are still GdkMonitors present for displays that are
present but disconnected (such as when a laptop disables the internal
display to connect to an external monitor).
2023-06-05 07:58:25 -04:00
Benjamin Otte 36b4903e0c glx: Implement support for EXT_swap_control
XWayland (at least on gnome-shell) does not support SGI_swap_control,
which we were using to unset the swap interval.

It does support EXT_swap_control though, which is the more modern
version of the same thing, so this commit adds support for that.

And now GDK_DEBUG=no-vsync gives me >1000fps instead of just 60fps,
2023-06-05 07:58:12 -04:00
José Expósito 2092d21bad gtkeventcontrollerscroll: Send lores scroll in the middle of the detent
Some mice send a value slightly lower than 120 for some detents. The
current approach waits until a value of 120 is reached before sending a
low-resolution scroll event.

For example, the MX Master 3 sends a value of 112 in some detents:

              detent                   detent
    |                        |                       |
                        ^    ^                    ^
                        112  REL_WHEEL            224

As illustrated, only one event was sent but two were expected. However,
sending the low-resolution scroll event in the middle plus the existing
heuristics to reset the accumulator solve this issue:

              detent                   detent
    |                        |                       |
                ^          ^             ^          ^
                REL_WHEEL  112           REL_WHEEL  224

Send low-resolution scroll events in the middle of the detent to solve
this problem.

Related to https://gitlab.gnome.org/GNOME/mutter/-/issues/2469
2023-06-05 07:57:52 -04:00
Daniel Boles 23c044d060 MenuButton: Fix small grammar-o/match related syms 2023-06-05 07:57:33 -04:00
Matthias Clasen 9de18be775 menus: Avoid unnecessary right padding
We are using placeholders in the 'check' column
that are put in a size group, so that they all
take the same space once a check or radio is shown.

Unfortunately, for the inline-buttons option, we
were using a GtkBuiltinIcon as placeholder, and those
respect the -gtk-icon-size CSS property and take
a minimum size of 16px. Use a GtkGizmo instead to
get the expected result of no extra padding unless
there's a check or radio.

Fixes: #5839
2023-06-05 07:57:21 -04:00
Khalid Abu Shawarib 10c62d9e72 gtk/recentmanager: Fix date leak 2023-06-05 07:57:07 -04:00
Arjan Molenaar dc82959ac1 Fix typo in CSS docs 2023-06-05 07:56:40 -04:00
Calvin Walton e435d8b93c filelauncher: Use ShowItems to show in File Manager
The non-portal fallback method for launching a file manager to show the
file in its parent directory was incorrectly using the `ShowFolders`
method (open a folder) instead of `ShowItems` (open the parent directory
and show the file).

The `show_item` function (previously `show_folder`) had an unused
`callback` parameter; it has been removed and the type of the parameter
containing the GTask has been renamed and now uses the correct type
instead of gpointer to reduce the amount of casting required.

Fixes GNOME/gtk#5842
2023-06-05 07:56:23 -04:00
Matthias Clasen 97ac0a4587 roaring: Mark a variable as unused
Otherwise clang complains.
2023-06-05 07:55:38 -04:00
Fina Wilke a8ec2d6b9e scrolledwindow: Propagate child measure size whenever possible
In height-for-width and hscrollbar-policy = never, we can provide
the child with a proper for_size when measuring it. The same is true for
width-for-height and vscrollbar-policy = never.

This allows for accurately measuring the size of eg. wrapping labels.
2023-06-05 07:55:20 -04:00
Matthias Clasen e8869391bb gsk: Fix a crash
When we start ignoring batches, we must do it everywhere,
or we may run into assertions. This was triggered by an
enormous text node tree produced by tests/rendernode-create.
2023-06-05 07:53:31 -04:00
Benjamin Otte b902838344 node-editor: Print default renderer in title
If there is a value passed to GSK_RENDERER, display it in the window
title.

This is mostly so that when I show off screenshots, people know what
renderer I'm using.
2023-06-05 07:52:43 -04:00
Benjamin Otte 830d28df90 rendernode: clip when drawing shadows
Ensures the shadow stays small.
2023-06-05 07:52:27 -04:00
Benjamin Otte 41696b0c57 css: Remove crashy resource:// optimization
Using gdk_texture_new_from_resource() is not valid here because we are
not sure if the given resource is valid.

Plus, the previous optimization is no longer relevant, because we are
not using gdk_pixbuf_new_from_resource() anymore - which was what this
optimization was about before it was ported to GdkTexture.

Test attached.
2023-06-05 07:52:05 -04:00
Benjamin Otte 49d06736a5 gdk: Clamp frame region to surface size
The region may be larger than the surface's size, but many rendering
APIs require the size to be clamped.

Fixes #5812
2023-06-05 07:51:30 -04:00
Matthias Clasen b4acfc890b Fix a few bugs in GtkPropertyLookupListModel
Fix bugs in property types.
2023-06-05 07:51:09 -04:00
Corey Berla 51140f2b3a filesystemmodel: Ignore changes on the parent directory
The filesystemmodel tracks changes and additions to child files
through G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED.  This event will also
occur if the parent directory is changed.  Since the parent directory
doesn't exist in the model, it creates a non-existent item.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4233
2023-06-05 07:50:34 -04:00
Corey Berla 999f503eec filechooserwidget: Stop leaking file system models 2023-06-05 07:50:25 -04:00
FeRD (Frank Dana) 7ef7dee97e doc/actions: Fix end-of-file :
The actions document ended with a : where there used to be a period,
seemingly a bug in the conversion from XML. Replace that : with a
period, and remove another spurious : inserted during the conversion.
2023-06-05 07:49:25 -04:00
FeRD (Frank Dana) e67bfe453e docs/input: <kbd>␣</kbd> => <kbd>Space</kbd>
- Switch to semantic newlines, where adding <kbd> caused wrapped text
  to grow wider than 80 characters on some lines.
2023-06-05 07:49:17 -04:00
FeRD (Frank Dana) 630392c18f docs/input-handling: A few more <kbd> wrappings
- Format a few missed keypresses/combos using <kbd>
- Switch to semantic newlines for those (paragraphs, bullet points)
2023-06-05 07:49:09 -04:00
FeRD (Frank Dana) 39475ead3b docs/input-handling: Don't leave reader hanging
Strangely, the document's last sentence ended with a colon,
giving the impression there's missing text that should follow.
There is not.

Even more strange, it's _always_ ended with a colon,
ever since the file was converted from XML
(in commit 10cd539104).

BUT, the XML file it was converted _from_ ended that same sentence
with a period! I have no idea where the colon came from.
2023-06-05 07:48:43 -04:00
Matthias Clasen 84b5209e0c Add a README to examples/hello
Just so nobody wonders why there's a meson.build
in this subdirectory.
2023-06-05 07:48:26 -04:00
Daniel Boles b1fe1c3417 Widget: Fix doubled word need, missing possessives 2023-06-05 07:48:04 -04:00
Matthias Clasen 062f9aa0eb popover: Stop making assumptions about corners
The popover tail drawing code was just assuming that
the corner values are numbers. Which they won't, anymore.
2023-06-05 07:47:45 -04:00
Matthias Clasen 14ec1e3388 css: Fix initial rotate transform value 2023-06-05 07:47:21 -04:00
Matthias Clasen 97f889d96c css: Make some corner values static
Provide static value for uniform corners
with lengths from 0 to 8px. This covers
the majority of corners in widget-factory.
2023-06-05 07:47:11 -04:00
Matthias Clasen 3a88cbd9b9 css: More static length values
Make all length values from 0px to 8px available
as static values. This will help with cutting
down on the number of corner values (we have a
lot of 5px corners).
2023-06-05 07:46:59 -04:00
Matthias Clasen a1c7935d9d Revert "csscornervalue: Accept other values if x == y"
This reverts commit 1f2f2777e1.

It broke transitioning of corner values.
2023-06-05 07:46:47 -04:00
Matthias Clasen 17da269a5f css: Correct initial shadow filter values
This was using numbers instead of lengths,
causing confusion in the transition code.
2023-06-05 07:46:32 -04:00
Matthias Clasen db5286d670 css: Fix transition of font features
If we store ints as values, we better use
g_hash_table_lookup_extended, or zeros will
show up as missing values.
2023-06-05 07:46:20 -04:00
Maximiliano Sandoval R 3f04251224 mediacontrols: Set valign=center on volume button
To match the play button.
2023-06-05 07:46:09 -04:00
Daniel Boles 17c5297aef Overlay: Add minimal doc blurb for property :child 2023-06-05 07:46:03 -04:00
Matthias Clasen b88b4919be urilauncher: Validate the uri
We don't want to send nonsense to the portal.

Fixes: #5829
2023-06-05 07:45:25 -04:00
Matthias Clasen bb3a6214cb tests: Stop copying the tool tests
No point in doing that, and the meson feature
we are using here is deprecated.
2023-06-05 07:44:08 -04:00
Aurimas Černius c403656620 Update Lithuanian translation 2023-06-04 20:32:14 +00:00
Matthias Clasen faa700e3a4 Merge branch 'backport_gtkstack_crash' into 'gtk-4-10'
Backport the fix from #6031

See merge request GNOME/gtk!6036
2023-05-30 10:24:10 +00:00
Lukáš Tyrychtr 35e813c814 GtkStack: Fix a potential crash in gtk_stack_get_first_accessible_child
This one can occur when the stack has no pages.
2023-05-30 10:45:15 +02:00
Matthias Clasen dc306aec28 Merge branch 'cherry-pick-099955b0' into 'gtk-4-10'
cherry-picking "gridview: Add border-spacing where it was missed"

See merge request GNOME/gtk!6029
2023-05-29 00:14:36 +00:00
Benjamin Otte 915dd6583a gridview: Add border-spacing where it was missed
We were computing column widths without taking border-spacing into
account, making them slightly too big.


(cherry picked from commit 099955b0c0)
2023-05-28 15:13:39 -04:00
Asier Sarasua Garmendia a6931a66c5 Update Basque translation 2023-05-18 16:30:55 +00:00
Jordi Mas c163f74d99 Update Catalan translation 2023-05-12 19:42:11 +02:00
Guillaume Bernard cfa3f25934 Update French translation 2023-05-12 13:13:03 +00:00
Matthias Clasen 38f9803f45 Merge branch 'cherry-pick-29e71868' into 'gtk-4-10'
treelistmodel: Be safer during collapsing

See merge request GNOME/gtk!5918
2023-05-05 03:52:53 +00:00
Benjamin Otte 541de3451c Merge branch 'wip/otte/treelistmodel-madness' into 'main'
treelistmodel: Be safer during collapsing

See merge request GNOME/gtk!5875

(cherry picked from commit 29e7186829)

8766a6fa treelistmodel: Be safer during collapsing
3c76f3fb treelistmodel: Delay notifies from TreeListRow
2023-05-04 21:45:06 -04:00
Matthias Clasen b41af7b983 Merge branch 'wip/carlosg/invalidate-surface-x11-4-10' into 'gtk-4-10'
gdk/x11: Invalidate whole surface after size change (4.10)

See merge request GNOME/gtk!5916
2023-05-04 19:22:13 +00:00
Carlos Garnacho b686ce1cb6 gdk/x11: Invalidate whole surface after size change
The Expose events following a ConfigureNotify may arrive at
a time that we did not resize the surface yet, making these
expose events a no-op. Even though gsk/gtk take care of the
window content itself, this might lead to unrendered portions
of the window shadow.

This may be seen with GSK_RENDERER=cairo and GDK_BACKEND=x11,
attempting to tile a window (e.g. gtk4-demo) left or right.
The window will show black rectangles or other artifacts in
the window shadow areas that correspond to the newly painted
portions (as the window needs to expand vertically).

In order to fix this with a similar behavior to Wayland,
consider ourselves the whole surface invalidated after resize,
in order to ensure everything is painted from scratch.

(cherry-picked from commit 24302315fb)
2023-05-04 19:03:58 +02:00
Danial Behzadi 954011ef80 Update Persian translation 2023-05-03 09:00:53 +00:00
Matthias Clasen 3fe1fb4930 Merge branch 'backport-css-fix-to-gtk-4-10' into 'gtk-4-10'
Backport "css: Don't transition to currentColor" to gtk-4-10

See merge request GNOME/gtk!5911
2023-05-02 22:21:09 +00:00
Benjamin Otte 966a23503a css: Don't transition to currentColor
Transition to the color that is in use instead.

Fixes crashes because currentColor is not an RGBA color and
therefor could not be queried later.

Fixes #5798
2023-05-02 21:18:52 +02:00
Boyuan Yang d2490c30b1 Update Chinese (China) translation 2023-04-28 18:46:49 +00:00
Kukuh Syafaat ada4272aa9 Update Indonesian translation 2023-04-28 05:33:27 +00:00
Matthias Clasen 4a187d7f1d Merge branch 'cherry-pick-c5a53f23' into 'gtk-4-10'
Merge branch 'wip/otte/trelistmodel-fixage' into 'main'

See merge request GNOME/gtk!5873
2023-04-27 08:57:59 +00:00
Matthias Clasen 4f47683710 Merge branch 'wip/otte/trelistmodel-fixage' into 'main'
treelistmodel: Don't add items in reverse

Closes #5707

See merge request GNOME/gtk!5744

(cherry picked from commit c5a53f235a)

1718db14 treelistmodel: Don't add items in reverse
cd860beb Add a test for splicing treelistmodel
2023-04-26 10:31:58 -04:00
Fran Dieguez 7470bc01f2 Update Galician translation 2023-04-25 23:22:20 +00:00
Sabri Ünal e2784e81cc Update Turkish translation 2023-04-23 21:12:30 +00:00
Anders Jonsson 5a110c1bdd Update Swedish translation 2023-04-23 09:58:47 +00:00
Yuri Chornoivan 003a9c7e07 Update Ukrainian translation 2023-04-22 18:19:13 +00:00
Aleksandr Melman 68fe4fb0a8 Update Russian translation 2023-04-22 12:20:35 +00:00
Matthias Clasen 80f74a8e37 Post-release version bump 2023-04-22 12:38:20 +02:00
Matthias Clasen 06b3ced8e7 4.10.3 2023-04-22 12:33:35 +02:00
Matthias Clasen 3730fd4632 Merge branch 'cherry-pick-0ce6bc67' into 'gtk-4-10'
filesystemmodel: Emit items-changed when modifying attributes

See merge request GNOME/gtk!5860
2023-04-22 10:19:35 +00:00
Piotr Drąg be2b12f904 Update Polish translation 2023-04-22 11:16:08 +02:00
Martin b351c10dae Update Slovenian translation 2023-04-22 07:35:34 +00:00
Matthias Clasen 30f2bf9761 Merge branch 'fix-popover-positioning-4-10' into 'gtk-4-10'
popover: Fix positioning

See merge request GNOME/gtk!5859
2023-04-22 06:59:59 +00:00
Olivier Crête 2a0d111505 filesystemmodel: Emit items-changed when modifying attributes
(cherry picked from commit 0ce6bc677e)
2023-04-22 02:44:10 -04:00
Matthias Clasen 3bba2dbb9d popover: Fix positioning 2023-04-22 08:39:43 +02:00
Hugo Carvalho 5bc3284dd8 Update Portuguese translation 2023-04-21 14:30:47 +00:00
Matthias Clasen 5377bd0422 Post-release version bump 2023-04-21 16:28:00 +02:00
Matthias Clasen 3b24fc7a07 4.10.2 2023-04-21 16:23:22 +02:00
Matthias Clasen 0bf8a39177 Move some nonworking reftests to xfail
A few of the inscription reftests have been failing since 4.10.1.
Move them to xfail until somebody shows up to fix them.
2023-04-21 16:23:22 +02:00
Ekaterine Papava 7a4b3faec6 Update Georgian translation 2023-04-21 13:53:46 +00:00
Matthias Clasen f0f1228982 Merge branch 'backports-for-4-10' into 'gtk-4-10'
Accumulated backports for 4.10

This branch has my cherry-picks from main since we branched after 4.10.1.
Two inscription reftests are failing, but they were also failing before.

See merge request GNOME/gtk!5856
2023-04-21 07:58:08 +00:00
Marc-André Lureau b03f21193b gdk/win32: drop some unused variables
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-04-21 09:29:12 +02:00
Marc-André Lureau 4e305e215b gdk: drop libangle GLES minimum version
GLES 2.0 version is fine now with current gtk according to B. Otte.
Let's use the same minimum requirement for all implementations.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-04-21 09:28:59 +02:00
Marc-André Lureau 3f29f65396 gdk: use GLES when on win32/ANGLE
When using GDK_DEBUG=gl-egl, we end up using GL, but that is not well supported:

Creating EGL context version 3.0 (debug:no, forward:no, legacy:yes, es:no)
Created EGL context[0000000000000004]
OpenGL version: 0.0 (legacy)
* GLSL version: (NULL)
* Max texture size: -1059701680
* Extensions checked:
 - GL_KHR_debug: no
 - GL_EXT_unpack_subimage: yes
 - OES_vertex_half_float: no

** (gtk4-demo.exe:14324): WARNING **: 19:16:41.468: Compile failure in
vertex shader:
ERROR: 0:7: 'gl_Position' : undeclared identifier
---8<---

Use GLES when EGL implementation is ANGLE.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-04-21 09:28:51 +02:00
Marc-André Lureau d55d3fc3fe gdk: drop unused vertex_array_object
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-04-21 09:28:40 +02:00
Benjamin Otte fe9096a959 glrenderer: Don't try to use float framebuffers on GLES2
GLES doesn't know what that is.
2023-04-21 09:27:33 +02:00
Matthias Clasen 91ca51222a testsuite: Skip focus tests when necessary
If our window does not get focus, we can't reliably
test things that depend on widgets being focused.
2023-04-21 09:27:08 +02:00
Matthias Clasen f0560c8cdb Try harder to fix focus tests
The focus test now asserts that its window is active.
So we should not run them in parallel with other tests,
since those might steal the focus.
2023-04-21 09:26:59 +02:00
Benjamin Otte 8178465c1a testsuite: Fix broken test to not unref surfaces twice
The test doesn't hold 2 references, it holds only one.

The reason one unref can cause a leak is that some backends - like X11 -
only destroy the surface once the DestroyNotify event from the X server
has come in.
2023-04-21 09:26:46 +02:00
Benjamin Otte 555c7e9ee2 wayland: Don't leak all surfaces
X11 does add an extra reference to surfaces that gets released when the
DestroyNotify event arrives.
Wayland doesn't ave such an event, so that reference never gets
released.

This fixes a copy/paste error introduced in commit 590f3dfa1f.
2023-04-21 09:26:23 +02:00
Benjamin Otte 79d8220908 wayland: Don't insta-crash when a surface gets disposed
We want to remove the event queue from the list of event queues, not the
surface.
Otherwise the freed queue stays in the list and the next time an event
comes in, we access invalid memory.

Fixes thinko introduced in commit 7fafa5133b.

Luckily, we leak all surfaces, so this problem never occured.
2023-04-21 09:23:26 +02:00
Matthias Clasen 7417d30a1f testsuite: Actually wait for focus
We were failing to properly iterate the main
context here. Oops.
2023-04-21 09:23:02 +02:00
Matthias Clasen f492e37354 tests: Check is-focus instead of has-focus
We are not presenting windows here.
2023-04-21 09:22:56 +02:00
Matthias Clasen 22ff7bceff text: Fix fallout from focus changes
We don't get proper notification for when the toplevel
is-active property changes, so monitor has-focus, and
update cursor blinking.
2023-04-21 09:22:42 +02:00
Cam Cook 116324e21c | method | current | suggestion |
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------|----------------------------------------------------------------------|
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3242) | "use`pango_layout_get_attribute (gtk_label_get_layout (self))`" | "use`pango_layout_get_attributes (gtk_label_get_layout (self))`" [1] |
| [set_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5897)     | "(attributes org.gtk.Method.get_property=yalign)"               | "(attributes org.gtk.Method.set_property=yalign)"                    |
| [get_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5923)     | "(attributes org.gtk.Method.set_property=yalign)"               | "(attributes org.gtk.Method.get_property=yalign)"                    |
| [set_ellipsize](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3892)  | "to ellipsizei"                                                 | "to ellipsize"                                                       |
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3239) | "from the labels markup"                                        | "from the label's markup"                                            |

[1] https://docs.gtk.org/Pango/method.Layout.get_attributes.html
2023-04-21 09:22:29 +02:00
Cam Cook f9810d76ae | method | current | suggestion |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------|-----------------------------------------------------------|
| [Entry/set_invisible_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2101) | "(attributes org.gtk.Method.sets_property=invisible-char)" | "(attributes org.gtk.Method.set_property=invisible-char)" |
| [FlowBox::activate](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkflowbox.c#L541)       | "This can be happen either by"                             | "This can happen either by"                               |
2023-04-21 09:22:14 +02:00
Benjamin Otte 8b8f493bba gles: Don't use vertex array objects
They're not needed and GLES doesn't technically support them, even
though GTK had been using them via epoxy sneakily using the
GL_OES_vertex_array_object extension behind our back.
2023-04-21 09:21:10 +02:00
Matthias Clasen 2634e2b74b text: Only claim primary when focused
It does not make sense otherwise, and has unfortunate
side-effects on Wayland.
2023-04-21 09:20:58 +02:00
Matthias Clasen 56503cd623 wayland: Improve logging for primary selection 2023-04-21 09:20:53 +02:00
Matthias Clasen 47070e5663 window: Don't mark widget prematurely as has-focus
has-focus is defined is-focus && toplevel::is-active.
We were forgetting to look at is_active when handling
focus widget changes.
2023-04-21 09:20:44 +02:00
Marco Trevisan (Treviño) 8c1e61d54c gtk: Improve documentation on returned nodes for snapshot
Closes: #5747
2023-04-21 09:20:08 +02:00
Matthias Clasen d9fbcdb82e openuriportal: Detect if the interface isn't there
Check the portal version number before trying to use
it. Most importantly, this will detect the case where
the interface isn't supported at all, since the proxy
will report a version of 0 in that case.

Fixes: #5733
2023-04-21 09:17:39 +02:00
Alexander Mikhaylenko 439dec9a54 printunixdialog: Remove a redundant style class
.view does absolutely nothing in Default style since the whole box is
covered with a GtkNotebook which has its own background, and adds an
unwanted background onto the tab strip in Adwaita.
2023-04-21 09:17:18 +02:00
Marco Trevisan (Treviño) e63a066ced gtk/dialogs: Destroy the window promptly on finish async function
Some bindings (GJS!) could add temporary references to the GAsyncResult
argument that we return, and thus to the GTask, which may cause the
dialog not to close when the finish function is called (but at garbage
collection instead!).

To prevent this, just manually destroy the window (by removing the task
data), so that we are not bound to the GTask lifetime anymore.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5741
2023-04-21 09:17:07 +02:00
Matthias Clasen f66b6e5059 filechooserentry: Plug a memory leak 2023-04-21 09:16:51 +02:00
Matthias Clasen ca12226e7c filechooserentry: Make filtering work again
We need to look at the filchooser::filtered-out
attribute to know which files the filesystem model
has filtered away.

Fixes: #5743
2023-04-21 09:16:45 +02:00
Carlos Garnacho 2ac3d0a59d textview: Reset press counter if double/triple clicking on a different line
If we click close enough between lines, and with the maximum distances applied
by GtkGestureClick we could jump between lines when handling double/triple
click for word/line selection.

Ensure that the whole operation stays in the same line and reset the
gesture/counter if we do move between lines, so we start from scratch in the
new line.
2023-04-21 09:16:32 +02:00
G.Willems 353cec50c8 scalebutton: fix orientation not applied to scale 2023-04-21 09:16:21 +02:00
G.Willems d11ac6d83e scalebutton: fix CSS name in documentation 2023-04-21 09:16:14 +02:00
Matthias Clasen 51f6129578 scrolledwindow: Avoid a critical
When setting the child property to NULL, we also need
to unset auto_added_viewport, to avoid triggering a
critical when setting it again.
2023-04-21 09:15:04 +02:00
Matthias Clasen 9a10d16f69 gtk-demo: Add a keyword
Make the demo using the 'bluroverlay' come up when you type 'blur'.
2023-04-21 09:14:50 +02:00
Matthias Clasen ec9b0ec8b4 gesture stylus: Fix condition
Now that the paint demo lets us test this, it has
become apparent that this condition is wrong, and
we don't get the expected events if stylus-only is
FALSE.
2023-04-21 09:14:22 +02:00
Matthias Clasen 4e340afce0 gtk-demo: Work without stylus
In the paint demo, don't assume that the event
backlog contains pressure. It won't, if we are
working with a plain old mouse.
2023-04-21 09:14:12 +02:00
Matthias Clasen 7d634f8671 gtk-demo: Test stylus-only mode
Add a checkbutton to toggle the stylus-only
mode of GtkGestureStylus, so we can test this.
2023-04-21 09:14:06 +02:00
Matthias Clasen ada1e212f1 range: Fix a copy-paste error
This was showing up as the alpha popup in
the color editor not being positioned correctly.
2023-04-21 09:13:50 +02:00
Matthias Clasen 22cf3e9269 gestureclick: Use drag threshold for updates 2023-04-21 09:10:32 +02:00
Matthias Clasen 8415c5f375 gestureclick: Don't use threshold for touch
When determining double-clicks, don't use the distance
threshold for touch events. It is very hard to double
touch reliably within a few pixels of the same position.

Fixes: #5580
2023-04-21 09:10:18 +02:00
Carlos Garnacho 126b847fdd gtkpopover: Move GTK grabs to map/unmap
Typically, a popover gets mapped when shown and unmapped when
hidden. A situation there that breaks is where the popover gets
recursively unmapped/unrealized when its root is destroyed.

In that situation, the popover does however unmap (without being
hidden first), moving the GTK grab from show/hide to map/unmap
will handle the previous situations, plus this one.

Fixes things being unclickable if e.g. a modal dialog got a
popover popped up, then got closed via Alt-F4.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5730
2023-04-21 09:10:05 +02:00
Matthias Clasen dd6ea529f8 inspector: Redo the actions list
Make the actions list implement GtkActionObserver
for the muxer case, and make updates work.
2023-04-21 09:09:49 +02:00
Matthias Clasen 1ab1885540 inspector: Simplify the action editor
No need to listen for changes, the actions list
code will do so and tell us to update.
2023-04-21 09:09:40 +02:00
Matthias Clasen 3f1a083cfa inspector: Add ActionHolder::changed
We will use this signal to communicate
action changes to the action list widgetry.
2023-04-21 09:09:26 +02:00
Matthias Clasen c6fc895b6d inspector: Cosmetics
Make the variant editor use a checkbutton
instead of a togglebutton.
2023-04-21 09:08:35 +02:00
Matthias Clasen 18720031a3 actionmuxer: Add a precondition
This helps with debugging the inspectors action
handling.
2023-04-21 09:08:28 +02:00
Matthias Clasen 7e1a4b5b7c inspector: Be more careful
Tweak the variant-editor code to handle some
cases more explicitly.
2023-04-21 09:08:16 +02:00
Matthias Clasen 60ea127592 inspector: Plug a memory leak 2023-04-21 09:08:09 +02:00
Matthias Clasen 3287199f37 inspector: Be safer when handling actions
Those query apis are serious about not ignoring
their return value, and may not set their our
arguments to anything if they return FALSE.
2023-04-21 09:08:02 +02:00
Matthias Clasen 9be7e170b8 actionmuxer: Make the compiler warn
Warn when the boolean return isn't used, since we
may not initialize the out arguments in the FALSE
case (see the previous commits).
2023-04-21 09:07:42 +02:00
Matthias Clasen 9f50647ddb textview: Handle a return value 2023-04-21 09:07:34 +02:00
Nelson Benítez León fa4af02531 inspector: fix crash caused by uninitialized GVariant
we were not checking the return gboolean of
gtk_action_muxer_query_action() which was
returning FALSE for the crash case, meaning
it didn't set the passed in GVariant, but
we were still using it as it was non-null.

Fixes #5729
2023-04-21 09:07:21 +02:00
Maximiliano Sandoval R 2e8a32db26 mediacontrols: Add tooltip text to play button
This makes the button accessible.
2023-04-21 09:06:51 +02:00
Lukáš Tyrychtr 33fc6cc479 a11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT
By doing this, alert dialogs will be read automatically, or at least
they should be, because a screen reader know that these are special.
2023-04-21 09:04:12 +02:00
Matthias Clasen a058a382d4 expander: Fix the css docs
The docs were not matching reality since the
css node names were changed in 6d20fe0b.

Fixes: #5723
2023-04-21 09:03:36 +02:00
Matthias Clasen cad7247f2d rendernodepaintable: Preserve aspect ratio in snapshot()
This is the better fix.
2023-04-21 09:03:26 +02:00
Matthias Clasen a1ad1fc9db node-editor: Improve the scaling
We only want to scale the main rendering, not whats
shown in the sidebar. Also, make the scale logarithmic.
2023-04-21 09:03:03 +02:00
Benjamin Otte 5f0a9a60e9 tooltipwindow: Cast the correct object
the tooltipwindow is in the userdata.
2023-04-21 09:01:34 +02:00
Cam Cook fcec5a817e Documentation corrections for GtkTextIter
| method                                                                                                     | current                                                       | suggestion                                                      |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------|
| [backward_visible_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3785) | "Moves @iter forward to the previous visible cursor position" | "Moves @iter backward to the previous visible cursor position." |
| [get_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L595)                        | "Use [method@Gtk,TextBuffer.get_iter_at_offset]"              | "Use [method@Gtk.TextBuffer.get_iter_at_offset]"                |
| [starts_tag](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1201)                       | "returns %TRUE, [method@Gtk.TextIter.has_tag"                 | "returns %TRUE, [method@Gtk.TextIter.has_tag] "                 |

| method                                                                                                 | current                                             | suggestion                                                |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------|
| [backward_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3715)     | "Like gtk_text_iter_forward_cursor_position()"      | "Like [method@Gtk.TextIter.forward_cursor_position]"      |
| [backward_find_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4483)           | "Same as gtk_text_iter_forward_find_char()"         | "Same as [method@Gtk.TextIter.forward_find_char]"         |
| [backward_search](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L5295)              | "Same as gtk_text_iter_forward_search()"            | "Same as [method@Gtk.TextIter.forward_search]"            |
| [backward_sentence_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3611)     | "Calls gtk_text_iter_backward_sentence_start()"     | "Calls [method@Gtk.TextIter.backward_sentence_start]"     |
| [backward_visible_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3421) | "Calls gtk_text_iter_backward_visible_word_start()" | "Calls [method@Gtk.TextIter.backward_visible_word_start]" |
| [backward_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3345)         | "Calls gtk_text_iter_backward_word_start()"         | "Calls [method@Gtk.TextIter.backward_word_start]"         |
| [forward_sentence_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3591)        | "Calls gtk_text_iter_forward_sentence_end()"        | "Calls [method@Gtk.TextIter.forward_sentence_end]"        |
| [forward_to_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4131)               | "gtk_text_iter_get_char() called on"                | "[method@Gtk.TextIter.get_char] called on"                |
| [forward_visible_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3403)    | "Calls gtk_text_iter_forward_visible_word_end()"    | "Calls [method@Gtk.TextIter.forward_visible_word_end]"    |
| [forward_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3327)            | "Calls gtk_text_iter_forward_word_end()"            | " Calls [method@Gtk.TextIter.forward_word_end]"           |
| [is_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1664)                       | "gtk_text_iter_is_end() is the most efficient"      | "[method@Gtk.TextIter.is_end] is the most efficient"    |
| [set_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3900)               | "Same as gtk_text_iter_set_line_offset()"           | "Same as [method@Gtk.TextIter.set_line_offset]"         |
| [set_visible_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3987)       | "Like gtk_text_iter_set_line_index()"               | "Like [method@Gtk.TextIter.set_line_index]"             |
| [set_visible_line_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3946)      | "Like gtk_text_iter_set_line_offset()"              | "Like [method@Gtk.TextIter.set_line_offset]"            |
2023-04-21 09:01:02 +02:00
Cam Cook 9782158a9e Documentation corrections for GtkTextIter
| method                                                                                                     | current                                                       | suggestion                                                      |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------|
| [backward_visible_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3785) | "Moves @iter forward to the previous visible cursor position" | "Moves @iter backward to the previous visible cursor position." |
| [get_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L595)                        | "Use [method@Gtk,TextBuffer.get_iter_at_offset]"              | "Use [method@Gtk.TextBuffer.get_iter_at_offset]"                |
| [starts_tag](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1201)                       | "returns %TRUE, [method@Gtk.TextIter.has_tag"                 | "returns %TRUE, [method@Gtk.TextIter.has_tag] "                 |

| method                                                                                                 | current                                             | suggestion                                                |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------|
| [backward_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3715)     | "Like gtk_text_iter_forward_cursor_position()"      | "Like [method@Gtk.TextIter.forward_cursor_position]"      |
| [backward_find_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4483)           | "Same as gtk_text_iter_forward_find_char()"         | "Same as [method@Gtk.TextIter.forward_find_char]"         |
| [backward_search](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L5295)              | "Same as gtk_text_iter_forward_search()"            | "Same as [method@Gtk.TextIter.forward_search]"            |
| [backward_sentence_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3611)     | "Calls gtk_text_iter_backward_sentence_start()"     | "Calls [method@Gtk.TextIter.backward_sentence_start]"     |
| [backward_visible_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3421) | "Calls gtk_text_iter_backward_visible_word_start()" | "Calls [method@Gtk.TextIter.backward_visible_word_start]" |
| [backward_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3345)         | "Calls gtk_text_iter_backward_word_start()"         | "Calls [method@Gtk.TextIter.backward_word_start]"         |
| [forward_sentence_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3591)        | "Calls gtk_text_iter_forward_sentence_end()"        | "Calls [method@Gtk.TextIter.forward_sentence_end]"        |
| [forward_to_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4131)               | "gtk_text_iter_get_char() called on"                | "[method@Gtk.TextIter.get_char] called on"                |
| [forward_visible_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3403)    | "Calls gtk_text_iter_forward_visible_word_end()"    | "Calls [method@Gtk.TextIter.forward_visible_word_end]"    |
| [forward_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3327)            | "Calls gtk_text_iter_forward_word_end()"            | " Calls [method@Gtk.TextIter.forward_word_end]"           |
| [is_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1664)                       | "gtk_text_iter_is_end() is the most efficient"      | "[method@Gtk.TextBuffer.is_end] is the most efficient"    |
| [set_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3900)               | "Same as gtk_text_iter_set_line_offset()"           | "Same as [method@Gtk.TextBuffer.set_line_offset]"         |
| [set_visible_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3987)       | "Like gtk_text_iter_set_line_index()"               | "Like [method@Gtk.TextBuffer.set_line_index]"             |
| [set_visible_line_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3946)      | "Like gtk_text_iter_set_line_offset()"              | "Like [method@Gtk.TextBuffer.set_line_offset]"            |
2023-04-21 09:00:47 +02:00
Matthias Clasen 67310c8753 inspector: Update some misc info rows 2023-04-21 08:59:19 +02:00
Georges Basile Stavracas Neto e09a5bc2dd gsk/gl/renderjob: Decompose matrix for 3D transforms
While this can be more expensive, it's also correct.
2023-04-21 08:58:17 +02:00
Matthias Clasen a14ac90229 inspector: Improve display of paths
The values in the path section are long and generally
ellipsized. It does not make sense to reserve extra
space that the labels don't need.
2023-04-21 08:57:12 +02:00
Bilal Elmoussaoui 67d8b4c976 docs: Improve GtkLabel rendering
By adding some missing links & avoid the browser
from rendering the entities as their equivalent symbols
2023-04-21 08:56:28 +02:00
Matthias Clasen 6a566648d2 listitem: Fix a notification problem
We were notifying ::item when ::child is
changed. Oops
2023-04-21 08:48:57 +02:00
Lukáš Tyrychtr 1b07d02671 a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows
According to the at-spi2 docs, for a widget to be considered visible,
it needs both the showing and visible states. Many applications rely on that,
for example the flat review functionality of Orca.

this fixes #5194
2023-04-21 08:48:04 +02:00
Emmanuele Bassi 47e90f1de6 Remove wrong annotation for GdkToplevel::compute-size
The size argument is passed to the signal by the GDK surface machinery,
as is: it's not going to be allocated by the caller (since it's a
signal), and it's not an out argument.
2023-04-21 08:43:34 +02:00
Matthias Clasen 1b2ae02b26 magnifier: Correct position of area
The widget paintable uses the widgets bounds
as intrinsic size, so we need to offset from
that to the allocation, which is what the
coordinates are relative to.
2023-04-21 08:38:46 +02:00
Matthias Clasen b02ade43c3 texthandle: Correct placement of handles
Text handles had the same problem as popovers.
They were interpreting their pointing-to rectangle
relative to the widgets bounds, when it is meant
to be relative to the widgtets allocation.

While we touch this code, rewrite it to use
gtk_widget_compute_point.
2023-04-21 08:38:17 +02:00
Matthias Clasen bb48a02a77 popover: Correct placement of popovers
When we don't have a pointing-to rectangle, we want to place
the popover wrt to the parents bounds. But if we have a
pointing-to rectangle, it is relative to the widgets allocation,
which is different from the bounds.

We were not handling the second case correctly, leading to context
menus in the text view being mispositioned by the widgets CSS padding.

While we are touching this code, rewrite it to handle transforms.

Fixes: #5695
2023-04-21 08:38:12 +02:00
Matthias Clasen 4897ff0278 docs: Improve markup for keys
Consistently use <kbd>x</kbd> to render keys in the docs
and use + for key combinations.
2023-04-21 08:37:02 +02:00
Matthias Clasen 40fdf4aa9f docs: Some updates
Fix some links ot point to docs.gtk.org.
2023-04-21 08:36:54 +02:00
Marco Trevisan (Treviño) 354ceb5778 gtkwidget: Do a type-check in gtk_widget_in_destruction()
Given it can be called during a widget destruction, it's safer to do a
type-check before crashing.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1727
2023-04-21 08:34:47 +02:00
Caolán McNamara 7cf72976d9 fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
presumably since:

commit de80f503e4
Date:   Thu Feb 23 14:22:20 2023 +0100

    a11y: Introduce a dedicated role for toggle buttons
2023-04-21 08:32:22 +02:00
Benjamin Otte 243f4b0729 checkbutton: Only andle arrow focus if we're in a group
If there is no other widget in the group that we can focus, don't focus
and activate ourselves.

Otherwise the arrow keys on checkbuttons toggle the checkbutton.
2023-04-21 08:31:32 +02:00
Marco Trevisan (Treviño) b4d33c0810 theme: Use 0.5 opacity for disabled pictures
If a GtkImage is using an icon we use a gtk-icon-filter to se the icon
opacity when in insensitive state, however when using other kinds of
pictures we do not apply the same style leading to an inconsistent
result.

Closes: #5683
2023-04-21 08:31:25 +02:00
Matthias Clasen 24f615cad1 gsk: Use explicit switches
This makes it harder to forget to add new
node types here.
2023-04-21 08:23:26 +02:00
Matthias Clasen 370b72c674 gsk: Mask nodes support 2d transforms
When adding mask nodes, I overlooked that
we have two separate functions for determining
what transforms a node supports without offlines.

Since we claim that mask nodes support general
transform, they must certainly support 2d transforms
as well.
2023-04-21 08:22:51 +02:00
Matthias Clasen 806639d974 Stop binding textdomain for -properties
We don't have these translations anymore.
2023-04-21 08:22:06 +02:00
Matthias Clasen 9ca65eb787 gtk-demo: Reset properties when the image changes 2023-04-21 08:20:44 +02:00
Matthias Clasen ee22a3ea36 broadway: Don't cause traffic when disconnecting
The recently added transient-for support was causing
roundtrips when a client with transients disconnects,
leading to assertion failures. Avoid that.
2023-04-21 08:19:17 +02:00
Matthias Clasen dd8bd8ad15 docs: Update broadway docs
Using Broadway without broadwayd hasn't worked since 2013...

Fixes: #5662
2023-04-21 08:19:06 +02:00
Benjamin Otte 53655c1041 gldriver: Quick workaround for filter mismatch
We should really use texture views or samplers to handle this case for
shared textures, but this at least makes NEAREST not break.
2023-04-21 08:18:47 +02:00
Matthias Clasen 28e56d0dde label: Use GtkFileLauncher for file URI
The GtkUriLauncher calls into the openuri portal, which distinguishes
between files, directories, and URI. The GtkFileLauncher contains logic
to deal with this, because it can already handle the file and folder
differences.

If we have a file:// URI it's easier to create a GFile out of it, and
use the GtkFileLauncher API, while leaving the GtkUriLauncher API for
every other URI scheme.

Same fix as de3c1d0c73, for GtkLabel.

Fixes: #5671
2023-04-21 08:17:35 +02:00
Emmanuele Bassi 6a797f6b1a linkbutton: Use GtkFileLauncher for file URI
The GtkUriLauncher calls into the openuri portal, which distinguishes
between files, directories, and URI. The GtkFileLauncher contains logic
to deal with this, because it can already handle the file and folder
differences.

If we have a file:// URI it's easier to create a GFile out of it, and
use the GtkFileLauncher API, while leaving the GtkUriLauncher API for
every other URI scheme.

Fixes: #5671
2023-04-21 08:16:55 +02:00
Alexander Mikhaylenko 6b5baefd75 theme: Port .boxed-list style from libadwaita
Consistently use it for boxed lists in inspector and gtk-demo.

Fixes issues like https://gitlab.gnome.org/GNOME/gtk/-/issues/3145
2023-04-21 08:15:19 +02:00
Matthias Clasen a6010b40f2 Merge branch 'fix-410-tests' into 'gtk-4-10'
testsuite: Fix broken test

See merge request GNOME/gtk!5855
2023-04-21 05:55:14 +00:00
Matthias Clasen 80c765b54d Merge branch 'cherry-pick-03b71a97' into 'gtk-4-10'
Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5854
2023-04-21 05:42:51 +00:00
Benjamin Otte 1b872743bc testsuite: Fix broken test
The test was referencing a nonexisting image.

Plus, node parsing cannot reference relative URLs.
2023-04-21 07:37:53 +02:00
Benjamin Otte 3e26418dfe Merge branch 'wip/otte/for-main' into 'main'
testsuite: Be less verbose in accessor-apis test

Closes #5763

See merge request GNOME/gtk!5851

(cherry picked from commit 03b71a9759)

be5f2250 testsuite: Be less verbose in accessor-apis test
39583e40 testsuite: Allow accessors in interfaces
e47c0760 adjustment: Split out a function
75c47755 adjustment: sanity-check values when setting them
f393f70e listbase: Don't warn on scroll in empty list
2023-04-21 00:48:27 -04:00
Sabri Ünal 78931915e4 Update Turkish translation 2023-04-19 12:59:55 +00:00
Matthias Clasen 15a62434f4 Merge branch 'cherry-pick-faac2f78' into 'gtk-4-10'
filesystemmodel: Notify correct position removed in remove_file()

See merge request GNOME/gtk!5816
2023-04-11 06:02:23 +00:00
Corey Berla e041f7bf71 filesystemmodel: Notify correct position removed in remove_file()
32247bc50e made several changes to account for the
fact that we no longer have a NULL editable at the beginning of the list
model.  The commit mistakenly left out one change in remove_file(),
which causes the wrong file to be removed.


(cherry picked from commit faac2f7894)
2023-04-11 01:28:45 -04:00
Alexander Shopov f15aa82eaf Update Bulgarian translation 2023-04-07 16:26:55 +00:00
Matthias Clasen 625219508b Merge branch 'cherry-pick-515f39f1' into 'gtk-4-10'
Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5760
2023-04-01 12:48:49 +00:00
Matthias Clasen 520b25e96c Merge branch 'cherry-picks-for-4-10' into 'gtk-4-10'
scrolledwindow: Disconnect the right handler

See merge request GNOME/gtk!5762
2023-04-01 01:23:44 +00:00
Benjamin Otte f00b29f2c6 rendernodeparser: Emit error when failing to resolve URL 2023-03-31 20:26:19 -04:00
Benjamin Otte 5c20cb08dc rendernodeparser: Failing to parse a string is an error
Testcase included.
2023-03-31 20:26:12 -04:00
Matthias Clasen 5d8bf6d9ca wayland: Comply with protocol requirements
If you send a bad anchor rect to mutter, it crashes.
Thats not great, so lets not do that.
2023-03-31 20:25:51 -04:00
Matthias Clasen ea6f176055 gdk: Avoid a pointless indirection
Don't use g_fprintf if GLib is using system printf
anyway.
2023-03-31 20:23:42 -04:00
Matthias Clasen eec1298aa1 Improve an error message
We were producing a misleading error message
when gtk_init() fails.

Fixes: #5704
2023-03-31 20:23:27 -04:00
Matthias Clasen 61536ea1a7 gdk: Improve logging for backends
Log more when trying backends.
2023-03-31 20:22:11 -04:00
Benjamin Otte 340ab6c20f enums: Move G_END_DECLS to the end of the file 2023-03-31 20:21:51 -04:00
Bilal Elmoussaoui 2229ff6807 docs: Fix various broken links 2023-03-31 20:21:36 -04:00
Jonas Ådahl 7bc18a125f wayland/popup: Handle late received reposition feedback
If we map, reposition, unmap, remap, the reposition feedback from the
last time a popup was mapped might be received while we're dealing with
the new version of the popup. At this point, the old reposition token
has no meating, so lets drop it. Also reset the reposition tokens when
creating new protocol objects, so that the reposition token are as if
we're in the initial state.

This fixes an issue where we'd get stuck if repeatedly smashing a button
that'd create popups that'd immediately get dismissed by the compositor.
2023-03-31 20:21:28 -04:00
Ludovico de Nittis 5303bbf66a wayland: Try to open the display even if XDG_RUNTIME_DIR is unset
Since Wayland 1.15, it is now possible to use absolute paths in
"WAYLAND_DISPLAY".
In that scenario, having a valid "XDG_RUNTIME_DIR" is not a requirement
anymore.

For this reason we remove the "XDG_RUNTIME_DIR" check and we let
`wl_display_connect()` decide if our environment is correct.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2023-03-31 20:21:02 -04:00
Benjamin Otte c2f432b6df magnifier: Don't check for visibility
gtk_widget_queue_draw() already does that.
2023-03-31 20:20:41 -04:00
Matthias Clasen e0a48a215f scrolledwindow: Disconnect the right handler
We connect gtk_scrolled_window_update_use_indicators
as signal handler in realize(), but we were disconnecting
gtk_scrolled_window_sync_use_indicators in unrealize.

Spotted by Milan Crha.

Fixes: #5684
2023-03-31 20:20:12 -04:00
Benjamin Otte 1be7a1f18f Merge branch 'wip/otte/for-main' into 'main'
various fixes

See merge request GNOME/gtk!5756

(cherry picked from commit 515f39f161)

6f417534 widget: Shortcut widget not repositioning
dbff49b5 listbase: Clear any newly set adjustments
2023-03-31 17:56:21 -04:00
Alexander Shopov 3458ebf8c9 Update Bulgarian translation 2023-03-31 10:04:26 +00:00
Марко Костић 1bd53839c6 Update Serbian translation 2023-03-29 11:28:23 +00:00
Matthias Clasen 427f65bac4 Merge branch 'cherry-pick-3a5282ab' into 'gtk-4-10'
wayland: Don't crash without xdg_activation_v1

See merge request GNOME/gtk!5742
2023-03-29 01:08:16 +00:00
Matthias Clasen 78bdfe9db9 wayland: Don't crash without xdg_activation_v1
If the compositor does not support this protocol,
we can't use it.

Fixes: #5701


(cherry picked from commit 3a5282abe1)
2023-03-28 20:39:04 -04:00
Boyuan Yang 76c6a55206 Update Chinese (China) translation 2023-03-28 15:14:10 +00:00
Guillaume Bernard 3fc6acf638 Update French translation 2023-03-28 09:36:51 +00:00
Matthias Clasen 2b8bf0236a Merge branch 'cursor-size-fix-4-10' into 'gtk-4-10'
wayland: Don't crash on cursor size 0

See merge request GNOME/gtk!5722
2023-03-26 12:15:04 +00:00
Matthias Clasen c80d712d35 wayland: Don't crash on cursor size 0
The cursor-theme-size setting is documented as
'0 means the default size'. Make it so by using
size 24 if we see a 0. Its better than crashing.

Fixes: #5700
2023-03-25 22:01:20 -04:00
Matthias Clasen 3c5b8be62e Merge branch 'cherry-pick-d209f556' into 'gtk-4-10'
Backport !5702 (fix for #5685) into gtk-4-10

See merge request GNOME/gtk!5713
2023-03-24 16:15:11 +00:00
Chun-wei Fan 5df9d4a727 Merge branch 'alternative-fix-5685' into 'main'
GDK/Win32: Use wgl* functions directly as needed (fix #5685)

Closes #5685

See merge request GNOME/gtk!5702

(cherry picked from commit d209f55677)

627ee674 GDK-Win32: Add wrapper functions for calling core wgl* functions
b5ebe270 gtkgstsink.c: Drop workarounds needed for Windows
2023-03-24 11:38:58 -04:00
Matthias Clasen 8cefb950d0 Merge branch 'cherry-pick-7b22983b' into 'gtk-4-10'
Don't leak all AT contexts

See merge request GNOME/gtk!5703
2023-03-24 03:04:20 +00:00
Matthias Clasen 804d6cf6c9 Don't leak all AT contexts
create_at_context was confused - it stored a reference
to the newly created context in priv->context, but then
also returned a reference, and the caller stored that
in priv->context again.

Change it to only return a reference.

Fixes: #5690


(cherry picked from commit 7b22983be5)
2023-03-23 08:19:45 -04:00
Emmanuele Bassi c8bedb7d3d Merge branch 'backport_next_accessible-sibling_fix' into 'gtk-4-10'
a11y: Backport the gtk_accessible_get_next_accessible_sibling fix

See merge request GNOME/gtk!5699
2023-03-22 16:02:15 +00:00
Bruce Cowan d80cecec06 Update British English translation 2023-03-22 15:46:17 +00:00
Matthias Clasen 678e11ecb5 Merge branch 'fix_next_accessible_sibling_after_refcounts' into 'main'
a11y: Fix the logic in gtk_accessible_get_next_accessible_sibling which decided whether we will use the overridden sibling on the context.

See merge request GNOME/gtk!5659
2023-03-22 16:34:42 +01:00
Emmanuele Bassi b35898abf8 Merge branch 'cherry-pick-724ecf3b' into 'gtk-4-10'
Ensure GtkFileChooserCell's type

See merge request GNOME/gtk!5697
2023-03-22 12:33:13 +00:00
Matthias Clasen 6cddd96eb7 Merge branch 'ebassi/ensure-file-chooser-types' into 'main'
Ensure GtkFileChooserCell's type

See merge request GNOME/gtk!5696

(cherry picked from commit 724ecf3b51)

b2e8158c Ensure GtkFileChooserCell's type
2023-03-22 06:55:36 -04:00
Martin 96c47b8c6e Update Slovenian translation 2023-03-20 22:16:13 +00:00
Benjamin Otte c9987d4889 Merge branch 'cherry-pick-56b904f1-2' into 'gtk-4-10'
Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5683
2023-03-19 17:33:38 +00:00
Benjamin Otte d0648a5c6e Merge branch 'wip/otte/for-main' into 'main'
treelistmodel: Clear item in right place

Closes #5681

See merge request GNOME/gtk!5682

(cherry picked from commit 56b904f1e6)

dd1e76e6 treelistmodel: Clear item in right place
2023-03-19 13:10:24 -04:00
Benjamin Otte 04dc23d047 Merge branch 'cherry-pick-f211a217' into 'gtk-4-10'
Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5679
2023-03-19 14:37:46 +00:00
Matthias Clasen c95d677083 Merge branch 'for-4-10' into 'gtk-4-10'
[4.10] Cherry-pick "listitem: Claim sequence when handling an event"

See merge request GNOME/gtk!5680
2023-03-19 14:23:16 +00:00
Benjamin Otte d87ac9761d listitem: Claim sequence when handling an event
See my rants on IRC for why we definitely need to claim gestures by
default in GTK5.

Fixes #5669
2023-03-19 12:12:40 +00:00
Benjamin Otte ea7acdace3 Merge branch 'wip/otte/for-main' into 'main'
Fix inspector doing weird stuff

Closes #5646

See merge request GNOME/gtk!5678

(cherry picked from commit f211a2177f)

f4be5c80 cssnode: Refer the correct previous item
9048e391 treelistmodel: Cache the item
bf556850 treelistmodel: Track the item in the row
c4636852 treelistmodel: Clarify docs
2023-03-19 02:24:01 -04:00
Danial Behzadi f55cbf5643 Update Persian translation 2023-03-18 01:10:45 +00:00
Matthias Clasen a1912482ce Merge branch 'cherry-pick-565c9aed' into 'gtk-4-10'
Merge branch 'gridview-filler-tile-fix' into 'main'

See merge request GNOME/gtk!5666
2023-03-17 04:54:23 +00:00
Benjamin Otte 8d18ef4f5c Merge branch 'gridview-filler-tile-fix' into 'main'
gridview: Fix condition for adding filler tiles

See merge request GNOME/gtk!5664

(cherry picked from commit 565c9aed94)

65b6150e gridview: Fix condition for adding filler tiles
2023-03-16 19:50:28 -04:00
Benjamin Otte 9af8f92ba1 Merge branch 'cherry-pick-fbc8bfb3' into 'gtk-4-10'
Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5663
2023-03-16 21:46:28 +00:00
Benjamin Otte d31dc4343b Merge branch 'wip/otte/for-main' into 'main'
Various small fixes

Closes #5380

See merge request GNOME/gtk!5662

(cherry picked from commit fbc8bfb303)

707c63c6 win32: Fix rowstride math
ef3c515c rowstrides are gsize, not int
a0382ef4 listview: Fix culling issues when using CSS padding
2023-03-16 17:05:40 -04:00
Matthias Clasen ce651ee924 Merge branch 'drag-gl-wayland-hotspot-fix-4-10' into 'gtk-4-10'
[4.10] wayland: Reset pending offset in GL path

See merge request GNOME/gtk!5660
2023-03-16 19:48:45 +00:00
Ivan Molodetskikh 96e0c0f095 wayland: Reset pending offset in GL path
Otherwise GL surfaces that redraw without changing the hotspot have it
applied on top every frame and quickly slide away.

The cairo path and the X11 backend do not have this bug.
2023-03-16 10:54:15 -07:00
Kukuh Syafaat f548ee93a2 Update Indonesian translation 2023-03-15 12:03:47 +00:00
Changwoo Ryu a2d29d6a72 Update Korean translation 2023-03-15 10:04:10 +00:00
Aleksandr Melman 2c34a8a970 Update Russian translation 2023-03-14 21:01:53 +00:00
Martin bd181cab67 Update Slovenian translation 2023-03-14 17:19:43 +00:00
Benjamin Otte f4a7c2a7c5 Merge branch 'cherry-pick-a05b73cb' into 'gtk-4-10'
Merge branch 'wip/hadess/children-left-msg' into 'main'

See merge request GNOME/gtk!5653
2023-03-14 16:32:44 +00:00
Benjamin Otte 40bc44503a Merge branch 'wip/hadess/children-left-msg' into 'main'
gtk: Fix "children left" warning with fatal warnings

See merge request GNOME/gtk!5652

(cherry picked from commit a05b73cb05)

4f1ea18c gtk: Fix "children left" warning with fatal warnings
2023-03-14 12:32:00 -04:00
218 changed files with 37471 additions and 34980 deletions
+116 -1
View File
@@ -1,6 +1,121 @@
Overview of Changes in 4.10.2, xx-xx-xxxx
Overview of Changes in 4.10.6, xx-xx-xxxx
=========================================
Overview of Changes in 4.10.5, 05-08-2023
=========================================
* Fix ordering problems with filter model signals
* Avoid lingering resize cursors
* Fix alignment issues on sparc
* Fix a problem with CSS corner values
* Translation updates
Brazilian Portuguese
Czech
Greek
Spanish
Vietnamese
Overview of Changes in 4.10.4, 05-06-2023
=========================================
* GtkFileChooser
- Fix some memory leaks
* GtkUriLauncher
- Validate the uri
* GtkStack
- Fix a crash
* GtkGridView
- Respect css border-spacing
* GtkScrolledWindow
- Propagate child measure size whenever possible
* GtkPopoverMenu:
- Avoid unnecessary left padding
* GtkSearchEntry:
- Improve size allocation for the clear icon
* X11
- Avoid black flickering with xwayland window decorations
- Trap XRandr errors
* CSS
- Various fixes to transitions
* Translation updates:
Basque
Catalan
Chinese (China)
French
Galician
Indonesian
Lithuanian
Persian
Russian
Swedish
Turkish
Ukrainian
Overview of Changes in 4.10.3, 22-04-2023
=========================================
* Fix a popover positioning regression in 4.10.2
* Fix issues with slow loading files in the file chooser
Overview of Changes in 4.10.2, 21-04-2023
=========================================
* Fixed issues:
- Holding control to select multiple files broken in filechooser (#5669)
- Inspector crash (#5681)
- Listbase doesn't account for bottom padding in size_allocate_child (#5380)
- Leaking AT contexts (#5690)
- OpenGL / Windows: Crash when closing gtk4-widget-factory (#5685)
- GTK apps crash on startup when setting cursor-size to 0 on Wayland (#5700)
- Segmentation fault: gdk_wayland_toplevel_set_startup_id() needs to null-check
display->xdg_activation before using it (#5701)
- Possible use-after-free under gtk_scrolled_window_update_use_indicators() (#5684)
- Wrong error message in `gtk_init` (#5704)
- Segfault when scrolling after changing ListView model (#5763)
- Bluetooth panel from the Settings app: clicking in the "Downloads" link
no longer opens Nautilus (#5671)
- Broadway docs or code is broken (#5662)
- Disabled GtkPicture's are not properly themed (#5683)
- Setting CSS padding to a GtkTextView gives the context menu an offset (#5695)
- A11y: the Showing state is used only for windows (#5194)
- Gtk4 expander: CSS nodes mismatch code vs. documentation (#5723)
- Invoking gtk inspector on a folder results in a crash (#5729)
- Double tap requires very precise touch input (#5580)
- Name autocompletion dropdown in the GTK4 FileChooser's Save dialog gets
stuck, creates artifacts, jumps around (#5743)
- Links are not opened when xdg-desktop-portal OpenURI is not available (#5733)
- GtkSnapshot generates no nodes appending whitespace-only layouts (#5747)
* Translation updates
British English
Bulgarian
Chinese (China)
French
Indonesian
Korean
Russian
Serbian
Slovenian
Turkish
Overview of Changes in 4.10.1, 14-03-2023
=========================================
+7
View File
@@ -224,7 +224,14 @@ demo3_widget_set_property (GObject *object,
case PROP_TEXTURE:
g_clear_object (&self->texture);
self->texture = g_value_dup_object (value);
self->scale = 1.f;
self->angle = 0.f;
self->filter = GSK_SCALING_FILTER_LINEAR;
update_actions (self);
gtk_widget_queue_resize (GTK_WIDGET (object));
g_object_notify (object, "scale");
g_object_notify (object, "angle");
g_object_notify (object, "filter");
break;
case PROP_SCALE:
+195 -203
View File
@@ -30,90 +30,86 @@
</object>
</child>
<child>
<object class="GtkFrame">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<signal name="row-activated" handler="row_activated"/>
<style>
<class name="rich-list"/>
<class name="boxed-list"/>
</style>
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<signal name="row-activated" handler="row_activated"/>
<style>
<class name="rich-list"/>
</style>
<object class="GtkListBoxRow">
<child>
<object class="GtkListBoxRow">
<object class="GtkBox">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="switch_label">
<property name="label" translatable="yes">Switch</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="switch">
<property name="halign">end</property>
<property name="valign">center</property>
</object>
</child>
<object class="GtkLabel" id="switch_label">
<property name="label" translatable="yes">Switch</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="switch">
<property name="halign">end</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkListBoxRow">
<object class="GtkBox">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="check_label">
<property name="label" translatable="yes">Check</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="check">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="active">1</property>
</object>
</child>
<object class="GtkLabel" id="check_label">
<property name="label" translatable="yes">Check</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="check">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="active">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="GtkListBoxRow">
<object class="GtkBox">
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="image_label">
<property name="label" translatable="yes">Click here!</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="image">
<property name="icon-name">object-select-symbolic</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="opacity">0</property>
</object>
</child>
<object class="GtkLabel" id="image_label">
<property name="label" translatable="yes">Click here!</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkImage" id="image">
<property name="icon-name">object-select-symbolic</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="opacity">0</property>
</object>
</child>
</object>
@@ -134,146 +130,142 @@
</style>
</object>
</child>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list"/>
</style>
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="rich-list"/>
<class name="boxed-list"/>
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="scale_label">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">0</property>
<property name="width-request">150</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="scale_label">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">0</property>
<property name="width-request">150</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="spin_label">
<property name="label" translatable="yes">Spinbutton</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSpinButton">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="dropdown_label">
<property name="label" translatable="yes">Dropdown</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkDropDown">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="model">
<object class="GtkStringList">
<items>
<item>Choice 1</item>
<item>Choice 2</item>
<item>Choice 3</item>
<item>Choice 4</item>
</items>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="spin_label">
<property name="label" translatable="yes">Spinbutton</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkSpinButton">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="upper">100</property>
<property name="value">50</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="dropdown_label">
<property name="label" translatable="yes">Dropdown</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkDropDown">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="model">
<object class="GtkStringList">
<items>
<item>Choice 1</item>
<item>Choice 2</item>
<item>Choice 3</item>
<item>Choice 4</item>
</items>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="entry_label">
<property name="label" translatable="yes">Entry</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkEntry">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="placeholder-text">Type here…</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="entry_label">
<property name="label" translatable="yes">Entry</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkEntry">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="placeholder-text">Type here…</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
+26 -8
View File
@@ -24,6 +24,7 @@ typedef struct
GdkRGBA draw_color;
GtkPadController *pad_controller;
double brush_size;
GtkGesture *gesture;
} DrawingArea;
typedef struct
@@ -262,7 +263,7 @@ drawing_area_apply_stroke (DrawingArea *area,
double y,
double pressure)
{
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
if (tool && gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
{
cairo_set_line_width (area->cr, 10 * pressure * area->brush_size);
cairo_set_operator (area->cr, CAIRO_OPERATOR_DEST_OUT);
@@ -313,7 +314,9 @@ stylus_gesture_motion (GtkGestureStylus *gesture,
drawing_area_apply_stroke (area, tool,
backlog[i].axes[GDK_AXIS_X],
backlog[i].axes[GDK_AXIS_Y],
backlog[i].axes[GDK_AXIS_PRESSURE]);
backlog[i].flags & GDK_AXIS_FLAG_PRESSURE
? backlog[i].axes[GDK_AXIS_PRESSURE]
: 1);
}
g_free (backlog);
@@ -343,6 +346,8 @@ drawing_area_init (DrawingArea *area)
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
area->brush_size = 1;
area->gesture = gesture;
}
static GtkWidget *
@@ -381,6 +386,12 @@ drawing_area_color_set (DrawingArea *area,
gtk_color_dialog_button_set_rgba (button, color);
}
static GtkGesture *
drawing_area_get_gesture (DrawingArea *area)
{
return area->gesture;
}
GtkWidget *
do_paint (GtkWidget *toplevel)
{
@@ -388,7 +399,7 @@ do_paint (GtkWidget *toplevel)
if (!window)
{
GtkWidget *draw_area, *headerbar, *colorbutton;
GtkWidget *draw_area, *headerbar, *button;
window = gtk_window_new ();
@@ -397,15 +408,22 @@ do_paint (GtkWidget *toplevel)
headerbar = gtk_header_bar_new ();
colorbutton = gtk_color_dialog_button_new (gtk_color_dialog_new ());
g_signal_connect (colorbutton, "notify::rgba",
button = gtk_color_dialog_button_new (gtk_color_dialog_new ());
g_signal_connect (button, "notify::rgba",
G_CALLBACK (color_button_color_set), draw_area);
g_signal_connect (draw_area, "color-set",
G_CALLBACK (drawing_area_color_set), colorbutton);
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (colorbutton),
G_CALLBACK (drawing_area_color_set), button);
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (button),
&(GdkRGBA) { 0, 0, 0, 1 });
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), button);
button = gtk_check_button_new_with_label ("Stylus only");
g_object_bind_property (button, "active",
drawing_area_get_gesture ((DrawingArea *)draw_area), "stylus-only",
G_BINDING_SYNC_CREATE);
gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), button);
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
gtk_window_set_title (GTK_WINDOW (window), "Paint");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
+1 -1
View File
@@ -1,5 +1,5 @@
/* Overlay/Transparency
* #Keywords: GtkOverlay, GtkSnapshot
* #Keywords: GtkOverlay, GtkSnapshot, blur
*
* Blur the background behind an overlay.
*/
+31 -7
View File
@@ -174,6 +174,7 @@ text_changed (GtkTextBuffer *buffer,
GtkTextIter iter;
GtkTextIter start, end;
float scale;
GskRenderNode *big_node;
g_array_remove_range (self->errors, 0, self->errors->len);
text = get_current_text (self->text_buffer);
@@ -186,13 +187,18 @@ text_changed (GtkTextBuffer *buffer,
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)
if (self->node && scale != 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;
scale = pow (2., scale);
big_node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
}
else if (self->node)
{
big_node = gsk_render_node_ref (self->node);
}
else
{
big_node = NULL;
}
g_bytes_unref (bytes);
@@ -204,18 +210,27 @@ text_changed (GtkTextBuffer *buffer,
graphene_rect_t bounds;
guint i;
snapshot = gtk_snapshot_new ();
gsk_render_node_get_bounds (big_node, &bounds);
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- bounds.origin.x, - bounds.origin.y));
gtk_snapshot_append_node (snapshot, big_node);
paintable = gtk_snapshot_free_to_paintable (snapshot, &bounds.size);
gtk_picture_set_paintable (GTK_PICTURE (self->picture), paintable);
g_clear_object (&paintable);
snapshot = gtk_snapshot_new ();
gsk_render_node_get_bounds (self->node, &bounds);
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- bounds.origin.x, - bounds.origin.y));
gtk_snapshot_append_node (snapshot, self->node);
paintable = gtk_snapshot_free_to_paintable (snapshot, &bounds.size);
gtk_picture_set_paintable (GTK_PICTURE (self->picture), paintable);
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i++)
{
gpointer item = g_list_model_get_item (G_LIST_MODEL (self->renderers), i);
gtk_renderer_paintable_set_paintable (item, paintable);
g_object_unref (item);
}
g_clear_object (&paintable);
}
else
@@ -223,6 +238,8 @@ text_changed (GtkTextBuffer *buffer,
gtk_picture_set_paintable (GTK_PICTURE (self->picture), NULL);
}
g_clear_pointer (&big_node, gsk_render_node_unref);
gtk_text_buffer_get_start_iter (self->text_buffer, &iter);
while (!gtk_text_iter_is_end (&iter))
@@ -1292,6 +1309,13 @@ node_editor_window_init (NodeEditorWindow *self)
" }\n"
" transform: translate(0, 140);\n"
"}", -1);
if (g_getenv ("GSK_RENDERER"))
{
char *new_title = g_strdup_printf ("GTK Node Editor - %s", g_getenv ("GSK_RENDERER"));
gtk_window_set_title (GTK_WINDOW (self), new_title);
g_free (new_title);
}
}
NodeEditorWindow *
+3 -3
View File
@@ -163,9 +163,9 @@
<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="lower">-4</property>
<property name="value">0</property>
<property name="upper">4</property>
<property name="step-increment">0.1</property>
<property name="page-increment">0.5</property>
</object>
+2 -2
View File
@@ -220,6 +220,6 @@ clipboard.cut, clipboard.copy, clipboard.paste
selection.delete, selection.select-all
: Selection operations on entries, text view and labels
color.select, color.customize:
color.select, color.customize
: Operate on colors in a `GtkColorChooserWidget`. These actions are
unusual in that they have the non-trivial parameter type (dddd):
unusual in that they have the non-trivial parameter type (dddd).
+6 -11
View File
@@ -6,22 +6,15 @@ Slug: broadway
The GDK Broadway backend provides support for displaying GTK applications in
a web browser, using HTML5 and web sockets.
To run your application in this way, select the Broadway backend by setting
`GDK_BACKEND=broadway`. Then you can make your application appear in a web
browser by pointing it at `http://127.0.0.1:8080`. Note that you need to
enable web sockets in your web browser.
You can choose a different port from the default 8080 by setting the
`BROADWAY_DISPLAY` environment variable to the port that you want to use.
It is also possible to use multiple GTK applications in the same web browser
window, by using the Broadway server, `gtk4-broadwayd`, that ships with GTK.
To start the Broadway server use:
To run your application in this way, first run the broadway server,
`gtk-broadwayd`, that ships with GTK:
```
gtk4-broadwayd :5
```
The server expects the colon-prefixed display number as a commandline argument.
Then point your web browser at `http://127.0.0.1:8085`.
Once the Broadway server is running, you can start your applications like
@@ -31,6 +24,8 @@ this:
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
```
Multiple applications can be presented in the same web browser window.
## Broadway-specific environment variables
### `BROADWAY_DISPLAY`
+1 -1
View File
@@ -68,7 +68,7 @@ in a selector, widget names must be prefixed with a &num; character.
| E:focus-within | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#focus-within-pseudo) | Set on all ancestors of the focus widget, unlike CSS |
| E:focus-visible | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#focus-within-pseudo) | Set on focus widget and all ancestors, unlike CSS |
| E:disabled | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_INSENSITIVE |
| E:disabled | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_CHECKED |
| E:checked | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_CHECKED |
| E:indeterminate | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#indeterminate) | Corresponds to GTK_STATE_FLAG_INCONSISTENT |
| E:backdrop, E:selected | | Corresponds to GTK_STATE_FLAG_BACKDROP, GTK_STATE_FLAG_SELECTED |
| E:not(selector) | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#negation) | |
+16 -13
View File
@@ -103,14 +103,15 @@ fields, but e.g. buttons can take the focus too.
Input widgets can be given the focus by clicking on them, but focus
can also be moved around with certain key events (this is known as
“keyboard navigation”). GTK reserves the Tab key to move the focus
to the next location, and Shift-Tab to move it back to the previous
one. In addition many containers allow “directional navigation” with
the arrow keys.
“keyboard navigation”).
GTK reserves the <kbd>Tab</kbd> key to move the focus to the next location,
and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move it back to the previous one.
In addition many containers allow “directional navigation” with the arrow keys.
Many widgets can be “activated” to trigger and action. E.g., you can
activate a button or switch by clicking on them, but you can also
activate them with the keyboard, by using the Enter or Space keys.
Many widgets can be “activated” to trigger and action.
E.g., you can activate a button or switch by clicking on them,
but you can also activate them with the keyboard,
by using the <kbd>Enter</kbd> or <kbd>Space</kbd> keys.
Apart from keyboard navigation, activation and directly typing into
entries or text views, GTK widgets can use key events for activating
@@ -121,15 +122,17 @@ GTK has traditionally supported different kinds of shortcuts:
- Accelerators are any other shortcuts that can be activated regardless
of where the focus is, and typically trigger global actions, such as
Ctrl-Q to quit an application.
- Mnemonics are usually triggered using Alt as a modifier for a letter.
<kbd>Ctrl</kbd>+<kbd>Q</kbd> to quit an application.
- Mnemonics are usually triggered using <kbd>Alt</kbd>
as a modifier for a letter.
They are used in places where a label is associated with a control,
and are indicated by underlining the letter in the label. As a special
case, inside menus (i.e. inside `GtkPopoverMenu`), mnemonics can be
triggered without the modifier.
- Key bindings are specific to individual widgets, such as Ctrl-C or
Ctrl-V in an entry copy to or paste from the clipboard. They are only
triggered when the widget has focus.
- Key bindings are specific to individual widgets,
such as <kbd>Ctrl</kbd>+<kbd>C</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd>
in an entry copy to or paste from the clipboard.
They are only triggered when the widget has focus.
GTK handles accelerators and mnemonics in a global scope, during the
capture phase, and key bindings locally, during the target phase.
@@ -208,4 +211,4 @@ sequence, so setting the state on one does transfer the state to
the others. They also are mutually exclusive, within a widget
where may be only one gesture group claiming a given sequence.
If another gesture group claims later that same sequence, the
first group will deny the sequence:
first group will deny the sequence.
+8 -5
View File
@@ -263,10 +263,13 @@ the question you have, this list is a good place to start.
* How do I load an image or animation from a file?
To load an image file straight into a display widget, use
[ctor@Gtk.Picture.new_for_file] or [ctor@GTk.Picture.new_for_filename].
[ctor@Gtk.Picture.new_for_file] or [ctor@Gtk.Picture.new_for_filename].
To load an image for another purpose, use [ctor@Gdk.Texture.new_from_file].
To load a video from a file, use [ctor@Gtk.MediaFile.new_for_file].
Note that [class@Gtk.Image] is meant for fixed-size icons. For arbitrary
image files, you should use [class@Gtk.Picture].
* How do I draw text?
If you just want to put text into your user interface somewhere, it is
@@ -283,8 +286,8 @@ the question you have, this list is a good place to start.
pango_font_description_free (fontdesc);
g_object_unref (layout);
See also the [Cairo Rendering](https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html)
section of the [Pango documentation](https://developer.gnome.org/pango/stable/).
See also the [Cairo Rendering](https://docs.gtk.org/PangoCairo/pango_cairo.html)
section of the [Pango documentation](https://docs.gtk.org/Pango/).
To draw a piece of text in a widget [vfunc@Gtk.Widget.snapshot] implementation,
use [method@Gtk.Snapshot.append_layout].
@@ -301,8 +304,8 @@ the question you have, this list is a good place to start.
pango_font_description_free (fontdesc);
g_object_unref (layout);
See also the [Layout Objects](https://developer.gnome.org/pango/stable/pango-Layout-Objects.html)
section of the [Pango documentation](https://developer.gnome.org/pango/stable/).
See also the [Layout Objects](https://docs.gtk.org/Pango/class.Layout.html)
section of the [Pango documentation](https://docs.gtk.org/Pango/).
* Why are types not registered if I use their `GTK_TYPE_BLAH` macro?
+7
View File
@@ -0,0 +1,7 @@
A trivial example
=================
This is a very minimal example of an app that can be built against GTK.
We use this in CI to test that building against the installed GTK works.
That is why there is a standalone meson.build in this subdirectory.
+4 -4
View File
@@ -1574,7 +1574,8 @@ broadway_server_query_mouse (BroadwayServer *server,
void
broadway_server_destroy_surface (BroadwayServer *server,
int id)
int id,
gboolean disconnected)
{
BroadwaySurface *surface;
gint32 transient_for = -1;
@@ -1589,8 +1590,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
server->pointer_grab_surface_id = -1;
if (server->output)
broadway_output_destroy_surface (server->output,
id);
broadway_output_destroy_surface (server->output, id);
surface = broadway_server_lookup_surface (server, id);
if (surface != NULL)
@@ -1604,7 +1604,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
broadway_surface_free (server, surface);
}
if (transient_for != -1)
if (transient_for != -1 && !disconnected)
{
surface = broadway_server_lookup_surface (server, transient_for);
if (surface != NULL)
+2 -1
View File
@@ -93,7 +93,8 @@ guint32 broadway_server_new_surface (BroadwayServer *
int width,
int height);
void broadway_server_destroy_surface (BroadwayServer *server,
int id);
int id,
gboolean disconnected);
gboolean broadway_server_surface_show (BroadwayServer *server,
int id);
gboolean broadway_server_surface_hide (BroadwayServer *server,
+2 -3
View File
@@ -101,8 +101,7 @@ client_disconnected (BroadwayClient *client)
}
for (l = client->surfaces; l != NULL; l = l->next)
broadway_server_destroy_surface (server,
GPOINTER_TO_UINT (l->data));
broadway_server_destroy_surface (server, GPOINTER_TO_UINT (l->data), TRUE);
g_list_free (client->surfaces);
client->surfaces = NULL;
@@ -268,7 +267,7 @@ client_handle_request (BroadwayClient *client,
client->surfaces =
g_list_remove (client->surfaces,
GUINT_TO_POINTER (request->destroy_surface.id));
broadway_server_destroy_surface (server, request->destroy_surface.id);
broadway_server_destroy_surface (server, request->destroy_surface.id, FALSE);
break;
case BROADWAY_REQUEST_SHOW_SURFACE:
broadway_server_surface_show (server, request->show_surface.id);
+4
View File
@@ -60,7 +60,11 @@ GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
void gdk_display_set_debug_flags (GdkDisplay *display,
GdkDebugFlags flags);
#ifdef GLIB_USING_SYSTEM_PRINTF
#define gdk_debug_message(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
#else
#define gdk_debug_message(format, ...) g_fprintf (stderr, format "\n", ##__VA_ARGS__)
#endif
#ifdef G_ENABLE_DEBUG
-2
View File
@@ -1723,8 +1723,6 @@ gdk_display_init_egl (GdkDisplay *self,
epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_no_config_context");
self->have_egl_pixel_format_float =
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_pixel_format_float");
self->have_egl_win32_libangle =
epoxy_has_egl_extension (priv->egl_display, "EGL_ANGLE_d3d_share_handle_client_buffer");
if (self->have_egl_no_config_context)
priv->egl_config_high_depth = gdk_display_create_egl_config (self,
+15 -2
View File
@@ -410,12 +410,19 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
{
const char *backend = backends[i];
gboolean any = g_str_equal (backend, "*");
gboolean found = FALSE;
if (!allow_any && !any && !strstr (allowed_backends, backend))
continue;
{
GDK_DEBUG (MISC, "Skipping %s backend", backend);
continue;
}
for (j = 0; gdk_backends[j].name != NULL; j++)
{
if (g_str_equal (backend, gdk_backends[j].name))
found = TRUE;
if ((any && allow_any) ||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
g_str_equal (backend, gdk_backends[j].name))
@@ -423,9 +430,15 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
GDK_DEBUG (MISC, "Trying %s backend", gdk_backends[j].name);
display = gdk_backends[j].open_display (name);
if (display)
break;
{
GDK_DEBUG (MISC, "Using %s display %s", gdk_backends[j].name, gdk_display_get_name (display));
break;
}
}
}
if (!found && !display)
g_warning ("No such backend: %s", backend);
}
g_strfreev (backends);
-1
View File
@@ -109,7 +109,6 @@ struct _GdkDisplay
guint have_egl_buffer_age : 1;
guint have_egl_no_config_context : 1;
guint have_egl_pixel_format_float : 1;
guint have_egl_win32_libangle : 1;
};
struct _GdkDisplayClass
+6
View File
@@ -371,6 +371,12 @@ gdk_draw_context_begin_frame_full (GdkDrawContext *context,
priv->surface->paint_context = g_object_ref (context);
GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, prefers_high_depth, priv->frame_region);
cairo_region_intersect_rectangle (priv->frame_region,
&(cairo_rectangle_int_t) {
0, 0,
priv->surface->width, priv->surface->height
});
}
#ifdef HAVE_SYSPROF
+2 -2
View File
@@ -48,7 +48,7 @@
* for the synchronization being implemented, the clock will process a frame and
* emit signals for each phase that has been requested. (See the signals of the
* `GdkFrameClock` class for documentation of the phases.
* %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@GdkFrameClock::update] signal
* %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@Gdk.FrameClock::update] signal
* are most interesting for application writers, and are used to update the
* animations, using the frame time given by [method@Gdk.FrameClock.get_frame_time].
*
@@ -60,7 +60,7 @@
* are called at a similar time get the same value. This means that
* if different animations are timed by looking at the difference in
* time between an initial value from [method@Gdk.FrameClock.get_frame_time]
* and the value inside the [signal@GdkFrameClock::update] signal of the clock,
* and the value inside the [signal@Gdk.FrameClock::update] signal of the clock,
* they will stay exactly synchronized.
*/
+2 -12
View File
@@ -295,7 +295,6 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
/* 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,
@@ -968,7 +967,6 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
void
gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor)
{
@@ -989,16 +987,8 @@ gdk_gl_context_get_matching_version (GdkGLAPI api,
}
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;
}
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
min = GDK_GL_MIN_GLES_VERSION_MINOR;
}
if (major != NULL)
+1 -6
View File
@@ -37,8 +37,7 @@ G_BEGIN_DECLS
* 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
* OPENGL_PROFILE_MASK; and OpenGL ES respectively
*/
#define GDK_GL_MIN_GL_VERSION_MAJOR (3)
#define GDK_GL_MIN_GL_VERSION_MINOR (2)
@@ -46,8 +45,6 @@ G_BEGIN_DECLS
#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,
@@ -101,7 +98,6 @@ typedef struct {
} GdkGLContextProgram;
typedef struct {
guint vertex_array_object;
guint tmp_framebuffer;
guint tmp_vertex_buffer;
@@ -141,7 +137,6 @@ void gdk_gl_context_get_clipped_version (GdkGLContext
int *minor);
void gdk_gl_context_get_matching_version (GdkGLAPI api,
gboolean legacy,
gboolean win32_libangle,
int *major,
int *minor);
+5 -5
View File
@@ -50,7 +50,7 @@ void gtk_snapshot_pop (GdkSnapshot
* to do, it is suggested that you scale your paintable ignoring any potential
* aspect ratio.
*
* The contents that a `GdkPaintable` produces may depend on the [class@GdkSnapshot]
* The contents that a `GdkPaintable` produces may depend on the [class@Gdk.Snapshot]
* passed to it. For example, paintables may decide to use more detailed images
* on higher resolution screens or when OpenGL is available. A `GdkPaintable`
* will however always produce the same output for the same snapshot.
@@ -58,7 +58,7 @@ void gtk_snapshot_pop (GdkSnapshot
* A `GdkPaintable` may change its contents, meaning that it will now produce
* a different output with the same snapshot. Once that happens, it will call
* [method@Gdk.Paintable.invalidate_contents] which will emit the
* [signal@GdkPaintable::invalidate-contents] signal. If a paintable is known
* [signal@Gdk.Paintable::invalidate-contents] signal. If a paintable is known
* to never change its contents, it will set the %GDK_PAINTABLE_STATIC_CONTENTS
* flag. If a consumer cannot deal with changing contents, it may call
* [method@Gdk.Paintable.get_current_image] which will return a static
@@ -69,7 +69,7 @@ void gtk_snapshot_pop (GdkSnapshot
* can use this information to layout thepaintable appropriately. Just like the
* contents, the size of a paintable can change. A paintable will indicate this
* by calling [method@Gdk.Paintable.invalidate_size] which will emit the
* [signal@GdkPaintable::invalidate-size] signal. And just like for contents,
* [signal@Gdk.Paintable::invalidate-size] signal. And just like for contents,
* if a paintable is known to never change its size, it will set the
* %GDK_PAINTABLE_STATIC_SIZE flag.
*
@@ -529,7 +529,7 @@ gdk_paintable_compute_concrete_size (GdkPaintable *paintable,
* the missing dimension is calculated from the present
* dimension and the intrinsic aspect ratio.
* Otherwise, the missing dimension is taken from the default
* object size.
* object size.
*/
if (image_width)
*concrete_width = image_width;
@@ -559,7 +559,7 @@ gdk_paintable_compute_concrete_size (GdkPaintable *paintable,
* dimensions, the missing dimension is taken from the object's intrinsic
* dimensions.
* Otherwise, the missing dimension of the concrete object size is taken
* from the default object size.
* from the default object size.
*/
if (specified_width)
{
+3 -3
View File
@@ -37,10 +37,10 @@ G_DECLARE_INTERFACE (GdkPaintable, gdk_paintable, GDK, PAINTABLE, GObject)
/**
* GdkPaintableFlags:
* @GDK_PAINTABLE_STATIC_SIZE: The size is immutable.
* The [signal@GdkPaintable::invalidate-size] signal will never be
* The [signal@Gdk.Paintable::invalidate-size] signal will never be
* emitted.
* @GDK_PAINTABLE_STATIC_CONTENTS: The content is immutable.
* The [signal@GdkPaintable::invalidate-contents] signal will never be
* The [signal@Gdk.Paintable::invalidate-contents] signal will never be
* emitted.
*
* Flags about a paintable object.
@@ -97,7 +97,7 @@ struct _GdkPaintableInterface
double height);
/* get the current contents in an immutable form (optional) */
GdkPaintable * (* get_current_image) (GdkPaintable *paintable);
/* get flags for potential optimizations (optional) */
GdkPaintableFlags (* get_flags) (GdkPaintable *paintable);
/* preferred width of paintable or 0 if it has no width (optional) */
+2 -2
View File
@@ -31,7 +31,7 @@
* The `GdkPopup` is positioned relative to its parent surface.
*
* `GdkPopup`s are typically used to implement menus and similar popups.
* They can be modal, which is indicated by the [property@GdkPopup:autohide]
* They can be modal, which is indicated by the [property@Gdk.Popup:autohide]
* property.
*/
@@ -113,7 +113,7 @@ gdk_popup_default_init (GdkPopupInterface *iface)
* otherwise it will change position according to @layout.
*
* After calling this function, the result should be handled in response
* to the [signal@GdkSurface::layout] signal being emitted. The resulting
* to the [signal@Gdk.Surface::layout] signal being emitted. The resulting
* popup position can be queried using [method@Gdk.Popup.get_position_x],
* [method@Gdk.Popup.get_position_y], and the resulting size will be sent as
* parameters in the layout signal. Use [method@Gdk.Popup.get_rect_anchor]
+3 -1
View File
@@ -165,7 +165,7 @@ parse_rgb_value (const char *str,
*
* The string can be either one of:
*
* - A standard name (Taken from the Css specification).
* - A standard name (Taken from the CSS specification).
* - A hexadecimal value in the form \#rgb, \#rrggbb,
* \#rrrgggbbb or \#rrrrggggbbbb
* - A hexadecimal value in the form \#rgba, \#rrggbbaa,
@@ -173,6 +173,8 @@ parse_rgb_value (const char *str,
* - A RGB color in the form rgb(r,g,b) (In this case the color
* will have full opacity)
* - A RGBA color in the form rgba(r,g,b,a)
* - A HSL color in the form "hsl(hue, saturation, lightness)"
* - A HSLA color in the form "hsla(hue, saturation, lightness, alpha)"
*
* Where r, g, b and a are respectively the red, green,
* blue and alpha color values. In the last two cases, r, g,
+3 -1
View File
@@ -1081,8 +1081,10 @@ gdk_surface_set_egl_native_window (GdkSurface *self,
if (priv->egl_surface != NULL)
{
GdkDisplay *display = gdk_surface_get_display (self);
gdk_gl_context_clear_current_if_surface (self);
eglDestroySurface (gdk_surface_get_display (self), priv->egl_surface);
eglDestroySurface (gdk_display_get_egl_display (display), priv->egl_surface);
priv->egl_surface = NULL;
}
+1 -1
View File
@@ -395,7 +395,7 @@ gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf)
bytes = g_bytes_new_with_free_func (gdk_pixbuf_get_pixels (pixbuf),
gdk_pixbuf_get_height (pixbuf)
* gdk_pixbuf_get_rowstride (pixbuf),
* (gsize) gdk_pixbuf_get_rowstride (pixbuf),
g_object_unref,
g_object_ref (pixbuf));
texture = gdk_memory_texture_new (gdk_pixbuf_get_width (pixbuf),
+6 -5
View File
@@ -261,15 +261,16 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
/**
* GdkToplevel::compute-size:
* @toplevel: a `GdkToplevel`
* @size: (type Gdk.ToplevelSize) (out caller-allocates): a `GdkToplevelSize`
* @size: (type Gdk.ToplevelSize): a `GdkToplevelSize`
*
* Emitted when the size for the surface needs to be computed, when
* it is present.
*
* It will normally be emitted during or after [method@Gdk.Toplevel.present],
* depending on the configuration received by the windowing system.
* It may also be emitted at any other point in time, in response
* to the windowing system spontaneously changing the configuration.
* This signal will normally be emitted during or after a call to
* [method@Gdk.Toplevel.present], depending on the configuration
* received by the windowing system. It may also be emitted at any
* other point in time, in response to the windowing system
* spontaneously changing the configuration of the toplevel surface.
*
* It is the responsibility of the toplevel user to handle this signal
* and compute the desired size of the toplevel, given the information
+12 -14
View File
@@ -207,7 +207,7 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
{
char *path;
XcursorImages *images;
struct cursor *cursor;
struct wl_cursor *cursor;
struct cursor_image *image;
int i, nbytes;
unsigned int load_size;
@@ -240,17 +240,16 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
return NULL;
}
cursor->cursor.images =
malloc(images->nimage * sizeof cursor->cursor.images[0]);
if (!cursor->cursor.images) {
cursor->images =
malloc(images->nimage * sizeof cursor->images[0]);
if (!cursor->images) {
free(cursor);
xcursor_images_destroy (images);
return NULL;
}
cursor->cursor.name = strdup(name);
cursor->cursor.size = load_size;
cursor->total_delay = 0;
cursor->name = strdup(name);
cursor->size = load_size;
for (i = 0; i < images->nimage; i++) {
image = malloc(sizeof *image);
@@ -291,14 +290,13 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
}
}
}
cursor->total_delay += image->image.delay;
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
cursor->images[i] = (struct wl_cursor_image *) image;
}
cursor->cursor.image_count = i;
cursor->image_count = i;
if (cursor->cursor.image_count == 0) {
free(cursor->cursor.name);
free(cursor->cursor.images);
if (cursor->image_count == 0) {
free(cursor->name);
free(cursor->images);
free(cursor);
xcursor_images_destroy (images);
return NULL;
@@ -306,7 +304,7 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
xcursor_images_destroy (images);
return &cursor->cursor;
return cursor;
}
static void
+3 -7
View File
@@ -586,13 +586,6 @@ _gdk_wayland_display_open (const char *display_name)
GDK_DEBUG (MISC, "opening display %s", display_name ? display_name : "");
/* If this variable is unset then wayland initialisation will surely
* fail, logging a fatal error in the process. Save ourselves from
* that.
*/
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
return NULL;
wl_log_set_handler_client (log_handler);
wl_display = wl_display_connect (display_name);
@@ -1082,6 +1075,9 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
g_assert (display_wayland);
g_assert (display_wayland->shm);
if (size == 0)
size = 24;
if (g_strcmp0 (name, display_wayland->cursor_theme_name) == 0 &&
display_wayland->cursor_theme_size == size)
return;
+4 -1
View File
@@ -65,6 +65,9 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
int dx = impl->pending_buffer_offset_x;
int dy = impl->pending_buffer_offset_y;
impl->pending_buffer_offset_x = 0;
impl->pending_buffer_offset_y = 0;
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
@@ -118,7 +121,7 @@ gdk_wayland_display_init_gl (GdkDisplay *display,
{
GdkWaylandDisplay *self = GDK_WAYLAND_DISPLAY (display);
if (!gdk_display_init_egl (display,
if (!gdk_display_init_egl (display,
EGL_PLATFORM_WAYLAND_EXT,
self->wl_display,
TRUE,
+34 -17
View File
@@ -398,7 +398,11 @@ gdk_wayland_popup_handle_configure (GdkWaylandSurface *wayland_surface)
g_warn_if_reached ();
if (wayland_popup->pending.has_repositioned_token)
wayland_popup->received_reposition_token = wayland_popup->pending.repositioned_token;
{
wayland_popup->received_reposition_token =
wayland_popup->pending.repositioned_token;
wayland_popup->pending.has_repositioned_token = FALSE;
}
switch (wayland_popup->state)
{
@@ -743,9 +747,7 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkRectangle geometry;
uint32_t constraint_adjustment = ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE;
const GdkRectangle *anchor_rect;
int real_anchor_rect_x, real_anchor_rect_y;
int anchor_rect_width, anchor_rect_height;
GdkRectangle anchor_rect;
int rect_anchor_dx;
int rect_anchor_dy;
GdkGravity rect_anchor;
@@ -771,12 +773,24 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
gdk_wayland_surface_get_window_geometry (surface->parent, &parent_geometry);
anchor_rect = gdk_popup_layout_get_anchor_rect (layout);
real_anchor_rect_x = anchor_rect->x - parent_geometry.x;
real_anchor_rect_y = anchor_rect->y - parent_geometry.y;
anchor_rect = *gdk_popup_layout_get_anchor_rect (layout);
anchor_rect_width = MAX (anchor_rect->width, 1);
anchor_rect_height = MAX (anchor_rect->height, 1);
/* Wayland protocol requires that the anchor rect is specified
* wrt. to the parent geometry, and that it is non-empty and
* contained in the parent geometry.
*/
if (!gdk_rectangle_intersect (&parent_geometry, &anchor_rect, &anchor_rect))
{
anchor_rect.x = 0;
anchor_rect.y = 0;
anchor_rect.width = 1;
anchor_rect.height = 1;
}
else
{
anchor_rect.x -= parent_geometry.x;
anchor_rect.y -= parent_geometry.y;
}
gdk_popup_layout_get_offset (layout, &rect_anchor_dx, &rect_anchor_dy);
@@ -797,10 +811,10 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
xdg_positioner_set_size (positioner, geometry.width, geometry.height);
xdg_positioner_set_anchor_rect (positioner,
real_anchor_rect_x,
real_anchor_rect_y,
anchor_rect_width,
anchor_rect_height);
anchor_rect.x,
anchor_rect.y,
anchor_rect.width,
anchor_rect.height);
xdg_positioner_set_offset (positioner, rect_anchor_dx, rect_anchor_dy);
anchor = rect_anchor_to_anchor (rect_anchor);
@@ -851,10 +865,10 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height);
zxdg_positioner_v6_set_anchor_rect (positioner,
real_anchor_rect_x,
real_anchor_rect_y,
anchor_rect_width,
anchor_rect_height);
anchor_rect.x,
anchor_rect.y,
anchor_rect.width,
anchor_rect.height);
zxdg_positioner_v6_set_offset (positioner,
rect_anchor_dx,
rect_anchor_dy);
@@ -968,6 +982,9 @@ gdk_wayland_surface_create_xdg_popup (GdkWaylandPopup *wayland_popup,
g_assert_not_reached ();
}
wayland_popup->received_reposition_token = 0;
wayland_popup->reposition_token = 0;
gdk_popup_layout_get_shadow_width (layout,
&impl->shadow_left,
&impl->shadow_right,
+11 -4
View File
@@ -99,7 +99,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
if (cb->source)
{
GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring clipboard offer for self", cb);
GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring primary offer for self", cb);
gdk_content_formats_unref (formats);
g_clear_pointer (&offer, zwp_primary_selection_offer_v1_destroy);
return;
@@ -111,7 +111,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: remote clipboard claim for %s", cb, s);
gdk_debug_message ("%p: remote primary claim for %s", cb, s);
g_free (s);
}
#endif
@@ -119,8 +119,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
cb->offer_formats = formats;
cb->offer = offer;
gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb),
cb->offer_formats);
gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb), cb->offer_formats);
}
static void
@@ -271,6 +270,14 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
{
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (clipboard);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (clipboard), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: claim primary (%s) for %s", cb, local ? "local" : "remote", s);
g_free (s);
}
#endif
if (local)
{
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));
+1 -3
View File
@@ -520,8 +520,6 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
surface->width = width;
surface->height = height;
g_object_ref (surface);
/* More likely to be right than just assuming 1 */
if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
{
@@ -632,7 +630,7 @@ gdk_wayland_surface_dispose (GObject *object)
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
display_wayland->event_queues =
g_list_remove (display_wayland->event_queues, surface);
g_list_remove (display_wayland->event_queues, impl->event_queue);
g_clear_pointer (&impl->event_queue, wl_event_queue_destroy);
}
+1 -1
View File
@@ -991,7 +991,7 @@ gdk_wayland_toplevel_set_startup_id (GdkWaylandToplevel *toplevel,
startup_id = free_me;
}
if (startup_id)
if (display->xdg_activation && startup_id)
xdg_activation_v1_activate (display->xdg_activation,
startup_id,
surface->display_server.wl_surface);
+5 -4
View File
@@ -1005,7 +1005,8 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
} bmi;
HDC hdc;
uint8_t *pixels, *bits;
int rowstride, x, y, w, h;
int x, y, w, h;
gsize rowstride;
if (!GDI_CALL (GetIconInfo, (hicon, &ii)))
return NULL;
@@ -1057,7 +1058,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
no_alpha = FALSE;
pixels += 4;
}
pixels += (w * 4 - rowstride);
pixels += rowstride - w * 4;
}
/* mask */
@@ -1072,7 +1073,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
pixels[3] = 255 - bits[(x + y * w) * 4];
pixels += 4;
}
pixels += (w * 4 - rowstride);
pixels += rowstride - w * 4;
}
}
}
@@ -1146,7 +1147,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
xorp++;
}
}
pixels += (w * 4 - rowstride);
pixels += rowstride - w * 4;
}
}
+1
View File
@@ -1207,6 +1207,7 @@ gdk_win32_display_init_gl (GdkDisplay *display,
{
return g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL,
"display", display,
"allowed-apis", GDK_GL_API_GLES,
NULL);
}
else
-7
View File
@@ -83,20 +83,13 @@ gdk_win32_gl_context_egl_end_frame (GdkDrawContext *draw_context,
cairo_region_t *painted)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkWin32GLContextEGL *context_egl = GDK_WIN32_GL_CONTEXT_EGL (context);
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
cairo_rectangle_int_t whole_window;
EGLSurface egl_surface;
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->end_frame (draw_context, painted);
gdk_gl_context_make_current (context);
whole_window =
(GdkRectangle) { 0, 0,
gdk_surface_get_width (surface),
gdk_surface_get_height (surface)
};
egl_surface = gdk_surface_get_egl_surface (surface);
@@ -0,0 +1,56 @@
/* GDK - The GIMP Drawing Kit
*
* gdkglcontext-win32-wgl-private.c: Win32 specific OpenGL wrappers
*
* Copyright © 2023 Chun-wei Fan
*
* 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/>.
*/
/*
* These wrapper functions are used when we don't want to use the wgl*() core functions
* that we acquire via libepoxy (such as when we are disposing the Gdk(W)GLContext from,
* different threads, so for these calls, we are actually linking to the system's/ICD
* opengl32.dll directly, so that we are guaranteed that the "right" versions of these
* WGL calls are carried out. This must be a separate source file because we can't include
* the system's GL/gl.h with epoxy/(w)gl.h together in a single source file. We should not
* need to use these when we are creating/initializing a WGL context in GDK, since we should
* be in the same thread at this point.
*/
#define DONT_INCLUDE_LIBEPOXY
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <GL/gl.h>
#include "gdkglcontext-win32.h"
void
gdk_win32_private_wglDeleteContext (HGLRC hglrc)
{
wglDeleteContext (hglrc);
}
HGLRC
gdk_win32_private_wglGetCurrentContext (void)
{
return wglGetCurrentContext ();
}
BOOL
gdk_win32_private_wglMakeCurrent (HDC hdc,
HGLRC hglrc)
{
return wglMakeCurrent (hdc, hglrc);
}
+6 -6
View File
@@ -60,12 +60,12 @@ gdk_win32_gl_context_wgl_dispose (GObject *gobject)
if (context_wgl->wgl_context != NULL)
{
if (wglGetCurrentContext () == context_wgl->wgl_context)
wglMakeCurrent (NULL, NULL);
if (gdk_win32_private_wglGetCurrentContext () == context_wgl->wgl_context)
gdk_win32_private_wglMakeCurrent (NULL, NULL);
GDK_NOTE (OPENGL, g_print ("Destroying WGL context\n"));
wglDeleteContext (context_wgl->wgl_context);
gdk_win32_private_wglDeleteContext (context_wgl->wgl_context);
context_wgl->wgl_context = NULL;
}
@@ -628,7 +628,7 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
static gboolean
gdk_win32_gl_context_wgl_clear_current (GdkGLContext *context)
{
return wglMakeCurrent (NULL, NULL);
return gdk_win32_private_wglMakeCurrent (NULL, NULL);
}
static gboolean
@@ -636,7 +636,7 @@ gdk_win32_gl_context_wgl_is_current (GdkGLContext *context)
{
GdkWin32GLContextWGL *self = GDK_WIN32_GL_CONTEXT_WGL (context);
return self->wgl_context == wglGetCurrentContext ();
return self->wgl_context == gdk_win32_private_wglGetCurrentContext ();
}
static gboolean
@@ -654,7 +654,7 @@ gdk_win32_gl_context_wgl_make_current (GdkGLContext *context,
else
hdc = GDK_WIN32_SURFACE (surface)->hdc;
if (!wglMakeCurrent (hdc, context_wgl->wgl_context))
if (!gdk_win32_private_wglMakeCurrent (hdc, context_wgl->wgl_context))
return FALSE;
if (!surfaceless && display_win32->hasWglEXTSwapControl)
+17
View File
@@ -21,6 +21,7 @@
#ifndef __GDK_WIN32_GL_CONTEXT__
#define __GDK_WIN32_GL_CONTEXT__
#ifndef DONT_INCLUDE_LIBEPOXY
#include <epoxy/gl.h>
#include <epoxy/wgl.h>
@@ -31,9 +32,18 @@
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
#include "gdksurface.h"
#else
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <GL/gl.h>
# include <glib.h>
#endif
G_BEGIN_DECLS
#ifndef DONT_INCLUDE_LIBEPOXY
#define GDK_WIN32_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
#define GDK_WIN32_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
#define GDK_WIN32_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_GL_CONTEXT))
@@ -78,6 +88,13 @@ GType gdk_win32_gl_context_egl_get_type (void) G_GNUC_CONST;
void
_gdk_win32_surface_invalidate_egl_framebuffer (GdkSurface *surface);
#endif /* !DONT_INCLUDE_LIBEPOXY */
HGLRC gdk_win32_private_wglGetCurrentContext (void);
BOOL gdk_win32_private_wglMakeCurrent (HDC hdc,
HGLRC hglrc);
void gdk_win32_private_wglDeleteContext (HGLRC hglrc);
G_END_DECLS
#endif /* __GDK_WIN32_GL_CONTEXT__ */
+6 -3
View File
@@ -443,9 +443,6 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
char *path, *path_lower;
DISPLAYCONFIG_RATIONAL *refresh;
if ((dispconf_paths[path_index].flags & DISPLAYCONFIG_PATH_ACTIVE) == 0)
continue;
tdn.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
tdn.header.size = sizeof (tdn);
tdn.header.adapterId = dispconf_paths[path_index].targetInfo.adapterId;
@@ -481,6 +478,12 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
if (w32mon == NULL)
continue;
if ((dispconf_paths[path_index].flags & DISPLAYCONFIG_PATH_ACTIVE) == 0)
{
w32mon->remove = TRUE;
continue;
}
mon = GDK_MONITOR (w32mon);
if (!tdn.flags.friendlyNameForced)
+2
View File
@@ -23,6 +23,7 @@ gdk_win32_sources = gdk_win32_public_sources + files([
'gdkdevice-wintab.c',
'gdkdrop-win32.c',
'gdkglobals-win32.c',
'gdkglcontext-win32-wgl-private.c',
'gdkhdataoutputstream-win32.c',
'gdkinput-dmanipulation.c',
'gdkinput-winpointer.c',
@@ -59,6 +60,7 @@ endif
gdk_win32_deps = [
pangowin32_dep, # FIXME
cc.find_library('hid'),
cc.find_library('opengl32'),
]
libgdk_win32 = static_library('gdk-win32',
+2 -1
View File
@@ -145,7 +145,8 @@ struct _GdkX11Display
guint server_time_is_monotonic_time : 1;
/* GLX extensions we check */
guint has_glx_swap_interval : 1;
guint has_glx_sgi_swap_control : 1;
guint has_glx_swap_control : 1;
guint has_glx_create_context : 1;
guint has_glx_texture_from_pixmap : 1;
guint has_glx_video_sync : 1;
+1 -204
View File
@@ -134,35 +134,6 @@ struct _GdkX11DragClass
GdkDragClass parent_class;
};
typedef struct {
int keysym;
int modifiers;
} GrabKey;
static GrabKey grab_keys[] = {
{ XK_Escape, 0 },
{ XK_space, 0 },
{ XK_KP_Space, 0 },
{ XK_Return, 0 },
{ XK_KP_Enter, 0 },
{ XK_Up, 0 },
{ XK_Up, Mod1Mask },
{ XK_Down, 0 },
{ XK_Down, Mod1Mask },
{ XK_Left, 0 },
{ XK_Left, Mod1Mask },
{ XK_Right, 0 },
{ XK_Right, Mod1Mask },
{ XK_KP_Up, 0 },
{ XK_KP_Up, Mod1Mask },
{ XK_KP_Down, 0 },
{ XK_KP_Down, Mod1Mask },
{ XK_KP_Left, 0 },
{ XK_KP_Left, Mod1Mask },
{ XK_KP_Right, 0 },
{ XK_KP_Right, Mod1Mask }
};
/* Forward declarations */
static GdkSurfaceCache *gdk_surface_cache_ref (GdkSurfaceCache *cache);
@@ -1899,20 +1870,15 @@ drag_grab (GdkDrag *drag)
{
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
GdkSeatCapabilities capabilities;
GdkDisplay *display;
Window root;
GdkSeat *seat;
int keycode, i;
GdkCursor *cursor;
if (!x11_drag->ipc_surface)
return FALSE;
display = gdk_drag_get_display (drag);
root = GDK_DISPLAY_XROOTWIN (display);
seat = gdk_device_get_seat (gdk_drag_get_device (drag));
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING | GDK_SEAT_CAPABILITY_KEYBOARD;
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
cursor = gdk_drag_get_cursor (drag, x11_drag->current_action);
g_set_object (&x11_drag->cursor, cursor);
@@ -1924,46 +1890,6 @@ drag_grab (GdkDrag *drag)
g_set_object (&x11_drag->grab_seat, seat);
gdk_x11_display_error_trap_push (display);
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
{
int deviceid = gdk_x11_device_get_id (gdk_seat_get_keyboard (seat));
unsigned char mask[XIMaskLen(XI_LASTEVENT)];
XIGrabModifiers mods;
XIEventMask evmask;
int num_mods;
keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display),
grab_keys[i].keysym);
if (keycode == NoSymbol)
continue;
memset (mask, 0, sizeof (mask));
XISetMask (mask, XI_KeyPress);
XISetMask (mask, XI_KeyRelease);
evmask.deviceid = deviceid;
evmask.mask_len = sizeof (mask);
evmask.mask = mask;
num_mods = 1;
mods.modifiers = grab_keys[i].modifiers;
XIGrabKeycode (GDK_DISPLAY_XDISPLAY (display),
deviceid,
keycode,
root,
GrabModeAsync,
GrabModeAsync,
False,
&evmask,
num_mods,
&mods);
}
gdk_x11_display_error_trap_pop_ignored (display);
return TRUE;
}
@@ -1971,41 +1897,13 @@ static void
drag_ungrab (GdkDrag *drag)
{
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
GdkDisplay *display;
GdkDevice *keyboard;
Window root;
int keycode, i;
if (!x11_drag->grab_seat)
return;
gdk_seat_ungrab (x11_drag->grab_seat);
display = gdk_drag_get_display (drag);
keyboard = gdk_seat_get_keyboard (x11_drag->grab_seat);
root = GDK_DISPLAY_XROOTWIN (display);
g_clear_object (&x11_drag->grab_seat);
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
{
XIGrabModifiers mods;
int num_mods;
keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display),
grab_keys[i].keysym);
if (keycode == NoSymbol)
continue;
num_mods = 1;
mods.modifiers = grab_keys[i].modifiers;
XIUngrabKeycode (GDK_DISPLAY_XDISPLAY (display),
gdk_x11_device_get_id (keyboard),
keycode,
root,
num_mods,
&mods);
}
}
GdkDrag *
@@ -2232,103 +2130,6 @@ gdk_dnd_handle_motion_event (GdkDrag *drag,
return TRUE;
}
static gboolean
gdk_dnd_handle_key_event (GdkDrag *drag,
GdkEvent *event)
{
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
GdkModifierType state;
GdkDevice *pointer;
GdkSeat *seat;
int dx, dy;
dx = dy = 0;
state = gdk_event_get_modifier_state (event);
seat = gdk_event_get_seat (event);
pointer = gdk_seat_get_pointer (seat);
if (event->event_type == GDK_KEY_PRESS)
{
guint keyval = gdk_key_event_get_keyval (event);
switch (keyval)
{
case GDK_KEY_Escape:
gdk_drag_cancel (drag, GDK_DRAG_CANCEL_USER_CANCELLED);
return TRUE;
case GDK_KEY_space:
case GDK_KEY_Return:
case GDK_KEY_ISO_Enter:
case GDK_KEY_KP_Enter:
case GDK_KEY_KP_Space:
if ((gdk_drag_get_selected_action (drag) != 0) &&
(x11_drag->proxy_xid != None))
{
g_signal_emit_by_name (drag, "drop-performed");
}
else
gdk_drag_cancel (drag, GDK_DRAG_CANCEL_NO_TARGET);
return TRUE;
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
case GDK_KEY_Left:
case GDK_KEY_KP_Left:
dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Right:
case GDK_KEY_KP_Right:
dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
default:
break;
}
}
/* The state is not yet updated in the event, so we need
* to query it here. We could use XGetModifierMapping, but
* that would be overkill.
*/
gdk_x11_device_xi2_query_state (pointer, NULL, NULL, NULL, &state);
if (dx != 0 || dy != 0)
{
GdkDisplay *display;
Display *xdisplay;
GdkX11Screen *screen;
Window dest;
x11_drag->last_x += dx;
x11_drag->last_y += dy;
display = gdk_event_get_display ((GdkEvent *)event);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
screen = GDK_X11_DISPLAY (display)->screen;
dest = GDK_SCREEN_XROOTWIN (screen);
XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0,
round (x11_drag->last_x * screen->surface_scale),
round (x11_drag->last_y * screen->surface_scale));
}
gdk_drag_update (drag, x11_drag->last_x, x11_drag->last_y, state,
gdk_event_get_time (event));
return TRUE;
}
static gboolean
gdk_dnd_handle_grab_broken_event (GdkDrag *drag,
GdkEvent *event)
@@ -2395,10 +2196,6 @@ gdk_x11_drag_handle_event (GdkDrag *drag,
case GDK_BUTTON_RELEASE:
return gdk_dnd_handle_button_event (drag, event);
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
return gdk_dnd_handle_key_event (drag, event);
case GDK_GRAB_BROKEN:
return gdk_dnd_handle_grab_broken_event (drag, event);
+36 -11
View File
@@ -162,7 +162,7 @@ gdk_x11_gl_context_glx_end_frame (GdkDrawContext *draw_context,
if (display_x11->has_glx_video_sync)
glXGetVideoSyncSGI (&end_frame_counter);
if (self->do_frame_sync && !display_x11->has_glx_swap_interval)
if (self->do_frame_sync && !display_x11->has_glx_sgi_swap_control && !display_x11->has_glx_swap_control)
{
glFinish ();
@@ -249,7 +249,7 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
if (!glXMakeContextCurrent (dpy, drawable, drawable, self->glx_context))
return FALSE;
if (!surfaceless && GDK_X11_DISPLAY (display)->has_glx_swap_interval)
if (!surfaceless)
{
/* If the WM is compositing there is no particular need to delay
* the swap when drawing on the offscreen, rendering to the screen
@@ -257,14 +257,35 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
* to the vblank. */
do_frame_sync = ! gdk_display_is_composited (display);
if (do_frame_sync != self->do_frame_sync)
if (GDK_X11_DISPLAY (display)->has_glx_swap_control)
{
self->do_frame_sync = do_frame_sync;
if (do_frame_sync != self->do_frame_sync)
{
self->do_frame_sync = do_frame_sync;
if (do_frame_sync)
glXSwapIntervalSGI (1);
else
glXSwapIntervalSGI (0);
if (do_frame_sync)
glXSwapIntervalEXT (dpy, drawable, 1);
else
glXSwapIntervalEXT (dpy, drawable, 0);
}
}
else if (GDK_X11_DISPLAY (display)->has_glx_sgi_swap_control)
{
/* If the WM is compositing there is no particular need to delay
* the swap when drawing on the offscreen, rendering to the screen
* happens later anyway, and its up to the compositor to sync that
* to the vblank. */
do_frame_sync = ! gdk_display_is_composited (display);
if (do_frame_sync != self->do_frame_sync)
{
self->do_frame_sync = do_frame_sync;
if (do_frame_sync)
glXSwapIntervalSGI (1);
else
glXSwapIntervalSGI (0);
}
}
}
@@ -488,7 +509,7 @@ gdk_x11_context_create_glx_context (GdkGLContext *context,
/* 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,
gdk_gl_context_get_matching_version (api, legacy,
&min_major, &min_minor);
gdk_gl_context_get_clipped_version (context, min_major, min_minor,
&major, &minor);
@@ -925,8 +946,10 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
epoxy_has_glx_extension (dpy, screen_num, "GLX_ARB_create_context_profile");
display_x11->has_glx_create_es2_context =
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_create_context_es2_profile");
display_x11->has_glx_swap_interval =
display_x11->has_glx_sgi_swap_control =
epoxy_has_glx_extension (dpy, screen_num, "GLX_SGI_swap_control");
display_x11->has_glx_swap_control =
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_swap_control");
display_x11->has_glx_texture_from_pixmap =
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_texture_from_pixmap");
display_x11->has_glx_video_sync =
@@ -987,6 +1010,7 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
"\t* GLX_ARB_create_context_profile: %s\n"
"\t* GLX_EXT_create_context_es2_profile: %s\n"
"\t* GLX_SGI_swap_control: %s\n"
"\t* GLX_EXT_swap_control: %s\n"
"\t* GLX_EXT_texture_from_pixmap: %s\n"
"\t* GLX_SGI_video_sync: %s\n"
"\t* GLX_EXT_buffer_age: %s\n"
@@ -998,7 +1022,8 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
glXGetClientString (dpy, GLX_VENDOR),
display_x11->has_glx_create_context ? "yes" : "no",
display_x11->has_glx_create_es2_context ? "yes" : "no",
display_x11->has_glx_swap_interval ? "yes" : "no",
display_x11->has_glx_sgi_swap_control ? "yes" : "no",
display_x11->has_glx_swap_control ? "yes" : "no",
display_x11->has_glx_texture_from_pixmap ? "yes" : "no",
display_x11->has_glx_video_sync ? "yes" : "no",
display_x11->has_glx_buffer_age ? "yes" : "no",
+19 -3
View File
@@ -685,8 +685,13 @@ init_randr13 (GdkX11Screen *x11_screen)
for (i = 0; i < resources->noutput; ++i)
{
RROutput output = resources->outputs[i];
XRROutputInfo *output_info =
XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
XRROutputInfo *output_info;
gdk_x11_display_error_trap_push (display);
output_info = XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
if (gdk_x11_display_error_trap_pop (display))
continue;
if (output_info->connection == RR_Disconnected)
{
@@ -697,13 +702,22 @@ init_randr13 (GdkX11Screen *x11_screen)
if (output_info->crtc)
{
GdkX11Monitor *monitor;
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
XRRCrtcInfo *crtc;
char *name;
GdkRectangle geometry;
GdkRectangle newgeo;
int j;
int refresh_rate = 0;
gdk_x11_display_error_trap_push (display);
crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
if (gdk_x11_display_error_trap_pop (display))
{
XRRFreeOutputInfo (output_info);
continue;
}
for (j = 0; j < resources->nmode; j++)
{
XRRModeInfo *xmode = &resources->modes[j];
@@ -775,8 +789,10 @@ init_randr13 (GdkX11Screen *x11_screen)
}
x11_display->primary_monitor = 0;
gdk_x11_display_error_trap_push (display);
primary_output = XRRGetOutputPrimary (x11_screen->xdisplay,
x11_screen->xroot_window);
gdk_x11_display_error_trap_pop_ignored (display);
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)); i++)
{
+12 -12
View File
@@ -89,7 +89,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
if (size == 0)
{
/* EOF marker, put it back */
g_async_queue_push_front_unlocked (priv->chunks, bytes);
g_async_queue_push_front_unlocked (priv->chunks, g_steal_pointer (&bytes));
break;
}
else if (size > count)
@@ -107,7 +107,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
memcpy (buffer, g_bytes_get_data (bytes, NULL), size);
}
g_bytes_unref (bytes);
g_bytes_unref (g_steal_pointer (&bytes));
result += size;
if (buffer)
buffer += size;
@@ -165,9 +165,7 @@ gdk_x11_selection_input_stream_complete (GdkX11SelectionInputStream *stream)
GDK_X11_DISPLAY (priv->display)->streams = g_slist_remove (GDK_X11_DISPLAY (priv->display)->streams, stream);
g_signal_handlers_disconnect_by_func (priv->display,
gdk_x11_selection_input_stream_xevent,
stream);
g_object_unref (stream);
g_steal_pointer (&stream));
}
static gssize
@@ -416,7 +414,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
"%s:%s: got PropertyNotify erroring out of INCR",
priv->selection, priv->target);
/* error, should we signal one? */
gdk_x11_selection_input_stream_complete (stream);
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
}
else if (g_bytes_get_size (bytes) == 0 || type == None)
{
@@ -424,7 +422,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
"%s:%s: got PropertyNotify ending INCR",
priv->selection, priv->target);
g_bytes_unref (bytes);
gdk_x11_selection_input_stream_complete (stream);
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
}
else
{
@@ -467,7 +465,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
_("Format %s not supported"), priv->target);
gdk_x11_selection_input_stream_complete (stream);
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
}
else
{
@@ -478,7 +476,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
if (bytes == NULL)
{
gdk_x11_selection_input_stream_complete (stream);
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
}
else
{
@@ -500,7 +498,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
g_bytes_get_size (bytes));
g_async_queue_push (priv->chunks, bytes);
gdk_x11_selection_input_stream_complete (stream);
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
}
}
@@ -541,7 +539,10 @@ gdk_x11_selection_input_stream_new_async (GdkDisplay *display,
priv->property = g_strdup_printf ("GDK_SELECTION_%p", stream);
priv->xproperty = gdk_x11_get_xatom_by_name_for_display (display, priv->property);
g_signal_connect (display, "xevent", G_CALLBACK (gdk_x11_selection_input_stream_xevent), stream);
g_signal_connect_data (display, "xevent",
G_CALLBACK (gdk_x11_selection_input_stream_xevent),
g_steal_pointer (&stream),
(GClosureNotify) g_object_unref, 0);
XConvertSelection (GDK_DISPLAY_XDISPLAY (display),
priv->xselection,
@@ -577,7 +578,6 @@ gdk_x11_selection_input_stream_new_finish (GAsyncResult *result,
*type = priv->type;
if (format)
*format = priv->format;
g_object_ref (stream);
}
return G_INPUT_STREAM (stream);
+2
View File
@@ -208,6 +208,8 @@ gdk_x11_surface_update_size (GdkX11Surface *self,
cairo_surface_set_device_scale (self->cairo_surface, scale, scale);
}
gdk_surface_invalidate_rect (surface, NULL);
return TRUE;
}
+11 -3
View File
@@ -662,6 +662,10 @@ gsk_gl_command_queue_split_draw (GskGLCommandQueue *self)
g_assert (GSK_IS_GL_COMMAND_QUEUE (self));
g_assert (self->batches.len > 0);
if (will_ignore_batch (self))
return;
g_assert (self->in_draw == TRUE);
program = self->program_info;
@@ -1002,8 +1006,11 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation (GL_FUNC_ADD);
glGenVertexArrays (1, &vao_id);
glBindVertexArray (vao_id);
if (!gdk_gl_context_get_use_es (self->context))
{
glGenVertexArrays (1, &vao_id);
glBindVertexArray (vao_id);
}
vbo_id = gsk_gl_buffer_submit (&self->vertices);
@@ -1159,7 +1166,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
}
glDeleteBuffers (1, &vbo_id);
glDeleteVertexArrays (1, &vao_id);
if (!gdk_gl_context_get_use_es (self->context))
glDeleteVertexArrays (1, &vao_id);
gdk_profiler_set_int_counter (self->metrics.n_binds, n_binds);
gdk_profiler_set_int_counter (self->metrics.n_uniforms, n_uniforms);
+1 -1
View File
@@ -733,7 +733,7 @@ gsk_gl_driver_load_texture (GskGLDriver *self,
format = GL_RGBA8;
if (GDK_IS_GL_TEXTURE (texture))
if (GDK_IS_GL_TEXTURE (texture) && min_filter == GL_LINEAR && mag_filter == GL_LINEAR)
{
GdkGLTexture *gl_texture = (GdkGLTexture *) texture;
GdkGLContext *texture_context = gdk_gl_texture_get_context (gl_texture);
+5 -1
View File
@@ -372,7 +372,11 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
return texture;
}
format = gsk_render_node_prefers_high_depth (root) ? GL_RGBA32F : GL_RGBA8;
if (gsk_render_node_prefers_high_depth (root) &&
gdk_gl_context_check_version (self->context, 3, 0, 3, 0))
format = GL_RGBA32F;
else
format = GL_RGBA8;
gdk_gl_context_make_current (self->context);
+45 -19
View File
@@ -254,7 +254,7 @@ gsk_rounded_rect_shrink_to_minimum (GskRoundedRect *self)
static inline gboolean G_GNUC_PURE
node_supports_2d_transform (const GskRenderNode *node)
{
switch ((int)gsk_render_node_get_node_type (node))
switch (gsk_render_node_get_node_type (node))
{
case GSK_COLOR_NODE:
case GSK_OPACITY_NODE:
@@ -272,6 +272,7 @@ node_supports_2d_transform (const GskRenderNode *node)
case GSK_CAIRO_NODE:
case GSK_BLEND_NODE:
case GSK_BLUR_NODE:
case GSK_MASK_NODE:
return TRUE;
case GSK_SHADOW_NODE:
@@ -288,8 +289,18 @@ node_supports_2d_transform (const GskRenderNode *node)
}
return TRUE;
default:
case GSK_BORDER_NODE:
case GSK_INSET_SHADOW_NODE:
case GSK_OUTSET_SHADOW_NODE:
case GSK_REPEAT_NODE:
case GSK_CLIP_NODE:
case GSK_ROUNDED_CLIP_NODE:
case GSK_GL_SHADER_NODE:
return FALSE;
case GSK_NOT_A_RENDER_NODE:
default:
g_assert_not_reached ();
}
}
@@ -303,7 +314,7 @@ node_supports_transform (const GskRenderNode *node)
* opacity or color matrix.
*/
switch ((int)gsk_render_node_get_node_type (node))
switch (gsk_render_node_get_node_type (node))
{
case GSK_COLOR_NODE:
case GSK_OPACITY_NODE:
@@ -324,8 +335,25 @@ node_supports_transform (const GskRenderNode *node)
case GSK_TRANSFORM_NODE:
return node_supports_transform (gsk_transform_node_get_child (node));
default:
case GSK_CONTAINER_NODE:
case GSK_LINEAR_GRADIENT_NODE:
case GSK_REPEATING_LINEAR_GRADIENT_NODE:
case GSK_RADIAL_GRADIENT_NODE:
case GSK_REPEATING_RADIAL_GRADIENT_NODE:
case GSK_CONIC_GRADIENT_NODE:
case GSK_BORDER_NODE:
case GSK_INSET_SHADOW_NODE:
case GSK_OUTSET_SHADOW_NODE:
case GSK_REPEAT_NODE:
case GSK_CLIP_NODE:
case GSK_ROUNDED_CLIP_NODE:
case GSK_GL_SHADER_NODE:
case GSK_TEXTURE_SCALE_NODE:
return FALSE;
case GSK_NOT_A_RENDER_NODE:
default:
g_assert_not_reached ();
}
}
@@ -535,23 +563,21 @@ extract_matrix_metadata (GskGLRenderModelview *modelview)
case GSK_TRANSFORM_CATEGORY_ANY:
case GSK_TRANSFORM_CATEGORY_3D:
{
graphene_vec3_t col1;
graphene_vec3_t col2;
graphene_quaternion_t rotation;
graphene_vec4_t perspective;
graphene_vec3_t translation;
graphene_vec3_t scale;
graphene_vec3_t shear;
/* TODO: 90% sure this is incorrect. But we should never hit this code
* path anyway. */
graphene_vec3_init (&col1,
graphene_matrix_get_value (&modelview->matrix, 0, 0),
graphene_matrix_get_value (&modelview->matrix, 1, 0),
graphene_matrix_get_value (&modelview->matrix, 2, 0));
graphene_matrix_decompose (&modelview->matrix,
&translation,
&scale,
&rotation,
&shear,
&perspective);
graphene_vec3_init (&col2,
graphene_matrix_get_value (&modelview->matrix, 0, 1),
graphene_matrix_get_value (&modelview->matrix, 1, 1),
graphene_matrix_get_value (&modelview->matrix, 2, 1));
modelview->scale_x = graphene_vec3_length (&col1);
modelview->scale_y = graphene_vec3_length (&col2);
modelview->scale_x = graphene_vec3_get_x (&scale);
modelview->scale_y = graphene_vec3_get_y (&scale);
modelview->dx = 0;
modelview->dy = 0;
}
+2
View File
@@ -377,6 +377,8 @@ gsk_renderer_render_texture (GskRenderer *renderer,
gsk_render_node_get_bounds (root, &real_viewport);
viewport = &real_viewport;
}
g_return_val_if_fail (viewport->size.width > 0, NULL);
g_return_val_if_fail (viewport->size.height > 0, NULL);
texture = GSK_RENDERER_GET_CLASS (renderer)->render_texture (renderer, root, viewport);
+6
View File
@@ -4108,6 +4108,11 @@ gsk_shadow_node_draw (GskRenderNode *node,
pattern = cairo_pop_group (cr);
cairo_restore (cr);
cairo_save (cr);
/* clip so the blur area stays small */
gsk_cairo_rectangle (cr, &node->bounds);
cairo_clip (cr);
for (i = 0; i < self->n_shadows; i++)
{
GskShadow *shadow = &self->shadows[i];
@@ -4129,6 +4134,7 @@ gsk_shadow_node_draw (GskRenderNode *node,
cairo_set_source (cr, pattern);
cairo_paint (cr);
cairo_restore (cr);
cairo_pattern_destroy (pattern);
}
+21 -3
View File
@@ -128,6 +128,10 @@ parse_texture (GtkCssParser *parser,
}
else
{
g_set_error (&error,
GTK_CSS_PARSER_ERROR,
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
"Failed to resolve URL");
texture = NULL;
}
}
@@ -229,8 +233,19 @@ parse_script (GtkCssParser *parser,
GFile *file;
file = gtk_css_parser_resolve_url (parser, url);
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_object_unref (file);
if (file)
{
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_object_unref (file);
}
else
{
g_set_error (&error,
GTK_CSS_PARSER_ERROR,
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
"Failed to resolve URL");
bytes = NULL;
}
}
g_free (scheme);
@@ -416,7 +431,10 @@ parse_string (GtkCssParser *parser,
token = gtk_css_parser_get_token (parser);
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_STRING))
return FALSE;
{
gtk_css_parser_error_syntax (parser, "Expected a string");
return FALSE;
}
s = g_strdup (gtk_css_token_get_string (token));
gtk_css_parser_consume_token (parser);
+2 -1
View File
@@ -142,10 +142,10 @@ collect_states (GtkAtSpiContext *self,
accessible = gtk_at_context_get_accessible (ctx);
set_atspi_state (&states, ATSPI_STATE_VISIBLE);
set_atspi_state (&states, ATSPI_STATE_SHOWING);
if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_WINDOW)
{
set_atspi_state (&states, ATSPI_STATE_SHOWING);
if (gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE))
set_atspi_state (&states, ATSPI_STATE_ACTIVE);
}
@@ -918,6 +918,7 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
{
gtk_at_spi_root_child_changed (self->root, change, accessible);
emit_state_changed (self, "showing", gtk_boolean_accessible_value_get (value));
emit_state_changed (self, "visible", gtk_boolean_accessible_value_get (value));
}
else
{
+1 -1
View File
@@ -43,7 +43,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return ATSPI_ROLE_ALERT;
case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG:
return ATSPI_ROLE_DIALOG;
return ATSPI_ROLE_ALERT;
case GTK_ACCESSIBLE_ROLE_BANNER:
break;
+1 -1
View File
@@ -235,7 +235,7 @@
* button events, however some customized derived areas can be implemented
* who are interested in handling other events. Handling an event can
* trigger the [`signal@Gtk.CellArea::focus-changed`] signal to fire; as well
* as [`signal@GtkCellArea::add-editable`] in the case that an editable cell
* as [`signal@Gtk.CellArea::add-editable`] in the case that an editable cell
* was clicked and needs to start editing. You can call
* [method@Gtk.CellArea.stop_editing] at any time to cancel any cell editing
* that is currently in progress.
+28 -28
View File
@@ -37,7 +37,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and
* [class@Gtk.FontButton].
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
@@ -60,7 +60,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The font description as a string, e.g. "Sans Italic 12".
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -73,7 +73,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The font description as a `PangoFontDescription`.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -86,7 +86,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The string with which to preview the font.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -99,7 +99,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* Whether to show an entry to change the preview text.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -112,7 +112,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The level of granularity to offer for selecting fonts.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -131,7 +131,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* The format of the string is compatible with
* CSS and with Pango attributes.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -144,7 +144,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
*
* The language for which the font features were selected.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
g_object_interface_install_property
(iface,
@@ -163,7 +163,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* or an item is selected and the user presses one of the keys
* Space, Shift+Space, Return or Enter.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
*/
chooser_signals[SIGNAL_FONT_ACTIVATED] =
g_signal_new (I_("font-activated"),
@@ -189,7 +189,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* Returns: (nullable) (transfer none): A `PangoFontFamily` representing the
* selected font family
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
PangoFontFamily *
@@ -212,7 +212,7 @@ gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser)
* Returns: (nullable) (transfer none): A `PangoFontFace` representing the
* selected font group details
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
PangoFontFace *
@@ -232,7 +232,7 @@ gtk_font_chooser_get_font_face (GtkFontChooser *fontchooser)
* Returns: A n integer representing the selected font size,
* or -1 if no font size is selected.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
int
@@ -261,7 +261,7 @@ gtk_font_chooser_get_font_size (GtkFontChooser *fontchooser)
* Returns: (nullable) (transfer full): A string with the name
* of the current font
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
char *
@@ -284,7 +284,7 @@ gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
*
* Sets the currently-selected font.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -315,7 +315,7 @@ gtk_font_chooser_set_font (GtkFontChooser *fontchooser,
* Returns: (nullable) (transfer full): A `PangoFontDescription` for the
* current font
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
PangoFontDescription *
@@ -337,7 +337,7 @@ gtk_font_chooser_get_font_desc (GtkFontChooser *fontchooser)
*
* Sets the currently-selected font from @font_desc.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -358,7 +358,7 @@ gtk_font_chooser_set_font_desc (GtkFontChooser *fontchooser,
*
* Returns: (transfer full): the text displayed in the preview area
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
char *
@@ -382,7 +382,7 @@ gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser)
*
* The @text is used to show how the selected font looks.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -403,7 +403,7 @@ gtk_font_chooser_set_preview_text (GtkFontChooser *fontchooser,
*
* Returns: %TRUE if the preview entry is shown or %FALSE if it is hidden.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
gboolean
@@ -425,7 +425,7 @@ gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser)
*
* Shows or hides the editable preview entry.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -448,7 +448,7 @@ gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
* Adds a filter function that decides which fonts to display
* in the font chooser.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -505,7 +505,7 @@ _gtk_font_chooser_font_activated (GtkFontChooser *chooser,
* pango_context_set_font_map (context, fontmap);
* ```
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -528,7 +528,7 @@ gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
*
* Returns: (nullable) (transfer full): a `PangoFontMap`
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
PangoFontMap *
@@ -551,7 +551,7 @@ gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser)
*
* Sets the desired level of granularity for selecting fonts.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
@@ -571,7 +571,7 @@ gtk_font_chooser_set_level (GtkFontChooser *fontchooser,
*
* Returns: the current granularity level
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
GtkFontChooserLevel
@@ -598,7 +598,7 @@ gtk_font_chooser_get_level (GtkFontChooser *fontchooser)
*
* Returns: the currently selected font features
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
char *
@@ -621,7 +621,7 @@ gtk_font_chooser_get_font_features (GtkFontChooser *fontchooser)
*
* Returns: the currently selected language
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
char *
@@ -643,7 +643,7 @@ gtk_font_chooser_get_language (GtkFontChooser *fontchooser)
*
* Sets the language to use for font features.
*
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
* instead
*/
void
+1 -1
View File
@@ -126,7 +126,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* style class applied.
*
* Deprecated: 4.10: There is no replacement in GTK for an "info bar" widget;
* you can use [class@Gtk.Revealer] with a [class@GtkBox] containing a
* you can use [class@Gtk.Revealer] with a [class@Gtk.Box] containing a
* [class@Gtk.Label] and an optional [class@Gtk.Button], according to
* your application's design.
*/
+2 -1
View File
@@ -284,7 +284,8 @@ extract_plane (GdkPixbuf *src,
int to_plane)
{
guchar *src_data, *dst_data;
int width, height, src_stride, dst_stride;
int width, height;
gsize src_stride, dst_stride;
guchar *src_row, *dst_row;
int x, y;
+3
View File
@@ -460,6 +460,9 @@ gsk_pango_renderer_release (GskPangoRenderer *renderer)
* Creates render nodes for rendering @layout in the given foregound @color
* and appends them to the current node of @snapshot without changing the
* current node.
*
* Note that if the layout does not produce any visible output, then nodes
* may not be added to the @snapshot.
**/
void
gtk_snapshot_append_layout (GtkSnapshot *snapshot,
+11 -14
View File
@@ -249,25 +249,21 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self)
g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), NULL);
GtkATContext *context;
GtkAccessible *sibling = NULL;
context = gtk_accessible_get_at_context (self);
if (context != NULL)
if (context != NULL && gtk_at_context_get_accessible_parent (context) != NULL)
{
GtkAccessible *sibling = NULL;
if (gtk_at_context_get_accessible_parent (context) != NULL)
{
sibling = gtk_at_context_get_next_accessible_sibling (context);
if (sibling != NULL)
sibling = g_object_ref (sibling);
}
g_object_unref (context);
return sibling;
sibling = gtk_at_context_get_next_accessible_sibling (context);
if (sibling != NULL)
sibling = g_object_ref (sibling);
}
else
return GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self);
sibling = GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self);
g_clear_object (&context);
return sibling;
}
/**
@@ -834,6 +830,7 @@ static const char *role_names[] = {
[GTK_ACCESSIBLE_ROLE_TREE_ITEM] = NC_("accessibility", "tree item"),
[GTK_ACCESSIBLE_ROLE_WIDGET] = NC_("accessibility", "widget"),
[GTK_ACCESSIBLE_ROLE_WINDOW] = NC_("accessibility", "window"),
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NC_("accessibility", "toggle button"),
};
/*< private >
+6 -1
View File
@@ -232,6 +232,8 @@ gtk_action_muxer_list_actions (GtkActionMuxer *muxer,
GHashTable *actions;
char **keys;
g_return_val_if_fail (GTK_IS_ACTION_MUXER (muxer), NULL);
actions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for ( ; muxer != NULL; muxer = muxer->parent)
@@ -323,6 +325,9 @@ gtk_action_muxer_get_group (GtkActionMuxer *muxer,
{
Group *group;
if (!muxer->groups)
return NULL;
group = g_hash_table_lookup (muxer->groups, group_name);
if (group)
return group->group;
@@ -450,7 +455,7 @@ notify_observers_added (GtkActionMuxer *muxer,
gtk_action_observable_register_observer (GTK_ACTION_OBSERVABLE (parent), action_name, GTK_ACTION_OBSERVER (muxer));
if (!action_muxer_query_action (parent, action_name,
if (!action_muxer_query_action (muxer, action_name,
&enabled, &parameter_type,
NULL, NULL, &state,
TRUE))
+1 -1
View File
@@ -74,7 +74,7 @@ gboolean gtk_action_muxer_query_action (GtkActi
const GVariantType **parameter_type,
const GVariantType **state_type,
GVariant **state_hint,
GVariant **state);
GVariant **state) G_GNUC_WARN_UNUSED_RESULT;
void gtk_action_muxer_activate_action (GtkActionMuxer *muxer,
const char *action_name,
GVariant *parameter);
+19 -10
View File
@@ -352,6 +352,21 @@ gtk_adjustment_dispatch_properties_changed (GObject *object,
}
}
static double
gtk_adjustment_sanitize_value (GtkAdjustment *self,
double value)
{
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (self);
/* don't use CLAMP() so we don't end up below lower if upper - page_size
* is smaller than lower
*/
value = MIN (value, priv->upper - priv->page_size);
value = MAX (value, priv->lower);
return value;
}
/**
* gtk_adjustment_new:
* @value: the initial value
@@ -419,6 +434,8 @@ adjustment_set_value (GtkAdjustment *adjustment,
{
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
value = gtk_adjustment_sanitize_value (adjustment, value);
if (priv->value != value)
{
priv->value = value;
@@ -497,11 +514,7 @@ gtk_adjustment_set_value_internal (GtkAdjustment *adjustment,
{
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
/* don't use CLAMP() so we don't end up below lower if upper - page_size
* is smaller than lower
*/
value = MIN (value, priv->upper - priv->page_size);
value = MAX (value, priv->lower);
value = gtk_adjustment_sanitize_value (adjustment, value);
if (animate && priv->duration != 0 && priv->clock != NULL)
{
@@ -825,11 +838,7 @@ gtk_adjustment_configure (GtkAdjustment *adjustment,
gtk_adjustment_set_page_increment (adjustment, page_increment);
gtk_adjustment_set_page_size (adjustment, page_size);
/* don't use CLAMP() so we don't end up below lower if upper - page_size
* is smaller than lower
*/
value = MIN (value, upper - page_size);
value = MAX (value, lower);
value = gtk_adjustment_sanitize_value (adjustment, value);
if (value != priv->value)
{
+3
View File
@@ -747,6 +747,9 @@ gtk_alert_dialog_choose_finish (GtkAlertDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), -1);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_alert_dialog_choose, -1);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return (int) g_task_propagate_int (G_TASK (result), error);
}
+1 -1
View File
@@ -105,7 +105,7 @@ struct _GtkBuildableParser
* @set_buildable_property: Sets a property of a buildable object.
* It is normally not necessary to implement this, g_object_set_property()
* is used by default. `GtkWindow` implements this to delay showing itself
* (i.e. setting the [property@GtkWidget:visible] property) until the whole
* (i.e. setting the [property@Gtk.Widget:visible] property) until the whole
* interface is created.
* @construct_child: Constructs a child of a buildable that has been
* specified as constructor in the UI definition. This can be used to
+5 -1
View File
@@ -288,6 +288,9 @@ gtk_button_class_init (GtkButtonClass *klass)
*
* This is an action signal. Applications should never connect
* to this signal, but use the [signal@Gtk.Button::clicked] signal.
*
* The default bindings for this signal are all forms of the
* <kbd></kbd> and <kbd>Enter</kbd> keys.
*/
button_signals[ACTIVATE] =
g_signal_new (I_("activate"),
@@ -669,7 +672,8 @@ gtk_button_new_from_icon_name (const char *icon_name)
* If characters in @label are preceded by an underscore, they are underlined.
* If you need a literal underscore character in a label, use __ (two
* underscores). The first underlined character represents a keyboard
* accelerator called a mnemonic. Pressing Alt and that key activates the button.
* accelerator called a mnemonic. Pressing <kbd>Alt</kbd> and that key
* activates the button.
*
* Returns: a new `GtkButton`
*/
+7 -5
View File
@@ -481,16 +481,15 @@ gtk_check_button_focus (GtkWidget *widget,
}
}
g_ptr_array_free (child_array, TRUE);
if (new_focus)
if (new_focus && new_focus != widget)
{
gtk_widget_grab_focus (new_focus);
gtk_widget_activate (new_focus);
return TRUE;
}
g_ptr_array_free (child_array, TRUE);
return TRUE;
return FALSE;
}
else
{
@@ -673,6 +672,9 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
* Applications should never connect to this signal, but use the
* [signal@Gtk.CheckButton::toggled] signal.
*
* The default bindings for this signal are all forms of the
* <kbd></kbd> and <kbd>Enter</kbd> keys.
*
* Since: 4.2
*/
signals[ACTIVATE] =
+3
View File
@@ -492,6 +492,9 @@ gtk_color_dialog_choose_rgba_finish (GtkColorDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_color_dialog_choose_rgba, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
+43 -10
View File
@@ -88,7 +88,7 @@ gtk_css_value_corner_transition (GtkCssValue *start,
static void
gtk_css_value_corner_print (const GtkCssValue *corner,
GString *string)
GString *string)
{
_gtk_css_value_print (corner->x, string);
if (!_gtk_css_value_equal (corner->x, corner->y))
@@ -109,16 +109,55 @@ static const GtkCssValueClass GTK_CSS_VALUE_CORNER = {
gtk_css_value_corner_print
};
static GtkCssValue corner_singletons[] = {
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
{ &GTK_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
};
static inline void
initialize_corner_singletons (void)
{
static gboolean initialized = FALSE;
if (initialized)
return;
for (unsigned int i = 0; i < G_N_ELEMENTS (corner_singletons); i++)
{
corner_singletons[i].x = gtk_css_dimension_value_new (i, GTK_CSS_PX);
corner_singletons[i].y = gtk_css_value_ref (corner_singletons[i].x);
}
initialized = TRUE;
}
GtkCssValue *
_gtk_css_corner_value_new (GtkCssValue *x,
GtkCssValue *y)
{
GtkCssValue *result;
if (_gtk_css_value_equal (x, y))
if (x == y &&
gtk_css_number_value_get_dimension (x) == GTK_CSS_DIMENSION_LENGTH)
{
_gtk_css_value_unref (y);
return x;
initialize_corner_singletons ();
for (unsigned int i = 0; i < G_N_ELEMENTS (corner_singletons); i++)
{
if (corner_singletons[i].x == x)
{
gtk_css_value_unref (x);
gtk_css_value_unref (y);
return gtk_css_value_ref (&corner_singletons[i]);
}
}
}
result = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_CORNER);
@@ -162,9 +201,6 @@ double
_gtk_css_corner_value_get_x (const GtkCssValue *corner,
double one_hundred_percent)
{
if (corner->class != &GTK_CSS_VALUE_CORNER)
return _gtk_css_number_value_get (corner, one_hundred_percent);
g_return_val_if_fail (corner != NULL, 0.0);
g_return_val_if_fail (corner->class == &GTK_CSS_VALUE_CORNER, 0.0);
@@ -175,9 +211,6 @@ double
_gtk_css_corner_value_get_y (const GtkCssValue *corner,
double one_hundred_percent)
{
if (corner->class != &GTK_CSS_VALUE_CORNER)
return _gtk_css_number_value_get (corner, one_hundred_percent);
g_return_val_if_fail (corner != NULL, 0.0);
g_return_val_if_fail (corner->class == &GTK_CSS_VALUE_CORNER, 0.0);
+8 -8
View File
@@ -102,10 +102,10 @@ gtk_css_filter_clear (GtkCssFilter *filter)
}
static void
gtk_css_filter_init_identity (GtkCssFilter *filter,
GtkCssFilterType type)
gtk_css_filter_init_identity (GtkCssFilter *filter,
const GtkCssFilter *other)
{
switch (type)
switch (other->type)
{
case GTK_CSS_FILTER_BRIGHTNESS:
filter->brightness.value = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
@@ -135,7 +135,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
filter->blur.value = _gtk_css_number_value_new (0, GTK_CSS_PX);
break;
case GTK_CSS_FILTER_DROP_SHADOW:
filter->drop_shadow.value = gtk_css_shadow_value_new_filter ();
filter->drop_shadow.value = gtk_css_shadow_value_new_filter (other->drop_shadow.value);
break;
case GTK_CSS_FILTER_NONE:
default:
@@ -143,7 +143,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
break;
}
filter->type = type;
filter->type = other->type;
}
#define R 0.2126
@@ -466,7 +466,7 @@ gtk_css_value_filter_equal (const GtkCssValue *value1,
{
GtkCssFilter filter;
gtk_css_filter_init_identity (&filter, larger->filters[i].type);
gtk_css_filter_init_identity (&filter, &larger->filters[i]);
if (!gtk_css_filter_equal (&larger->filters[i], &filter))
{
@@ -590,7 +590,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
{
GtkCssFilter filter;
gtk_css_filter_init_identity (&filter, start->filters[i].type);
gtk_css_filter_init_identity (&filter, &start->filters[i]);
gtk_css_filter_transition (&result->filters[i],
&start->filters[i],
&filter,
@@ -602,7 +602,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
{
GtkCssFilter filter;
gtk_css_filter_init_identity (&filter, end->filters[i].type);
gtk_css_filter_init_identity (&filter, &end->filters[i]);
gtk_css_filter_transition (&result->filters[i],
&filter,
&end->filters[i],
+5 -6
View File
@@ -75,7 +75,8 @@ gtk_css_value_font_features_equal (const GtkCssValue *value1,
g_hash_table_iter_init (&iter, value1->features);
while (g_hash_table_iter_next (&iter, &name, &val1))
{
val2 = g_hash_table_lookup (value2->features, name);
if (!g_hash_table_lookup_extended (value2->features, name, NULL, &val2))
return FALSE;
if (val1 != val2)
return FALSE;
@@ -106,11 +107,10 @@ gtk_css_value_font_features_transition (GtkCssValue *start,
g_hash_table_iter_init (&iter, start->features);
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&start_val))
{
end_val = g_hash_table_lookup (end->features, name);
if (end_val == NULL)
if (!g_hash_table_lookup_extended (end->features, name, NULL, &end_val))
transition = start_val;
else
transition = progress > 0.5 ? start_val : end_val;
transition = progress < 0.5 ? start_val : end_val;
gtk_css_font_features_value_add_feature (result, name, GPOINTER_TO_INT (transition));
}
@@ -118,8 +118,7 @@ gtk_css_value_font_features_transition (GtkCssValue *start,
g_hash_table_iter_init (&iter, end->features);
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&end_val))
{
start_val = g_hash_table_lookup (start->features, name);
if (start_val != NULL)
if (g_hash_table_lookup_extended (end->features, name, NULL, &start_val))
continue;
gtk_css_font_features_value_add_feature (result, name, GPOINTER_TO_INT (end_val));
+1 -15
View File
@@ -47,21 +47,7 @@ gtk_css_image_url_load_image (GtkCssImageUrl *url,
return url->loaded_image;
}
/* We special case resources here so we can use gdk_texture_new_from_resource. */
if (g_file_has_uri_scheme (url->file, "resource"))
{
char *uri = g_file_get_uri (url->file);
char *resource_path = g_uri_unescape_string (uri + strlen ("resource://"), NULL);
texture = gdk_texture_new_from_resource (resource_path);
g_free (resource_path);
g_free (uri);
}
else
{
texture = gdk_texture_new_from_file (url->file, &local_error);
}
texture = gdk_texture_new_from_file (url->file, &local_error);
if (texture == NULL)
{
+1 -1
View File
@@ -64,7 +64,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
case GTK_CSS_PROPERTY_FONT_FAMILY:
settings = gtk_style_provider_get_settings (provider);
if (settings && gtk_settings_get_font_family (settings) != NULL)
return _gtk_css_string_value_new (gtk_settings_get_font_family (settings));
return _gtk_css_array_value_new (_gtk_css_string_value_new (gtk_settings_get_font_family (settings)));
break;
default:
+1 -1
View File
@@ -713,7 +713,7 @@ gtk_css_node_reposition (GtkCssNode *node,
{
GTK_CSS_NODE_GET_CLASS (old_parent)->node_removed (old_parent, node, node->previous_sibling);
if (old_parent->children_observer && old_parent != new_parent)
gtk_list_list_model_item_removed (old_parent->children_observer, previous);
gtk_list_list_model_item_removed (old_parent->children_observer, old_previous);
if (old_parent->first_child && node->visible)
gtk_css_node_invalidate (old_parent->first_child, GTK_CSS_CHANGE_NTH_LAST_CHILD);
}
+11 -6
View File
@@ -380,6 +380,9 @@ gtk_css_dimension_value_new (double value,
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 2 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 3 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 4 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 5 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 6 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 7 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 8 }} },
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 16 }} }, /* Icon size default */
{ &GTK_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 32 }} },
@@ -418,16 +421,18 @@ gtk_css_dimension_value_new (double value,
value == 1 ||
value == 2 ||
value == 3 ||
value == 4)
value == 4 ||
value == 5 ||
value == 6 ||
value == 7 ||
value == 8)
return _gtk_css_value_ref (&px_singletons[(int) value]);
if (value == 8)
return _gtk_css_value_ref (&px_singletons[5]);
if (value == 16)
return _gtk_css_value_ref (&px_singletons[6]);
return _gtk_css_value_ref (&px_singletons[9]);
if (value == 32)
return _gtk_css_value_ref (&px_singletons[7]);
return _gtk_css_value_ref (&px_singletons[10]);
if (value == 64)
return _gtk_css_value_ref (&px_singletons[8]);
return _gtk_css_value_ref (&px_singletons[11]);
break;
+6 -6
View File
@@ -331,16 +331,16 @@ gtk_css_shadow_value_new (ShadowValue *shadows,
}
GtkCssValue *
gtk_css_shadow_value_new_filter (void)
gtk_css_shadow_value_new_filter (const GtkCssValue *other)
{
ShadowValue value;
value.inset = FALSE;
value.hoffset = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
value.voffset = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
value.radius = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
value.spread = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
value.color = _gtk_css_color_value_new_current_color ();
value.hoffset = _gtk_css_number_value_new (0, GTK_CSS_PX);
value.voffset = _gtk_css_number_value_new (0, GTK_CSS_PX);
value.radius = _gtk_css_number_value_new (0, GTK_CSS_PX);
value.spread = _gtk_css_number_value_new (0, GTK_CSS_PX);
value.color = gtk_css_value_ref (other->shadows[0].color);
return gtk_css_shadow_value_new (&value, 1, TRUE);
}
+1 -1
View File
@@ -35,7 +35,7 @@
G_BEGIN_DECLS
GtkCssValue * gtk_css_shadow_value_new_none (void);
GtkCssValue * gtk_css_shadow_value_new_filter (void);
GtkCssValue * gtk_css_shadow_value_new_filter (const GtkCssValue *other);
GtkCssValue * gtk_css_shadow_value_parse (GtkCssParser *parser,
gboolean box_shadow_mode);
+8 -5
View File
@@ -1095,25 +1095,29 @@ _gtk_css_style_property_init_properties (void)
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
_gtk_css_number_value_new (0, GTK_CSS_PX));
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
_gtk_css_number_value_new (0, GTK_CSS_PX)));
gtk_css_style_property_register ("border-top-right-radius",
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
_gtk_css_number_value_new (0, GTK_CSS_PX));
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
_gtk_css_number_value_new (0, GTK_CSS_PX)));
gtk_css_style_property_register ("border-bottom-right-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
_gtk_css_number_value_new (0, GTK_CSS_PX));
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
_gtk_css_number_value_new (0, GTK_CSS_PX)));
gtk_css_style_property_register ("border-bottom-left-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
_gtk_css_number_value_new (0, GTK_CSS_PX));
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
_gtk_css_number_value_new (0, GTK_CSS_PX)));
gtk_css_style_property_register ("outline-style",
GTK_CSS_PROPERTY_OUTLINE_STYLE,
@@ -1133,7 +1137,6 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_AFFECTS_OUTLINE,
outline_parse,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("background-clip",
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
0,
+1 -1
View File
@@ -142,7 +142,7 @@ gtk_css_transform_init_identity (GtkCssTransform *transform,
case GTK_CSS_TRANSFORM_ROTATE:
transform->rotate.x = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
transform->rotate.y = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
transform->rotate.z = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
transform->rotate.z = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
transform->rotate.angle = _gtk_css_number_value_new (0, GTK_CSS_DEG);
break;
case GTK_CSS_TRANSFORM_SCALE:
+1 -1
View File
@@ -2098,7 +2098,7 @@ gtk_entry_get_visibility (GtkEntry *entry)
}
/**
* gtk_entry_set_invisible_char: (attributes org.gtk.Method.sets_property=invisible-char)
* gtk_entry_set_invisible_char: (attributes org.gtk.Method.set_property=invisible-char)
* @entry: a `GtkEntry`
* @ch: a Unicode character
*
+2 -2
View File
@@ -852,8 +852,6 @@ typedef enum {
GTK_LEVEL_BAR_MODE_DISCRETE
} GtkLevelBarMode;
G_END_DECLS
/**
* GtkInputPurpose:
* @GTK_INPUT_PURPOSE_FREE_FORM: Allow any character
@@ -1670,4 +1668,6 @@ typedef enum { /*< prefix=GTK_ACCESSIBLE_SORT >*/
GTK_ACCESSIBLE_SORT_OTHER
} GtkAccessibleSort;
G_END_DECLS
#endif /* __GTK_ENUMS_H__ */
+16 -4
View File
@@ -410,16 +410,22 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
}
else
{
if (ABS (scroll->cur_dx) >= 1)
if (ABS (scroll->cur_dx) >= 0.5)
{
steps = trunc (scroll->cur_dx);
if (steps == 0)
steps = (scroll->cur_dx > 0) ? 1 : -1;
scroll->cur_dx -= steps;
dx = steps;
}
if (ABS (scroll->cur_dy) >= 1)
if (ABS (scroll->cur_dy) >= 0.5)
{
steps = trunc (scroll->cur_dy);
if (steps == 0)
steps = (scroll->cur_dy > 0) ? 1 : -1;
scroll->cur_dy -= steps;
dy = steps;
}
@@ -459,16 +465,22 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
scroll->cur_dy += dy;
dx = dy = 0;
if (ABS (scroll->cur_dx) >= 1)
if (ABS (scroll->cur_dx) >= 0.5)
{
steps = trunc (scroll->cur_dx);
if (steps == 0)
steps = (scroll->cur_dx > 0) ? 1 : -1;
scroll->cur_dx -= steps;
dx = steps;
}
if (ABS (scroll->cur_dy) >= 1)
if (ABS (scroll->cur_dy) >= 0.5)
{
steps = trunc (scroll->cur_dy);
if (steps == 0)
steps = (scroll->cur_dy > 0) ? 1 : -1;
scroll->cur_dy -= steps;
dy = steps;
}
+5 -5
View File
@@ -40,7 +40,7 @@
* expanded widget yourself, such as when you want to actually create
* the widget at expansion time. In this case, create a `GtkExpander`
* but do not add a child to it. The expander widget has an
* [property@Gtk.Expander:expanded[ property which can be used to
* [property@Gtk.Expander:expanded] property which can be used to
* monitor its expansion state. You should watch this property with
* a signal connection as follows:
*
@@ -98,16 +98,16 @@
* # CSS nodes
*
* ```
* expander
* expander-widget
* box
* title
* arrow
* expander
* <label widget>
* <child>
* ```
*
* `GtkExpander` has three CSS nodes, the main node with the name expander,
* a subnode with name title and node below it with name arrow. The arrow of an
* `GtkExpander` has three CSS nodes, the main node with the name expander-widget,
* a subnode with name title and node below it with name expander. The arrow of an
* expander that is showing its child gets the :checked pseudoclass added to it.
*
* # Accessibility
+17 -12
View File
@@ -193,28 +193,30 @@ match_func (GtkEntryCompletion *compl,
gpointer user_data)
{
GtkFileChooserEntry *chooser_entry = user_data;
GFileInfo *info;
gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store),
iter,
FILE_INFO_COLUMN, &info,
-1);
g_assert (info != NULL);
g_object_unref (info);
if (g_file_info_get_attribute_boolean (info, "filechooser::filtered-out"))
return FALSE;
/* If we arrive here, the GtkFileSystemModel's GtkFileFilter already filtered out all
* files that don't start with the current prefix, so we manually apply the GtkFileChooser's
* current file filter (e.g. just jpg files) here. */
* current file filter (e.g. just jpg files) here.
*/
if (chooser_entry->current_filter != NULL)
{
GFileInfo *info;
gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store),
iter,
FILE_INFO_COLUMN, &info,
-1);
g_assert (info != NULL);
g_object_unref (info);
/* We always allow navigating into subfolders, so don't ever filter directories */
if (g_file_info_get_file_type (info) != G_FILE_TYPE_REGULAR)
return TRUE;
g_assert (g_file_info_has_attribute (info, "standard::file"));
return gtk_filter_match (GTK_FILTER (chooser_entry->current_filter), info);
}
@@ -598,6 +600,9 @@ model_items_changed_cb (GListModel *model,
DISPLAY_NAME_COLUMN, display_name,
-1);
g_free (display_name);
g_free (full_path);
g_clear_object (&info);
position++;
+6
View File
@@ -34,6 +34,7 @@
#include "gtkfilechooserprivate.h"
#include "deprecated/gtkfilechooserdialog.h"
#include "deprecated/gtkfilechooser.h"
#include "gtkfilechoosercellprivate.h"
#include "gtkfilechooserentry.h"
#include "gtkfilechooserutils.h"
#include "gtkfilesystemmodelprivate.h"
@@ -577,7 +578,10 @@ gtk_file_chooser_widget_finalize (GObject *object)
stop_loading_and_clear_list_model (impl, FALSE);
search_clear_model (impl, FALSE);
recent_clear_model (impl, FALSE);
g_clear_object (&impl->recent_model);
g_clear_object (&impl->search_model);
g_clear_object (&impl->model_for_search);
g_clear_object (&impl->browse_files_model);
g_clear_object (&impl->selection_model);
g_clear_object (&impl->sort_model);
@@ -3980,6 +3984,7 @@ set_list_model (GtkFileChooserWidget *impl,
set_busy_cursor (impl, TRUE);
g_clear_object (&impl->browse_files_model);
impl->browse_files_model =
_gtk_file_system_model_new_for_directory (impl->current_folder, MODEL_ATTRIBUTES);
@@ -7304,6 +7309,7 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl)
g_type_ensure (GTK_TYPE_PATH_BAR);
g_type_ensure (GTK_TYPE_PLACES_VIEW);
g_type_ensure (GTK_TYPE_PLACES_SIDEBAR);
g_type_ensure (GTK_TYPE_FILE_CHOOSER_CELL);
g_type_ensure (GTK_TYPE_FILE_CHOOSER_ERROR_STACK);
impl->select_multiple = FALSE;
+15
View File
@@ -976,6 +976,9 @@ gtk_file_dialog_open_finish (GtkFileDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_open, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return finish_file_op (self, G_TASK (result), error);
}
@@ -1050,6 +1053,9 @@ gtk_file_dialog_select_folder_finish (GtkFileDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_select_folder, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return finish_file_op (self, G_TASK (result), error);
}
@@ -1120,6 +1126,9 @@ gtk_file_dialog_save_finish (GtkFileDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_save, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return finish_file_op (self, G_TASK (result), error);
}
@@ -1194,6 +1203,9 @@ gtk_file_dialog_open_multiple_finish (GtkFileDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_open_multiple, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return finish_multiple_files_op (self, G_TASK (result), error);
}
@@ -1268,6 +1280,9 @@ gtk_file_dialog_select_multiple_folders_finish (GtkFileDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_select_multiple_folders, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return finish_multiple_files_op (self, G_TASK (result), error);
}
+13 -14
View File
@@ -229,9 +229,9 @@ open_done (GObject *source,
#endif
static void
show_folder_done (GObject *source,
GAsyncResult *result,
gpointer data)
show_item_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
GDBusConnection *bus = G_DBUS_CONNECTION (source);
GTask *task = G_TASK (data);
@@ -261,11 +261,10 @@ show_folder_done (GObject *source,
#define FILE_MANAGER_DBUS_PATH "/org/freedesktop/FileManager1"
static void
show_folder (GtkWindow *parent,
const char *uri,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
show_item (GtkWindow *parent,
const char *uri,
GCancellable *cancellable,
GTask *task)
{
GDBusConnection *bus;
GVariantBuilder uris_builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_STRING_ARRAY);
@@ -274,10 +273,10 @@ show_folder (GtkWindow *parent,
if (!bus)
{
g_task_return_new_error (G_TASK (user_data),
g_task_return_new_error (task,
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED,
"Session bus not available");
g_object_unref (G_TASK (user_data));
g_object_unref (task);
return;
}
@@ -287,14 +286,14 @@ show_folder (GtkWindow *parent,
FILE_MANAGER_DBUS_NAME,
FILE_MANAGER_DBUS_PATH,
FILE_MANAGER_DBUS_IFACE,
"ShowFolders",
"ShowItems",
g_variant_new ("(ass)", &uris_builder, ""),
NULL, /* ignore returned type */
G_DBUS_CALL_FLAGS_NONE,
-1,
cancellable,
show_folder_done,
user_data);
show_item_done,
task);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -470,7 +469,7 @@ gtk_file_launcher_open_containing_folder (GtkFileLauncher *self,
{
char *uri = g_file_get_uri (self->file);
show_folder (parent, uri, cancellable, show_folder_done, task);
show_item (parent, uri, cancellable, task);
g_free (uri);
}
+18 -7
View File
@@ -331,8 +331,6 @@ list_model_get_item (GListModel *list_model,
GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (list_model);
FileModelNode *node;
/* The first items of GtkFileSystemModel is not really a file,
* so ignore it. */
if (position >= model->files->len)
return NULL;
@@ -386,6 +384,7 @@ gtk_file_system_model_refilter_all (GtkFileSystemModel *model)
for (i = 0; i < model->files->len; i++)
node_compute_visibility_and_filters (model, i);
g_list_model_items_changed (G_LIST_MODEL (model), 0, model->files->len, model->files->len);
model->filter_on_thaw = FALSE;
thaw_updates (model);
}
@@ -410,6 +409,7 @@ thaw_updates (GtkFileSystemModel *model)
if (stuff_added)
{
guint i;
guint changed_idx = G_MAXUINT;
for (i = 0; i < model->files->len; i++)
{
@@ -417,9 +417,17 @@ thaw_updates (GtkFileSystemModel *model)
if (!node->frozen_add)
continue;
node->frozen_add = FALSE;
node_compute_visibility_and_filters (model, i);
if (changed_idx == G_MAXUINT)
changed_idx = i;
}
if (changed_idx != G_MAXUINT)
g_list_model_items_changed (G_LIST_MODEL (model), changed_idx,
model->files->len - changed_idx,
model->files->len - changed_idx);
}
}
@@ -450,9 +458,10 @@ add_file (GtkFileSystemModel *model,
position = model->files->len - 1;
if (!model->frozen)
node_compute_visibility_and_filters (model, position);
g_list_model_items_changed (G_LIST_MODEL (model), position, 0, 1);
{
node_compute_visibility_and_filters (model, position);
g_list_model_items_changed (G_LIST_MODEL (model), position, 0, 1);
}
}
static void
@@ -502,7 +511,7 @@ remove_file (GtkFileSystemModel *model,
g_array_remove_index (model->files, id);
g_list_model_items_changed (G_LIST_MODEL (model), id - 1, 1, 0);
g_list_model_items_changed (G_LIST_MODEL (model), id, 1, 0);
}
static void
@@ -739,7 +748,9 @@ gtk_file_system_model_monitor_change (GFileMonitor * monitor,
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
/* We can treat all of these the same way */
if (g_file_equal (file, model->dir))
return;
/* We can treat all children the same way */
g_file_query_info_async (file,
model->attributes,
G_FILE_QUERY_INFO_NONE,
+2 -3
View File
@@ -180,9 +180,6 @@ gtk_filter_list_model_run_filter (GtkFilterListModel *self,
gtk_bitset_remove_range_closed (self->pending, 0, pos - 1);
else
g_clear_pointer (&self->pending, gtk_bitset_unref);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
return;
}
static void
@@ -237,6 +234,7 @@ gtk_filter_list_model_run_filter_cb (gpointer data)
gtk_filter_list_model_stop_filtering (self);
gtk_filter_list_model_emit_items_changed_for_changes (self, old);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
return G_SOURCE_CONTINUE;
}
@@ -857,6 +855,7 @@ gtk_filter_list_model_set_incremental (GtkFilterListModel *self,
gtk_filter_list_model_stop_filtering (self);
gtk_filter_list_model_emit_items_changed_for_changes (self, old);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
}
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INCREMENTAL]);
+1 -1
View File
@@ -538,7 +538,7 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
*
* Emitted when the user activates a child widget in a `GtkFlowBox`.
*
* This can be happen either by clicking or double-clicking,
* This can happen either by clicking or double-clicking,
* or via a keybinding.
*
* This is a [keybinding signal](class.SignalAction.html),
+11
View File
@@ -697,6 +697,9 @@ gtk_font_dialog_choose_family_finish (GtkFontDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_family, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -777,6 +780,9 @@ gtk_font_dialog_choose_face_finish (GtkFontDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_face, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -855,6 +861,9 @@ gtk_font_dialog_choose_font_finish (GtkFontDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font, NULL);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -944,6 +953,8 @@ gtk_font_dialog_choose_font_and_features_finish (GtkFontDialog *self,
g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font_and_features, FALSE);
/* Destroy the dialog window not to be bound to GTask lifecycle */
g_task_set_task_data (G_TASK (result), NULL, NULL);
font_result = g_task_propagate_pointer (G_TASK (result), error);
if (font_result)
+5 -5
View File
@@ -150,6 +150,7 @@ _gtk_gesture_click_update_timeout (GtkGestureClick *gesture)
static gboolean
_gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture,
const char *setting,
double x,
double y)
{
@@ -165,9 +166,7 @@ _gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture,
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
settings = gtk_widget_get_settings (widget);
g_object_get (settings,
"gtk-double-click-distance", &double_click_distance,
NULL);
g_object_get (settings, setting, &double_click_distance, NULL);
if (ABS (priv->initial_press_x - x) < double_click_distance &&
ABS (priv->initial_press_y - y) < double_click_distance)
@@ -220,7 +219,8 @@ gtk_gesture_click_begin (GtkGesture *gesture,
_gtk_gesture_click_update_timeout (click);
gtk_gesture_get_point (gesture, current, &x, &y);
if (!_gtk_gesture_click_check_within_threshold (click, x, y))
if (gdk_device_get_source (priv->current_device) == GDK_SOURCE_MOUSE &&
!_gtk_gesture_click_check_within_threshold (click, "gtk-double-click-distance", x, y))
_gtk_gesture_click_stop (click);
/* Increment later the real counter, just if the gesture is
@@ -250,7 +250,7 @@ gtk_gesture_click_update (GtkGesture *gesture,
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
gtk_gesture_get_point (gesture, current, &x, &y);
if (!_gtk_gesture_click_check_within_threshold (click, x, y))
if (!_gtk_gesture_click_check_within_threshold (click, "gtk-dnd-drag-threshold", x, y))
_gtk_gesture_click_stop (click);
}
+1 -1
View File
@@ -103,7 +103,7 @@ gtk_gesture_stylus_handle_event (GtkEventController *controller,
priv = gtk_gesture_stylus_get_instance_private (GTK_GESTURE_STYLUS (controller));
GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_stylus_parent_class)->handle_event (controller, event, x, y);
if (!(priv->stylus_only || gdk_event_get_device_tool (event)))
if (priv->stylus_only && !gdk_event_get_device_tool (event))
return FALSE;
switch ((guint) gdk_event_get_event_type (event))

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