gtk4.git
2 years agowidget: Cosmetics
Matthias Clasen [Sat, 29 Apr 2023 17:35:24 +0000 (13:35 -0400)]
widget: Cosmetics

Rename allocated_size_baseline to allocated_baseline,
to match better with the other allocated_ fields.

2 years agoEventController: Fix type "even propagation"→event
Daniel Boles [Sat, 29 Apr 2023 17:12:30 +0000 (18:12 +0100)]
EventController: Fix type "even propagation"→event

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

entry: Ignore the baseline when centering

See merge request GNOME/gtk!5889

2 years agowidget: Don't set baselines when unused
Matthias Clasen [Sat, 29 Apr 2023 13:47:59 +0000 (09:47 -0400)]
widget: Don't set baselines when unused

When we are not doing baseline alignment, don't pass
a baseline to the allocated widget. This helps because
a number of widgets (GtkLabel, GtkEntry, etc) always
position their text on the given baseline.

2 years agoentry: Ignore the baseline when centering
Matthias Clasen [Sat, 29 Apr 2023 13:20:07 +0000 (09:20 -0400)]
entry: Ignore the baseline when centering

GtkEntry was always placing its text on the baseline,
even when the valign said something else.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 29 Apr 2023 12:27:23 +0000 (12:27 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

theme: Reinstate switch labels in hc

See merge request GNOME/gtk!5888

2 years agotestbaseline2: Don't set height-requests
Matthias Clasen [Sat, 29 Apr 2023 12:00:07 +0000 (08:00 -0400)]
testbaseline2: Don't set height-requests

Widget with height requests have their baselines
ignored. Oops.

2 years agotheme: Reinstate switch labels in hc
Matthias Clasen [Sat, 29 Apr 2023 11:58:42 +0000 (07:58 -0400)]
theme: Reinstate switch labels in hc

Since we show them in GNOME shell, show them here too.

The comment that says "only show these in the a11y
theme" was still there, but we were always hiding them.

2 years agoUpdate Friulian translation
Fabio Tomat [Sat, 29 Apr 2023 08:57:53 +0000 (08:57 +0000)]
Update Friulian translation

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

wayland: Use wl_surface_damage_buffer() in Cairo

See merge request GNOME/gtk!5886

2 years agorendernode: Add diffing for affine transforms
Benjamin Otte [Fri, 28 Apr 2023 02:28:23 +0000 (04:28 +0200)]
rendernode: Add diffing for affine transforms

This will be needed most importantly for inverted textures,
like in GLArea.

2 years agowayland: Use wl_surface_damage_buffer() in Cairo
Benjamin Otte [Sat, 29 Apr 2023 03:07:03 +0000 (05:07 +0200)]
wayland: Use wl_surface_damage_buffer() in Cairo

... when it is available.

Also introduce the new function gdk_rectangle_transform_affine(), which
looks like overkill for this purpose, but I'm about to use it elsewhere.

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

shortcutswindow: Avoid criticals

See merge request GNOME/gtk!5885

2 years agoshortcutswindow: Avoid criticals
Matthias Clasen [Sat, 29 Apr 2023 00:44:18 +0000 (20:44 -0400)]
shortcutswindow: Avoid criticals

No point in resetting accessible relations
when we are in finalize.

2 years agoMerge branch 'clarify-swapped-default-object-signal' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 23:00:31 +0000 (23:00 +0000)]
Merge branch 'clarify-swapped-default-object-signal' into 'main'

builder: Clarify default "swapped" value when "object" is set for signals

See merge request GNOME/gtk!4514

2 years agoMerge branch 'gtkshortcutswindow_a11y' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 22:57:10 +0000 (22:57 +0000)]
Merge branch 'gtkshortcutswindow_a11y' into 'main'

GtkShortcutsWindow: Allow a screen reader user to browse the available shortcuts

See merge request GNOME/gtk!5042

2 years agoMerge branch 'harmonize-would_drop' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 22:55:42 +0000 (22:55 +0000)]
Merge branch 'harmonize-would_drop' into 'main'

Harmonize would_drop() replacement for g_log_writer_default_would_drop()

See merge request GNOME/gtk!4935

2 years agoMerge branch 'deprecate-get-allocation' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 22:49:42 +0000 (22:49 +0000)]
Merge branch 'deprecate-get-allocation' into 'main'

Deprecate get allocation

See merge request GNOME/gtk!5882

