Commit Graph

74176 Commits

Author SHA1 Message Date
Carlos Garnacho
35744d87a2 gsk: Also ceil() top side when converting graphene to cairo rectangles
The outset border for all sides is ceil()ed, except for the top side.
Most often values are already nicely rounded here, but this seems an
oversight.
2022-11-23 18:56:45 +01:00
Matthias Clasen
200f31f285 Merge branch 'work/zzag/wl-output-cleanup' into 'main'
gdk/wayland: Destroy zxdg_output_v1 upon GdkWaylandMonitor destruction

See merge request GNOME/gtk!5242
2022-11-22 12:01:43 +00:00
Vlad Zahorodnii
1d94aefe2b gdk/wayland: Clear GdkWaylandMonitor::output using g_clear_pointer()
Use g_clear_pointer() to make tear down code consistent.
2022-11-22 11:23:08 +02:00
Vlad Zahorodnii
e82e7823a8 gdk/wayland: Destroy zxdg_output_v1 upon GdkWaylandMonitor destruction
It prevents potentially leaking memory.
2022-11-22 11:18:32 +02:00
Matthias Clasen
0de172f03d Merge branch 'file-filter-properties' into 'main'
filefilter: Add properties for the criteria

See merge request GNOME/gtk!5241
2022-11-22 04:00:40 +00:00
Matthias Clasen
d34ac99916 filefilter: Add properties for the criteria
Add construct-only properties for patterns,
suffixes and mime-types. This provides an
alternative way to specify these in ui files.

Related: #5350
2022-11-21 22:44:03 -05:00
Matthias Clasen
055f3e5d97 Merge branch 'color-picker-portal' into 'main'
colorpicker: Always try the portal first

See merge request GNOME/gtk!5240
2022-11-21 19:46:17 +00:00
Matthias Clasen
205b718fe5 colorpicker: Always try the portal first
It does not hurt., and going forward, we want to
prefer portals.
2022-11-21 14:26:29 -05:00
Matthias Clasen
01ae136a4c Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: add missing array annotation to AlertDialog.set_buttons

See merge request GNOME/gtk!5234
2022-11-21 10:49:05 +00:00
Matthias Clasen
74806ed324 Merge branch 'fix-upside-down-labels' into 'main'
gsk: Avoid a crash with negative scales

See merge request GNOME/gtk!5236
2022-11-21 10:48:29 +00:00
Matthias Clasen
83839cb219 Merge branch 'drop-buildable-get-id' into 'main'
builder: Stop using GtkBuildable.get_id

See merge request GNOME/gtk!5239
2022-11-21 10:35:16 +00:00
Matthias Clasen
f22db024a8 Merge branch 'stringlist-prop' into 'main'
stringlist: Add a construct-only strings property

See merge request GNOME/gtk!5238
2022-11-21 10:34:54 +00:00
Matthias Clasen
e357ff6055 Drop gtk_widget_buildable_parser_finished
No need to have this no-op implementation.
This was the only implementation of this vfunc
in GTK.
2022-11-20 14:36:35 -05:00
Matthias Clasen
92edd4c476 builder: Stop using GtkBuildable.get_id
Drop the only implementation of this vfunc,
and stop using it. It isn't needed, and the
only implementation did the same thing GtkBuilder
does anyway.
2022-11-20 14:35:36 -05:00
Matthias Clasen
f0aefe2f7f stringlist: Add a construct-only strings property
This enables creating string lists in ui files
without using custom markup.

Related: #5350
2022-11-20 14:07:45 -05:00
Matthias Clasen
8f24072354 Merge branch 'center-box-props' into 'main'
centerbox: Add properties for child widgets

See merge request GNOME/gtk!5237
2022-11-20 18:25:12 +00:00
Matthias Clasen
8dc89ba3d8 centerbox: Add properties for child widgets
This provides and alternative to add children
in ui files.

