gtk4.git
3 years agotestsuite: Skip tests that miss charset support
Matthias Clasen [Tue, 29 Nov 2022 08:52:27 +0000 (03:52 -0500)]
testsuite: Skip tests that miss charset support

This came up when running the tests in a fresh
toolbox missing the glibc-gconv-extra package.

3 years agoMerge branch 'wip/corey/at-spi-context' into 'main'
Matthias Clasen [Tue, 29 Nov 2022 07:51:23 +0000 (07:51 +0000)]
Merge branch 'wip/corey/at-spi-context' into 'main'

atspicontext: Cache empty atspi bus address

See merge request GNOME/gtk!5276

3 years agoMerge branch 'show-hide-cleanup' into 'main'
Matthias Clasen [Tue, 29 Nov 2022 07:30:04 +0000 (07:30 +0000)]
Merge branch 'show-hide-cleanup' into 'main'

gtk: Stop using gtk_widget_show/hide

See merge request GNOME/gtk!5273

3 years agoatspicontext: Log more helpful warnings when the a11y bus doesn't exist
Corey Berla [Tue, 29 Nov 2022 00:34:12 +0000 (16:34 -0800)]
atspicontext: Log more helpful warnings when the a11y bus doesn't exist

3 years agoatspicontext: Cache empty atspi bus address
Corey Berla [Tue, 29 Nov 2022 00:32:52 +0000 (16:32 -0800)]
atspicontext: Cache empty atspi bus address

We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 28 Nov 2022 23:08:58 +0000 (23:08 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Revert "builder: Stop using GtkBuildable.get_id"

See merge request GNOME/gtk!5274

3 years agoMerge branch 'wip/carlosg/osk-activation-in-widgets' into 'main'
Matthias Clasen [Mon, 28 Nov 2022 19:43:19 +0000 (19:43 +0000)]
Merge branch 'wip/carlosg/osk-activation-in-widgets' into 'main'

Handle OSK activation in GtkText/GtkTextView widgets

See merge request GNOME/gtk!5269

3 years agoRevert "builder: Stop using GtkBuildable.get_id"
Matthias Clasen [Mon, 28 Nov 2022 19:36:26 +0000 (14:36 -0500)]
Revert "builder: Stop using GtkBuildable.get_id"

This reverts commit 92edd4c476917e83c5f50e5eab8aa5a0ad240793.

This commit changed behavior that GNOME Builder relies on.

3 years agotools: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 18:43:21 +0000 (13:43 -0500)]
tools: Stop using gtk_widget_show/hide

3 years agoconstraint editor: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 11:20:14 +0000 (06:20 -0500)]
constraint editor: Stop using gtk_widget_show/hide

3 years agoicon browser: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 11:26:28 +0000 (06:26 -0500)]
icon browser: Stop using gtk_widget_show/hide

3 years agogtk-demo: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 04:03:14 +0000 (23:03 -0500)]
gtk-demo: Stop using gtk_widget_show/hide

3 years agowidget-factory: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 03:17:07 +0000 (22:17 -0500)]
widget-factory: Stop using gtk_widget_show/hide

3 years agogtk: Stop using gtk_widget_show/hide
Matthias Clasen [Mon, 28 Nov 2022 18:43:36 +0000 (13:43 -0500)]
gtk: Stop using gtk_widget_show/hide

gtk_widget_set_visible and gtk_window_present
are better alternatives, and calling gtk_widget_show
on newly created widgets is no longer necessary
anyway.

3 years agoMerge branch 'wip/corey/tree-expander' into 'main'
Benjamin Otte [Mon, 28 Nov 2022 15:53:17 +0000 (15:53 +0000)]
Merge branch 'wip/corey/tree-expander' into 'main'

treeexpander: Add hide-expander and indent-for-depth properties

Closes #4969

See merge request GNOME/gtk!5268

3 years agoimcontextwayland: Set up OSK activation gesture on non text widgets
Carlos Garnacho [Sun, 27 Nov 2022 19:22:33 +0000 (20:22 +0100)]
imcontextwayland: Set up OSK activation gesture on non text widgets