2 years agoREADME: Updates
Matthias Clasen [Fri, 28 Apr 2023 21:29:08 +0000 (17:29 -0400)]
README: Updates

Drop the section that talked about main and how to update
local checkouts - its been 2 years, people should have gotten
around to it by now. Add some general git hints instead.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Fri, 28 Apr 2023 21:22:12 +0000 (21:22 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

Fix hangs on Wayland

Closes #5761

See merge request GNOME/gtk!5884

2 years agowayland: Set EGL swap interval to 0.
Benjamin Otte [Fri, 28 Apr 2023 20:40:39 +0000 (22:40 +0200)]
wayland: Set EGL swap interval to 0.

There's no need for EGL to do any timing, we do it in GTK already.

This fixes hangs in Mesa when we hide a surface after a SwapBuffers()
but before the frame callback arrives.
If we then reshow the surface and immediately render to it, Mesa would
still have a frame callback from before the hiding and forever poll()
waiting for the compositor to send the callback.

Fixes #5761

2 years agowayland: Disconnect the frame callback when hiding
Benjamin Otte [Fri, 28 Apr 2023 20:21:42 +0000 (22:21 +0200)]
wayland: Disconnect the frame callback when hiding

Do not leave spurious frame callbacks around wen hiding surfaces.
Instead, store the callback and remove it.

2 years agomigrating-3to4: Don't mention removed Box method &
Daniel Boles [Fri, 28 Apr 2023 20:11:12 +0000 (21:11 +0100)]
migrating-3to4: Don't mention removed Box method &

donʼt mention its renamed successor either, as that has its own section
later. We could have another sentence paragraph like ‘In the case of
GtkBox, the pack methods have been renamed to X and lost the trailing
arguments Y’, but that wonʼt help people prepare still on GTK3, which is
the point in the affected section… so just remove the misleading relic.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 20:09:17 +0000 (20:09 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Cosmetics

See merge request GNOME/gtk!5883

2 years agoUpdates
Matthias Clasen [Fri, 28 Apr 2023 20:02:18 +0000 (16:02 -0400)]
Updates

2 years agoCosmetics
Matthias Clasen [Fri, 28 Apr 2023 19:36:37 +0000 (15:36 -0400)]
Cosmetics

2 years agoDeprecate gtk_widget_get_allocated_baseline
Matthias Clasen [Fri, 28 Apr 2023 19:19:22 +0000 (15:19 -0400)]
Deprecate gtk_widget_get_allocated_baseline

2 years agoStop using gtk_widget_get_allocated_baseline
Matthias Clasen [Fri, 28 Apr 2023 19:25:09 +0000 (15:25 -0400)]
Stop using gtk_widget_get_allocated_baseline

Use gtk_widget_get_baseline instead.

2 years agoAdd gtk_widget_get_baseline
Matthias Clasen [Fri, 28 Apr 2023 19:18:13 +0000 (15:18 -0400)]
Add gtk_widget_get_baseline

This is just a renaming of gtk_widget_get_allocated_baseline
that fits better with gtk_widget_get_width/height.

2 years agoDeprecate gtk_widget_get_allocation
Matthias Clasen [Fri, 28 Apr 2023 19:03:30 +0000 (15:03 -0400)]
Deprecate gtk_widget_get_allocation

2 years agoflowbox: Use deprecation guards around get_allocation
Matthias Clasen [Fri, 28 Apr 2023 18:57:03 +0000 (14:57 -0400)]
flowbox: Use deprecation guards around get_allocation

2 years agoinspector: Show bounds instead of allocation
Matthias Clasen [Fri, 28 Apr 2023 19:03:07 +0000 (15:03 -0400)]
inspector: Show bounds instead of allocation

2 years agoscrolledwindow: Stop using gtk_widget_get_allocation
Matthias Clasen [Fri, 28 Apr 2023 18:27:07 +0000 (14:27 -0400)]
scrolledwindow: Stop using gtk_widget_get_allocation

2 years agotextutil: Stop using gtk_widget_get_allocation
Matthias Clasen [Fri, 28 Apr 2023 18:16:32 +0000 (14:16 -0400)]
textutil: Stop using gtk_widget_get_allocation

2 years agotetview: Stop using gtk_widget_get_allocation
Matthias Clasen [Fri, 28 Apr 2023 18:10:07 +0000 (14:10 -0400)]
tetview: Stop using gtk_widget_get_allocation

2 years agotext: Stop using gtk_widget_get_allocation
Matthias Clasen [Fri, 28 Apr 2023 17:29:15 +0000 (13:29 -0400)]
text: Stop using gtk_widget_get_allocation

2 years agoUpdate Chinese (China) translation
Boyuan Yang [Fri, 28 Apr 2023 18:51:56 +0000 (18:51 +0000)]
Update Chinese (China) translation

2 years agoMerge branch 'wip/otte/texturebuilder' into 'main'
Benjamin Otte [Fri, 28 Apr 2023 15:58:10 +0000 (15:58 +0000)]
Merge branch 'wip/otte/texturebuilder' into 'main'

Add GdkGLTextureBuilder

See merge request GNOME/gtk!5862

2 years agoMerge branch 'baseline-fixes' into 'main'
Matthias Clasen [Fri, 28 Apr 2023 14:40:57 +0000 (14:40 +0000)]
Merge branch 'baseline-fixes' into 'main'

boxlayout: Fix baselines a bit

See merge request GNOME/gtk!5879

2 years agoMore docs for BASELINE
Matthias Clasen [Fri, 28 Apr 2023 13:21:15 +0000 (09:21 -0400)]
More docs for BASELINE

Add some more details to the docs for GTK_ALIGN_BASELINE.

2 years agowidget: Handle baseline better
Matthias Clasen [Thu, 27 Apr 2023 20:19:24 +0000 (22:19 +0200)]
widget: Handle baseline better

When adjusting allocations, treat BASELINE more like CENTER
than like FILL. The results are better, in particular for
controls like entries or switches, which we never want to
scale up vertically, but still want to align to the baseline.

2 years agoimage: Simplify baseline handling
Matthias Clasen [Thu, 27 Apr 2023 20:19:01 +0000 (22:19 +0200)]
image: Simplify baseline handling

We guarantee that the out arguments of the measure
vfunc are non-NULL, no need to check.

2 years agoswitch: Fix up baseline handling
Matthias Clasen [Thu, 27 Apr 2023 20:18:20 +0000 (22:18 +0200)]
switch: Fix up baseline handling

We need to report a baseline for baseline alignment
to work...

2 years agospinbutton: Use a grid layout
Matthias Clasen [Thu, 27 Apr 2023 18:24:49 +0000 (20:24 +0200)]
spinbutton: Use a grid layout

A grid layout lets us get the baseline right in
vertical orientation, by setting a baseline row.

It would be nice if the box layout supported this
as well, but currently it doesn't, and adding that
feature isn't trivial.

2 years agoboxlayout: Fix baselines a bit
Matthias Clasen [Thu, 27 Apr 2023 16:14:49 +0000 (18:14 +0200)]
boxlayout: Fix baselines a bit

When we are not doing height-for-width, we still
need to line up baselines.

2 years agoAdd another baseline test client
Matthias Clasen [Thu, 27 Apr 2023 15:56:12 +0000 (17:56 +0200)]
Add another baseline test client

2 years agogldriver: Add a sync when creating textures
Matthias Clasen [Tue, 25 Apr 2023 09:48:50 +0000 (11:48 +0200)]
gldriver: Add a sync when creating textures

2 years agogstreamer: Defer the sync
Matthias Clasen [Tue, 25 Apr 2023 09:44:21 +0000 (11:44 +0200)]
gstreamer: Defer the sync

Don't sync right when we receive the buffer,
pass it along with the texture to be executed
later in the renderer.

2 years agoglarea: Synchronize
Matthias Clasen [Sat, 28 Jan 2023 16:04:10 +0000 (11:04 -0500)]
glarea: Synchronize

Create a fence object and pass it along when
creating the GL texture, so that the GL renderer
can wait for the texture to be ready.

2 years agofilechooser: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 06:46:25 +0000 (08:46 +0200)]
filechooser: Plug a memory leak

2 years agoAdd some more valgrind suppressions
Matthias Clasen [Thu, 27 Apr 2023 06:33:03 +0000 (08:33 +0200)]
Add some more valgrind suppressions

2 years agocolumnview: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 06:26:53 +0000 (08:26 +0200)]
columnview: Plug a memory leak