Related: #5350
2022-11-20 12:54:31 -05:00
Matthias Clasen
b441c684ab gsk: Avoid a crash with negative scales
Don't crash when both scale_x and scale_y are -1.

A test is included.
2022-11-20 12:13:02 -05:00
Bilal Elmoussaoui
97d76417fa g-i: add missing array annotation to AlertDialog.(s|g)et_buttons 2022-11-19 14:33:19 +01:00
Matthias Clasen
ab530b9e5a Merge branch 'builder-parse-attributes' into 'main'
builder: Parse PangoAttrList values

See merge request GNOME/gtk!5228
2022-11-19 02:49:23 +00:00
Matthias Clasen
21a69e7107 Merge branch 'wip/carlosg/osk-activation' into 'main'
gtktext: Claim gesture more selectively

Closes #5351

See merge request GNOME/gtk!5230
2022-11-18 19:33:55 +00:00
Matthias Clasen
d45155364e Merge branch 'kjellahl/menubar' into 'main'
gtk_popover_menu_bar_set_menu_model(): Accept model == NULL

See merge request GNOME/gtk!5232
2022-11-18 19:33:37 +00:00
Matthias Clasen
4a71957c1f Merge branch 'shorter-im-context-ids' into 'main'
immmodule: Warn if GTK_IM_MODULE is bad

See merge request GNOME/gtk!5229
2022-11-18 19:33:17 +00:00
Matthias Clasen
e53c9e4832 Merge branch 'wayland-foreign-v2' into 'main'
wayland: Also support the v2 of the importer

See merge request GNOME/gtk!5231
2022-11-18 18:00:42 +00:00
Matthias Clasen
b3821b19b5 wayland: Also support the v2 of the importer
Commit 0ba8e16e14 added support for the export
part of zxdg_foreign_v2, but neglected that the importer
has a v2 as well. Support it.
2022-11-18 12:10:56 -05:00
Kjell Ahlstedt
8911015549 gtkpopovermenubar: Make model nullable
The description of gtk_popover_menu_bar_new_from_model() and
gtk_popover_menu_bar_set_menu_model() says that model is nullable.
Make it so.
2022-11-18 18:09:42 +01:00
Carlos Garnacho
f1168c5012 gdksurface: Do not consider GDK_TOUCH_END/CANCEL as popup-dismiss worthy
GDK_TOUCH_END deserves the same treatment than GDK_BUTTON_RELEASE, since it's
subject to the same circumstances (popping up a menu on long press would be
immediately dismissed on release if we handled them there). Ideally, we would
want to match releases that we obtained a press for while grabbed, but as
the popup is also dismissed on GDK_BUTTON_PRESS/GDK_TOUCH_BEGIN, there's no
use for this tracking.

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

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2512
2022-11-18 17:56:14 +01:00
Carlos Garnacho
ae54374a51 gtktext: Claim gesture more selectively
Even though button 1 (or touch down) presses do most often have
an effect in one way or another (starting drag, moving focus,
starting selection, ...), there is one situation that they do
immediately nothing: When clicking on the entry does not move
the text caret around. Dragging might start a selection, but
the entry did not do anything just yet, and an immediate
button/touch release should remain at "did nothing".

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

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

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5351
2022-11-18 17:56:14 +01:00
Matthias Clasen
64b8a8740f Merge branch 'wip/fix-tiling-without-gtk-shell' into 'main'
wayland/surface: Set the tiling state from xdg-shell too

See merge request GNOME/gtk!5227
2022-11-18 16:33:25 +00:00
Matthias Clasen
1f97714293 immodule: Accept 'simple' and 'none'
Everybody (including myself) gets this wrong,
so accept 'simple' and 'none' as shorthands
for the official IDs 'gtk-im-context-simple'
and 'gtk-im-context-none'.
2022-11-18 11:18:48 -05:00
Matthias Clasen
9af8c6fb25 immmodule: Warn if GTK_IM_MODULE is bad
If we don't find an immodule matching the
ids in the GTK_IM_MODULE envvar, print a
warning.
2022-11-18 11:18:48 -05:00
Matthias Clasen
9682085e09 builder: Parse PangoAttrList values
Allow specifying PangoAttrList properties in the
serialized format supported by pango_attr_list_to_string().