With GtkText and GtkTextView (and in extension, all their subclasses)
handling OSK activation activation, this gesture is only useful for
all text input widgets that are not subclasses of these 2 widgets,
e.g. the VTEs and crosswords of the world.

These still do need a hand in handling OSK activation, so only
set up the gesture for such cases.

3 years agogtktextview: Invoke OSK on button/touch taps that move/undo selection
Carlos Garnacho [Sun, 27 Nov 2022 12:20:02 +0000 (13:20 +0100)]
gtktextview: Invoke OSK on button/touch taps that move/undo selection

If the ::release handler is invoked, the press/release happened without
drags in between. Additionally check that there is no selection at all.

This makes OSK invoked on taps that move the caret around, while tapping
in the selection invokes edition popup and text handles without bringing
in the OSK.

3 years agogtktextview: Claim drag gesture after an actual selection change
Carlos Garnacho [Sun, 27 Nov 2022 12:18:18 +0000 (13:18 +0100)]
gtktextview: Claim drag gesture after an actual selection change

This way, the drag gesture lets the click gesture ::release handler
happen if there was no actual changes to the selected text (i.e.
too short drags). This matches the ::release handler behavior match
the situations in which the OSK was being invoked by the wayland
GtkIMContext.

3 years agogtktext: Invoke OSK on button/touch taps that move/undo selection
Carlos Garnacho [Sun, 27 Nov 2022 12:10:53 +0000 (13:10 +0100)]
gtktext: Invoke OSK on button/touch taps that move/undo selection

If the ::release handler is invoked, the press/release happened without
drags in between. Additionally check that the press did not happen within
the selection, and that there is no selection at all.

This makes OSK invoked on taps that move the caret around, while tapping
in the selection invokes edition popup and text handles without bringing
in the OSK.

3 years agogtktext: Claim drag gesture after an actual selection change
Carlos Garnacho [Sun, 27 Nov 2022 12:06:40 +0000 (13:06 +0100)]
gtktext: Claim drag gesture after an actual selection change

This way, the drag gesture lets the click gesture ::release handler
happen if there was no actual changes to the selected text (i.e.
too short drags). This matches the ::release handler behavior match
the situations in which the OSK was being invoked by the wayland
GtkIMContext.

3 years agoimcontextwayland: Implement activate_osk() vmethod
Carlos Garnacho [Sun, 27 Nov 2022 12:04:29 +0000 (13:04 +0100)]
imcontextwayland: Implement activate_osk() vmethod

This method does explicitly what the builtin GtkClickGesture in
the IM context is doing implicitly. The gesture will be dropped
after porting is done.

3 years agoimmulticontext: Implement activate_osk() vmethod
Carlos Garnacho [Sun, 27 Nov 2022 12:02:55 +0000 (13:02 +0100)]
immulticontext: Implement activate_osk() vmethod

The multicontext lets this call go through to the active
underlying GtkIMContext.

3 years agoimcontext: Add private activate_osk() vmethod
Carlos Garnacho [Sun, 27 Nov 2022 12:00:54 +0000 (13:00 +0100)]
imcontext: Add private activate_osk() vmethod

This method is so far private for both external GtkIMContext
implementations and external GtkIMContext users, and is meant
to activate the OSK in the environments where this may happen.

3 years agoRevert "gtktext: Claim gesture more selectively"
Carlos Garnacho [Sat, 26 Nov 2022 14:46:41 +0000 (15:46 +0100)]
Revert "gtktext: Claim gesture more selectively"

This reverts commit ae54374a514aa33b34f95eee94b4a2848b8a16d9.

3 years agoMerge branch 'bilelmoussaoui/gi-since' into 'main'
Matthias Clasen [Mon, 28 Nov 2022 11:17:51 +0000 (11:17 +0000)]
Merge branch 'bilelmoussaoui/gi-since' into 'main'

g-i: Add missing since annotations

See merge request GNOME/gtk!5271