g_list_model_get_item strikes again.

2 years agofilechooser: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 06:26:13 +0000 (08:26 +0200)]
filechooser: Plug a memory leak

We own references to the columns. Drop them.

2 years agofilechoosernative: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 06:25:30 +0000 (08:25 +0200)]
filechoosernative: Plug a memory leak

Unref all the GVariants.

2 years agofiledialog: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 05:22:38 +0000 (07:22 +0200)]
filedialog: Plug a memory leak

We own a reference to the native dialog,
and we need to drop it when we're done.

2 years agonode-editor: Plug a memory leak
Matthias Clasen [Thu, 27 Apr 2023 04:51:30 +0000 (06:51 +0200)]
node-editor: Plug a memory leak

2 years agonotebook: Drop an unused variable
Matthias Clasen [Thu, 27 Apr 2023 11:41:16 +0000 (13:41 +0200)]
notebook: Drop an unused variable

2 years agoFix various bitfield warnings
Matthias Clasen [Thu, 27 Apr 2023 04:46:36 +0000 (06:46 +0200)]
Fix various bitfield warnings

clang rightly complains about using gboolean
as type for bitfields, since it is signed.
Avoid that.

2 years agogsk: Synchronize when using textures
Matthias Clasen [Sat, 28 Jan 2023 20:20:26 +0000 (15:20 -0500)]
gsk: Synchronize when using textures

