Commit Graph

39223 Commits

Author SHA1 Message Date
Matthias Clasen
2611a996ff Merge branch 'matthiasc/for-main' into 'main'
textbuffer: Fix pasting text

Closes #4357

See merge request GNOME/gtk!4205
2021-12-01 02:59:10 +00:00
Matthias Clasen
3e7618fef7 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.
2021-11-30 21:42:19 -05:00
Matthias Clasen
5b1b75b055 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
2021-11-30 20:37:25 -05:00
Matthias Clasen
f1612e36ee Merge branch 'update_focus_indicators_in_popovers' into 'main'
update focus indicators in popovers

See merge request GNOME/gtk!4124
2021-12-01 01:21:32 +00:00
Matthias Clasen
b3b0321620 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
2021-11-30 19:44:26 -05:00
Matthias Clasen
e0deacd236 inspector: Make dropdowns bigger
If there's enough values to warrant scrolling,
the dropdown was much too small for comfort.
2021-11-30 18:38:33 -05:00
Matthias Clasen
f66172451d textview: Respect editability for Emoji
Switch the Emoji chooser keybinding to use the
action, so that disabling the action has the
desired effect.
2021-11-30 18:37:33 -05:00
Benjamin Otte
07cfdd8ca0 label: Don't set ellipsized size as natural size
Natural size should never ellipsize.

Tests added.
2021-11-30 15:10:02 +01:00
Matthias Clasen
ddd5704c92 Update references to master in the repository 2021-11-29 17:37:49 -05:00
Benjamin Otte
3ba6d2bd27 Merge branch 'wip/otte/hfw-min-size' into 'master'
window: Implement height-for-width for min size

See merge request GNOME/gtk!4183
2021-11-29 10:31:42 +00:00
Matthias Clasen
e9d8bf96e0 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.
2021-11-27 17:13:23 -05:00
Emmanuele Bassi
c742debea8 Merge branch 'fix_typo_gesture' into 'master'
gesture: fix typo in docs

See merge request GNOME/gtk!4191
2021-11-24 19:56:42 +00:00
Alexandros Theodotou
cd60ec1576
gesture: fix typo in docs 2021-11-24 19:34:49 +00:00
Benjamin Otte
0709dc7a6a 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.
2021-11-21 18:52:42 +00:00
Benjamin Otte
15528599f4 Merge branch 'wip/otte/for-master' into 'master'
window: Always clamp to max size

See merge request GNOME/gtk!4185
2021-11-21 18:44:26 +00:00
Emmanuele Bassi
031aab3ef6 Merge branch 'ebassi/issue-4421' into 'master'
Unrealize ATContext on unroot

Closes #4421

See merge request GNOME/gtk!4136
2021-11-21 15:36:25 +00:00
Benjamin Otte
c990134e49 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.
2021-11-21 08:19:07 +01:00
Benjamin Otte
822508f33e 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.
2021-11-21 06:08:06 +01:00
Benjamin Otte
358893aa84 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.
2021-11-21 05:33:28 +01:00
Benjamin Otte
c025bc5098 paned: Compute the right handle size
Testcase included

Fixes #4469
2021-11-21 01:49:40 +01:00
Benjamin Otte
170bc0a8de window: properly compute desired size
Previously, the code did not expand the size properly when a default
size was already set.

Reftest included.
2021-11-21 01:31:06 +01:00
Benjamin Otte
eefb6a0dd4 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.
2021-11-20 17:05:36 +01:00
Benjamin Otte
1eb86d6394 widget: Remove a check
That consistency check is entirely outdated and just prints confusing
stuff.
2021-11-20 06:04:10 +01:00
Benjamin Otte
a0ca936e8d sizerequestcache: Increase size
This is a quickfix to avoid infinite runtime in nested boxes with
wrapped labels.

Test included
2021-11-20 06:04:10 +01:00
Benjamin Otte
de3c50a237 sizerequest: Use g_printerr() for debug messages
glib doesn't print debug messages by default anymore.
2021-11-20 06:04:10 +01:00
Benjamin Otte
244ddea0ea 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.
2021-11-20 06:04:10 +01:00
Benjamin Otte
6c94835f5d 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.
2021-11-20 06:04:10 +01:00
Benjamin Otte
617566128d stack: Index the homogeneous array by orientation 2021-11-20 06:04:10 +01:00
Benjamin Otte
7bf772111c stack: Turn the homogenenous variables into an array
that way, we can index them by orientation.
2021-11-20 06:04:10 +01:00
Benjamin Otte
50e0893497 widget: force adjustment method is one size is FILL
If halign=fill, force adjustment to height-for-width.
If valign=fill, force adjustment to width-for-height.
Otherwise look at request mode.

This way we don't try to adapt the filled dimension and only adjust
the one that is not set to fill.
2021-11-20 06:04:10 +01:00
Benjamin Otte
7459d430eb widget: Don't forget margins when adjusting
This could lead to the wrong values being passed and computing invalid
sizes which would then lead to very unhappy code.