3 years agog-i: Add missing since annotations
Bilal Elmoussaoui [Mon, 28 Nov 2022 07:54:48 +0000 (07:54 +0000)]
g-i: Add missing since annotations

3 years agotreeexpander: Minor formatting changes
Corey Berla [Sun, 27 Nov 2022 20:22:30 +0000 (12:22 -0800)]
treeexpander: Minor formatting changes

3 years agotreeexpander: Add indent-for-depth property
Corey Berla [Sun, 27 Nov 2022 05:28:22 +0000 (21:28 -0800)]
treeexpander: Add indent-for-depth property

When set to TRUE, indent-for-depth indents each level of
depth with an additional indent

3 years agotreeexpander: Add hide-expander property
Corey Berla [Sun, 27 Nov 2022 05:02:14 +0000 (21:02 -0800)]
treeexpander: Add hide-expander property

When set to TRUE hide-expander hides the expander icon in a
GtkTreeListRow.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4969
3 years agoMerge branch 'wip/corey/spi-logging' into 'main'
Matthias Clasen [Mon, 28 Nov 2022 01:29:10 +0000 (01:29 +0000)]
Merge branch 'wip/corey/spi-logging' into 'main'

atspicontext: Log failure to connect to a11y

See merge request GNOME/gtk!5270

3 years agoMerge branch 'work/zzag/wl-output-release' into 'main'
Matthias Clasen [Sun, 27 Nov 2022 22:21:29 +0000 (22:21 +0000)]
Merge branch 'work/zzag/wl-output-release' into 'main'

gdk/wayland: Prefer wl_output_release() over wl_output_destroy()

See merge request GNOME/gtk!5243

3 years agoatspicontext: Log failure to connect to a11y
Corey Berla [Sun, 27 Nov 2022 22:12:36 +0000 (14:12 -0800)]
atspicontext: Log failure to connect to a11y

GTK depends on the a11y infrastructure to be in place unless GTK_A11Y is
set to none.  It appears that despite that, users attempt to
get around the a11y requirement without setting GTK_A11Y.
This can cause, amongst other issues, performance problems
with gtk applications.  Log failure to connect to the a11y
bus.

3 years agoMerge branch 'fix-keymap-notify' into 'main'
Matthias Clasen [Sun, 27 Nov 2022 19:04:13 +0000 (19:04 +0000)]
Merge branch 'fix-keymap-notify' into 'main'

Don't emit ::notify from a getter

See merge request GNOME/gtk!5267

3 years agoDon't emit ::notify from a getter
Matthias Clasen [Sun, 27 Nov 2022 02:53:33 +0000 (21:53 -0500)]
Don't emit ::notify from a getter

GdkX11Keymap ddetermines the direction of the
keymap on demand, and was emitting notify::direction

3 years agoMerge branch 'wip/corey/demo-file-dialog' into 'main'
Matthias Clasen [Sat, 26 Nov 2022 18:11:41 +0000 (18:11 +0000)]
Merge branch 'wip/corey/demo-file-dialog' into 'main'

gtk-demo: Application demo use open_finish()

See merge request GNOME/gtk!5264

