gtk4.git
2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 20 Apr 2023 21:50:44 +0000 (21:50 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Be less verbose in accessor-apis test

Closes #5763

See merge request GNOME/gtk!5851

2 years agolistbase: Don't warn on scroll in empty list
Benjamin Otte [Thu, 20 Apr 2023 17:07:08 +0000 (19:07 +0200)]
listbase: Don't warn on scroll in empty list

Empty lists can still be scrolled if the scroll happens in the same
frame as the emptying of the list.

Related: #5763

2 years agoadjustment: sanity-check values when setting them
Benjamin Otte [Thu, 20 Apr 2023 17:00:08 +0000 (19:00 +0200)]
adjustment: sanity-check values when setting them

It's not enough to sanitize values when starting an animation, as the
adjustment can reconfigure itself while the animation runs.
So as a simple way to handle this, we sanitize every value right before
setting it, too.

In the future we might also want to look at sanitizing start/end values
of the animation.

Fixes #5763

2 years agoadjustment: Split out a function
Benjamin Otte [Thu, 20 Apr 2023 16:52:49 +0000 (18:52 +0200)]
adjustment: Split out a function

2 years agoMerge branch 'dark_theme_fix_hover_toolbar_buttons' into 'main'
Matthias Clasen [Thu, 20 Apr 2023 20:08:31 +0000 (20:08 +0000)]
Merge branch 'dark_theme_fix_hover_toolbar_buttons' into 'main'

theme: fix 'hover' and 'check' colors for buttons under .toolbar

See merge request GNOME/gtk!5844

2 years agoMerge branch 'dark_theme_increase_selection_color' into 'main'
Matthias Clasen [Thu, 20 Apr 2023 20:08:01 +0000 (20:08 +0000)]
Merge branch 'dark_theme_increase_selection_color' into 'main'

Increase contrast for text entry selection color on dark theme

See merge request GNOME/gtk!5843

2 years agotestsuite: Allow accessors in interfaces
Benjamin Otte [Thu, 20 Apr 2023 15:32:36 +0000 (17:32 +0200)]
testsuite: Allow accessors in interfaces

There are a lot of cases where properties are implemented in classes but
the getters for these exist in an interface that class implements.

A common Example is g_list_model_get_n_items() being the getter for
GtkWhateverListModel::n-items.
But also property implementations that don't use override_property()
(usually because they have a different default) are handled by this.

2 years agotestsuite: Be less verbose in accessor-apis test
Benjamin Otte [Thu, 20 Apr 2023 15:31:57 +0000 (17:31 +0200)]
testsuite: Be less verbose in accessor-apis test

Only print the tried names when --verbose is passed to the test.

2 years agoUpdate Turkish translation
Emin Tufan Çetin [Wed, 19 Apr 2023 13:22:31 +0000 (13:22 +0000)]
Update Turkish translation

2 years agoMerge branch 'mask-node-transforms' into 'main'
Matthias Clasen [Wed, 19 Apr 2023 07:44:45 +0000 (07:44 +0000)]
Merge branch 'mask-node-transforms' into 'main'

Fix a comment

See merge request GNOME/gtk!5848

2 years agogsk: Use explicit switches
Matthias Clasen [Wed, 19 Apr 2023 07:19:12 +0000 (09:19 +0200)]
gsk: Use explicit switches

This makes it harder to forget to add new
node types here.

2 years agogsk: Mask nodes support 2d transforms
Matthias Clasen [Wed, 19 Apr 2023 06:13:55 +0000 (08:13 +0200)]
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.

2 years agoFix a comment
Matthias Clasen [Wed, 19 Apr 2023 05:48:58 +0000 (07:48 +0200)]
Fix a comment

I tried to improve things in d67101d46e7d8647,
but I made it worse. The original note was meant
to be removed. Pointed out be Sebastian Bacher.

2 years agoMerge branch 'angle-gles' into 'main'
Benjamin Otte [Mon, 17 Apr 2023 11:56:03 +0000 (11:56 +0000)]
Merge branch 'angle-gles' into 'main'

gdk: prefer GLES when on win32/ANGLE

See merge request GNOME/gtk!5829

2 years agogdk/win32: drop some unused variables
Marc-André Lureau [Sun, 16 Apr 2023 17:23:49 +0000 (21:23 +0400)]
gdk/win32: drop some unused variables

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: drop libangle GLES minimum version
Marc-André Lureau [Sat, 15 Apr 2023 10:33:20 +0000 (14:33 +0400)]
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>
2 years agogdk: use GLES when on win32/ANGLE
Marc-André Lureau [Thu, 13 Apr 2023 15:22:21 +0000 (19:22 +0400)]
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>
2 years agogdk: drop unused vertex_array_object
Marc-André Lureau [Sat, 15 Apr 2023 10:35:04 +0000 (14:35 +0400)]
gdk: drop unused vertex_array_object

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Mon, 17 Apr 2023 04:49:59 +0000 (04:49 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

glrenderer: Don't try to use float framebuffers on GLES2

See merge request GNOME/gtk!5845

2 years agogl: Only allow RGB(A)8 on GLES2
Benjamin Otte [Mon, 17 Apr 2023 03:42:19 +0000 (05:42 +0200)]
gl: Only allow RGB(A)8 on GLES2

GLES2 has no idea what 16bit textures even are, let alone floating point.

2 years agoglrenderer: Don't try to use float framebuffers on GLES2
Benjamin Otte [Mon, 17 Apr 2023 03:41:34 +0000 (05:41 +0200)]
glrenderer: Don't try to use float framebuffers on GLES2

GLES doesn't know what that is.

2 years agotheme: more contrast for text entry selection color on dark theme
Nelson Benítez León [Sun, 16 Apr 2023 18:15:58 +0000 (14:15 -0400)]
theme: more contrast for text entry selection color on dark theme

Part of #5725

2 years agotheme: fix 'hover' and 'check' colors for buttons under .toolbar
Nelson Benítez León [Sun, 16 Apr 2023 20:16:10 +0000 (16:16 -0400)]
theme: fix 'hover' and 'check' colors for buttons under .toolbar

Buttons under .toolbar were using for their 'hover', 'active'
and 'check' colors the default ones from %button_basic_flat
which are very dimmed, so we explicitly darken them.

Part of #5725

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 20:00:46 +0000 (20:00 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Try harder to fix focus tests

See merge request GNOME/gtk!5842

2 years agotestsuite: Skip focus tests when necessary
Matthias Clasen [Sun, 16 Apr 2023 18:58:26 +0000 (20:58 +0200)]
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.

2 years agoMerge branch 'ccook/doc-changes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 18:16:36 +0000 (18:16 +0000)]
Merge branch 'ccook/doc-changes' into 'main'

Two corrections that show up in docs

See merge request GNOME/gtk!5838

2 years agoTry harder to fix focus tests
Matthias Clasen [Sun, 16 Apr 2023 18:07:13 +0000 (20:07 +0200)]
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.

2 years agoMerge branch 'wip/otte/alt.wl_surface.die.die.die' into 'main'
Benjamin Otte [Sun, 16 Apr 2023 18:02:33 +0000 (18:02 +0000)]
Merge branch 'wip/otte/alt.wl_surface.die.die.die' into 'main'

wayland: Don't leak all surfaces

See merge request GNOME/gtk!5840

2 years agotestsuite: Fix broken test to not unref surfaces twice
Benjamin Otte [Sun, 16 Apr 2023 14:57:48 +0000 (16:57 +0200)]
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.

2 years agowayland: Don't leak all surfaces
Benjamin Otte [Sun, 16 Apr 2023 02:39:21 +0000 (04:39 +0200)]
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 590f3dfa1fcb.

2 years agowayland: Don't insta-crash when a surface gets disposed
Benjamin Otte [Sun, 16 Apr 2023 02:36:12 +0000 (04:36 +0200)]
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 7fafa5133b5.

Luckily, we leak all surfaces, so this problem never occured.

2 years agoMerge branch 'ccook/gtklabel-doc-changes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 17:07:49 +0000 (17:07 +0000)]
Merge branch 'ccook/gtklabel-doc-changes' into 'main'

GtkLabel doc corrections

See merge request GNOME/gtk!5839

2 years agoMerge branch 'focus-testsuite-fixes' into 'main'
Matthias Clasen [Sun, 16 Apr 2023 07:36:11 +0000 (07:36 +0000)]
Merge branch 'focus-testsuite-fixes' into 'main'

text: Fix fallout from focus changes

See merge request GNOME/gtk!5841

2 years agotestsuite: Actually wait for focus
Matthias Clasen [Sun, 16 Apr 2023 07:11:24 +0000 (09:11 +0200)]
testsuite: Actually wait for focus

We were failing to properly iterate the main
context here. Oops.

2 years agotests: Check is-focus instead of has-focus
Matthias Clasen [Sun, 16 Apr 2023 06:50:35 +0000 (08:50 +0200)]
tests: Check is-focus instead of has-focus

We are not presenting windows here.

2 years agotext: Fix fallout from focus changes
Matthias Clasen [Sun, 16 Apr 2023 06:49:20 +0000 (08:49 +0200)]
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.

2 years ago| method ...
Cam Cook [Sun, 16 Apr 2023 01:48:27 +0000 (21:48 -0400)]
| 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

2 years ago| method ...
Cam Cook [Sat, 15 Apr 2023 16:41:13 +0000 (12:41 -0400)]
| 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"                               |

2 years agoRevert "Two corrections and added method linking that show up in docs"
Cam Cook [Sat, 15 Apr 2023 16:40:22 +0000 (12:40 -0400)]
Revert "Two corrections and added method linking that show up in docs"

This reverts commit c7f30ecdfdb70fd8d4fcc02a4a576dfee0991e28.

2 years agoMerge branch 'wip/otte/gles-fixes' into 'main'
Matthias Clasen [Sat, 15 Apr 2023 16:27:16 +0000 (16:27 +0000)]
Merge branch 'wip/otte/gles-fixes' into 'main'

GLES 2 fixes

See merge request GNOME/gtk!5837

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 15 Apr 2023 16:09:32 +0000 (16:09 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

window: Don't mark widget prematurely as has-focus

See merge request GNOME/gtk!5836

2 years agoTwo corrections and added method linking that show up in docs
Cam Cook [Sat, 15 Apr 2023 16:08:46 +0000 (12:08 -0400)]
Two corrections and added method linking that show up in docs

| 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"                               |

| method                                                                                                    | current                                                | suggestion                                                   |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------------|
| [Box/get_baseline_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkbox.c#L461)             | "value set by gtk_box_set_baseline_position()."        | "value set by [method@Gtk.Box.set_baseline_position]."       |
| [Box/get_spacing](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkbox.c#L412)                       | "value set by gtk_box_set_spacing()."                  | "value set by [method@Gtk.Box.set_spacing]."                 |
| [CenterBox/get_baseline_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkcenterbox.c#L528) | "value set by gtk_center_box_set_baseline_position()." | "value set by [method@Gtk.CenterBox.set_baseline_position]." |
| [Entry/get_activates_default](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2296)        | "value set by gtk_entry_set_activates_default()."      | "value set by [method@Gtk.Entry.set_activates_default]."     |
| [Entry/get_alignment](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2380)                | "value set by gtk_entry_set_alignment()."              | "value set by [method@Gtk.Entry.set_alignment]."             |
| [Entry/get_extra_menu](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L3727)               | "set with gtk_entry_set_extra_menu()."                 | "set with [method@Gtk.Entry.set_extra_menu]."                |
| [Entry/get_has_frame](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2340)                | "value set by gtk_entry_set_has_frame()."              | "value set by [method@Gtk.Entry.set_has_frame]."             |
| [Entry/get_progress_pulse_step](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L3372)      | "set with gtk_entry_set_progress_pulse_step()."        | "set with [method@Gtk.Entry.set_progress_pulse_step]."       |
| [Fixed/get_child_transform](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkfixed.c#L314)           | "set using gtk_fixed_set_child_transform()."           | "set using [method@Gtk.Fixed.set_child_transform]."          |

2 years agotestsuite: Make GLES testsuite run use GLES 2
Benjamin Otte [Sat, 15 Apr 2023 15:53:54 +0000 (17:53 +0200)]
testsuite: Make GLES testsuite run use GLES 2

We want to support GLES 2, so make sure we test that support.

Also force-disable common extensions we don't explicitly check for and
don't want to accidentally use.

2 years agogles: Don't use vertex array objects
Benjamin Otte [Sat, 15 Apr 2023 15:50:18 +0000 (17:50 +0200)]
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.

2 years agotext: Only claim primary when focused
Matthias Clasen [Sat, 15 Apr 2023 13:02:09 +0000 (15:02 +0200)]
text: Only claim primary when focused

It does not make sense otherwise, and has unfortunate
side-effects on Wayland.

2 years agowayland: Improve logging for primary selection
Matthias Clasen [Sat, 15 Apr 2023 13:00:53 +0000 (15:00 +0200)]
wayland: Improve logging for primary selection

2 years agowindow: Don't mark widget prematurely as has-focus
Matthias Clasen [Sat, 15 Apr 2023 12:58:57 +0000 (14:58 +0200)]
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.

2 years agoMerge branch 'better-snapshot-nodes-docs' into 'main'
Matthias Clasen [Sat, 15 Apr 2023 10:51:39 +0000 (10:51 +0000)]
Merge branch 'better-snapshot-nodes-docs' into 'main'

gtk: Improve documentation on returned nodes for snapshot

Closes #5747

See merge request GNOME/gtk!5831

2 years agoTweak the wording
Matthias Clasen [Sat, 15 Apr 2023 10:35:12 +0000 (10:35 +0000)]
Tweak the wording

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sat, 15 Apr 2023 03:40:00 +0000 (03:40 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

inspector: Don't randomly emit application signals

See merge request GNOME/gtk!5834

2 years agolistlistmodel: Add a cache
Benjamin Otte [Sat, 15 Apr 2023 03:24:29 +0000 (05:24 +0200)]
listlistmodel: Add a cache

Cache the last looked up item and use it for looking up the next item if
it's closest. This massively speeds up iteration over the model, because
each call to get_item() will be adjacent to the previous one.

Improves performance of the inspector quite a bit.

2 years agotestsuite: Add some more exhaustive testing to listlistmodel
Benjamin Otte [Sat, 15 Apr 2023 03:24:11 +0000 (05:24 +0200)]
testsuite: Add some more exhaustive testing to listlistmodel

2 years agoinspector: Don't randomly emit application signals
Benjamin Otte [Fri, 14 Apr 2023 22:02:01 +0000 (00:02 +0200)]
inspector: Don't randomly emit application signals

When the variant-editor emits a callback, it might not actually have
edited the value in question. Try to detect that by only emitting
signals if the value changed.

2 years agoMerge branch 'gbsneto/vulkan-buffer-release' into 'main'
Benjamin Otte [Fri, 14 Apr 2023 23:28:55 +0000 (23:28 +0000)]
Merge branch 'gbsneto/vulkan-buffer-release' into 'main'

gsk/vulkan/render: Download image before reset

See merge request GNOME/gtk!5832

2 years agogsk/vulkan/render: Download image before reset
Georges Basile Stavracas Neto [Fri, 14 Apr 2023 19:27:42 +0000 (16:27 -0300)]
gsk/vulkan/render: Download image before reset

gsk_vulkan_render_download_target() currently resets the uploader
objects before downloading the image that it produces. This is
problematic because there might be unreleased buffers and images
in the command queue.

In particular, this can make validation layers complain about the
glyph atlas - of all things! - upload buffer being released while
still being used by the command queue.

Fix that by resetting the uploader after downloading the image.

2 years agogtk: Improve documentation on returned nodes for snapshot
Marco Trevisan (Treviño) [Fri, 14 Apr 2023 16:05:21 +0000 (18:05 +0200)]
gtk: Improve documentation on returned nodes for snapshot

Closes: #5747
2 years agoMerge branch 'fix_scalebutton_orientation' into 'main'
Matthias Clasen [Thu, 13 Apr 2023 20:44:23 +0000 (20:44 +0000)]
Merge branch 'fix_scalebutton_orientation' into 'main'

ScaleButton: fix CSS name in documentation, fix orientation doing nothing

See merge request GNOME/gtk!5819

2 years agoMerge branch 'check-openuri-portal-version' into 'main'
Matthias Clasen [Thu, 13 Apr 2023 20:44:03 +0000 (20:44 +0000)]
Merge branch 'check-openuri-portal-version' into 'main'

openuriportal: Detect if the interface isn't there

Closes #5733

See merge request GNOME/gtk!5826

2 years agoMerge branch 'gbsneto/vulkan-mailbox' into 'main'
Georges Basile Stavracas Neto [Thu, 13 Apr 2023 17:07:59 +0000 (17:07 +0000)]
Merge branch 'gbsneto/vulkan-mailbox' into 'main'

gdk/vulkancontext: Use more appropriate present mode

See merge request GNOME/gtk!5828

2 years agogdk/vulkancontext: Use more appropriate present mode
Georges Basile Stavracas Neto [Thu, 13 Apr 2023 15:15:53 +0000 (12:15 -0300)]
gdk/vulkancontext: Use more appropriate present mode

Check if the driver supports MAILBOX and prefer using it; in its
absense, checkif the driver supports IMMEDIATE and prefer using
it; finally, if neither of them are supported, use the guaranteed
to be supported FIFO mode.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 13 Apr 2023 15:34:48 +0000 (15:34 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

x11: Remove commented outdated code

See merge request GNOME/gtk!5827

2 years agox11: Remove commented outdated code
Benjamin Otte [Thu, 13 Apr 2023 03:28:57 +0000 (05:28 +0200)]
x11: Remove commented outdated code

... and it's copy/paste into the win32 backend

2 years agogdk: Remove unused vfunc
Benjamin Otte [Thu, 13 Apr 2023 03:28:14 +0000 (05:28 +0200)]
gdk: Remove unused vfunc

2 years agoMerge branch 'wip/otte/wl-gloria-gaynor' into 'main'
Benjamin Otte [Thu, 13 Apr 2023 15:12:07 +0000 (15:12 +0000)]
Merge branch 'wip/otte/wl-gloria-gaynor' into 'main'

wayland: Make wl_surface survive until surface is desstroyed

See merge request GNOME/gtk!5825

2 years agoMerge branch 'wip/exalm/print-dialog' into 'main'
Matthias Clasen [Thu, 13 Apr 2023 05:39:08 +0000 (05:39 +0000)]
Merge branch 'wip/exalm/print-dialog' into 'main'

printunixdialog: Remove a redundant style class

See merge request GNOME/gtk!5823

2 years agoopenuriportal: Detect if the interface isn't there
Matthias Clasen [Thu, 13 Apr 2023 05:23:06 +0000 (07:23 +0200)]
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
2 years agoMerge branch 'bilelmoussaoui/g-i' into 'main'
Matthias Clasen [Thu, 13 Apr 2023 04:37:45 +0000 (04:37 +0000)]
Merge branch 'bilelmoussaoui/g-i' into 'main'

g-i: Fix GtkGLArea type name

See merge request GNOME/gtk!5824

2 years agowayland: Keep EGL window around when hidden
Benjamin Otte [Thu, 13 Apr 2023 02:30:24 +0000 (04:30 +0200)]
wayland: Keep EGL window around when hidden

See previous commit:

We want to keep resources around as long as the surface exists.

2 years agowayland: Don't destroy the wl_surface on hide()
Benjamin Otte [Thu, 13 Apr 2023 01:33:59 +0000 (03:33 +0200)]
wayland: Don't destroy the wl_surface on hide()

We want to keep the wl_surface around, because surfaces create their
resources on construct and keep them until destroyed. See the HWND ond
Windows and the XWindow on X11.

This is relevant for graphics resources, where we want to have access
to the VkSurface and eglSurface while the GdkSurface is hidden.
We also want these surfaces to be permanent and not change during the
lifetime of the GdkSurface.

What we can - and must - destroy however are the xdg surfaces, because
those handle visibility on screen.
And we also need to ensure no buffer is attached, so that during the
next creation of the xdg surface we don't get a protocol error.

2 years agowayland: Split out a function
Benjamin Otte [Thu, 13 Apr 2023 00:56:12 +0000 (02:56 +0200)]
wayland: Split out a function

We have a create_wl_surface(), create a matching destroy_wl_surface().

2 years agowayland: Remove useless function
Benjamin Otte [Thu, 13 Apr 2023 00:47:51 +0000 (02:47 +0200)]
wayland: Remove useless function

gdk_wayland_surface_maybe_resize() just calls
gdk_wayland_surface_update_size(), so make all callers call that one
instead.

The check that it does is done by the other function again.

2 years agowayland: Remove an old workaround
Benjamin Otte [Thu, 13 Apr 2023 00:44:05 +0000 (02:44 +0200)]
wayland: Remove an old workaround

This workaround - were it ever to trigger - is broken today. It destroys
the wl_surface and all associated structs but does not recreate the
xdg_popup or xdg_toplevel struct, so it would cause a hidden window.

The workaround looked a lot different when it was introduced in commit
83b54bab5734f17d01633c1b5a0ce3e4896d2ee0, too - both in what it did and
in what the vfuncs did that it called.

2 years agog-i: Fix GtkGLArea type name
Bilal Elmoussaoui [Wed, 12 Apr 2023 18:12:40 +0000 (18:12 +0000)]
g-i: Fix GtkGLArea type name

2 years agoprintunixdialog: Remove a redundant style class
Alexander Mikhaylenko [Wed, 12 Apr 2023 17:05:23 +0000 (21:05 +0400)]
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.

2 years agoMerge branch 'dialogs-force-window-destruction' into 'main'
Matthias Clasen [Wed, 12 Apr 2023 13:54:13 +0000 (13:54 +0000)]
Merge branch 'dialogs-force-window-destruction' into 'main'

gtk/dialogs: Destroy the window promptly on finish async function

Closes #5741

See merge request GNOME/gtk!5820

2 years agogtk/dialogs: Destroy the window promptly on finish async function
Marco Trevisan (Treviño) [Tue, 11 Apr 2023 22:41:20 +0000 (00:41 +0200)]
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
2 years agoMerge branch 'filechooserentry-fixes' into 'main'
Matthias Clasen [Wed, 12 Apr 2023 10:38:04 +0000 (10:38 +0000)]
Merge branch 'filechooserentry-fixes' into 'main'

filechooserentry: Make filtering work again

Closes #5743

See merge request GNOME/gtk!5822

2 years agoMerge branch 'wip/carlosg/multi-click-text-view' into 'main'
Matthias Clasen [Wed, 12 Apr 2023 10:11:16 +0000 (10:11 +0000)]
Merge branch 'wip/carlosg/multi-click-text-view' into 'main'

textview: Reset press counter if double/triple clicking on a different line

See merge request GNOME/gtk!5821

2 years agoMerge branch 'touch-no-double-click-threshold' into 'main'
Matthias Clasen [Wed, 12 Apr 2023 10:10:31 +0000 (10:10 +0000)]
Merge branch 'touch-no-double-click-threshold' into 'main'

gestureclick: Don't use threshold for touch

Closes #5580

See merge request GNOME/gtk!5798

2 years agoMerge branch 'stylus-fixes' into 'main'
Matthias Clasen [Wed, 12 Apr 2023 10:10:11 +0000 (10:10 +0000)]
Merge branch 'stylus-fixes' into 'main'

gtk-demo: Test stylus-only mode

See merge request GNOME/gtk!5804

2 years agofilechooserentry: Plug a memory leak
Matthias Clasen [Wed, 12 Apr 2023 10:08:14 +0000 (12:08 +0200)]
filechooserentry: Plug a memory leak

2 years agofilechooserentry: Make filtering work again
Matthias Clasen [Wed, 12 Apr 2023 10:07:30 +0000 (12:07 +0200)]
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
2 years agotextview: Reset press counter if double/triple clicking on a different line
Carlos Garnacho [Wed, 12 Apr 2023 09:24:46 +0000 (11:24 +0200)]
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.

2 years agoscalebutton: fix orientation not applied to scale
G.Willems [Tue, 11 Apr 2023 21:53:35 +0000 (23:53 +0200)]
scalebutton: fix orientation not applied to scale

2 years agoscalebutton: fix CSS name in documentation
G.Willems [Tue, 11 Apr 2023 20:06:09 +0000 (22:06 +0200)]
scalebutton: fix CSS name in documentation

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 06:10:56 +0000 (06:10 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

filechooser: Fix the gridview

See merge request GNOME/gtk!5817

2 years agofilechooser: Fix the gridview
Matthias Clasen [Tue, 11 Apr 2023 05:41:09 +0000 (07:41 +0200)]
filechooser: Fix the gridview

2a70093a309481cf6 was a bit overeager in its porting
to GtkColumnViewCell. The gridview needs to keep its
list items.

2 years agoMerge branch 'wip/corey/file-chooser-widget' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 05:32:38 +0000 (05:32 +0000)]
Merge branch 'wip/corey/file-chooser-widget' into 'main'

More fixes to filechooserwidget

See merge request GNOME/gtk!5815

2 years agoMerge branch 'wip/corey/filesystemmodel' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 05:27:24 +0000 (05:27 +0000)]
Merge branch 'wip/corey/filesystemmodel' into 'main'

filesystemmodel: Notify correct position removed in remove_file()

See merge request GNOME/gtk!5814

2 years agofilechooser: Set date and time after cell is a child of filechooserwidget
Corey Berla [Tue, 11 Apr 2023 00:58:09 +0000 (17:58 -0700)]
filechooser: Set date and time after cell is a child of filechooserwidget

The date/time column relies on the filechooserwidget to format the date
properly.  During bind, the filechoosercell, get the filechooserwidget
ancestor, but now due to changes in the listview, the cell isn't a
child of the filechooserwidget at that point.  Since this is deeply
ingrained into the filechooserwidget, let's keep the same behavior,
but move it to filechoosercell in realize.  Alternatively, we could have
used a signal factory (with the file chooser widget as the user data),
but that would have been a major overhaul.

2 years agofilechoosercell: Store type_format in filechoosercell
Corey Berla [Mon, 10 Apr 2023 22:14:42 +0000 (15:14 -0700)]
filechoosercell: Store type_format in filechoosercell

The format of the type column depends on the the type_format, which
is stored in the filechooserwidget.  We get that setting by looking
for the filechooserwidget ancestor, which no longer works after recent
changes to the list views (it was fragile to begin with).  At one point,
the setting appears to have been dynamic, but now it is only loading
from GSettings, so let's simply do the same within FileChooserCell.

2 years agofilechooserwidget: Finish port to GtkColumnViewCell
Corey Berla [Mon, 10 Apr 2023 21:08:47 +0000 (14:08 -0700)]
filechooserwidget: Finish port to GtkColumnViewCell

Some missing updates from f5dea9a3c217c49f44eedb18822be080d2451dc0

2 years agofilesystemmodel: Notify correct position removed in remove_file()
Corey Berla [Mon, 10 Apr 2023 19:56:08 +0000 (12:56 -0700)]
filesystemmodel: Notify correct position removed in remove_file()

32247bc50e63b709ae738a95a2ec71345b5fad75 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.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 10 Apr 2023 14:28:38 +0000 (14:28 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

node-editor: Typo fixes

See merge request GNOME/gtk!5812

2 years agonode-editor: Typo fixes
Matthias Clasen [Mon, 10 Apr 2023 05:53:23 +0000 (07:53 +0200)]
node-editor: Typo fixes

Fix some typos in the node format documentation.

2 years agoMerge branch 'scrolled-window-critical' into 'main'
Matthias Clasen [Mon, 10 Apr 2023 05:50:20 +0000 (05:50 +0000)]
Merge branch 'scrolled-window-critical' into 'main'

scrolledwindow: Avoid a critical

See merge request GNOME/gtk!5809

2 years agotestsuite: Check widget properties better
Matthias Clasen [Mon, 10 Apr 2023 04:24:57 +0000 (00:24 -0400)]
testsuite: Check widget properties better

Check that setting a property after resetting
it works. An instance of this was fixed in the
previous commit.

2 years agoscrolledwindow: Avoid a critical
Matthias Clasen [Mon, 10 Apr 2023 04:22:20 +0000 (00:22 -0400)]
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.

2 years agoMerge branch 'warn-show-destoyed-window' into 'main'
Matthias Clasen [Sun, 9 Apr 2023 20:16:52 +0000 (20:16 +0000)]
Merge branch 'warn-show-destoyed-window' into 'main'

Show a warning when a destroyed window is shown

See merge request GNOME/gtk!5122

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 9 Apr 2023 13:02:55 +0000 (13:02 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Add a keyword

See merge request GNOME/gtk!5805