gtk4.git
4 years agoinspector: Add a clipboard page
Benjamin Otte [Thu, 19 Aug 2021 16:38:27 +0000 (18:38 +0200)]
inspector: Add a clipboard page

Shows all the formats supported by the clipboard (and primary clipboard)
and allows displaying them (by potentially downloading them)

4 years agoMerge branch 'fix-picture-natural-size-0' into 'main'
Benjamin Otte [Wed, 8 Dec 2021 19:33:28 +0000 (19:33 +0000)]
Merge branch 'fix-picture-natural-size-0' into 'main'

picture: Return natural size 0 for size 0

See merge request GNOME/gtk!4177

4 years agoreftests: Add center-center reftests without GtkOverlay
Benjamin Otte [Wed, 8 Dec 2021 18:09:29 +0000 (19:09 +0100)]
reftests: Add center-center reftests without GtkOverlay

4 years agoreftests: Rename a bunch of tests
Benjamin Otte [Wed, 8 Dec 2021 17:14:59 +0000 (18:14 +0100)]
reftests: Rename a bunch of tests

They use a GtkOverlay, so reflect that in the name.

4 years agopicture: Return natural size 0 for size 0
Ivan Molodetskikh [Fri, 19 Nov 2021 13:26:07 +0000 (16:26 +0300)]
picture: Return natural size 0 for size 0

It was returning the full natural size (same as -1) due to default value
handling in the code below.

Tests have been updated to match this output.

4 years agoMerge branch 'wip/chergert/fix-recursive-action-muxer' into 'main'
Matthias Clasen [Wed, 8 Dec 2021 10:47:40 +0000 (10:47 +0000)]
Merge branch 'wip/chergert/fix-recursive-action-muxer' into 'main'

actionmuxer: avoid duplicate and recursive work

Closes #4422, #4519, and gnome-text-editor#220

See merge request GNOME/gtk!4223

4 years agoMerge branch 'wip/chergert/layout-marshaller' into 'main'
Matthias Clasen [Wed, 8 Dec 2021 10:46:35 +0000 (10:46 +0000)]
Merge branch 'wip/chergert/layout-marshaller' into 'main'

surface: add missing va_marshaller for layout signal

See merge request GNOME/gtk!4221

4 years agoMerge branch 'wip/chergert/reduce-action-muxer-allocations' into 'main'
Matthias Clasen [Wed, 8 Dec 2021 10:45:56 +0000 (10:45 +0000)]
Merge branch 'wip/chergert/reduce-action-muxer-allocations' into 'main'

menutracker: reduce allocations and signal emission

See merge request GNOME/gtk!4222

4 years agoactionmuxer: avoid duplicate and recursive work
Christian Hergert [Wed, 8 Dec 2021 08:31:49 +0000 (00:31 -0800)]
actionmuxer: avoid duplicate and recursive work

If we've already done the tracking into the parent muxer, there is no need
to do it again. This can save a great deal of recursive work when adding
items to the muxer.

This makes showing the context menu in gnome-text-editor repeatedly fast
even as spelling corrections are changed.

It is likely that this could fix #4422 as well.

Fixes #4519
Fixes https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/220

4 years agomenutracker: reduce allocations and signal emission
Christian Hergert [Wed, 8 Dec 2021 06:33:20 +0000 (22:33 -0800)]
menutracker: reduce allocations and signal emission

When handling action-added callbacks the code was previously using a
freeze_notify/thaw_notify in all cases. This turns out to allocate a
significant amount of memory when called a lot.

That said, it shouldn't be getting called this much but given the current
state of affairs elsewhere in GtkActionMuxer, this brought temporary
allocations down from 9MiB to 9KiB in gnome-text-editor after showing
the context menu a few times.

Related #4422

4 years agosurface: add missing va_marshaller for layout signal
Christian Hergert [Wed, 8 Dec 2021 06:21:19 +0000 (22:21 -0800)]
surface: add missing va_marshaller for layout signal

I saw this coming across through a ffi boundary in Sysprof, and we wanted
to keep most things within GDK using native marshalling to improve
profiler results when frame pointers are not used.

4 years agoMerge branch 'wip/otte/viewport' into 'main'
Benjamin Otte [Tue, 7 Dec 2021 23:31:06 +0000 (23:31 +0000)]
Merge branch 'wip/otte/viewport' into 'main'

viewport: Handle things differently

See merge request GNOME/gtk!4220