Test included.
2022-11-18 10:42:50 -05:00
Jonas Ådahl
07a59da6e4 wayland/surface: Set the tiling state from xdg-shell too
We plumbed it from the gtk-shell configure event, but didn't for the
equivalent state passed via xdg_toplevel.configure.
2022-11-18 13:11:25 +01:00
Matthias Clasen
dfbaeefc64 Merge branch 'matthiasc/for-main' into 'main'
gsk: Add an assertion to help static analysis

See merge request GNOME/gtk!5224
2022-11-18 05:22:44 +00:00
Matthias Clasen
9cbfbbdf39 stringsorter: Fix one case of collation handling
When not ignoring case, and not collating, we were
returning sort keys that were already freed. Oops.

Pointed out by clang.
2022-11-18 00:04:23 -05:00
Matthias Clasen
8c1a041104 gdk: Fix possible memory errors
clang complained that we may end up jumping
to the cleanup code without initializing data
in the jpeg code. Always initialize data to
NULL to prevent that eventuality.
2022-11-18 00:04:23 -05:00
Matthias Clasen
95fc5109bb composetable: Fix a memory leak
Pointed out by clang.
2022-11-18 00:04:23 -05:00
Matthias Clasen
ce57150203 gsk: Add an assertion to help static analysis
clang gets wild ideas about negative radii otherwise.
2022-11-18 00:04:23 -05:00
Matthias Clasen
203685a46a Merge branch 'matthiasc/for-main' into 'main'
Fix spelling errors

See merge request GNOME/gtk!5223
2022-11-18 04:56:57 +00:00
Matthias Clasen
ebe6d52252 Drop redundant glib version checks
We require GLib 2.72 now.
2022-11-17 22:49:56 -05:00
Matthias Clasen
60aaf38f39 gdk: Clean up gdkprivate.h
Move apis to more specific headers.
2022-11-17 22:49:56 -05:00
Matthias Clasen
2bab8cca5f gdk: Rename GDK_SURFACE_TEMP
We use this value only for drag surfaces, so call it that.
2022-11-17 22:49:56 -05:00
Matthias Clasen
b12d31d189 Fix spelling errors
These were pointed out by codespell.
2022-11-17 22:49:45 -05:00
Matthias Clasen
0d2161ee40 Merge branch 'file-dialog-portals' into 'main'
file dialog: Use portals

See merge request GNOME/gtk!5221
2022-11-18 03:49:30 +00:00
Matthias Clasen
cda06f375e Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Add some keywords

See merge request GNOME/gtk!5220
2022-11-17 20:53:51 +00:00
Matthias Clasen
b0148972fd filedialog: Use portals
We want this new API to be portal-first.
Make it so.
2022-11-17 15:52:53 -05:00
Matthias Clasen
ea3c58f0ec gtk-demo: Add folders to the clipboard demo
This is handy for testing a case where folder
dnd does not work with the file transfer portal.

See #5348
2022-11-17 06:31:09 -05:00
Matthias Clasen
af8ad1efe8 gtk-demo: Add some keywords
Make sure that dnd and drag-and-drop yield the right
(and the same) set of demos.
2022-11-17 05:50:34 -05:00
Matthias Clasen
12a50735da Merge branch 'ccook/doc-spelling-fixes' into 'main'
doc fix: various spelling mistakes corrected

See merge request GNOME/gtk!5215
2022-11-17 10:28:38 +00:00
Luca Bacci
7c62eaa528 Merge branch 'win32-hotspot' into 'main'
gdk/win32: fix cursor hotspot

See merge request GNOME/gtk!5216
2022-11-17 09:06:55 +00:00