3 years agogtk-demo: Application demo use open_finish()
Corey Berla [Sat, 26 Nov 2022 18:11:40 +0000 (18:11 +0000)]
gtk-demo: Application demo use open_finish()

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 26 Nov 2022 13:15:28 +0000 (13:15 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Cosmetics

See merge request GNOME/gtk!5265

3 years agogtk-demo: Cosmetics
Matthias Clasen [Sat, 26 Nov 2022 11:40:47 +0000 (06:40 -0500)]
gtk-demo: Cosmetics

3 years agoMerge branch 'bilelmoussaoui/g-i' into 'main'
Matthias Clasen [Fri, 25 Nov 2022 14:43:19 +0000 (14:43 +0000)]
Merge branch 'bilelmoussaoui/g-i' into 'main'

g-i: Add missing since annotation

See merge request GNOME/gtk!5259

3 years agoMerge branch 'wip/smcv/xfail' into 'main'
Matthias Clasen [Fri, 25 Nov 2022 14:40:33 +0000 (14:40 +0000)]
Merge branch 'wip/smcv/xfail' into 'main'

testsuite: Avoid using should_fail

See merge request GNOME/gtk!5248

3 years agog-i: Add missing since annotation
Bilal Elmoussaoui [Fri, 25 Nov 2022 10:16:37 +0000 (10:16 +0000)]
g-i: Add missing since annotation

3 years agoMerge branch 'dialog-improvements' into 'main'
Matthias Clasen [Fri, 25 Nov 2022 03:48:04 +0000 (03:48 +0000)]
Merge branch 'dialog-improvements' into 'main'

gtk-demo: Test cancellation support for file dialog

See merge request GNOME/gtk!5257

3 years agofile dialog: Handle Escape better
Matthias Clasen [Thu, 24 Nov 2022 15:29:43 +0000 (10:29 -0500)]
file dialog: Handle Escape better

Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.

3 years agocolor dialog: Handle Escape better
Matthias Clasen [Thu, 24 Nov 2022 15:29:03 +0000 (10:29 -0500)]
color dialog: Handle Escape better

Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.

3 years agogtk-demo: Test cancellation support for file dialog
Matthias Clasen [Thu, 24 Nov 2022 15:26:43 +0000 (10:26 -0500)]
gtk-demo: Test cancellation support for file dialog

Add a timeout that closes the file dialog after
20 seconds, to test programmatic cancellation.

3 years agotestsuite: Don't create .test files for flaky or failing tests
Simon McVittie [Wed, 23 Nov 2022 21:26:50 +0000 (21:26 +0000)]
testsuite: Don't create .test files for flaky or failing tests

These tests can be run manually, but are not suitable for use as an
acceptance test, so let's not make frameworks like Debian's autopkgtest
run these when they run ginsttest-runner in the most obvious way.

Signed-off-by: Simon McVittie <smcv@debian.org>
3 years agotestsuite: Use separate setups for unstable tests instead of should_fail
Simon McVittie [Wed, 23 Nov 2022 19:13:32 +0000 (19:13 +0000)]
testsuite: Use separate setups for unstable tests instead of should_fail

There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.

Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:

    meson test --setup=x11_unstable --suite=flaky --suite=failing

As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.

When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.

This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.

Signed-off-by: Simon McVittie <smcv@debian.org>
3 years agoMerge branch 'deprecate-infobar' into 'main'
Matthias Clasen [Thu, 24 Nov 2022 03:43:11 +0000 (03:43 +0000)]
Merge branch 'deprecate-infobar' into 'main'

Deprecate GtkInfoBar

See merge request GNOME/gtk!5246

3 years agoMerge branch 'wip/carlosg/gsk-clipping' into 'main'
Matthias Clasen [Wed, 23 Nov 2022 22:38:49 +0000 (22:38 +0000)]
Merge branch 'wip/carlosg/gsk-clipping' into 'main'

gsk: Extend the blur radius for outset shadow extents

See merge request GNOME/gtk!5247

3 years agogdk/wayland: Improve readability of wl_output binding code
Vlad Zahorodnii [Tue, 22 Nov 2022 12:46:05 +0000 (14:46 +0200)]
gdk/wayland: Improve readability of wl_output binding code

Provide OUTPUT_VERSION macro to indicate the implemented version of
wl_output in gtk rather than use a magical number.

3 years agogsk: Extend the blur radius for outset shadow extents
Carlos Garnacho [Wed, 23 Nov 2022 17:58:18 +0000 (18:58 +0100)]
gsk: Extend the blur radius for outset shadow extents

By dividing the blur radius to obtain the clip radius, we may end up
with halved values that result in an overshunk clip mask. Extend this
so that we ensure to cover the last pixel.

Fixes artifacts seen with the cairo renderer in X11 when resizing
windows horizontally, a black 1px high line would be seen in the
top of the window due to these outset bounds being used in clipping.

More mysteriously, also seems to fix resize lag in the GL renderer
(also X11), if e.g. the bottom-right corner of a window is resized
diagonally in bottom-left -> top-right direction, or
bottom-right -> top-left.

Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175#note_1599335

3 years agoDeprecate GtkInfoBar
Matthias Clasen [Tue, 22 Nov 2022 20:10:48 +0000 (15:10 -0500)]
Deprecate GtkInfoBar

This widget has a dialog-like API, which is something
we want to get rid of in GTK 5, and libadwaita has
a replacement with AdwBanner incoming.

3 years agogsk: Also ceil() top side when converting graphene to cairo rectangles
Carlos Garnacho [Wed, 23 Nov 2022 17:56:45 +0000 (18:56 +0100)]
gsk: Also ceil() top side when converting graphene to cairo rectangles

The outset border for all sides is ceil()ed, except for the top side.
Most often values are already nicely rounded here, but this seems an
oversight.

3 years agogdk/wayland: Prefer wl_output_release() over wl_output_destroy()
Vlad Zahorodnii [Tue, 22 Nov 2022 10:04:12 +0000 (12:04 +0200)]
gdk/wayland: Prefer wl_output_release() over wl_output_destroy()

By using wl_output_release(), GDK lets the compositor to clean up the
output global more nicely.

For example, currently, most compositors remove the global and then
destroy it later after N seconds expire. With this, the compositor could
experiment with destroying the output global once all its resources are
destroyed.

3 years agoMerge branch 'work/zzag/wl-output-cleanup' into 'main'
Matthias Clasen [Tue, 22 Nov 2022 12:01:43 +0000 (12:01 +0000)]
Merge branch 'work/zzag/wl-output-cleanup' into 'main'

gdk/wayland: Destroy zxdg_output_v1 upon GdkWaylandMonitor destruction

See merge request GNOME/gtk!5242

3 years agogdk/wayland: Clear GdkWaylandMonitor::output using g_clear_pointer()
Vlad Zahorodnii [Tue, 22 Nov 2022 09:23:08 +0000 (11:23 +0200)]
gdk/wayland: Clear GdkWaylandMonitor::output using g_clear_pointer()

Use g_clear_pointer() to make tear down code consistent.

3 years agogdk/wayland: Destroy zxdg_output_v1 upon GdkWaylandMonitor destruction
Vlad Zahorodnii [Tue, 22 Nov 2022 09:03:05 +0000 (11:03 +0200)]
gdk/wayland: Destroy zxdg_output_v1 upon GdkWaylandMonitor destruction

It prevents potentially leaking memory.

3 years agoMerge branch 'file-filter-properties' into 'main'
Matthias Clasen [Tue, 22 Nov 2022 04:00:40 +0000 (04:00 +0000)]
Merge branch 'file-filter-properties' into 'main'

filefilter: Add properties for the criteria

See merge request GNOME/gtk!5241

3 years agofilefilter: Add properties for the criteria
Matthias Clasen [Tue, 22 Nov 2022 03:44:03 +0000 (22:44 -0500)]
filefilter: Add properties for the criteria

Add construct-only properties for patterns,
suffixes and mime-types. This provides an
alternative way to specify these in ui files.

Related: #5350

3 years agoMerge branch 'color-picker-portal' into 'main'
Matthias Clasen [Mon, 21 Nov 2022 19:46:17 +0000 (19:46 +0000)]
Merge branch 'color-picker-portal' into 'main'

colorpicker: Always try the portal first

See merge request GNOME/gtk!5240

3 years agocolorpicker: Always try the portal first
Matthias Clasen [Mon, 21 Nov 2022 19:26:29 +0000 (14:26 -0500)]
colorpicker: Always try the portal first

It does not hurt., and going forward, we want to
prefer portals.

3 years agoMerge branch 'bilelmoussaoui/g-i' into 'main'
Matthias Clasen [Mon, 21 Nov 2022 10:49:05 +0000 (10:49 +0000)]
Merge branch 'bilelmoussaoui/g-i' into 'main'

g-i: add missing array annotation to AlertDialog.set_buttons

See merge request GNOME/gtk!5234

3 years agoMerge branch 'fix-upside-down-labels' into 'main'
Matthias Clasen [Mon, 21 Nov 2022 10:48:29 +0000 (10:48 +0000)]
Merge branch 'fix-upside-down-labels' into 'main'

gsk: Avoid a crash with negative scales

See merge request GNOME/gtk!5236

3 years agoMerge branch 'drop-buildable-get-id' into 'main'
Matthias Clasen [Mon, 21 Nov 2022 10:35:16 +0000 (10:35 +0000)]
Merge branch 'drop-buildable-get-id' into 'main'

builder: Stop using GtkBuildable.get_id

See merge request GNOME/gtk!5239

3 years agoMerge branch 'stringlist-prop' into 'main'
Matthias Clasen [Mon, 21 Nov 2022 10:34:54 +0000 (10:34 +0000)]
Merge branch 'stringlist-prop' into 'main'

stringlist: Add a construct-only strings property

See merge request GNOME/gtk!5238

3 years agoDrop gtk_widget_buildable_parser_finished
Matthias Clasen [Sun, 20 Nov 2022 19:36:35 +0000 (14:36 -0500)]
Drop gtk_widget_buildable_parser_finished

No need to have this no-op implementation.
This was the only implementation of this vfunc
in GTK.

3 years agobuilder: Stop using GtkBuildable.get_id
Matthias Clasen [Sun, 20 Nov 2022 19:34:39 +0000 (14:34 -0500)]
builder: Stop using GtkBuildable.get_id

Drop the only implementation of this vfunc,
and stop using it. It isn't needed, and the
only implementation did the same thing GtkBuilder
does anyway.

3 years agostringlist: Add a construct-only strings property
Matthias Clasen [Sun, 20 Nov 2022 19:06:55 +0000 (14:06 -0500)]
stringlist: Add a construct-only strings property

This enables creating string lists in ui files
without using custom markup.

Related: #5350

3 years agoMerge branch 'center-box-props' into 'main'
Matthias Clasen [Sun, 20 Nov 2022 18:25:12 +0000 (18:25 +0000)]
Merge branch 'center-box-props' into 'main'

centerbox: Add properties for child widgets

See merge request GNOME/gtk!5237

3 years agocenterbox: Add properties for child widgets
Matthias Clasen [Sun, 20 Nov 2022 17:31:02 +0000 (12:31 -0500)]
centerbox: Add properties for child widgets

This provides and alternative to add children
in ui files.

Related: #5350

3 years agogsk: Avoid a crash with negative scales
Matthias Clasen [Sun, 20 Nov 2022 03:24:20 +0000 (22:24 -0500)]
gsk: Avoid a crash with negative scales

Don't crash when both scale_x and scale_y are -1.

A test is included.

3 years agog-i: add missing array annotation to AlertDialog.(s|g)et_buttons
Bilal Elmoussaoui [Sat, 19 Nov 2022 09:20:41 +0000 (09:20 +0000)]
g-i: add missing array annotation to AlertDialog.(s|g)et_buttons

3 years agoMerge branch 'builder-parse-attributes' into 'main'
Matthias Clasen [Sat, 19 Nov 2022 02:49:23 +0000 (02:49 +0000)]
Merge branch 'builder-parse-attributes' into 'main'

builder: Parse PangoAttrList values

See merge request GNOME/gtk!5228

3 years agoMerge branch 'wip/carlosg/osk-activation' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 19:33:55 +0000 (19:33 +0000)]
Merge branch 'wip/carlosg/osk-activation' into 'main'