4 years agoviewport: Allocate properly
Benjamin Otte [Tue, 7 Dec 2021 23:12:35 +0000 (00:12 +0100)]
viewport: Allocate properly

Instead of allocation width for height for width for height or whatever
that code was doing, actually allocate the size we were given or the
requested size, whatever is larger.

4 years agoRevert "viewport: Actually report the size we're gonna allocate"
Benjamin Otte [Tue, 7 Dec 2021 22:52:21 +0000 (23:52 +0100)]
Revert "viewport: Actually report the size we're gonna allocate"

This reverts commit b8468af4117974fd2af14e863865f494b021f29c.

4 years agoMerge branch 'wip/otte/viewport' into 'main'
Benjamin Otte [Tue, 7 Dec 2021 21:19:58 +0000 (21:19 +0000)]
Merge branch 'wip/otte/viewport' into 'main'

viewport: Use array for member variables

See merge request GNOME/gtk!4219

4 years agoviewport: Actually report the size we're gonna allocate
Benjamin Otte [Tue, 7 Dec 2021 20:54:02 +0000 (21:54 +0100)]
viewport: Actually report the size we're gonna allocate

Don't just pass on measure() calls, but actually behave in the way we
behave during size allocate.

This should improve cases where GtkScrolledWindow is used with GTK_POLICY_NEVER.

4 years agoviewport: Use array for member variables
Benjamin Otte [Tue, 7 Dec 2021 20:25:37 +0000 (21:25 +0100)]
viewport: Use array for member variables

That way we can index them by orientation in future commits.

4 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Tue, 7 Dec 2021 15:30:48 +0000 (15:30 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

gtktypes: GTK_INVALID_LIST_POSITION should be an int

See merge request GNOME/gtk!4218

4 years agogtktypes: GTK_INVALID_LIST_POSITION should be an int
Benjamin Otte [Tue, 7 Dec 2021 15:15:17 +0000 (16:15 +0100)]
gtktypes: GTK_INVALID_LIST_POSITION should be an int

GListModel uses guint, so the macros we define for it should match that.

Related: !3738

4 years agoMerge branch 'gi-const' into 'main'
Emmanuele Bassi [Tue, 7 Dec 2021 14:22:40 +0000 (14:22 +0000)]
Merge branch 'gi-const' into 'main'

gtk: fix GTK_INVALID_LIST_POSITION type

See merge request GNOME/gtk!3738

4 years agoUpdate Portuguese translation
Hugo Carvalho [Sat, 4 Dec 2021 19:46:16 +0000 (19:46 +0000)]
Update Portuguese translation

4 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sat, 4 Dec 2021 16:46:08 +0000 (16:46 +0000)]
Update Ukrainian translation

4 years agoMerge branch 'check-for-unknown-duration' into 'main'
Benjamin Otte [Sat, 4 Dec 2021 09:45:34 +0000 (09:45 +0000)]
Merge branch 'check-for-unknown-duration' into 'main'

gstmediafile: Correctly report unknown duration

See merge request GNOME/gtk!4217

4 years agoUpdate Swedish translation
Anders Jonsson [Sat, 4 Dec 2021 09:34:37 +0000 (09:34 +0000)]
Update Swedish translation

4 years agogstmediafile: Correctly report unknown duration
Ivan Molodetskikh [Sat, 4 Dec 2021 08:48:30 +0000 (11:48 +0300)]
gstmediafile: Correctly report unknown duration

When loading .mp3 files the duration is initially unknown. Before this
change it was reported as a large integer (since GST_CLOCK_TIME_NONE is
-1). Now it's correctly reported as 0.

4 years agoMerge branch 'wip/carlosg/im-wayland-module-priority' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 23:55:31 +0000 (23:55 +0000)]
Merge branch 'wip/carlosg/im-wayland-module-priority' into 'main'

gtkimcontextwayland: Set a higher IO extension priority

Closes #4443

See merge request GNOME/gtk!4216

4 years agogtkimcontextwayland: Set a higher IO extension priority
Carlos Garnacho [Fri, 3 Dec 2021 23:15:54 +0000 (00:15 +0100)]
gtkimcontextwayland: Set a higher IO extension priority

We want this to take precedence in the wayland platform to other
modules that might be loaded via the IO extension point. None of
those is going to bode well in this platform.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4443
4 years agoMerge branch 'wip/hadess/listbox-fixes' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 23:05:13 +0000 (23:05 +0000)]
Merge branch 'wip/hadess/listbox-fixes' into 'main'