Test included.
2021-11-19 23:46:59 +01:00
Benjamin Otte
163616cc0a sizerequest: Add a critical when for_size is too small
It's not expensive to check it because we'll cache the dfault size
request anyway, and people do it wrong a lot.
As a bonus, don't do any return_if_fail(), just use the min size
instead.
2021-11-19 23:46:59 +01:00
Fred Morcos
f019e9d856 Documentation fix and whitespace cleanup
- gtk_init() does not parse command-line options anymore.
- Gitlab's  WebIDE automatically cleans up whitespace.
2021-11-19 13:21:56 +00:00
Benjamin Otte
899cb44519 label: Don't add a pixel where none should be added
When the text width is larger than the measuring width, set the min
width to that value, don't also add 1 to it.
2021-11-18 07:16:09 +00:00
Marco Melorio
d3347e64ba picture: Setting keep-aspect-ratio requires a redraw 2021-11-18 02:39:15 +01:00
Matthias Clasen
0c53b608f9 Merge branch 'bilelmoussaoui/since-annotations' into 'master'
g-i: add missing since annotations

See merge request GNOME/gtk!4154
2021-11-16 21:34:58 +00:00
Matthias Clasen
d9d220cfc9 Merge branch 'wip/carlosg/x11-wm-drags' into 'master'
gtkmain: Disable implicit grab active state on CROSSING_GRAB leave events

Closes #4416

See merge request GNOME/gtk!4162
2021-11-16 17:21:38 +00:00
Matthias Clasen
2026256823 Merge branch 'compose-cache-symlinks' into 'master'
composetable: invalidate cache based on symlink mtime too

See merge request GNOME/gtk!4163
2021-11-16 17:21:04 +00:00
Matthias Clasen
012baeb909 Merge branch 'wip/carlosg/cancelled-gestures' into 'master'
gtkwidget: Do not check event sequence state before cancelling gesture

Closes #4387

See merge request GNOME/gtk!4160
2021-11-16 17:19:55 +00:00
Emmanuele Bassi
c4b2fe6ee5 docs: Add blurb for GtkEditableProperties. 2021-11-16 13:50:52 +00:00
Emmanuele Bassi
cea320af24 docs: Fix description for CellRendererAccelMode
Link to the property, instead of copy-pasting its description.
2021-11-16 13:41:52 +00:00
Emmanuele Bassi
a5bf0591ee docs: Fix link in GtkSymbolicColor description 2021-11-16 13:37:33 +00:00
Naïm Favier
22f5236943
composetable: invalidate cache based on symlink mtime too
When the compose file is a symbolic link, take the link itself's
modification time into account (in addition to its target's) in
determining whether to invalidate the compose cache.

This is useful e.g. on NixOS systems where the compose file might point
to a store path with an irrelevant modification time, and we want the
cache to expire when the symlink itself changes.
2021-11-16 12:53:38 +01:00
Carlos Garnacho
f84bcfbb97 gtkmain: Disable implicit grab active state on CROSSING_GRAB leave events
This grab-induced crossing event may come from outer means while there are
buttons pressed (e.g. WM window drags/resizes in X11), the implicit active
state should be undone in that situation.

Also, separate the handling of GDK_LEAVE_NOTIFY, as it's fundamentally
different from GDK_TOUCH_END/CANCEL handling.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4416
2021-11-16 10:58:03 +01:00
Carlos Garnacho
f36ee67226 gtkgesture: Do not cancel gesture when setting DENIED state
Touchpoint state and tracking are tangential, this is mixing up both.
This change was added in the fixes for
https://gitlab.gnome.org/GNOME/gtk/-/issues/3016 but is now unnecessary.
2021-11-16 00:47:57 +01:00
Carlos Garnacho
615b8fc569 gtkwidget: Do not check event sequence state before cancelling gesture
The sequence should be cancelled from the gesture despite its current state.
Also, there was a piece of pointer emulation that was not dropped here,
maybe breaking things further for the pointer emulated touchpoint.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4387
2021-11-16 00:41:17 +01:00
Emmanuele Bassi
ff3bb7f671 docs: Annotate Label.get_selection_bounds() out arguments
They are optional, and should be marked as such.

See issue: #4452
2021-11-15 15:35:13 +00:00
Bilal Elmoussaoui
40c08954db g-i: add missing since annotations 2021-11-13 17:50:53 +01:00
Benjamin Otte
7f7809f523 label: Don't do more work than necessary
We only want to determine the size pixel-exact, not pango-unit-exact, so
don't spend lots of time wondering if text is half a pixel or a quarter
pixel wider.
2021-11-11 05:24:58 +01:00
Benjamin Otte
46f8600b6a css: Don't crash when color stop offsets descend
Testcase included.

Fixes #4424
2021-11-10 17:28:14 +01:00