gtktext: Claim gesture more selectively

Closes #5351

See merge request GNOME/gtk!5230

3 years agoMerge branch 'kjellahl/menubar' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 19:33:37 +0000 (19:33 +0000)]
Merge branch 'kjellahl/menubar' into 'main'

gtk_popover_menu_bar_set_menu_model(): Accept model == NULL

See merge request GNOME/gtk!5232

3 years agoMerge branch 'shorter-im-context-ids' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 19:33:17 +0000 (19:33 +0000)]
Merge branch 'shorter-im-context-ids' into 'main'

immmodule: Warn if GTK_IM_MODULE is bad

See merge request GNOME/gtk!5229

3 years agoMerge branch 'wayland-foreign-v2' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 18:00:42 +0000 (18:00 +0000)]
Merge branch 'wayland-foreign-v2' into 'main'

wayland: Also support the v2 of the importer

See merge request GNOME/gtk!5231

3 years agowayland: Also support the v2 of the importer
Matthias Clasen [Fri, 18 Nov 2022 17:09:27 +0000 (12:09 -0500)]
wayland: Also support the v2 of the importer

Commit 0ba8e16e1417fdb added support for the export
part of zxdg_foreign_v2, but neglected that the importer
has a v2 as well. Support it.

3 years agogtkpopovermenubar: Make model nullable
Kjell Ahlstedt [Fri, 18 Nov 2022 17:09:42 +0000 (18:09 +0100)]
gtkpopovermenubar: Make model nullable