listbox: Explain behaviour of GtkListBoxCreateWidgetFunc

See merge request GNOME/gtk!4194

4 years agoMerge branch 'wip/chergert/inspector-im-module' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 22:51:32 +0000 (22:51 +0000)]
Merge branch 'wip/chergert/inspector-im-module' into 'main'

inspector: add im-module

Closes #4512

See merge request GNOME/gtk!4214

4 years agoMerge branch 'textview-im-surrounding' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 20:26:54 +0000 (20:26 +0000)]
Merge branch 'textview-im-surrounding' into 'main'

textview: Provide more context to input methods

See merge request GNOME/gtk!4209

4 years agoinspector: add im-module
Christian Hergert [Fri, 3 Dec 2021 20:11:25 +0000 (12:11 -0800)]
inspector: add im-module

This adds a new row to the Global/Information section which displays the
GTK im-module that is likely to be in use unless changed by an application.
It responds to updates of GtkSettings:gtk-im-module unless the
GTK_IM_MODULE environment variable is set.

Fixes #4512

4 years agoMerge branch 'text-scroll-test' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 20:00:05 +0000 (20:00 +0000)]
Merge branch 'text-scroll-test' into 'main'

Improve scroll-to mark behavior

Closes #4325

See merge request GNOME/gtk!4208

4 years agotextview: Provide more context to input methods
Matthias Clasen [Thu, 2 Dec 2021 03:38:19 +0000 (22:38 -0500)]
textview: Provide more context to input methods

When returning surrounding context to input methods,
include at least 2 words before and after the insertion
point.

Update the affected input method tests.

4 years agoMerge branch 'text-anchor-replacement-char' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 16:02:49 +0000 (16:02 +0000)]
Merge branch 'text-anchor-replacement-char' into 'main'

textchildanchor: allow to specify replacement character

See merge request GNOME/gtk!4213

4 years agotextchildanchor: allow to specify replacement character
Georg Vienna [Fri, 3 Dec 2021 16:02:48 +0000 (16:02 +0000)]
textchildanchor: allow to specify replacement character

4 years agoMerge branch 'better-tabs-demo' into 'main'
Matthias Clasen [Fri, 3 Dec 2021 13:30:22 +0000 (13:30 +0000)]
Merge branch 'better-tabs-demo' into 'main'

Beef up the tabs demo

See merge request GNOME/gtk!4200

4 years agoBeef up the tabs demo
Matthias Clasen [Mon, 29 Nov 2021 14:25:32 +0000 (09:25 -0500)]
Beef up the tabs demo

Show various alignments, including numeric.

4 years agoMerge branch 'gtk4-win32-egl' into 'main'
Benjamin Otte [Fri, 3 Dec 2021 10:48:50 +0000 (10:48 +0000)]
Merge branch 'gtk4-win32-egl' into 'main'

Fix running GTK4 under EGL on Windows

See merge request GNOME/gtk!4188

4 years agogskglcompiler.c: Force GLSL version 300 es as needed
Chun-wei Fan [Tue, 23 Nov 2021 10:22:55 +0000 (18:22 +0800)]
gskglcompiler.c: Force GLSL version 300 es as needed

For libANGLE to work with our shaders, we must use "300 es" for
the #version directive in our shaders, as well as using the non-legacy/
non-GLES codepath in the shaders.  In order to check whether we are
using the GLSL 300 es shaders, we check whether we are using a GLES 3.0+
context.  As a result, make ->glsl_version a const char* and make sure
the existing shader version macros are defined apprpriately, and add a
new macro for the "300 es" shader version string.