Pass the GLsync object from texture into our
command queue, and when executing the queue,
wait on the sync object the first time we
use its associated texture.

2 years agogltexture: Synchronize when downloading
Matthias Clasen [Mon, 30 Jan 2023 13:35:43 +0000 (08:35 -0500)]
gltexture: Synchronize when downloading

If the GL texture has a sync object, wait
on it before downloading the data.

2 years agogltexture: Optionally take a sync object
Matthias Clasen [Tue, 25 Apr 2023 09:03:51 +0000 (11:03 +0200)]
gltexture: Optionally take a sync object

Add a new function to TextureBuilder that takes a GLsync that
requires internal code to wait on before using the texture.

Somewhat sneakily, we don't take the sync if syncs are not supported by
the current GL context.
As public API has no code to query the sync for the destroy notify, this
is fine and it means we don't have to do the check every time we want to
call gdk_texture_get_sync() internally.

2 years agoglcontext: Add a way to check for GLsync
Matthias Clasen [Wed, 26 Apr 2023 09:59:51 +0000 (11:59 +0200)]
glcontext: Add a way to check for GLsync

2 years agogltexture: Deprecate gdk_gl_texture_new()
Benjamin Otte [Mon, 24 Apr 2023 20:44:01 +0000 (22:44 +0200)]
gltexture: Deprecate gdk_gl_texture_new()

Use GdkGLTextureBuilder instead.

2 years agoglrenderer: Port to GdkGLTextureBuilder
Benjamin Otte [Mon, 24 Apr 2023 20:36:42 +0000 (22:36 +0200)]
glrenderer: Port to GdkGLTextureBuilder

2 years agomedia-gstreamer: Port to GdkGLTextureBuilder
Benjamin Otte [Mon, 24 Apr 2023 20:22:07 +0000 (22:22 +0200)]
media-gstreamer: Port to GdkGLTextureBuilder

This is a rudimentary port that does not take advantage of all the cool
new formats that we could support now.

2 years agotestsuite: Use GLTextureBuilder
Benjamin Otte [Mon, 24 Apr 2023 20:10:06 +0000 (22:10 +0200)]
testsuite: Use GLTextureBuilder

2 years agoglarea: Port to GdkGLTextureBuilder
Benjamin Otte [Mon, 24 Apr 2023 20:02:10 +0000 (22:02 +0200)]
glarea: Port to GdkGLTextureBuilder

2 years agotexturebuilder: Pass the destroy notify to the build() function
Benjamin Otte [Mon, 24 Apr 2023 19:56:49 +0000 (21:56 +0200)]
texturebuilder: Pass the destroy notify to the build() function

This is more compatible with bindings that want to create per-object
callbacks and not have their callbacks reused over different build()
calls.

2 years agotexturebuilder: Add ::format and ::has-mipmap
Benjamin Otte [Mon, 24 Apr 2023 12:36:38 +0000 (14:36 +0200)]
texturebuilder: Add ::format and ::has-mipmap

We were trying to deduce that previously. Now we have explicit API

2 years agogdk: Add GdkGLTextureBuilder
Benjamin Otte [Mon, 24 Apr 2023 04:04:26 +0000 (06:04 +0200)]
gdk: Add GdkGLTextureBuilder

Building GL textures is complicated, so create an object to make them.