The description of gtk_popover_menu_bar_new_from_model() and
gtk_popover_menu_bar_set_menu_model() says that model is nullable.
Make it so.

3 years agogdksurface: Do not consider GDK_TOUCH_END/CANCEL as popup-dismiss worthy
Carlos Garnacho [Fri, 18 Nov 2022 14:02:22 +0000 (15:02 +0100)]
gdksurface: Do not consider GDK_TOUCH_END/CANCEL as popup-dismiss worthy

GDK_TOUCH_END deserves the same treatment than GDK_BUTTON_RELEASE, since it's
subject to the same circumstances (popping up a menu on long press would be
immediately dismissed on release if we handled them there). Ideally, we would
want to match releases that we obtained a press for while grabbed, but as
the popup is also dismissed on GDK_BUTTON_PRESS/GDK_TOUCH_BEGIN, there's no
use for this tracking.

And GDK_TOUCH_CANCEL sounds weird as a reason to dismiss popups, just like
crossing events would.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2512

3 years agogtktext: Claim gesture more selectively
Carlos Garnacho [Fri, 18 Nov 2022 12:57:02 +0000 (13:57 +0100)]
gtktext: Claim gesture more selectively

Even though button 1 (or touch down) presses do most often have
an effect in one way or another (starting drag, moving focus,
starting selection, ...), there is one situation that they do
immediately nothing: When clicking on the entry does not move
the text caret around. Dragging might start a selection, but
the entry did not do anything just yet, and an immediate
button/touch release should remain at "did nothing".