This will allow the gtk4 programs to run under Windows using EGL via
libANGLE.  Some of the GL demos won't work for now, but at least this
makes things a lot better for using GL-accelerated graphics under Windows
for those that want to or need to use libANGLE (such as those with
graphics drivers that aren't capable of our Desktop (W)GL requirements in
GTK.

4 years agogdksurface-win32.c: Call gdk_surface_set_egl_native_window()
Chun-wei Fan [Tue, 23 Nov 2021 08:19:34 +0000 (16:19 +0800)]
gdksurface-win32.c: Call gdk_surface_set_egl_native_window()

.. when creating the surface (with the HWND associated with the
newly-created surface) as well as destroying the surface (with NULL,
since the HWND is going to be destroyed), so that we can tie the EGL
calls to the HWND that we want to do the EGL stuff.

4 years agoBump pango req
Matthias Clasen [Mon, 29 Nov 2021 14:27:00 +0000 (09:27 -0500)]
Bump pango req

Require pango 1.50.

4 years agoMerge branch 'issue-4376' into 'main'
Matthias Clasen [Thu, 2 Dec 2021 17:38:16 +0000 (17:38 +0000)]
Merge branch 'issue-4376' into 'main'

Update placeholder visibility when setting a buffer

Closes #4376

See merge request GNOME/gtk!4211

4 years agoUpdate placeholder visibility when setting a buffer
Emmanuele Bassi [Thu, 2 Dec 2021 17:17:12 +0000 (17:17 +0000)]
Update placeholder visibility when setting a buffer

If we set the placeholder text before setting a buffer, we end up with
both the placeholder *and* the buffer's contents visible at the same
time.

Fixes: #4376
4 years agoMerge branch 'wip/carlosg/tablet-fixes' into 'main'
Matthias Clasen [Thu, 2 Dec 2021 16:34:35 +0000 (16:34 +0000)]
Merge branch 'wip/carlosg/tablet-fixes' into 'main'

Wayland tablet device modifier fixes

Closes #4103 and #4102

See merge request GNOME/gtk!4210

4 years agogesturestylus: Use GtkEventControllerEvent events to track changes
Carlos Garnacho [Thu, 2 Dec 2021 16:00:10 +0000 (17:00 +0100)]
gesturestylus: Use GtkEventControllerEvent events to track changes

We use gtk_gesture_get_last_event() underneath at places that need to
work during ::proximity emission. Since GtkGesture only tracks events
while there are button/touch presses involved, this is not going to
bring the right result there.

Use gtk_event_controller_get_current_event() consistently inside,
which always pokes at the event being handled (which is the correct
intent here).

4 years agogdk/wayland: Unset GDK_BUTTON1_MASK on proximity_in
Carlos Garnacho [Thu, 2 Dec 2021 15:53:47 +0000 (16:53 +0100)]
gdk/wayland: Unset GDK_BUTTON1_MASK on proximity_in

In some circumstances (e.g. activating with a stylus something that
closes a window), we can receive zwp_tablet_tool.proximity_out without
receiving a zwp_tablet_tool.up beforehand.

In those cases, we are not expecting neither .up nor .button, so
reset the stylus device button modifiers on proximity_out.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4103
4 years agogdk/wayland: Use right modifiers for tablet button events
Carlos Garnacho [Thu, 2 Dec 2021 15:19:16 +0000 (16:19 +0100)]
gdk/wayland: Use right modifiers for tablet button events

We are looking up the seat logical pointer modifiers (i.e. the wl_pointer),
not the ones for the tablet tool device. This breaks accounting further
along in GTK leaving stuck implicit grabs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4102
4 years agotextview: Improve scroll-to-mark behavior
Matthias Clasen [Thu, 2 Dec 2021 00:35:11 +0000 (19:35 -0500)]
textview: Improve scroll-to-mark behavior

The idea of within-margin is to scroll as little
as possible to bring the mark within the margins
defined by the factor. The code was achieving
that when scrolling down, but not when scrolling
up. This change makes things symmetrical.

Fixes: #4325
4 years agoAdd a testcase for scroll-to-mark
Matthias Clasen [Wed, 1 Dec 2021 22:20:52 +0000 (17:20 -0500)]
Add a testcase for scroll-to-mark

This should help for figuring out #4325.

4 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 1 Dec 2021 02:59:10 +0000 (02:59 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

textbuffer: Fix pasting text

Closes #4357

See merge request GNOME/gtk!4205

4 years agotextbuffer: Try harder to fix pasting
Matthias Clasen [Wed, 1 Dec 2021 02:42:19 +0000 (21:42 -0500)]
textbuffer: Try harder to fix pasting

It turns out we can't just use the size returned
by the memory stream as-is, since it may contain
unfilled garbage at the end, which utf8 validation
will choke on. So, cut it off at the first '\0'
we find.

4 years agotextbuffer: Fix pasting text
Matthias Clasen [Wed, 1 Dec 2021 01:37:25 +0000 (20:37 -0500)]
textbuffer: Fix pasting text

The memory stolen from a memory outputstream
isn't guaranteed to be 0-terminated, so don't
make that assumption.

Fixes: #4357
4 years agoMerge branch 'update_focus_indicators_in_popovers' into 'main'
Matthias Clasen [Wed, 1 Dec 2021 01:21:32 +0000 (01:21 +0000)]
Merge branch 'update_focus_indicators_in_popovers' into 'main'

update focus indicators in popovers

See merge request GNOME/gtk!4124

4 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 1 Dec 2021 01:13:48 +0000 (01:13 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

textview: Respect editability for Emoji

Closes #4479 and #4503

See merge request GNOME/gtk!4204

4 years agodocs: Clarify a sentence in the migration guide
Matthias Clasen [Wed, 1 Dec 2021 00:51:22 +0000 (19:51 -0500)]
docs: Clarify a sentence in the migration guide

Make it clear that we are giving examples of
no-longer existing APIs here.

Fixes: #4479
4 years agotextview: Avoid misplacing the Emoji chooser
Matthias Clasen [Wed, 1 Dec 2021 00:44:26 +0000 (19:44 -0500)]
textview: Avoid misplacing the Emoji chooser

When the iter is at the end of the buffer,
gtk_text_view_get_iter_location returns a
rectangle with width 0, which in turn makes
gdk_rectangle_intersect return FALSE.

Avoid that by always giving the rectangle
non-empty dimensions.

Fixes: #4503
4 years agoinspector: Make dropdowns bigger
Matthias Clasen [Tue, 30 Nov 2021 23:38:33 +0000 (18:38 -0500)]
inspector: Make dropdowns bigger

If there's enough values to warrant scrolling,
the dropdown was much too small for comfort.

4 years agotextview: Respect editability for Emoji
Matthias Clasen [Tue, 30 Nov 2021 23:37:33 +0000 (18:37 -0500)]
textview: Respect editability for Emoji

Switch the Emoji chooser keybinding to use the
action, so that disabling the action has the
desired effect.

4 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Tue, 30 Nov 2021 14:25:22 +0000 (14:25 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

texture: Remove gdk_texture_download_float()

See merge request GNOME/gtk!4202

4 years agolabel: Don't set ellipsized size as natural size
Benjamin Otte [Tue, 30 Nov 2021 13:05:22 +0000 (14:05 +0100)]
label: Don't set ellipsized size as natural size

Natural size should never ellipsize.

Tests added.

4 years agoGL renderer: Remove noperspective usage
Benjamin Otte [Mon, 29 Nov 2021 23:30:26 +0000 (00:30 +0100)]
GL renderer: Remove noperspective usage

It causes issues with compilation of GLES shaders and isn't in any
way correct.

4 years agonode-editor: Display errors
Benjamin Otte [Mon, 29 Nov 2021 22:58:28 +0000 (23:58 +0100)]
node-editor: Display errors

When opening a file or pasting DND fails, display the error as the
actual node.

4 years agotexture: Remove gdk_texture_download_float()
Benjamin Otte [Sun, 28 Nov 2021 07:03:07 +0000 (08:03 +0100)]
texture: Remove gdk_texture_download_float()

The download API is not well thought out yet, so postpone it until
there's an actual usecase for it.

Remove testcases, too.

4 years agorendernode: Simplify conic gradient code
Benjamin Otte [Sun, 28 Nov 2021 07:00:52 +0000 (08:00 +0100)]
rendernode: Simplify conic gradient code

4 years agotestsuite: Make function arguments const
Benjamin Otte [Wed, 24 Nov 2021 12:02:20 +0000 (13:02 +0100)]
testsuite: Make function arguments const

4 years agoMention main in NEWS and README.md
Matthias Clasen [Mon, 29 Nov 2021 22:42:40 +0000 (17:42 -0500)]
Mention main in NEWS and README.md

4 years agoUpdate references to master in the repository
Matthias Clasen [Mon, 29 Nov 2021 22:37:49 +0000 (17:37 -0500)]
Update references to master in the repository

4 years agoMerge branch 'wip/otte/hfw-min-size' into 'master'
Benjamin Otte [Mon, 29 Nov 2021 10:31:42 +0000 (10:31 +0000)]
Merge branch 'wip/otte/hfw-min-size' into 'master'

window: Implement height-for-width for min size

See merge request GNOME/gtk!4183

4 years agoMerge branch 'font-chooser-variations-fix' into 'master'
Matthias Clasen [Sun, 28 Nov 2021 12:56:09 +0000 (12:56 +0000)]
Merge branch 'font-chooser-variations-fix' into 'master'

fontchooser: Avoid setting variations needlessly

See merge request GNOME/gtk!4197

4 years agoUpdate POTFILES.skip
Piotr Drąg [Sun, 28 Nov 2021 12:30:19 +0000 (13:30 +0100)]
Update POTFILES.skip

4 years agofontchooser: Avoid setting variations needlessly
Matthias Clasen [Sat, 27 Nov 2021 15:10:53 +0000 (10:10 -0500)]
fontchooser: Avoid setting variations needlessly

Setting variations to their default value causes
them to show up in the serialization of the font
description - a font description has no idea about
the default values, so can't filter them out.

Avoid that.

4 years agolistbox: Explain behaviour of GtkListBoxCreateWidgetFunc
Bastien Nocera [Thu, 25 Nov 2021 11:27:16 +0000 (12:27 +0100)]
listbox: Explain behaviour of GtkListBoxCreateWidgetFunc

It might be an interesting shortcut for applications to use, but it
needs to be documented to be useful and agreed.

4 years agoMerge branch 'fix_typo_gesture' into 'master'
Emmanuele Bassi [Wed, 24 Nov 2021 19:56:42 +0000 (19:56 +0000)]
Merge branch 'fix_typo_gesture' into 'master'

gesture: fix typo in docs

See merge request GNOME/gtk!4191

4 years agogesture: fix typo in docs
Alexandros Theodotou [Wed, 24 Nov 2021 19:21:21 +0000 (19:21 +0000)]
gesture: fix typo in docs

4 years agoUpdate Friulian translation
Fabio Tomat [Mon, 22 Nov 2021 09:19:32 +0000 (09:19 +0000)]
Update Friulian translation

4 years agoUpdated Lithuanian translation
Aurimas Černius [Sun, 21 Nov 2021 19:58:20 +0000 (21:58 +0200)]
Updated Lithuanian translation

4 years agoUpdate Occitan translation
Quentin PAGÈS [Sun, 21 Nov 2021 19:38:33 +0000 (19:38 +0000)]
Update Occitan translation

4 years agowindow: Add a new fancy way to compute min size
Benjamin Otte [Sun, 21 Nov 2021 06:06:11 +0000 (07:06 +0100)]
window: Add a new fancy way to compute min size

Try to compute a min size that matches the current aspect ratio.

This means that when interactively resizing, we adapt the min size to
the current window area dynamically.

And that means that we always have a min size that is large enough, but
users can interactively cause it to be small-width x large-height,
large-width x small-width or anything inbetween.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Sun, 21 Nov 2021 18:44:26 +0000 (18:44 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

window: Always clamp to max size

See merge request GNOME/gtk!4185

4 years agoMerge branch 'ebassi/issue-4421' into 'master'
Emmanuele Bassi [Sun, 21 Nov 2021 15:36:25 +0000 (15:36 +0000)]
Merge branch 'ebassi/issue-4421' into 'master'

Unrealize ATContext on unroot

Closes #4421

See merge request GNOME/gtk!4136

4 years agowindow: Properly distribute size between title and child
Benjamin Otte [Sun, 21 Nov 2021 05:10:11 +0000 (06:10 +0100)]
window: Properly distribute size between title and child

Otherwise we can end up with a window that's too small in certain corner
cases after resizing.

4 years agowidget: Clear size request cache on queue_resize()
Benjamin Otte [Sun, 21 Nov 2021 05:08:06 +0000 (06:08 +0100)]
widget: Clear size request cache on queue_resize()

... and not later.

Otherwise future calls to sizing fucntions will reuse an outdated cache
and compute wrong values.

4 years agowindow: Always clamp to max size
Benjamin Otte [Sun, 21 Nov 2021 04:32:20 +0000 (05:32 +0100)]
window: Always clamp to max size

When computing the window size, always try to clamp to the max size.
This will shrink a window down into a sane size if it was too big
before.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Sun, 21 Nov 2021 03:55:28 +0000 (03:55 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Fixes

Closes #4469

See merge request GNOME/gtk!4182

4 years agobuilder-tool: Don't simplify enums too much
Benjamin Otte [Sun, 21 Nov 2021 00:51:35 +0000 (01:51 +0100)]
builder-tool: Don't simplify enums too much

Store the enum nick, not the enum value. That way the file remains
human-readable.

Updated reftests to new expected output.

4 years agopaned: Compute the right handle size
Benjamin Otte [Sun, 21 Nov 2021 00:46:32 +0000 (01:46 +0100)]
paned: Compute the right handle size

Testcase included

Fixes #4469

4 years agowindow: properly compute desired size
Benjamin Otte [Sun, 21 Nov 2021 00:15:59 +0000 (01:15 +0100)]
window: properly compute desired size

Previously, the code did not expand the size properly when a default
size was already set.

Reftest included.

4 years agoMerge branch 'missing-the-missing-glyphs' into 'master'
Matthias Clasen [Sat, 20 Nov 2021 21:56:37 +0000 (21:56 +0000)]
Merge branch 'missing-the-missing-glyphs' into 'master'

Go back to using pango for glyph rendering

See merge request GNOME/gtk!4181

4 years agoGo back to using pango for glyph rendering
Matthias Clasen [Sat, 20 Nov 2021 16:13:52 +0000 (11:13 -0500)]
Go back to using pango for glyph rendering

Using just cairo makes us lose hexboxes. So, until
we implement that ourselves, go back to using pango.

4 years agosizerequest: Change critical message
Benjamin Otte [Sat, 20 Nov 2021 15:59:50 +0000 (16:59 +0100)]
sizerequest: Change critical message

Printing the affected widget leads people to assume that it is to blame
for the error. However, the widget is the object the function is being
called on, not the caller. And the caller is doing it wrong.

Usually the caller is the parent widget, so we could print that one, but
it's only usually, it can be an issue propagating from a grandparent and
it doesn't tell you from where the function is called (allocation or
measuring), so you need a debugger anyway.

So don't put anything there instead.

4 years agoMerge branch 'wip/fix-randr-race' into 'master'
Matthias Clasen [Sat, 20 Nov 2021 14:43:48 +0000 (14:43 +0000)]
Merge branch 'wip/fix-randr-race' into 'master'

x11: Trap error when getting CRTC info

See merge request GNOME/gtk!4169

4 years agoRevert "a11y: return -1 if parent is NULL"
Samuel Thibault [Sat, 20 Nov 2021 09:59:00 +0000 (10:59 +0100)]
Revert "a11y: return -1 if parent is NULL"

This reverts commit 22847563cecb59c6f120a08bb49284599dbb6232.

4 years agoMerge branch 'wip/chergert/fix-a11y-critical' into 'master'
Samuel Thibault [Sat, 20 Nov 2021 08:14:35 +0000 (08:14 +0000)]
Merge branch 'wip/chergert/fix-a11y-critical' into 'master'

a11y: return -1 if parent is NULL

See merge request GNOME/gtk!4179

4 years agoUpdate Basque translation
Asier Sarasua Garmendia [Sat, 20 Nov 2021 07:52:06 +0000 (07:52 +0000)]
Update Basque translation

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Sat, 20 Nov 2021 06:06:08 +0000 (06:06 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Lots of sizing fixes

See merge request GNOME/gtk!4180

4 years agowidget: Remove a check
Benjamin Otte [Fri, 19 Nov 2021 23:44:47 +0000 (00:44 +0100)]
widget: Remove a check

That consistency check is entirely outdated and just prints confusing
stuff.

4 years agosizerequestcache: Increase size
Benjamin Otte [Fri, 19 Nov 2021 22:22:39 +0000 (23:22 +0100)]
sizerequestcache: Increase size

This is a quickfix to avoid infinite runtime in nested boxes with
wrapped labels.

Test included

4 years agosizerequest: Use g_printerr() for debug messages
Benjamin Otte [Fri, 19 Nov 2021 22:21:44 +0000 (23:21 +0100)]
sizerequest: Use g_printerr() for debug messages

glib doesn't print debug messages by default anymore.

4 years agopaned: Always query at least min size
Benjamin Otte [Sat, 20 Nov 2021 04:56:14 +0000 (05:56 +0100)]
paned: Always query at least min size

For shrinking children, we would not make sure of this and just throw
the current size at them.

4 years agostack: Make sure to not under-measure children
Benjamin Otte [Sat, 20 Nov 2021 04:42:20 +0000 (05:42 +0100)]
stack: Make sure to not under-measure children

When the stack is homogeneous in only one direction, the other direction
may produce min sizes to small for all children. Make sure to query at
least the min size for those.