So far, this object just contains the functionality of
gdk_gl_texture_new(), but that will change in the future.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Thu, 27 Apr 2023 04:37:12 +0000 (04:37 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix the build with clang

See merge request GNOME/gtk!5876

2 years agoMerge branch 'wip/otte/gl-version' into 'main'
Benjamin Otte [Thu, 27 Apr 2023 00:39:19 +0000 (00:39 +0000)]
Merge branch 'wip/otte/gl-version' into 'main'

Make sure highest possible version GLContext is created

See merge request GNOME/gtk!5870

2 years agowgl: Improve error messages when GL init fails
Benjamin Otte [Wed, 26 Apr 2023 16:08:59 +0000 (18:08 +0200)]
wgl: Improve error messages when GL init fails

In particular, we want to get the GL version, when the Windows box/VM
has an unsuitable GL implementation.

This is somewhat helpful in analyzing failures to bring up GL on
machines where users claim GL does work.

2 years agowgl: Create context during WGL initialization
Benjamin Otte [Wed, 26 Apr 2023 04:16:37 +0000 (06:16 +0200)]
wgl: Create context during WGL initialization

This way, we can realize it and either print success information about
it or return NULL if that fails.

This makes it more likely that we fail early, which means we can then
initialize EGL.

2 years agowin32: Get rid of display->gl_version
Benjamin Otte [Wed, 26 Apr 2023 03:54:45 +0000 (05:54 +0200)]
win32: Get rid of display->gl_version

We can just query the display's GL context.

And it's not used otherwise anymore.

2 years agowin32: Refactor context creation
Benjamin Otte [Wed, 26 Apr 2023 02:17:32 +0000 (04:17 +0200)]
win32: Refactor context creation

This refactor achieves the following:

 * check GL version against proper matching context version
   In particular, for legacy contexts, we now actually check
 * make sure the actual version is set, even for legacy contexts
 * make sure set_is_legacy() is set properly

2 years agogdk: Add workaround for Visual Studio
Benjamin Otte [Tue, 25 Apr 2023 21:18:36 +0000 (23:18 +0200)]
gdk: Add workaround for Visual Studio

apparently casting something to itself makes it not constant.

2 years agomac: Properly set GLContext.is_legacy()
Benjamin Otte [Tue, 25 Apr 2023 20:50:00 +0000 (22:50 +0200)]
mac: Properly set GLContext.is_legacy()

2 years agoglcontext: assert all contexts set the version on realize()
Benjamin Otte [Tue, 25 Apr 2023 20:45:34 +0000 (22:45 +0200)]
glcontext: assert all contexts set the version on realize()

Now that all contexts do that, insist that they keep doing it.

And because they keep doing it, we can support querying the GL version
from gdk_gl_context_get_version() without requiring the context to be
made current.

2 years agomac: Try all different OpenGL profiles
Benjamin Otte [Tue, 25 Apr 2023 20:16:27 +0000 (22:16 +0200)]
mac: Try all different OpenGL profiles

.. and pick the best one that is supported.

Also make sure that the resulting context has at least the desired
version, otherwise bail.

2 years agoglcontext: Compute matching version the simple way
Benjamin Otte [Tue, 25 Apr 2023 19:45:31 +0000 (21:45 +0200)]
glcontext: Compute matching version the simple way

Do it all in one function instead of requiring two different ones.

2 years agowin32: Make sure highest possible GL version is created
Benjamin Otte [Tue, 25 Apr 2023 19:55:16 +0000 (21:55 +0200)]
win32: Make sure highest possible GL version is created

Mirror EGL here.

2 years agowin32: Pass the version properly through the creation stack
Benjamin Otte [Tue, 25 Apr 2023 19:30:32 +0000 (21:30 +0200)]
win32: Pass the version properly through the creation stack

We were using major/minor instead of GdkGLVersion.

And we were resetting back to 0 and ignoring the required min version
which we should not do.

2 years agoglx: Make sure highest possible GL version is created
Benjamin Otte [Tue, 25 Apr 2023 19:24:04 +0000 (21:24 +0200)]
glx: Make sure highest possible GL version is created

Mirror EGL here.

2 years agoegl: Make sure highest possible GL version is created
Benjamin Otte [Tue, 25 Apr 2023 18:08:33 +0000 (20:08 +0200)]
egl: Make sure highest possible GL version is created

The EGL spec states:

    The context returned must be the specified version, or a later
    version which is backwards compatible with that version.
    Even if a later version is returned, the specified version
    must correspond to a defined version of the client API.

GTK has so far been relying on EGL implementations returning a
later version, because that is what Mesa does.
But ANGLE does not do that and only provides the minimum version, which
means Windows EGL has been forced to use a lower EGL version for no
reason.

So fix this and try versions in order from highest to lowest.

2 years agogdk: Move GdkGLAPI enum into gdkenums.h
Benjamin Otte [Tue, 25 Apr 2023 18:04:13 +0000 (20:04 +0200)]
gdk: Move GdkGLAPI enum into gdkenums.h

2 years agoglcontext: Use GdkGLVersion elsewhere
Benjamin Otte [Tue, 25 Apr 2023 17:32:12 +0000 (19:32 +0200)]
glcontext: Use GdkGLVersion elsewhere

... and add a convenience API to generate GL versions from strings to
make the gdk_gl_context_check() API nicer.

2 years agogdk: Introduce GdkGLVersion
Benjamin Otte [Tue, 25 Apr 2023 17:17:07 +0000 (19:17 +0200)]
gdk: Introduce GdkGLVersion

... and use it.

Makes the code simpler.

2 years agowin32: Remove an outdated check
Benjamin Otte [Tue, 25 Apr 2023 20:40:59 +0000 (22:40 +0200)]
win32: Remove an outdated check

We require GL 3.0, so checking for less than 2.0 makes no sense anymore.

2 years agoFix a crash
Matthias Clasen [Wed, 26 Apr 2023 22:09:18 +0000 (00:09 +0200)]
Fix a crash

Fix an oversight from c87b193d2abe1.

2 years agoMerge branch 'wip/otte/treelistmodel-madness' into 'main'
Benjamin Otte [Wed, 26 Apr 2023 22:06:40 +0000 (22:06 +0000)]
Merge branch 'wip/otte/treelistmodel-madness' into 'main'

treelistmodel: Be safer during collapsing

See merge request GNOME/gtk!5875

2 years agoFix the build with clang
Matthias Clasen [Wed, 26 Apr 2023 21:54:43 +0000 (23:54 +0200)]
Fix the build with clang

This broke our macos ci.

2 years agotreelistmodel: Delay notifies from TreeListRow
Benjamin Otte [Wed, 26 Apr 2023 21:40:56 +0000 (23:40 +0200)]
treelistmodel: Delay notifies from TreeListRow

Don't notify during destruction, notify afterwards.
This way we don't call into user code from a half-destructed node.

Note that this changes the order in which those notifies happen when
collapsing a large tree: From parent node before child nodes to child
nodes before parent node.

No actual use case for this, just thought it would be safer.

2 years agotreelistmodel: Be safer during collapsing
Benjamin Otte [Wed, 26 Apr 2023 21:30:37 +0000 (23:30 +0200)]
treelistmodel: Be safer during collapsing

While we are collapsing a subtree, some signal handlers may not be
disconnected while we are doing this. By adding this check and not
giving those nodes no longer access to the model, we can stop it from
modifying it while we are trying to collapse stuff.

Fixes some crashes in gnome-builder.

2 years agoMerge branch 'wip/otte/surface-surgery' into 'main'
Benjamin Otte [Wed, 26 Apr 2023 21:03:24 +0000 (21:03 +0000)]
Merge branch 'wip/otte/surface-surgery' into 'main'

refactor internal surface API

See merge request GNOME/gtk!5846

2 years ago3to4: Fix we said we replace doubles with doubles,
Daniel Boles [Wed, 26 Apr 2023 20:30:10 +0000 (21:30 +0100)]
3to4: Fix we said we replace doubles with doubles,

when what we are replacing are ints!

2 years agodisplay: Remove ::create_surface() vfunc
Benjamin Otte [Fri, 21 Apr 2023 03:41:48 +0000 (05:41 +0200)]
display: Remove ::create_surface() vfunc

Instead, have a toplevel_type and popup_type in GdkDisplay and
call g_object_new() with those types.

2 years agowayland: Set default title in toplevel_init()
Benjamin Otte [Fri, 21 Apr 2023 20:10:00 +0000 (22:10 +0200)]
wayland: Set default title in toplevel_init()

2 years agomacos: Add surface from ::constructed()
Benjamin Otte [Fri, 21 Apr 2023 19:59:31 +0000 (21:59 +0200)]
macos: Add surface from ::constructed()

2 years agogdk: Remove GDK_SURFACE_DRAG enum member
Benjamin Otte [Fri, 21 Apr 2023 19:47:53 +0000 (21:47 +0200)]
gdk: Remove GDK_SURFACE_DRAG enum member

I want to remove the whole enum, but this value was used all over the
place. So removing it first ensures I didn't forget anything.