And that is precisely the hint that the Wayland IM context's click
gesture takes, clicks that do not scroll nor move the caret around,
having the GtkText not claim the gesture in that situation makes
the IM gesture able to do its thing without in-fighting.

This is typically not a problem when the GtkText is embedded in
another GtkEditable implementation (e.g. GtkEntry), since the
IM gesture is inactive and capturing from the parent widget, so
gets a pass that it otherwise doesn't get when both gestures are
in the same widget. This makes it work regardless of GtkText not
being a child of a composite widget, like NautilusQueryEditor
and AdwRowEntry.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5351
3 years agoMerge branch 'wip/fix-tiling-without-gtk-shell' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 16:33:25 +0000 (16:33 +0000)]
Merge branch 'wip/fix-tiling-without-gtk-shell' into 'main'

wayland/surface: Set the tiling state from xdg-shell too

See merge request GNOME/gtk!5227

3 years agoimmodule: Accept 'simple' and 'none'
Matthias Clasen [Fri, 18 Nov 2022 16:17:20 +0000 (11:17 -0500)]
immodule: Accept 'simple' and 'none'

Everybody (including myself) gets this wrong,
so accept 'simple' and 'none' as shorthands
for the official IDs 'gtk-im-context-simple'
and 'gtk-im-context-none'.

3 years agoimmmodule: Warn if GTK_IM_MODULE is bad
Matthias Clasen [Fri, 18 Nov 2022 16:09:14 +0000 (11:09 -0500)]
immmodule: Warn if GTK_IM_MODULE is bad

If we don't find an immodule matching the
ids in the GTK_IM_MODULE envvar, print a
warning.

3 years agobuilder: Parse PangoAttrList values
Matthias Clasen [Fri, 18 Nov 2022 15:37:42 +0000 (10:37 -0500)]
builder: Parse PangoAttrList values

Allow specifying PangoAttrList properties in the
serialized format supported by pango_attr_list_to_string().

Test included.

3 years agowayland/surface: Set the tiling state from xdg-shell too
Jonas Ådahl [Fri, 18 Nov 2022 12:11:25 +0000 (13:11 +0100)]
wayland/surface: Set the tiling state from xdg-shell too

We plumbed it from the gtk-shell configure event, but didn't for the
equivalent state passed via xdg_toplevel.configure.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 05:22:44 +0000 (05:22 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gsk: Add an assertion to help static analysis

See merge request GNOME/gtk!5224

3 years agostringsorter: Fix one case of collation handling
Matthias Clasen [Fri, 18 Nov 2022 04:52:35 +0000 (23:52 -0500)]
stringsorter: Fix one case of collation handling

When not ignoring case, and not collating, we were
returning sort keys that were already freed. Oops.

Pointed out by clang.

3 years agogdk: Fix possible memory errors
Matthias Clasen [Fri, 18 Nov 2022 04:51:28 +0000 (23:51 -0500)]
gdk: Fix possible memory errors

clang complained that we may end up jumping
to the cleanup code without initializing data
in the jpeg code. Always initialize data to
NULL to prevent that eventuality.

3 years agocomposetable: Fix a memory leak
Matthias Clasen [Fri, 18 Nov 2022 04:21:19 +0000 (23:21 -0500)]
composetable: Fix a memory leak

Pointed out by clang.

3 years agogsk: Add an assertion to help static analysis
Matthias Clasen [Fri, 18 Nov 2022 05:02:20 +0000 (00:02 -0500)]
gsk: Add an assertion to help static analysis

clang gets wild ideas about negative radii otherwise.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 04:56:57 +0000 (04:56 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix spelling errors

See merge request GNOME/gtk!5223

3 years agoDrop redundant glib version checks
Matthias Clasen [Thu, 17 Nov 2022 19:16:37 +0000 (14:16 -0500)]
Drop redundant glib version checks

We require GLib 2.72 now.

3 years agogdk: Clean up gdkprivate.h
Matthias Clasen [Thu, 17 Nov 2022 19:01:11 +0000 (14:01 -0500)]
gdk: Clean up gdkprivate.h

Move apis to more specific headers.

3 years agogdk: Rename GDK_SURFACE_TEMP
Matthias Clasen [Thu, 10 Nov 2022 14:36:00 +0000 (15:36 +0100)]
gdk: Rename GDK_SURFACE_TEMP

We use this value only for drag surfaces, so call it that.

3 years agoFix spelling errors
Matthias Clasen [Fri, 18 Nov 2022 03:24:18 +0000 (22:24 -0500)]
Fix spelling errors

These were pointed out by codespell.

3 years agoMerge branch 'file-dialog-portals' into 'main'
Matthias Clasen [Fri, 18 Nov 2022 03:49:30 +0000 (03:49 +0000)]
Merge branch 'file-dialog-portals' into 'main'

file dialog: Use portals

See merge request GNOME/gtk!5221

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Thu, 17 Nov 2022 20:53:51 +0000 (20:53 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Add some keywords

See merge request GNOME/gtk!5220

3 years agofiledialog: Use portals
Matthias Clasen [Thu, 17 Nov 2022 20:51:11 +0000 (15:51 -0500)]
filedialog: Use portals

We want this new API to be portal-first.
Make it so.

3 years agogtk-demo: Add folders to the clipboard demo
Matthias Clasen [Thu, 17 Nov 2022 11:29:17 +0000 (06:29 -0500)]
gtk-demo: Add folders to the clipboard demo

This is handy for testing a case where folder
dnd does not work with the file transfer portal.

See #5348