Compare commits

...

2365 Commits

Author SHA1 Message Date
Matthias Clasen
ce09db1401 Bump pango req to 1.49.1
We are using pango api that was introduced in 1.49.1
without ifdefs, so we should require it.
2021-09-04 09:41:20 -04:00
Matthias Clasen
ed96414483 Avoid hand-rolled color glyph information
Followup to b244f31337. Pango provides color glyph
information for us now, so we don't need to steal a
bit anymore.
2021-09-04 09:39:29 -04:00
Matthias Clasen
e6de8a1746 Fix text node diffing
Now that text nodes carry flags, we need to compare
them (even though it is very unlikely that they will
differ from node to node).
2021-09-04 09:37:29 -04:00
Matthias Clasen
db1fc454ee Redo font options handling
Avoid cairo types in the API by introducing a
GskTextRenderFlags enum.
2021-09-04 09:37:01 -04:00
Matthias Clasen
850aebea5d Merge branch 'matthiasc/for-master' into 'master'
widget: Redraw when font options change

See merge request GNOME/gtk!3917
2021-09-03 18:16:33 +00:00
Matthias Clasen
26e632e549 widget: Redraw when font options change
Its the right thing to do, even if it is a rare event.
2021-09-03 13:56:29 -04:00
Matthias Clasen
64d2d7074f Merge branch 'small-text-fixes' into 'master'
gsk: Pass font options down

See merge request GNOME/gtk!3908
2021-09-03 17:21:08 +00:00
Matthias Clasen
062a15310a gtk: Pass font options along
Pass the widget's font options along when we
are creating text nodes.
2021-09-03 12:52:05 -04:00
Matthias Clasen
299c7c3514 gsk: Pass font options along
Use the font options from the text node when
looking up glyphs.
2021-09-03 12:52:05 -04:00
Matthias Clasen
6599cb001f gsk: Add font options to the glyph cache
The cairo_t that we create to render glyphs for
the glyph cache needs to match the font options
that are supposedly governing how glyphs are
drawn.

Since we allow font options to be different per
widget in gtk, we need to have them at least at
the level of individual render nodes. Adding them
to the lookup key for the glyph cache has the
side effect of solving another problem: We are
not flushing the cache when font options change.
2021-09-03 12:52:05 -04:00
Matthias Clasen
f1347f5841 gsk: Add font options to text nodes
Since font options affect how the glyphs get rendered,
we need to pass the font options down from the gtk level
to where the glyph cache is populated.

Add a new gsk_text_node_new_full api that takes a
cairo_font_options_t in addition to the other parameters.
2021-09-03 12:43:35 -04:00
Matthias Clasen
f3ccf62463 gtk-demo: Improve the font rendering demo
Add a toggle for antialiasing, and make the metrics
hinting turn on rounding of positions, to match what
we do with settings now.
2021-09-03 11:29:44 -04:00
Matthias Clasen
44fea33c5d Merge branch 'wip/exalm/buttons' into 'master'
Allow custom children on GtkMenuButton

Closes #4205

See merge request GNOME/gtk!3904
2021-09-03 14:49:09 +00:00
Alexander Mikhaylenko
8b48cf11f9 menubutton: Support custom children
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4205
2021-09-03 17:52:46 +05:00
Matthias Clasen
e681fdd958 Merge branch 'matthiasc/for-master' into 'master'
Add a README in gtk/compose

See merge request GNOME/gtk!3916
2021-09-03 00:55:45 +00:00
Matthias Clasen
d4b7a78c54 Add a README in gtk/compose 2021-09-02 20:10:19 -04:00
Matthias Clasen
a45cbad553 Merge branch 'wip/smcv/transparent-is-transparent' into 'master'
reftest-compare: Treat colour channels as undefined if alpha is zero

Closes #4227

See merge request GNOME/gtk!3914
2021-09-02 22:19:27 +00:00
Simon McVittie
16b9a30655 reftest-compare: Treat colour channels as undefined if alpha is zero
If the alpha channel is zero, it doesn't matter what the values of the
red, green and blue channels are: the pixel is still fully transparent.
On most architectures, fully transparent pixels end up all-zeroes
(fully transparent black), matching what's in the reference PNG file;
but on mips*el the blend-difference and blend-normal tests get all-ones
(fully transparent white) and a test failure.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4227
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-09-02 22:34:48 +01:00
Jiri Grönroos
82a184a7b7 Update Finnish translation
(cherry picked from commit 33a4ae12ef)
2021-09-02 16:06:57 +00:00
Aurimas Černius
9e198a59b6 Updated Lithuanian translation 2021-09-02 13:51:39 +03:00
Matthias Clasen
c002678085 Merge branch 'fix-gst-subproject' into 'master'
media: Check for gstreamer verion instead of using cc.links()

See merge request GNOME/gtk!3910
2021-09-02 01:33:06 +00:00
Matthias Clasen
486cffc361 Merge branch 'hint-metrics-setting' into 'master'
Add a gtk-hint-font-metrics setting

See merge request GNOME/gtk!3912
2021-09-01 23:15:50 +00:00
Matthias Clasen
67495fcc77 Update settings tests
We have a new setting, so the test that is counting
settings needs an update.
2021-09-01 17:16:08 -04:00
Matthias Clasen
b26a370ce4 Add a gtk-hint-font-metrics setting
This lets people switch back to font rendering that is closer
to what GTK 3 does. It is not perfect - subpixel antialiasing
is not going to work. But it give us an Escape hatch while
we shake out the bugs in our linear layout.

Related: #3787
2021-09-01 15:52:07 -04:00
Matthias Clasen
4dc0e67ac7 Merge branch 'color-glyph-info' into 'master'
Use color glyph information from Pango

See merge request GNOME/gtk!3909
2021-09-01 16:59:38 +00:00
Xavier Claessens
2c060663cf media: Check for gstreamer verion instead of using cc.links()
This fix error when gstgl_dep comes from a subproject because in that
case it cannot be used in compiler checks.
2021-09-01 12:04:05 -04:00
Matthias Clasen
76a8eb4960 Merge branch 'matthiasc/for-master' into 'master'
Initial support for new Pango attributes

See merge request GNOME/gtk!3911
2021-09-01 15:06:26 +00:00
Matthias Clasen
ad3dad1965 Initial support for new Pango attributes
This is still missing the GtkTextTag hookup,
but it fixes the build.
2021-09-01 10:32:45 -04:00
Danial Behzadi
172d97de05 Update Persian translation 2021-09-01 09:42:39 +00:00
Daniel Mustieles
4c967d5b45 Updated Spanish translation 2021-09-01 11:02:13 +02:00
Matthias Clasen
b244f31337 Use color glyph information from Pango
Pango now sets a bit in PangoGlyphVisAttr for
color glyphs, so we don't need to do that
ourselves anymore.
2021-09-01 01:47:06 -04:00
Nathan Follens
8550a04bf4 Update Dutch translation
(cherry picked from commit 9aa08dd1b8)
2021-08-31 15:55:14 +00:00
eshagh shahidani
cb38ead48e Update Persian translation
(cherry picked from commit 7691c94a37)
2021-08-31 14:42:34 +00:00
Matthias Clasen
9713c3394d Merge branch 'matthiasc/for-master' into 'master'
editable: Clarify the docs

See merge request GNOME/gtk!3906
2021-08-31 13:15:47 +00:00
Matthias Clasen
fa57b006c9 editable: Clarify the docs
Make it clear that your class must have all the editable properties
already before you call the (confusingly named) function
gtk_editable_install_properties.
2021-08-31 08:41:45 -04:00
Matthias Clasen
9f73f0234a Merge branch 'default-settings-non-debug' into 'master'
Revert "reftests: Enforce default settings"

See merge request GNOME/gtk!3903
2021-08-30 18:09:28 +00:00
Matthias Clasen
a4f067481c gdk: Make GDK_DEBUG=default-settings unconditional
Our tests use this settings, so we should respect it
in non-debug builds as well.
2021-08-30 11:01:55 -04:00
Matthias Clasen
733fb527fa Revert "reftests: Enforce default settings"
This reverts commit 4e4f57e091.

This should not be necessary, since we have GDK_DEBUG=default-settings.
2021-08-30 11:01:22 -04:00
Matthias Clasen
3667c6b053 Merge branch 'wip/smcv/compose-files' into 'master'
Fix Compose handling on big-endian host architectures

Closes #4217

See merge request GNOME/gtk!3902
2021-08-30 12:52:54 +00:00
Simon McVittie
1071818df8 compose: Update sequences from libX11 1.7.2
This adds support for sequences like <Compose>,G,u -> capital G with
breve. Previously, only a capital U was accepted for E, G, I and O
(but a lower-case u was accepted for A and U for some reason).

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 13:09:27 +01:00
Simon McVittie
11c2d9ea30 compose: Document how to get compose-parse input from libX11 source
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 13:09:05 +01:00
Simon McVittie
52cdf3056d compose: Generate endian-dependent compact Compose data
The GtkComposeTable cache is always in big-endian format and is
byteswapped on load for the more common little-endian CPUs, but
init_builtin_table() in GtkIMContextSimple can't byteswap the built-in
data without copying it, which is undesirable. Pregenerate both big-
and little-endian compose data, and compile the correct flavour into
each build of GTK. This fixes failure of the composetable test when
building for a big-endian architecture such as s390x and (traditional,
big-endian) powerpc.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4217
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 11:29:46 +01:00
Benjamin Otte
32899a1edd Merge branch 'wip/otte/for-master' into 'master'
fontbutton: Make sure the window is on the same display

See merge request GNOME/gtk!3901
2021-08-30 04:37:49 +00:00
Benjamin Otte
119458f13e contentdeserializer: Fix some API awkwardness
Allow uninitialized GValues to be passed. Makes life easier for the
inspector code I'm writing.
2021-08-30 06:02:16 +02:00
Benjamin Otte
2863095f06 node-editor: Allow dragging and dropping the center picture
Dragging will just drag the render node.

Dropping will replace the current contents of the textview with the
dropped node.

Neat side effect: You can drag the node onto itself to do a
deserialize/serialize of the current text.
2021-08-30 06:02:16 +02:00
Benjamin Otte
cbc050b9ed recorder: Make the render nodes in the list draggable
You can (soon) drag any of the nodes directly into the node-editor.
2021-08-30 06:02:16 +02:00
Benjamin Otte
18affbd390 dragicon: Add a default drag icon for GskRenderNode
Somebody should make this default drag icon machinery pluggable.
2021-08-30 06:02:16 +02:00
Benjamin Otte
0b7a36ce33 rendernode: Add (de)serialization support for render nodes
This includes our own new mime type for render nodes, too.
2021-08-30 06:02:15 +02:00
Benjamin Otte
1957915940 rendernode: Add GValue functions for render nodes
This is needed as GskRenderNode is its own fundamental type and has its
own GValue infrastructure. And I want to put render nodes into the
clipboard which uses GValues.
2021-08-30 06:02:15 +02:00
Benjamin Otte
552b71d4e2 stylecontext: Remove unneeded headers 2021-08-30 06:02:15 +02:00
Benjamin Otte
480112f9aa fontbutton: Destroy dialog in unrealize()
This way, we can be sure it's always using the right display.

We can also be sure that it doesn't leak.
2021-08-30 06:02:15 +02:00
Benjamin Otte
9a2f4d8026 fontbutton: Make sure the window is on the same display
We don't want the font buttons created by the inspector to run on the
default display.
2021-08-30 06:02:15 +02:00
Benjamin Otte
3b15f32335 Merge branch 'wip/otte/symbolic-paintable' into 'master'
Add GtkSymbolicPaintable

See merge request GNOME/gtk!3895
2021-08-30 03:54:35 +00:00
Benjamin Otte
7404a6fc4f Merge branch 'wip/otte/G_TYPE_POINTER' into 'master'
Get rid of G_TYPE_POINTER

See merge request GNOME/gtk!3900
2021-08-30 03:50:30 +00:00
Benjamin Otte
91d1ec41c2 symbolicpaintable: Refactor default colors path 2021-08-30 05:29:04 +02:00
Benjamin Otte
9237c8be67 icontheme: Refactor gtk_icon_theme_lookup_symbolic_colors()
With the new enum, the code looks much cleaner.
2021-08-30 04:52:47 +02:00
Benjamin Otte
6c87d362c5 enums: Add a GtkSymbolicColor enum
That way we don't nedmagic numbres to index the colors array.

Use it in the symbolic paintable demo.
2021-08-30 04:36:16 +02:00
Baurzhan Muftakhidinov
4f31d3587d Update Kazakh translation
(cherry picked from commit 37d2d407a1)
2021-08-29 17:09:01 +00:00
Baurzhan Muftakhidinov
29a2f4021a Update Kazakh translation
(cherry picked from commit 9e62fd82ea)
2021-08-29 07:41:58 +00:00
Benjamin Otte
e2d321a16a searchengine: Rename private headers
The code uses G_TYPE_POINTER and I got all sorts of scared.
2021-08-29 06:52:28 +02:00
Benjamin Otte
7366f5099a filesystemmodel: Don't use G_TYPE_POINTER
It's a GError, use G_TYPE_ERROR.
2021-08-29 06:52:28 +02:00
Benjamin Otte
4fbef5f466 placessidebar: Don't use G_TYPE_POINTER
We have a type for lists of GFiles. We invented it for DND.

Keep the annotation info, so bindings don't have to know this.
2021-08-29 06:52:28 +02:00
Benjamin Otte
2e48ff3362 pathbar: Use correct GType in signal 2021-08-29 06:52:28 +02:00
Benjamin Otte
7cdbdb663c gtk-demo: Add a symbolic paintable demo
Don't click the button!
2021-08-29 04:29:53 +02:00
Benjamin Otte
1b390d3857 gtk-demo: Explicitly pass nuclear icon colors 2021-08-29 04:29:53 +02:00
Benjamin Otte
2808f9c75b gtk: Port icontheme to GtkSymbolicPaintable 2021-08-29 04:29:53 +02:00
Benjamin Otte
49d109c29e gtk: Add the GtkSymbolicPaintable interface 2021-08-29 04:29:53 +02:00
Benjamin Otte
36dd959bf9 build: Check that introspection is enabled for docs build 2021-08-29 04:29:53 +02:00
Benjamin Otte
2f9a67b8a1 docs: Fix vfunc references
vfunc references should just use the object name, not the
class/interface/iface name.
2021-08-29 04:29:02 +02:00
Matthias Clasen
6d5d9ea073 Merge branch 'text-selection-missing' into 'master'
ngl: Avoid a coordinate overflow

Closes #4214

See merge request GNOME/gtk!3897
2021-08-28 21:21:02 +00:00
Matthias Clasen
1cfd340cae ngl: Avoid a coordinate overflow
This was showing up as big text selections going
missing sporadically.

Fixes: #4214
2021-08-28 15:42:30 -04:00
Matthias Clasen
369ccfc34f Merge branch 'matthiasc/for-master' into 'master'
Draw negatively sloped carets correctly

See merge request GNOME/gtk!3892
2021-08-28 17:18:21 +00:00
Matthias Clasen
e556513de6 Merge branch 'menu-accel' into 'master'
window: Prefer menu bars when handling F10

See merge request GNOME/gtk!3893
2021-08-28 17:17:43 +00:00
Matthias Clasen
79dc1a2a4d Merge branch 'randr' into 'master'
x11: Fix handling of `RRScreenChangeNotify`/`RRNotify` events

See merge request GNOME/gtk!3894
2021-08-28 17:17:00 +00:00
Ian Douglas Scott
9e5a501c73 x11: Fix handling of RRScreenChangeNotify/RRNotify events
It seems these are sent with `xwindow` set to the root window, so this
was failing to find a surface and get the screen from that.

I'm not sure if there's a reason not to get the screen this way
elsewhere in the function, but it seems this should be correct.

This fixes the behavior of `gdk_x11_display_get_monitors()`, which
wasn't correctly changing when monitors were added or removed. For
instance, this python code was always showing the same number of
monitors when one was turned off and on, but updates correctly with this
change applied:

```python
import gi
gi.require_version("GLib", "2.0")
gi.require_version("Gdk", "4.0")
gi.require_version("Gtk", "4.0")
from gi.repository import GLib, Gdk, Gtk

def f():
    print(len(Gdk.Display.get_default().get_monitors()))
    return True
GLib.timeout_add_seconds(1, f)

GLib.MainLoop().run()
```
2021-08-27 18:07:39 -07:00
Enrico Nicoletto
2db8d7f6a2 Update Brazilian Portuguese translation
(cherry picked from commit cd9735eab1)
2021-08-28 01:00:39 +00:00
Enrico Nicoletto
94c3f4d4fc Update Brazilian Portuguese translation
(cherry picked from commit 8f5a1471cc)
2021-08-28 00:44:38 +00:00
Florian Müllner
3fa26861cd window: Prefer menu bars when handling F10
Focusing the first widget in the titlebar is a good fallback,
but a "real" menubar or :primary menu button should take
precedence.
2021-08-28 00:19:23 +02:00
Matthias Clasen
ef2b0ccd6c Draw negatively sloped carets correctly
The code for handling negatively sloped caret
positions was not tested, and naturally did
not work. Fix it.
2021-08-27 17:20:35 -04:00
Matthias Clasen
f1702d24e7 Merge branch 'css-line-decoration' into 'master'
textview: Apply line decoration from css

See merge request GNOME/gtk!3890
2021-08-27 01:37:57 +00:00
Matthias Clasen
3a50ff57d8 Clean up the code
Avoid compiler warnings, and make the code
a bit more compact.
2021-08-26 20:45:17 -04:00
Matthias Clasen
8ac2e8d495 textview: Apply font features from css
We were forgetting to propagate these values from
CSS to the default attributes. Share the code for
getting these values out of a GtkCssStyle.
2021-08-26 20:21:23 -04:00
Matthias Clasen
e56cf85fd1 textview: Apply text transform from css
We were forgetting to propagate these values from
CSS to the default attributes.
2021-08-26 18:53:30 -04:00
Matthias Clasen
1c6aef1862 textview: Apply line decoration from css
We were forgetting to propagate these values from
CSS to the default attributes.
2021-08-26 18:46:57 -04:00
Matthias Clasen
4653cbe56e Merge branch 'css-letter-spacing' into 'master'
textview: Don't forget to collect css letterspacing

Closes #4207

See merge request GNOME/gtk!3889
2021-08-26 19:37:55 +00:00
Matthias Clasen
93148d302f textview: Don't forget to collect css letterspacing
There are more properties missing, this is just
the start.

Fixes: #4207
2021-08-26 15:01:23 -04:00
Andika Triwidada
a443ba91ce Update Indonesian translation
(cherry picked from commit 85ad1db8ef)
2021-08-26 14:40:16 +00:00
Hugo Carvalho
d8daef2de7 Update Portuguese translation
(cherry picked from commit 6e467de751)
2021-08-26 14:30:04 +00:00
Hugo Carvalho
845d43c77a Update Portuguese translation
(cherry picked from commit ae5b6395ad)
2021-08-26 14:12:59 +00:00
Andika Triwidada
f8dbcc472b Update Indonesian translation
(cherry picked from commit dcc899b621)
2021-08-26 13:39:00 +00:00
Marek Černocký
0f0f75f6b1 Updated Czech translation 2021-08-26 15:07:54 +02:00
Timm Bäder
4e2e2d84fc Merge branch 'clang-fallthrough' into 'master'
build: fix implicit-fallthrough errors with clang

See merge request GNOME/gtk!3887
2021-08-26 11:15:28 +00:00
Jordi Mas
887885b6e0 Update Catalan translation 2021-08-26 13:10:32 +02:00
Matthias Clasen
a868a5c434 Merge branch 'matthiasc/for-master' into 'master'
More markup demos

See merge request GNOME/gtk!3888
2021-08-26 06:15:06 +00:00
Christoph Reiter
a0c147d246 build: fix implicit-fallthrough errors with clang
The clang build fails due to -Werror=implicit-fallthrough being
on by default and some fallthrough cases not being marked as such.

Use G_GNUC_FALLTHROUGH or duplicate the code in those cases.
2021-08-26 07:08:38 +02:00
Matthias Clasen
38040c96d6 More markup demos
Showing more of what Pango can do.
2021-08-25 19:38:59 -04:00
Matthias Clasen
989ecf69ad Merge branch 'new-pango-attributes' into 'master'
Support new pango attributes

See merge request GNOME/gtk!3878
2021-08-25 20:11:45 +00:00
Matthias Clasen
9d26399143 Merge branch 'treeexpander-claim-gestures' into 'master'
GtkTreeExpander: claim expander-icon gestures

Closes #4199

See merge request GNOME/gtk!3886
2021-08-25 19:11:23 +00:00
Matthias Clasen
b9cad7cc54 textview: Implement new pango attributes
Implement the word and sentence attributes.
2021-08-25 14:57:13 -04:00
Matthias Clasen
357b97b5a6 Support new pango attributes
Support new Pango attributes for segmentation
in GtkBuilder.
2021-08-25 14:57:13 -04:00
Jan Lukas Gernert
318160d836 GtkTreeExpander: claim expander-icon gestures
Claim the pressed, released and canceled gestures
meant for the expander-icon of the TreeExpander.
This avoids selecting the row when expanding or collapsing it.

Closes #4199
2021-08-25 17:50:12 +02:00
Matthias Clasen
5e90d63373 Merge branch 'sloped-caret' into 'master'
Implement sloped caret drawing

See merge request GNOME/gtk!3880
2021-08-25 13:43:24 +00:00
Jordi Mas
0b7f1e488f Update Catalan translation 2021-08-25 15:17:27 +02:00
Matthias Clasen
e281bbbb55 Merge branch 'treeexpander-indent-property' into 'master'
GtkTreeExpander: indent-without-expander property

Closes #4175

See merge request GNOME/gtk!3858
2021-08-25 11:48:59 +00:00
Matthias Clasen
892bacee52 Merge branch '4195-include-gdkprivate-h' into 'master'
gdkmacoseventsource: Include "gdk-private.h"

Closes #4195

See merge request GNOME/gtk!3882
2021-08-25 11:48:11 +00:00
Matthias Clasen
2f1db4b77c Use pango_layout_get_caret_pos
This new api returns rectangles for sloped carets,
in contrast to pango_layout_get_cursor_pos, which
always returns a rectangle with a width of zero.
2021-08-25 06:53:53 -04:00
Matthias Clasen
f90e9b26f8 Implement sloped caret drawing
Prepare for Pango to return slope information for carets.

While we are at it, improve the shape of our carets a bit.
2021-08-25 06:53:53 -04:00
Matthias Clasen
ad71f454bd Merge branch 'fix-gettext' into 'master'
Fix wrong gettext ITS target

See merge request GNOME/gtk!3881
2021-08-25 10:51:57 +00:00
Rafał Dzięgiel
c66bd791c4 Fix wrong gettext ITS target
The installed ITS rule filename is "gtk4builder.its". The .loc file
is wrongly pointing to old "gtkbuilder.its" which makes gettext fail
on systems without GTK3 installed.
2021-08-25 10:08:50 +02:00
Fran Dieguez
40bceef3ca Update Galician translation
(cherry picked from commit 410ea1049b)
2021-08-25 07:26:55 +00:00
Fran Dieguez
9d79f55dc9 Update Galician translation
(cherry picked from commit 09a5828ccf)
2021-08-25 06:12:43 +00:00
Matthias Clasen
c5c1cf6d55 Merge branch 'wip/otte/for-master' into 'master'
wayland: Better error on eglGetDisplay() failure

See merge request GNOME/gtk!3879
2021-08-25 04:24:55 +00:00
Peter Bloomfield
9eb8aa9a32 gdkmacoseventsource: Include "gdk-private.h"
_gdk_macos_event_source_new() calls g_source_set_static_name(), which
for GLib versions before 2.69.1 is a macro defined in gdk-private.h.

Fixes #4195

modified:   gdk/macos/gdkmacoseventsource.c
2021-08-24 16:55:52 -04:00
Benjamin Otte
95931a7e6c wayland: Better error on eglGetDisplay() failure
Goals:

1. Provide as much information as possible in the error message, so
   users can try to fix their system themselves.
2. Try to formulate the error message in a way that explains that this
   is not something GTK can fix, but a lower layer problem.

Related: #4193
2021-08-24 19:55:22 +00:00
Yuri Chornoivan
d9daaed43f Update Ukrainian translation
(cherry picked from commit 6377b23bd6)
2021-08-24 17:29:02 +00:00
Matthias Clasen
b9c51e65c1 Merge branch 'wip/carlosg/gesture-state-in-entries' into 'master'
Claim clicks further at GtkEntry/GtkSearchEntry

See merge request GNOME/gtk!3873
2021-08-24 17:20:20 +00:00
Matthias Clasen
da5eb92f47 Merge branch 'matthiasc/for-master' into 'master'
Revert "imwayland: Tweak preedit text"

Closes #4123

See merge request GNOME/gtk!3877
2021-08-24 17:19:42 +00:00
Matthias Clasen
03ed585f6f tests: Rewrite PangoAttribute introspection
We can use the new binding helpers to make this
a little less bothersome. That way, it will need
tweaks less often (only when new fundamental types
are introduced).
2021-08-24 12:53:48 -04:00
Matthias Clasen
51f953a1aa Revert "imwayland: Tweak preedit text"
This reverts commit d84a028455.

IBus uses the same character now.

Fixes: #4123
2021-08-24 12:53:48 -04:00
Emmanuele Bassi
93fb07d808 Merge branch 'expander-ref-leak' into 'master'
Release an extra reference on GtkExpander:child

See merge request GNOME/gtk!3876
2021-08-24 13:20:48 +00:00
Emmanuele Bassi
5e311d4d85 Release an extra reference on GtkExpander:child
The child of a GtkExpander is owned directly by the expander whenever
the "expanded" flag is unset.

We are adding an additional reference to the child of an expander when
expander is not expanded.

Additionally, if a GtkExpander is disposed while not expanded, we need
to explicitly release the reference on the child widget that we own.

This reference leak was masked in GTK3 by GtkContainer removing each
child from the parent container by recursively calling
gtk_widget_destroy().
2021-08-24 11:28:59 +01:00
Carlos Garnacho
e652054d50 gtkpasswordentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-24 01:13:29 +02:00
Carlos Garnacho
58c31b8627 gtkpasswordentry: Consume click events after pressing on icon
This may result in user actions, so the gesture should consume the
events.
2021-08-24 01:12:31 +02:00
Matthias Clasen
b945033b41 Merge branch 'fix-docs' into 'master'
Fix documentation for gtk_icon_view_create_drag_icon

Closes #4190

See merge request GNOME/gtk!3875
2021-08-23 20:40:17 +00:00
Qiu Wenbo
92d2867170 docs: Fix documentation for gtk_icon_view_create_drag_icon
Fixes: #4190
2021-08-24 00:24:08 +08:00
Matthias Clasen
5d38c8c558 Merge branch 'wip/kalev/pre-compiled-css-detection' into 'master'
build: Fix detection for pre-compiled css files

See merge request GNOME/gtk!3874
2021-08-23 14:57:19 +00:00
Kalev Lember
552a4b2c82 build: Fix detection for pre-compiled css files
The default theme changed from Adwaita to Default and this tripped up
the logic to detect if the tarball builds contain pre-built css files or
not. Fix this by looking at pre-compiled css files in themes/Default/
instead of themes/Adwaita/.
2021-08-23 16:15:48 +02:00
Carlos Garnacho
7a4afb08bd gtksearchentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
c5cd1ac630 gtkentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
90edb76415 gtksearchentry: Consume click events after pressing on icon
This results in user actions, so the gesture should consume the
events.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
8f397502df gtktext: Set claimed state on button1 click gesture
All possible ramifications after button1 press (move cursor,
begin drag, begin dnd, select word/line, ...) result in user
actions. The right thing after that is consuming the events,
set the gesture state for that.
2021-08-23 15:28:27 +02:00
Jan Lukas Gernert
1cb17d8613 GtkTreeExpander: indent-for-icon property
A property to determine if the TreeExpander should indent the child
by the width of an expander-icon when it is not expandable.

Closes #4175
2021-08-23 07:54:45 +02:00
Jan Lukas Gernert
88e796bb45 Add 4.6 version macros 2021-08-23 07:54:27 +02:00
Matthias Clasen
1310bf0218 Merge branch 'matthiasc/for-master' into 'master'
NEWS: Updates

See merge request GNOME/gtk!3872
2021-08-22 21:16:02 +00:00
Matthias Clasen
4efeaa844f NEWS: Updates 2021-08-22 16:41:22 -04:00
Matthias Clasen
24685612a9 Merge branch 'css-text-transform' into 'master'
css: Implement text-transform

See merge request GNOME/gtk!3862
2021-08-22 20:40:50 +00:00
Matthias Clasen
bf21df4195 Add an example for text transforms
Show some transformed text in the markup demo.
2021-08-22 15:57:50 -04:00
Matthias Clasen
417b3f9c6b Implement text transforms for GtkTextView
Add a property to GtkTextTag and do all the
legwork to translate it to the Pango attribute.
2021-08-22 15:57:50 -04:00
Matthias Clasen
2d84a1c63e css: Implement text-transform
Implement the text-transform property from
https://www.w3.org/TR/css-text-3/#text-transform-property
using a new Pango attribute.
2021-08-22 15:57:50 -04:00
Matthias Clasen
5ab9a29bc4 Merge branch 'bump-pango' into 'master'
Bump the pango dependency

See merge request GNOME/gtk!3871
2021-08-22 19:57:21 +00:00
Matthias Clasen
383ea0d86a Merge branch 'css-line-height2' into 'master'
Implement CSS line-height

See merge request GNOME/gtk!3833
2021-08-22 19:47:10 +00:00
Matthias Clasen
df8f75bb8f Merge branch 'matthiasc/for-master' into 'master'
windowhandle: Quiet a compiler warning

See merge request GNOME/gtk!3868
2021-08-22 19:28:01 +00:00
Matthias Clasen
ba95ef63da Drop PANGO_VERSION_CHECK checks
We require Pango 1.49 now.
2021-08-22 15:26:23 -04:00
Matthias Clasen
bea4aa31ea Bump Pango dep
Require Pango 1.49, so we can support new attributes
without too much ifdeffery.
2021-08-22 15:23:42 -04:00
Matthias Clasen
6c19a8352f gtk-demo: Add a line height demo
Add an example for widely spaced text to the markup demo.
2021-08-22 15:15:50 -04:00
Matthias Clasen
e3df89b524 gtk-demo: Improve markup demo
The font sizes demo had the space between the font-size spans,
causing us to have a run with just a default sized space between
the words, which in turn leads to wobbly cursor sizes. Avoid that
by including the space in the preceding span.

Also, make it bigger.
2021-08-22 15:15:50 -04:00
Matthias Clasen
a9003f7ac0 gtk-demo: Set line height from markup
Keep the import-markup code in sync with GtkTextBuffer.
2021-08-22 15:15:50 -04:00
Matthias Clasen
2cc06f60c5 textview: Set line height from markup
Note that we ignore the absolute-line-height
attribute for now.
2021-08-22 15:15:50 -04:00
Matthias Clasen
4759afcc3e textview: Set line height from css
Set the line height in the default attributes from
the CSS style. This makes line height work in
GtkTextView.
2021-08-22 15:15:50 -04:00
Matthias Clasen
66b297e408 textview: Add line height plumbing
This adds a line-height property to GtkTexttag and a
line_height field to GtkTextAttributes, and translates
it to a pango attribute.
2021-08-22 15:15:50 -04:00
Matthias Clasen
bbd2b255a3 css: Document line-height as supported 2021-08-22 15:15:50 -04:00
Matthias Clasen
8b2f28eee3 css: Add parser tests for line-height 2021-08-22 15:15:50 -04:00
Matthias Clasen
ae767dc5bf css: Translate line-height to a Pango
Pango 1.50 introduces a line-height attribute. Use it.
This is enough to make line-height work for labels
and entries.
2021-08-22 15:15:50 -04:00
Matthias Clasen
d923402934 css: Add line-height property
This adds the plumbing to parse the line-height
property from CSS. Widgets are not picking it
up yet.
2021-08-22 15:15:50 -04:00
Benjamin Otte
9667f889b3 Merge branch 'clipboard-set-docs' into 'master'
docs: Expand gdk_clipboard_set() docs

See merge request GNOME/gtk!3865
2021-08-22 18:49:13 +00:00
Benjamin Otte
d2ea7af335 docs: Expand gdk_clipboard_set() docs 2021-08-22 18:49:12 +00:00
Matthias Clasen
f95e9407a9 Fix up test output for new version
Annoying that this test has to be touched every time
we bump the version.
2021-08-22 14:48:12 -04:00
Matthias Clasen
7be3c2974a windowhandle: Quiet a compiler warning
gesture was left uninitialized in the default case.
2021-08-22 14:19:14 -04:00
Matthias Clasen
5444f604cb Merge branch 'matthiasc/for-master' into 'master'
Bump version to 4.5

See merge request GNOME/gtk!3867
2021-08-22 17:53:34 +00:00
Matthias Clasen
94e68b0e36 Bump version to 4.5
4.4 has been branched off.
2021-08-22 13:06:29 -04:00
Matthias Clasen
910d86f958 NEWS: Updates 2021-08-22 13:06:15 -04:00
Matthias Clasen
fd885e42b0 Merge branch 'drop-gl' into 'master'
gsk: Drop the gl renderer

See merge request GNOME/gtk!3863
2021-08-22 17:04:25 +00:00
Matthias Clasen
ea31ae31c1 tests: Remove an outdated comment
It refers to a file that no longer exists.
2021-08-22 12:29:59 -04:00
Matthias Clasen
00763e5af3 media: Don't include gsk/gl/gskglrenderer.h 2021-08-22 12:29:40 -04:00
Matthias Clasen
1bf5aab18c testutils: Don't include gsk/gl/gskglrenderer.h 2021-08-22 12:29:13 -04:00
Matthias Clasen
210a709246 Merge branch 'matthiasc/for-master' into 'master'
Handle new pango attribute type

See merge request GNOME/gtk!3866
2021-08-22 15:22:14 +00:00
Matthias Clasen
5feba67a3d Handle new pango attribute type
Update all the places where we switch over
PangoAttrType to handle PANGO_ATTR_TEXT_TRANSFORM,
and do nothing for now - text-transform support
will land in 4.6.
2021-08-22 11:04:28 -04:00
Matthias Clasen
e9e373913e gsk: Drop the gl renderer
ngl supports all the same platforms as gl
now, and has seen more improvements in the
last cycle.
2021-08-20 22:58:30 -04:00
Matthias Clasen
f1f197e3b9 4.4.0 2021-08-20 15:10:25 -04:00
Matthias Clasen
cedb6183e9 Fix imcontext tests
We should force our internal im context for these
tests, so we don't depend on the environment.
2021-08-20 15:10:25 -04:00
Matthias Clasen
0415d46c0f Merge branch 'matthiasc/for-master' into 'master'
NEWS: Updates

See merge request GNOME/gtk!3861
2021-08-20 14:21:39 +00:00
Matthias Clasen
68388331c7 NEWS: Updates 2021-08-20 09:54:02 -04:00
Matthias Clasen
92817b0603 Merge branch 'cut-shortcut-activation-short' into 'master'
shortcutcontroller: Only do round-robin for mnemonics

Closes #4130

See merge request GNOME/gtk!3824
2021-08-20 13:50:51 +00:00
Matthias Clasen
f8a1726ffa shortcutcontroller: Only do round-robin for mnemonics
Don't do round-robin activation unless we are looking
for mnemonics, where this is an expected feature.

Fixes: #4130
2021-08-20 09:26:37 -04:00
Matthias Clasen
be34f27026 Merge branch 'matthiasc/for-master' into 'master'
gdk: Add a missing annotation

Closes #4097

See merge request GNOME/gtk!3860
2021-08-20 13:22:01 +00:00
Emmanuele Bassi
12c5518e2b Merge branch 'master' into 'master'
a11y: Send correct object reference for the root accessible

See merge request GNOME/gtk!3800
2021-08-20 13:18:37 +00:00
Matthias Clasen
d8ab5c3c45 gdk: Add a missing annotation
Mark an array as zero-terminated.

Fixes: #4097
2021-08-20 08:57:27 -04:00
Matthias Clasen
36d1c9e8b7 Merge branch 'add-support-for-windows-pointer-input-stack-gtk4' into 'master'
Add support for Windows Pointer Input Stack

Closes #262, #3162, #729, and #537

See merge request GNOME/gtk!3684
2021-08-20 11:31:16 +00:00
Matthias Clasen
45c047f5c0 Merge branch 'block-cursor-fixes' into 'master'
textview: Don't eat block cursors

See merge request GNOME/gtk!3857
2021-08-20 06:18:07 +00:00
Matthias Clasen
da1232caaf textview: Don't eat block cursors
We need to render even an empty paragraph when
it has a block cursor at the end. This fixes block
cursors not showing up in empty lines.
2021-08-20 01:57:31 -04:00
Matthias Clasen
fff5a83957 Merge branch 'matthiasc/for-master' into 'master'
window: Make resizeability changes work

See merge request GNOME/gtk!3856
2021-08-19 21:19:40 +00:00
Matthias Clasen
f5b6488eb2 window: Make resizeability changes work
We were forgetting to update the toplevel
properties here.
2021-08-19 16:03:58 -04:00
Luca Bacci
c02bae9e08 Move the _gdk_win32_pointer_input_api global variable into GdkWin32Display 2021-08-19 16:29:45 +02:00
Matthias Clasen
58e65ae7dd windows: Update the docs for env vars
We've replaced some env vars with a new one.
Update the docs to match.
2021-08-19 15:57:44 +02:00
Luca Bacci
3977518f00 Fix typo 2021-08-19 15:57:44 +02:00
Luca Bacci
8adee3dace Disable visual feedback for pen ad touch 2021-08-19 15:57:43 +02:00
Luca Bacci
09ad930da4 Filter out spurious mouse messages while handling pen or touch input 2021-08-19 15:57:43 +02:00
Luca Bacci
52f7bb6950 Add _gdk_win32_get_cursor_pos utility 2021-08-19 15:57:42 +02:00
Luca Bacci
68db945e47 Handle WinPointer input 2021-08-19 15:57:41 +02:00
Luca Bacci
b54f4cf5d4 Initialize WinPointer and enumerate devices 2021-08-19 15:57:41 +02:00
Luca Bacci
9a8a9451b1 Add new GdkDeviceWinpointer type 2021-08-19 15:57:40 +02:00
Luca Bacci
fffa903ce9 Add winpointer.h header file for type declarations 2021-08-19 15:57:39 +02:00
Luca Bacci
ab08885a32 Add entry for WinPointer in GdkWin32TabletInputAPI enum 2021-08-19 15:57:38 +02:00
Luca Bacci
ad3995b1b9 Make room for other API's than Wintab 2021-08-19 15:57:38 +02:00
Luca Bacci
75cc0710ac Remove _gdk_input_ignore_wintab variable
Also remove unused variable _gdk_max_colors
2021-08-19 15:57:37 +02:00
Luca Bacci
7cec7054e2 Rename some Wintab-related functions 2021-08-19 15:57:36 +02:00
Luca Bacci
fe280e578f Set active physical device when using the mouse 2021-08-19 15:57:36 +02:00
Luca Bacci
a32973f56b Move use of _gdk_win32_get_next_tick from synthesize_crossing_events to its callers 2021-08-19 15:57:35 +02:00
Luca Bacci
7762311911 Add a physical_device argument to send_crossing_event et al 2021-08-19 15:57:34 +02:00
Luca Bacci
edd73ffbed Raise _WIN32_WINNT macro to target Windows 7 API 2021-08-19 15:57:33 +02:00
Matthias Clasen
fca87d93e9 Updates 2021-08-19 01:47:43 -04:00
Matthias Clasen
c2fe2c0385 Merge branch 'better-word-selection' into 'master'
textview: Improve word selection

Closes #4177

See merge request GNOME/gtk!3855
2021-08-19 04:51:11 +00:00
Matthias Clasen
8aa25046dc textview: Improve word selection
Avoid selecting a whole extra paragraph when a select-by-words
selection is extended beyond the end of the previous paragraph.

Fixes: #4177
2021-08-19 00:33:03 -04:00
Matthias Clasen
27a07ed89c Merge branch 'matthiasc/for-master' into 'master'
Cosmetics

See merge request GNOME/gtk!3854
2021-08-19 02:49:23 +00:00
Matthias Clasen
071a6bcc06 Cosmetics 2021-08-18 22:33:23 -04:00
Benjamin Otte
f98ac6590d Merge branch 'wip/otte/for-master' into 'master'
demo: Add a dnd special-case for textures

See merge request GNOME/gtk!3853
2021-08-19 01:42:26 +00:00
Benjamin Otte
6b733d2943 gtk-demo: Make clipboard demo paste from clipboard
The old code was just pasting local clipboard data that we put there
ourselves and was causing criticals on remote clipboard data. Now the
code does the proper async paste.
2021-08-19 03:16:48 +02:00
Benjamin Otte
6f165efcdb contentprovider: Switch wrong order in type check
We can provide textures as a paintable - we can't provide paintables as
textures.
2021-08-19 03:16:48 +02:00
Benjamin Otte
7bc1c9a562 demo: Add a dnd special-case for textures
If the DND/clipboard machinery knows a texture is a texture, it will try
to serialize it. Paintables can't be serialized, so it wouldn't try.
2021-08-19 03:16:48 +02:00
Matthias Clasen
1596fdeba3 Merge branch 'matthiasc/for-master' into 'master'
infobar: Update buildable docs

Closes #4164

See merge request GNOME/gtk!3852
2021-08-18 22:05:07 +00:00
Matthias Clasen
1599b659cf infobar: Update buildable docs
Document the current state of GtkBuilder support in
GtkInfoBar, not what we had in GTK3.

Fixes: #4164
2021-08-18 17:42:54 -04:00
Matthias Clasen
bb65564c7d Merge branch 'seat-v7' into 'master'
gdk/wayland: add support for wl_seat version 7

See merge request GNOME/gtk!3842
2021-08-18 21:10:30 +00:00
Matthias Clasen
03031b3dc1 Merge branch 'fix/wm_class2' into 'master'
x11: ensure WM class is not null even if display is initialized early

See merge request GNOME/gtk!3808
2021-08-18 18:24:37 +00:00
Benjamin Otte
b7636ebbc0 Merge branch 'win32-drop-local-dnd' into 'master'
gdk/win32: Drop local DnD protocol

See merge request GNOME/gtk!3830
2021-08-18 14:27:14 +00:00
Matthias Clasen
5707b80a69 Merge branch 'win32-check-shader-support' into 'master'
GDK-Win32: Reject GL context if shaders aren't supported (fix issue #4165)

Closes #4165

See merge request GNOME/gtk!3850
2021-08-18 12:19:57 +00:00
Matthias Clasen
81e5d4c327 Merge branch 'master' into 'master'
gtkbuilderparser: Fix duplicate object id detection

See merge request GNOME/gtk!3848
2021-08-18 12:00:41 +00:00
Ye Moran
f8111125ef gtkbuilderparser: Fix duplicate object id detection 2021-08-18 12:00:40 +00:00
Matthias Clasen
c020e83890 Merge branch 'matthiasc/for-master' into 'master'
Add a custom input test

See merge request GNOME/gtk!3851
2021-08-18 03:24:41 +00:00
Matthias Clasen
f6659fea8d imcontext: Improve docs
Add some more docs around GtkIMContext.
2021-08-17 22:33:26 -04:00
Matthias Clasen
a06858ccd9 Add a custom input test
This shows the minimal work required to hook up an
im context to a custom widget.
2021-08-17 22:33:26 -04:00
Emmanuele Bassi
c6c48d327c Merge branch 'wip/exalm/query-action-transfer' into 'master'
widget: Fix gtk_widget_class_query_action() annotations

See merge request GNOME/gtk!3843
2021-08-17 17:56:40 +00:00
Chun-wei Fan
5d0f188615 GDK-Win32: Reject WGL context if shaders aren't supported
When we initialize OpenGL, check whether we have OpenGL  2.0 or later; if not,
check whether we have the 'GL_ARB_shader_objects' extension, since we must be
able to support shaders if using OpenGL for GTK.

If we don't support shaders, as some Windows graphics drivers do not support
OpenGL adequately, notably older Intel drivers, reject and destroy the GL
context that we created, and so fallback to the Cairo GSK renderer, so that
things continue to run, albeit with an expected warning message that the GL
context cannot be realized.

Also, when we could not make the created dummy WGL context current during
initialization, make sure that we destroy the dummy WGL context as well.

Fixes issue #4165.
2021-08-17 16:25:09 +08:00
Benjamin Otte
78fcc8feb8 Merge branch 'wip/otte/for-master' into 'master'
gdk: Include Vulkan error code in vulkan_strerror()

See merge request GNOME/gtk!3844
2021-08-12 12:36:28 +00:00
Benjamin Otte
27cad85247 gdk: Include Vulkan error code in vulkan_strerror() 2021-08-12 14:19:30 +02:00
Simon Ser
ad0c1d4dbe gdk/wayland: add support for wl_seat version 7
Version 7 requires wl_keyboard keymaps to be mapped with
MAP_PRIVATE, so that the compositor can share the same keymap
file between multiple clients.
2021-08-11 16:37:03 +02:00
Simon Ser
00abaed89a gdk/wayland: add support for wl_seat version 6
Version 6 adds two new wl_touch events, which can be ignored.
2021-08-11 16:36:57 +02:00
Alexander Mikhaylenko
342f02711b widget: Fix gtk_widget_class_query_action() annotations
Add transfer none on all out values as they aren't being copied.
2021-08-11 14:33:38 +05:00
Matthias Clasen
d9c48a8d01 Merge branch 'matthiasc/for-master' into 'master'
Handle the new line height pango attribute

See merge request GNOME/gtk!3840
2021-08-10 15:08:20 +00:00
Matthias Clasen
d757696116 ci: Add libjpeg-turbo-devel to the Fedora image
This was getting downloaded from sourceforge every
time for the docs build, and that started failing.
2021-08-10 08:22:52 -04:00
Matthias Clasen
528ebfabf0 Handle the new line height pango attribute
Update all the places where we switch over PangoAttributeType
to handle (and ignore, for now) the new line height attribute.
2021-08-10 08:22:52 -04:00
Vincent Bernat
2ebde276d1 x11: ensure WM class is not null even if display is initialized early
With gtkmm, when using `Application()`, the display is initialized
before we know the application name and therefore, the program class
associated to the display is NULL.

Instead of providing a default value, we set it equal to program name
when NULL. Moreover, we give up on capitalizing the class name to keep
the code super simple. Also, not using a capitalized name is
consistent with `gdk_x11_display_open()`. If someone has a good reason
to use a capitalized name, here is how to do it.

```c
  class_hint = XAllocClassHint ();
  class_hint->res_name = (char *) g_get_prgname ();
  if (display_x11->program_class)
    {
      class_hint->res_class = (char *) g_strdup (display_x11->program_class);
    }
  else if (class_hint->res_name && class_hint->res_name[0])
    {
      class_hint->res_class = (char *) g_strdup (class_hint->res_name);
      class_hint->res_class[0] = g_ascii_toupper (class_hint->res_class[0]);
    }
  XSetClassHint (xdisplay, impl->xid, class_hint);
  g_free (class_hint->res_class);
  XFree (class_hint);
```

Fix eff53c023a ("x11: set a default value for program_class")
2021-08-10 09:14:36 +02:00
Matthias Clasen
04f3c8054b Merge branch 'callback-annotation-again' into 'master'
widget: Change callback scope

See merge request GNOME/gtk!3796
2021-08-10 01:16:56 +00:00
Benjamin Otte
ea07bf7536 Merge branch 'wip/otte/for-master' into 'master'
ngl: Make current when unrealizing

See merge request GNOME/gtk!3835
2021-08-08 01:09:31 +00:00
Benjamin Otte
80e6f1ca8c ngl: Make current when unrealizing
The profiler (at least) discards GL objects and we want to discard them
on the right context.
2021-08-08 02:17:08 +02:00
Matthias Clasen
54d29568ec Merge branch 'matthiasc/for-master' into 'master'
Cosmetics: Tweak css parser error messages

See merge request GNOME/gtk!3834
2021-08-07 22:48:32 +00:00
Matthias Clasen
4e1ea58503 Cosmetics: Tweak css parser error messages
These show up in tooltips, so they should a) be capitalized
and b) not end with a period.
2021-08-07 18:18:10 -04:00
Andre Klapper
90c429a91c Belarusian translation: Remove broken translation string 2021-08-07 19:10:23 +02:00
Andre Klapper
4b28e038e0 Khmer translation: Strip some invisible bytes from setting translations 2021-08-07 19:10:22 +02:00
Matthias Clasen
8df694a358 Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Spruce up the hypertext demo

See merge request GNOME/gtk!3832
2021-08-07 16:56:56 +00:00
Yaron Shahrabani
eb8778e1cd Update Hebrew translation
(cherry picked from commit 11e6ce1751)
2021-08-07 16:51:55 +00:00
Matthias Clasen
256f3a0d60 gtk-demo: Spruce up the hypertext demo
Use the newish allow-breaks pango attribute
to make the text break better.
2021-08-07 12:35:17 -04:00
Danial Behzadi
54c087e7ec Update Persian translation 2021-08-07 14:48:55 +00:00
Danial Behzadi
69a99b89f9 Update Persian translation
(cherry picked from commit b467881274)
2021-08-07 14:45:02 +00:00
Matthias Clasen
f328ab9d83 Merge branch 'wip/chergert/revert-top-margin' into 'master'
Revert "textview: fix yoffset position when top_margin is set"

See merge request GNOME/gtk!3828
2021-08-06 13:13:21 +00:00
Chun-wei Fan
8acce5f294 gdk/win32: Drop local DnD protocol
It is basically not used by default and is pretty much broken at this point, so
it's about time to drop it.

Let's focus on fixing the OLE2 DnD protocol.
2021-08-06 17:16:27 +08:00
Matthias Clasen
bdbe0acd1f Merge branch 'matthiasc/for-master' into 'master'
settings: Default gtk-split-cursor to FALSE

See merge request GNOME/gtk!3827
2021-08-05 19:17:54 +00:00
Christian Hergert
fc701baef8 Revert "textview: fix yoffset position when top_margin is set"
This reverts commit 908b1e5e12.

This commit broke top-margin altogether.
2021-08-05 11:52:45 -07:00
Matthias Clasen
a457a81fd9 Merge branch 'matthiasc/for-master' into 'master'
text: Move setup code out of a loop

See merge request GNOME/gtk!3826
2021-08-05 18:45:39 +00:00
Matthias Clasen
4cc7977d36 settings: Default gtk-split-cursor to FALSE
According to Owen, this was the intention when the setting
was added in 2001. It only took us 20 years to fix the
default value.
2021-08-05 14:05:28 -04:00
Matthias Clasen
e5e7f5dd88 ci: Disable treeview-headers-hidden reftest
Somebody needs to figure out why it fails in ci so
frequently.
2021-08-05 12:41:04 -04:00
Matthias Clasen
916886312a Merge branch 'wip/exalm/shadow-extents' into 'master'
Shrink shadow extents

See merge request GNOME/gtk!3825
2021-08-05 16:39:52 +00:00
Matthias Clasen
8ff94ea1f2 text: Move setup code out of a loop
Just a cleanup, no functional change.
2021-08-05 12:31:18 -04:00
Matthias Clasen
053bd0cd31 Merge branch 'fix-tab-not-captured-in-popover' into 'master'
popovermenu: Cycle around focus also with (Shift+)Tab

Closes #3915

See merge request GNOME/gtk!3732
2021-08-05 02:07:43 +00:00
vanadiae
a3ce574193 popover: Cycle around focus with (Shift+)Tab
Same thing as the previous popovermenu commit, except for the base popover
because the popovermenu needs special behaviour with e.g. sides arrow so
we need to have the "cycle around" for regular popovers here too.
2021-08-04 12:11:44 +02:00
vanadiae
ef92adc87d popovermenu: Cycle around focus also with (Shift+)Tab
Currently when moving the focus with (Shift+)Tab, it also traverses the window's
widgets, although it would be expected that the focus stays within the popover,
as it's (almost) like it's a separate window. This would be consistent with
the behaviour of the Up/down arrows, which do cycle around the focus once it
reaches the end.

So this commit makes the popovermenu cycle around focus in any direction, apart
from left/right because they are used to open and close submenus and it wouldn't
make sense anyway to cycle horizontally as there's usually only one widget per
line.
2021-08-04 12:11:44 +02:00
Alexander Mikhaylenko
46a9538b6a Shrink shadow extents
Long time ago, Cairo shadows in both GTK3 and 4 were drawn at a size about
twice their radius. Eventually this was fixed but the shadow extents are
still calculated for the previous size and appear unreasonably large: for
example, 141px for a 50px radius shadow. This can get very noticeable in
places such as invisible window frame which gets included into screenshots.

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3419 just divides the
radius by 2 when drawing a shadow with Cairo, do the same when calculating
extents.

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3841
2021-08-04 14:47:17 +05:00
Matthias Clasen
ca547b8716 Merge branch 'combobox-keynav' into 'master'
treepopover: Add keynav

See merge request GNOME/gtk!3822
2021-08-03 11:20:56 +00:00
Matthias Clasen
04ea51e843 treepopover: Start adding keynav
Arrange for the items to be focusable, and add keyboard
activation. Still missing: cycling focus inside the
popover.
2021-08-02 23:49:05 -04:00
Matthias Clasen
f7dc0dda4e Merge branch 'big-keysyms' into 'master'
imcontext: Treat keysyms as 32bit values

Closes #4149

See merge request GNOME/gtk!3819
2021-08-03 01:05:16 +00:00
Matthias Clasen
8713843022 Merge branch 'surround-test' into 'master'
Remove an unimplemented function

Closes #4151

See merge request GNOME/gtk!3820
2021-08-03 01:00:13 +00:00
Matthias Clasen
6563b05d60 Add some GtkIMContext tests
For now, these check that the surrounding handling
in GtkText and GtkTextView is sane.

Fixes: #4151
2021-08-02 20:44:40 -04:00
Matthias Clasen
d119c55b72 textview: Fix the get_surrounding implementation
This was, sadly, returning garbage.
2021-08-02 20:44:40 -04:00
Matthias Clasen
253e25a73c Add a private getter for the textview key controller
This will be used in tests.
2021-08-02 20:44:40 -04:00
Matthias Clasen
c63774967f Remove an unimplemented function
_gtk_entry_get_im_context does not exist.
2021-08-02 20:44:40 -04:00
Matthias Clasen
bbc36448fb imcontext: Treat keysyms as 32bit values
Our compose table format is still limited to 16bit
values for keysyms, but what we see in key events
can be 32bit values, and we treat them as such now.

Fixes: #4149
2021-08-02 19:16:18 -04:00
Matthias Clasen
5df323fb64 Merge branch 'fix-custom-widget-menu-focus' into 'master'
menusectionbox: Passthrough the focus function of custom widgets' gizmo

Closes gnome-text-editor#93

See merge request GNOME/gtk!3817
2021-08-02 22:21:08 +00:00
Matthias Clasen
0f2c5f13be Merge branch 'wip/otte/for-master' into 'master'
video: Use cross-fade transition to avoid resizes

See merge request GNOME/gtk!3815
2021-08-02 22:19:39 +00:00
Matthias Clasen
58180ad3be Merge branch 'fix-4144' into 'master'
gtkgesturerotate: Fix assertion

Closes #4144

See merge request GNOME/gtk!3818
2021-08-02 22:17:20 +00:00
James Westman
fb0229890b gtkgesturerotate: Fix assertion
Fixes #4144. An assertion would be printed when GtkGestureRotate was
used with a touchscreen.
2021-08-02 16:38:35 -05:00
vanadiae
9099888398 menusectionbox: Passthrough the focus function of custom widgets' gizmo
It broke keyboard focusing any widget added through the custom widget
menu feature. So for example if you put e.g. a custom check box widget
in a menu, you won't be able to focus it.

This is because the gizmo is mostly used to custom drawing with e.g.
CSS for small visual elements like scale markers. That's probably why
gizmo's default focus overrides block the focus from going through
the children. So this commit fixes it by overriding those and passing
the focus through the children.
2021-08-02 21:20:32 +02:00
Benjamin Otte
882855f865 video: Use cross-fade transition to avoid resizes
Slide animations cause changes in the size requests due to the
behavior of GtkRevealer. We can avoid those by using cross-fades, which
don't have that problem.

Besides, cross-fades look better anyway.
2021-08-02 20:11:32 +02:00
Matthias Clasen
f59d2ae89d Merge branch 'input-tweaks' into 'master'
imcontext: Tweak Compose sequence preedit

Closes #10, #4127, and #4124

See merge request GNOME/gtk!3799
2021-08-02 18:07:46 +00:00
Matthias Clasen
7c3a53a171 Merge branch 'fix-double-underscore-mnemonic' into 'master'
label: Ignore __ for mnemonics

Closes #4129

See merge request GNOME/gtk!3814
2021-08-02 03:54:29 +00:00
Matthias Clasen
1e22572716 Avoid pango deprecations
This function has been deprecated on the main
branch of pango. Since we don't want to bump our
pango dependency to 1.49 yet, ignore the deprecation.
2021-08-01 23:20:01 -04:00
Matthias Clasen
8a25f54e1f Add more label parsing tests
Test various combinations of underline and markup
parsing.
2021-08-01 23:19:00 -04:00
Matthias Clasen
c51f2fc0ec label: Ignore __ for mnemonics
We were not ignoring double underscores for mnemonics
in one place, as we should.

Fixes: #4129
2021-08-01 22:14:12 -04:00
Matthias Clasen
2a528df977 Merge branch 'titlebar-gesture' into 'master'
Delegate titlebar action to the compositor if possible

See merge request GNOME/gtk!3797
2021-08-02 01:14:08 +00:00
Piotr Drąg
84684bd56e Update Polish translation 2021-08-01 14:21:25 +02:00
Matthias Clasen
e1606ce8eb Merge branch 'color-glyph-fixes' into 'master'
gsk: Make color glyphs

Closes #4141

See merge request GNOME/gtk!3812
2021-07-31 20:54:39 +00:00
Matthias Clasen
47072e0441 Merge branch 'fix-iconhelper' into 'master'
iconhelper: Fix the paintable implementation

Closes #4140

See merge request GNOME/gtk!3809
2021-07-31 20:35:08 +00:00
Matthias Clasen
915c229396 gsk: Use harfbuzz for color fonts
harfbuzz has all the information we need, so we
can avoid poking directly at freetype apis. Also
drop the caching of color glyph information until
it turns out to be a problem.
2021-07-31 16:34:38 -04:00
Matthias Clasen
0bf46b4845 Bump the harfbuzz dep
We need 2.1.0, which has the hb_ot_color apis that we
are going to use in the next commit.
2021-07-31 16:34:38 -04:00
Matthias Clasen
a7a2dbc3ea gsk: Cache per-glyph color information
We don't really want to load the bitmaps every time
we create a render node, so do it once and cache the
information on the PangoFont.
2021-07-31 16:34:38 -04:00
Matthias Clasen
7e8f586859 ngl: Use per-glyph color information
Decide per-glyph whether we need color nor not.

Fixes: #4141
2021-07-31 16:34:24 -04:00
Matthias Clasen
bb9dccd773 gsk: Mark color glyphs
Steal a bit from PangoGlyphVisAttr to mark glyphs
that have color.
2021-07-31 16:34:24 -04:00
Emmanuele Bassi
7b743e662e Merge branch 'update-docs' into 'master'
docs: Update the URL for related documentation

See merge request GNOME/gtk!3813
2021-07-31 18:39:52 +00:00
Emmanuele Bassi
769dc53c05 docs: Update the URLs of related projects for GTK
And install the gi-docgen project file as well.
2021-07-31 19:08:34 +01:00
Emmanuele Bassi
1a4554daf3 docs: Update the URLs of related projects for GSK
And install the gi-docgen project file.
2021-07-31 19:07:18 +01:00
Emmanuele Bassi
6c0633ef61 docs: Update the URL for related documentation
And install the gi-docgen project files for GDK.
2021-07-31 19:05:33 +01:00
Emmanuele Bassi
4d020a3875 Merge branch 'docs-trigger' into 'master'
ci: Trigger a pages build

See merge request GNOME/gtk!3811
2021-07-31 17:16:26 +00:00
Emmanuele Bassi
316cc55e69 ci: Trigger a pages build
Do not publish the API reference directly, but trigger a CI pipeline for
the docs-gtk-org branch, which will then do the publishing.
2021-07-31 17:13:27 +01:00
Emmanuele Bassi
95f2634ea9 Merge branch 'iter-is-valid-docs' into 'master'
docs: Fix iter_is_valid() description

See merge request GNOME/gtk!3810
2021-07-31 13:07:07 +00:00
Emmanuele Bassi
95c032f531 docs: Fix iter_is_valid() description
Drop the "WARNING" and the block quote, and follow the existing
documentation style guidelines.
2021-07-31 13:41:13 +01:00
Matthias Clasen
744955753f iconhelper: Fix the paintable implementation
get_current_image was recursing due to an obvious typo.

Fixes: #4140
2021-07-31 08:27:17 -04:00
Matthias Clasen
ae5e7dc65d Merge branch 'glyph-cache-mystery' into 'master'
ngl: Bypass pango for glyph cache rendering

See merge request GNOME/gtk!3807
2021-07-31 00:38:41 +00:00
Matthias Clasen
ed41c46926 ngl: Bypass pango for glyph cache rendering
We can just use cairo directly here,
and cut out some layers of pango in the middle.
2021-07-30 19:46:07 -04:00
Matthias Clasen
a460fb2734 Merge branch 'check-activate' into 'master'
checkbutton: Some fixes when used with GActions

See merge request GNOME/gtk!3805
2021-07-30 23:39:17 +00:00
Matthias Clasen
39ddce6ba3 Merge branch 'fix/wm_class' into 'master'
x11: set a default value for program_class

Closes #4138

See merge request GNOME/gtk!3806
2021-07-30 23:25:08 +00:00
Matthias Clasen
8da7e3bdc3 Merge branch 'wip/otte/for-master' into 'master'
widget-factory: Expand the video to cover the whole frame

See merge request GNOME/gtk!3804
2021-07-30 22:43:29 +00:00
Vincent Bernat
eff53c023a x11: set a default value for program_class
This was also the behaviour with GTK 3. We use the capitalized program
name.

Fixes #4138

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
2021-07-30 23:22:32 +02:00
Benjamin Otte
99e4a6a2d6 widget-factory: Propagate natural size for text styles
This avoids them requiring scrolling.
2021-07-30 20:54:58 +02:00
Benjamin Otte
c06817b951 widget-factory: Make frames cooler
Instead of havoing a label for the video frame that clashes with the
background of the video, add a frame around the text styles box and add
a label for them. As a side benefit, it also makes it more obvious that
it is scrollable.

Note: Most of this patch is just reindenting.
2021-07-30 20:43:02 +02:00
Benjamin Otte
e765aaa3f4 widget-factory: Expand the video to cover the whole frame
1. This looks way cooler.

2. Since the frame is rounded, it adds a very visible test for our
   clipping of rounded rectangles.
2021-07-30 20:37:34 +02:00
Florian Müllner
1728aa581c checkbutton: Activate when moving focus
Currently we update the :active property on both the previous and
new focus button. That "visually activate" the button and will
emit ::toggled, but if the button is associated with an action,
the action state won't change.

Fix that by activating the new focus instead of explicitly fiddling
with the :active property.
2021-07-30 20:34:24 +02:00
Florian Müllner
c50475de34 checkbutton: Delegate ::activate to the helper if appropriate
If the button is associated with an action, the action is currently
only activated when the button is clicked, not when it is activated.
2021-07-30 20:34:24 +02:00
Mike Gorse
5d7ecb7a6e a11y: Remove unneeded check 2021-07-30 08:58:27 -05:00
Matthias Clasen
06348a8517 Merge branch 'wip/chergert/fix-4134' into 'master'
textview: fix yoffset position when top_margin is set

Closes #4134

See merge request GNOME/gtk!3801
2021-07-30 13:41:30 +00:00
Matthias Clasen
c4dbb8f01e imcontext: Code cleanup 2021-07-29 20:37:58 -04:00
Matthias Clasen
e67b2cb54b composetable: Allow multiple dead keys
Remove the limitation on the number of dead keys
that we match, and allow the result be be multiple
characters.

Regenerate the builtin sequences, since this changes
what dead key sequences we can reproduce algorithmically.

Update tests to match.

Fixes: #10
2021-07-29 20:37:30 -04:00
Christian Hergert
908b1e5e12 textview: fix yoffset position when top_margin is set
This doesn't need to be included in the calculation or it will cause the
yoffset to continually shift while the window is resized.

Fixes #4134
2021-07-29 16:45:04 -07:00
Matthias Clasen
539391ce6c composetable: Change an API
Make gtk_check_algorithmically take a GString
for the result. This is in preparation for allowing
multi-character results here, in the future.

Update all callers.
2021-07-29 17:29:25 -04:00
Mike Gorse
7fc90aed26 a11y: Send correct object reference for the root accessible 2021-07-29 15:55:58 -05:00
Florian Müllner
23e79d2eb2 gtk/windowhandle: Delegate titlebar action to the compositor if possible
Delegating the action to the compositor not only improves consistency
with server-side decorations, but also allows for actions that aren't
available client-side (like lower-in-middle-click).

https://gitlab.gnome.org/GNOME/mutter/-/issues/602
2021-07-29 21:39:32 +02:00
Florian Müllner
0c7b1431d7 gdk/toplevel: Add gdk_toplevel_titlebar_gesture()
Where supported, this allows delegating the titlebar action to the
compositor instead of trying to replicate its behavior client-side.

https://gitlab.gnome.org/GNOME/mutter/-/issues/602
2021-07-29 21:39:32 +02:00
Matthias Clasen
b6c0155836 imcontext: Handle Escape in Compose sequence
Treat Escape the same in hex sequences and in
Compose sequence: reset the state.
2021-07-29 08:39:17 -04:00
Matthias Clasen
76d67b586c imcontext: Tweak Compose sequence handling
When we don't have any matches for a Compose sequence
anymore, beep, and keep the preedit as it was for the
last match.

Fixes: #4127
2021-07-29 08:24:14 -04:00
Matthias Clasen
914edb1472 composetable: Add a prefix api
Add a function that computes the longest prefix
of a buffer for which a compose table has matches.
2021-07-29 08:23:40 -04:00
Matthias Clasen
dbf5033f94 composetable: Reduce the scope of a variable
'prefix' is not a good name for a file-scope variable,
move it into the sole function using it.
2021-07-29 08:22:52 -04:00
Matthias Clasen
cc6ecc8b62 Merge branch 'source-static-name' into 'master'
Avoid copying static debug strings

See merge request GNOME/gtk!3789
2021-07-29 11:59:02 +00:00
Matthias Clasen
b7e6922605 imcontext: Tweak Compose sequence preedit
When sequences contain multiple Compose keys,
don't hide the first one. This is a very fringe
case, but it matches the behavior of IBus.

Fixes: #4124
2021-07-29 07:36:48 -04:00
Matthias Clasen
05eaffb9f2 ci: Collect tools test output
This should help understanding why some of them fail.
2021-07-28 22:42:46 -04:00
Matthias Clasen
67b568f464 testsuite: Set TEST_RESULT_DIR for tools tests 2021-07-28 22:42:46 -04:00
Matthias Clasen
19b534f7de Avoid copying static debug strings
The g_source_set_name calls were showing up as a
major source of strdups in our profiles. Avoid that
by using new GLib api when available.
2021-07-28 22:42:46 -04:00
Florian Müllner
bc386c9a60 widget: Change callback scope
Look who changed his mind since commit 8e2ffb3b46 :-)

The "call" scope means that the callback is only used during the
function call itself (here: gtk_widget_class_install_action()).

That's clearly wrong here, as the callback is invoked every time
the action is activated.

Arguably the "notified" scope is a better match here, where the
lack of a GDestroyNotify parameter suggests that the callback may
be used forever (which is the case here).

Related: #3498
2021-07-28 21:48:01 +02:00
Matthias Clasen
db8b3419c2 Merge branch 'compose-parse-msvc' into 'master'
compose-parse.c: Include stdlib.h (fix build on Visual Studio)

See merge request GNOME/gtk!3794
2021-07-28 10:38:25 +00:00
Fabio Tomat
0f5ba5192a Update Friulian translation
(cherry picked from commit 16aa8dbad7)
2021-07-28 09:11:33 +00:00
Chun-wei Fan
108c423d70 compose-parse.c: Include stdlib.h
That is needed for exit(), and it may not have been included by the
other headers.
2021-07-28 15:18:36 +08:00
Emmanuele Bassi
dded10a396 Merge branch 'gi-fix' into 'master'
gdk: add missing Since annotation

See merge request GNOME/gtk!3790
2021-07-27 17:38:28 +00:00
Marc-André Lureau
1b080826db gdk: add missing Since annotation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-27 21:01:31 +04:00
Matthias Clasen
910f23ea19 Merge branch 'wip/otte/widgetfactory-dnd' into 'master'
Improve DND

See merge request GNOME/gtk!3785
2021-07-27 04:12:58 +00:00
Benjamin Otte
f1b50baba1 widget-factory: Add images that support dnd
Just use the bottom left notebook for a GtkPicture with custom drag
source and drop target.
2021-07-27 04:40:57 +02:00
Matthias Clasen
4453597946 widget-factory: Some new backgrounds
Snowy wasn't ideal because of the aspect ratio.
Replace it by beach and nyc.
2021-07-27 04:40:42 +02:00
Benjamin Otte
192bfa10cb droptarget: Make formats construct-only writable
This way, it can be set in GtkBuilder.

Also make sure to only ever look at the GTypes set in the formats, as
GtkDropTarget cannot deal with mime types.
2021-07-27 04:28:04 +02:00
Benjamin Otte
0781429dc5 builder: Add support for GdkContentFormats 2021-07-27 04:28:04 +02:00
Benjamin Otte
d760332f00 testsuite: Add contentformat tests 2021-07-27 04:28:04 +02:00
Benjamin Otte
131be5f2e8 contentformats: Add gdk_content_formats_parse() 2021-07-27 04:13:42 +02:00
Matthias Clasen
57a95c540c Merge branch 'matthiasc/for-master' into 'master'
ngl: Cosmetics

See merge request GNOME/gtk!3786
2021-07-26 18:21:56 +00:00
Matthias Clasen
09deb1d757 ngl: Cosmetics
Use the macro we already have to check that colors
are fully transparent.
2021-07-26 13:42:10 -04:00
Matthias Clasen
5c4aba4b9c Merge branch 'wip/compose-parser' into 'master'
Clean up the GtkComposeTable api

See merge request GNOME/gtk!3746
2021-07-26 11:51:14 +00:00
Benjamin Otte
6a5d555f58 contentformats: Change the format of gdk_content_formats_to_string()
Now, we just print a whitespace-separated list of GTypes and mime types.

This makes this neat for 2 things:

1. Parsing it (see next commit)
2. Using it in GtkBuilder (see commits after that)

In particular, the common case of supporting a single GType (or mime
type) looks like just printing the GType (or mime type), which in
GtkBuilder looks like
<property name="formats">GdkTexture</property>
2021-07-26 02:28:49 +02:00
Benjamin Otte
f5dc71021f dnd: Guard drags with a reference when finishing
Usually the "dnd-finished" signal will be used to unref the GdkDrag. In
those cases, we would lose the object, so that when we do the final
drag_drop_done() afterwards, we wouldn't have a remaining reference.

With the reference guard, this now works.
2021-07-26 02:18:54 +02:00
Matthias Clasen
39005461c5 4.3.2 2021-07-24 22:04:49 -04:00
Matthias Clasen
4dc4c00267 Merge branch 'misc-speedups' into 'master'
ngl: Speed up clipping calculations a bit

See merge request GNOME/gtk!3784
2021-07-25 02:03:46 +00:00
Matthias Clasen
d76460343a sizerequest: Simplify some code
Avoid some repeated MAX().
2021-07-24 18:49:41 -04:00
Matthias Clasen
0d8dd0c664 sizerequest: Keep branches in sync
There are some unintentional differences between
the path that uses a layout manager, and the path
that uses widget vfuncs. Sync them up.
2021-07-24 18:49:41 -04:00
Matthias Clasen
ee6491f717 widget: Avoid some unnecessary back-and-forth casting
Avoid some unnecessary casting and a redundant early exit.
2021-07-24 18:49:27 -04:00
Matthias Clasen
7044951dab widget: Avoid GObject data for action muxer
Most widget have an action muxer now, so just
store it in GtkWidgetPrivate.
2021-07-24 18:48:10 -04:00
Matthias Clasen
98986a25f9 layoutmanager: Avoid some overhead
Use inline getters for some things.
2021-07-24 18:48:10 -04:00
Matthias Clasen
ae3e586714 gridlayout: Avoid some unnecessary overhead
Use inline functions for some things.
2021-07-24 18:48:10 -04:00
Matthias Clasen
0ef12193f9 gsk: Optimize gsk_transform_to...
Optimize these functions for the common cases.
2021-07-24 18:48:10 -04:00
Matthias Clasen
b695ef9168 gsk: Add a shortcut for a common transform case
Add a private getter for the translation part of a
transform node, to avoid pulling it out of the transform
over and over.
2021-07-24 18:48:09 -04:00
Matthias Clasen
7fb1389648 gsk: Add a private getter for container children
No need to get them one-by-one, in our inner loop.
2021-07-24 18:48:09 -04:00
Matthias Clasen
f88efb811b ngl: Reduce type checking overhead
No need to be very careful here, these are entirely
internal types.
2021-07-24 18:48:09 -04:00
Matthias Clasen
466d33ca69 ngl: Speed up clipping calculations a bit
Exit as early as possible from intersect_rounded_rectilinear.
2021-07-24 18:48:09 -04:00
Piotr Drąg
d44ce1987d Update POTFILES.in 2021-07-24 14:38:51 +02:00
Emmanuele Bassi
527b2c5ab1 Merge branch 'no-pposition' into 'master'
gdk/x11: Do not set PPosition hint

See merge request GNOME/gtk!3781
2021-07-24 11:45:00 +00:00
Florian Müllner
4d0c2997cf gdk/x11: Do not set PPosition hint
It is good practice for (floating) window managers to respect explicit
position hints from clients (as long as the window wouldn't end up
off-screen etc.).

Before commit 13d3afa56e, GTK had a flag for setting the PPosition hint,
but now does so unconditionally. However the real intention is to *not*
request a fixed position, so don't do that.
2021-07-24 06:32:16 +02:00
Matthias Clasen
6f04ec9dae Merge branch 'wip/exalm/gtktext-selection-fix' into 'master'
text: Use the widget y coordinate for gestures

See merge request GNOME/gtk!3780
2021-07-23 20:29:07 +00:00
Alexander Mikhaylenko
00cc99818d text: Use the widget y coordinate for gestures
Currently we use layout coordinates and widget height when determining
where a click or drag has happened. If the widget has top padding (which it
does inside a GtkEntry, for example), the area where it's possible to select
text is shifted down, so the part of GtkText above the layout is not counted
as the draggable area and instead the equal area below the widget is counted.

Since GtkText is always single-line, there's no need to do any of that and
we can use widget coordinates. Then the draggable area matches the widget
and the problems goes away.
2021-07-23 23:37:36 +05:00
Matthias Clasen
e51fdc1c9b Merge branch 'stack-page-name' into 'master'
stack: GtkStackPage:name is not construct-only

Closes #4109

See merge request GNOME/gtk!3778
2021-07-23 14:25:29 +00:00
Matthias Clasen
8d5ef4ab30 Merge branch 'matthiasc/for-master' into 'master'
Cosmetics

See merge request GNOME/gtk!3779
2021-07-22 21:22:55 +00:00
Matthias Clasen
7bdda15b86 Cosmetics
Fix a comment typo.
2021-07-22 17:03:08 -04:00
Matthias Clasen
4c41ef8de3 stack: GtkStackPage:name is not construct-only
We have a setter for this property, so we clearly
weren't serious when we marked it as construct-only.

Fixes: #4109
2021-07-22 16:55:15 -04:00
Matthias Clasen
7aec3b0fa1 Merge branch 'startup-profiling' into 'master'
Add more sysprof marks

See merge request GNOME/gtk!3777
2021-07-22 19:20:22 +00:00
Matthias Clasen
fce23c981b Add more sysprof marks
Add a few more marks during gtk_init to figure out where
our startup time goes, and avoid the sysprof initialization
from distorting the first mark.
2021-07-22 14:47:02 -04:00
Matthias Clasen
351819b570 Merge branch 'startup-profiling' into 'master'
Add more sysprof marks

See merge request GNOME/gtk!3776
2021-07-22 17:04:27 +00:00
Matthias Clasen
a10b1b7341 Add more sysprof marks
Add a few more marks during gtk_init to figure out where
our startup time goes, and avoid the sysprof initialization
from distorting the first mark.
2021-07-22 12:51:32 -04:00
Benjamin Otte
02c6226741 Merge branch 'wip/otte/gleanup' into 'master'
reorganize GDK's GL code

See merge request GNOME/gtk!3726
2021-07-22 14:51:05 +00:00
Benjamin Otte
620ccdabb5 glx: Get rid fo DrawableInfo
Store the frame counter in the surface, where it belongs.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
4b12dc6547 gdkdisplay-win32.c: Don't call ReleaseDC() unnecessarily
The dummy Win32 window that we use to capture display change events and
to create dummy WGL contexts was created with CS_OWNDC, so we really do
not need to (and should not) call ReleaseDC() on the HDC that we
obtained from it, so drop these calls.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
bd69d7e23f GDK-Win32: init_gl(): Default to WGL for now
Since the shaders need to be updated for using with GLES (libANGLE at
least), default to WGL for now.  Unfortunately it is not that common for
Windows to have GLES support, in which the easiest way to obtain such
support is via Google's libANGLE.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
8648486400 GDK-Win32: Fixup, and cleanup WGL HDC handling
It turns out that the problem of the WGL window not drawing was due to
the fact that I messed up where I placed SwapBuffers() during the
conversion... doh:|

At the same time, stop storing the HDC in the GdkWin32GLContextWGL, but
instead always create it along the surface we created, so that it is ready
for use for operating with WGL when we are not dealing with "surfaceless"
contexts.  If we are dealing with "surfaceless" contexts, just use the
HDC of the dummy window that we created when we created the
Gdk(Win32)Display.

WGL contexts should now be in working order at this point.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
6c00117119 Split out WGL/EGL stuff and simplify things
This commit attempts to split GdkWin32GLContext into two parts, one for
WGL and the other for EGL (ANGLE), and attempts to simplify things a
bit, by:

*  We are already creating a Win32 window to capture display changes,
   so we can just use that to act as our dummy window that we use to
   find out the pixel format that the system supports for WGL.  We also
   use it to obtain the dummy legacy WGL context that we will always
   require to create our more advanced Core WGL contexts.

*  Like what is done in X11, store up the WGL pixel format or the
   EGLConfig in our GdkWin32Display.

*  Ensure we do not create the dummy WGL context unnecessarily.

In this way, we can successfully create the WGL/EGL contexts, however
there are some issues at this point:

*  For WGL, the code successfully initializes and realizes the WGL
   Contexts, but for some reason things became invisible.  When running
   gtk4-demo, this can be verified by seeing the mouse cursor changing
   when moved to spots where one can resize the window, although they
   were invisible.

*  For EGL, the code initializes EGL but could not realize the EGL
   context as shaders failed to compile.  It seems like the shader issue
   is definitely outside the scope of this MR.
2021-07-22 16:28:16 +02:00
Benjamin Otte
9c4c4eaaa1 gl: Fix issue with EGL + nvidia
nvidia sets the default draw buffer to GL_NONE if EGL contexts are
initially bound to EGL_NO_SURFACE which is exactly what we are doing. So
bind them to GL_BACK when drawing, as they should be.

See https://phabricator.services.mozilla.com/D118743 for a discussion
about EGL_NO_CONTEXT and draw buffers.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
969b3257a7 GDK: Add debug option for WGL usage
This way, one can force using WGL on Windows even if EGL support was
enabled.  Also update the help text for gl-egl as it will apply for
Windows, albeit a bit later.
2021-07-22 16:28:16 +02:00
Chun-wei Fan
65c6af31e1 GDK-Win32: Move some functions out of gdkglcontext-win32.c
We want these to be out of the way as we split between WGL and EGL/ANGLE
GL contexts, so that they don't get in the way.
2021-07-22 16:28:16 +02:00
Benjamin Otte
6b8bc83420 display: Move GL selection code into gdkdisplay-x11.c
This has the benefit that we can refactor it and make sure we deal with
GdkDisplay::init_gl() not being called at all because
GDK_DEBUG=gl-disable had been specified.
2021-07-22 16:28:16 +02:00
Benjamin Otte
30aaab5c6c x11: Move code from GdkGLContextX11
It's not used there, but both backends have independent
immplementationgs for it.

I want to get rid of GdkGLContextX11 and moving code from it is the
first step.
2021-07-22 16:28:16 +02:00
Benjamin Otte
72e2a46c05 inspector: Add support for displaying GL errors
Also, no need to show a GL version if GL isn't available.
2021-07-22 16:27:32 +02:00
Benjamin Otte
e06e0e8555 gdk: Move GL context construction to GdkGLContext
Now that we have the display's context to hook into, we can use it to
construct other GL contexts and don't need a GdkSurface vfunc anymore.

This has the added benefit that backends can have different GdkGLContext
classes on the display and get new GLContexts generated from them, so
we get multiple GL backend support per GDK backend for free.

I originally wanted to make this a vfunc on GdkGLContextClass, but
it turns out all the abckends would just call g_object_new() anyway.
2021-07-22 16:27:32 +02:00
Benjamin Otte
9f1d6e1f44 gl: Move vfunc
Instead of
  Display::make_gl_context_current()
we now have
  GLContext::clear_current()
  GLContext::make_current()

This fits better with the backends (we can actually implement
clearCurrent on macOS now) and makes it easier to implement different GL
backends for backends (like EGL/GLX on X11).

We also pass a surfaceless boolean to make_current() so the calling code
can decide if a surface needs to be bound or not, because the backends
were all doing whatever, which was very counterproductive.
2021-07-22 16:27:32 +02:00
Benjamin Otte
15ed1a329e gl: Require EGL_KHR_surfaceless_context with egl
The code to create and manage a fake egl surface to bind to is
complex and completely untested because everyone seems to support this
extension.

nvidia and Mesa do support it and according to Mesa devs, adding support
in a new driver is rather simple and Mesa drivers gain that feature
automatically, so all future drivers shoould have it.
2021-07-22 16:27:31 +02:00
Benjamin Otte
505436340b gdk: Get rid of paint contexts
... or more exactly: Only use paint contexts with
gdk_cairo_draw_from_gl().

Instead of paint contexts being the only contexts who call swapBuffer(),
any context can be used for this, when it's used with
begin_frame()/end_frame().

This removes 2 features:

1. We no longer need a big sharing hierarchy. All contexts are now
   shared with gdk_display_get_gl_context().
2. There is no longer a difference between attached and non-attached
   contexts. All contexts work the same way.
2021-07-22 16:27:31 +02:00
Benjamin Otte
a27434a8a7 gl: Store the context::in-frame state in the current context
Do not treat the context as already current when the value
of context::in-frame changes.

This is so we can bind to EGL_NO_SURFACE if context::in-frame == false
and to context::surface if context::in-frame == true.

This allows getting rid of the attached property in future commits.
2021-07-22 16:27:31 +02:00
Benjamin Otte
2c987861a6 gl: Deprecate gdk_gl_context_get_shared_context()
It's not used anymore. And in particular we do want to keep the display
context private, so we're not gonna return it from this function.
2021-07-22 16:27:31 +02:00
Benjamin Otte
c7320df0c9 gdk: Add gdk_gl_context_is_shared()
... and use it in the GL renderers.
2021-07-22 16:27:31 +02:00
Benjamin Otte
dd666e4fe4 ngl: Store the shared driver in the display
... instead of some random GL context.
2021-07-22 16:23:56 +02:00
Benjamin Otte
e4f0418003 gdk: Require EGL version 1.4 across the board
Mesa currently ships 1.5.
2021-07-22 16:23:56 +02:00
Benjamin Otte
430b6f8fb1 gdk: Add GdkDisplay::init_gl vfunc
The vfunc is called to initialize GL and it returns a "base" context
that GDK then uses as the context all others are shared with. So the GL
context share tree now looks like:

+ context from init_gl
  - context1
  - context2
  ...

So this is a flat tree now, the complexity is gone.

The only caveat is that backends now need to create a GL context when
initializing GL so some refactoring was needed.

Two new functions have been added:

* gdk_display_prepare_gl()
  This is public API and can be used to ensure that GL has been
  initialized or if not, retrieve an error to display (or debug-print).
* gdk_display_get_gl_context()
  This is a private function to retrieve the base context from
  init_gl(). It replaces gdk_surface_get_shared_data_context().
2021-07-22 16:23:56 +02:00
Benjamin Otte
ba3e80cbfa wayland: Don't pass GL config to get_egl_surface()
There's only one GL config.
2021-07-22 16:23:56 +02:00
Benjamin Otte
7cd4282bad wayland: Move fbconfig into the display
Create it during init and then reuse it for all contexts.

While doing that, also improve error reporting - that's not used yet but
will in later commits.
2021-07-22 16:23:56 +02:00
Benjamin Otte
01e9fa9adb gdk: Allow GdkDrawContext with a %NULL surface
This is not used yet, but it allows surfaceless GL contexts.

For that purpose, we need to make the display a construct-only property,
so that it can be set when the surface isn't.

This adds a bunch of very picky checks in the constructor so nothing bad
can happen.
2021-07-22 16:23:56 +02:00
Benjamin Otte
581e01b2da gdk: Add a private struct to GdkDisplay
... and move some members from the GdkDisplay struct.

We've always wanted to add one to isolate the display from the backends
a bit more, but so far it's never happened.

Now that I'm about to add more data to GdkDisplay, it's a good excuse to
start.
2021-07-22 16:23:56 +02:00
Benjamin Otte
5a3b4de1b7 x11: Redo choice between EGL and GLX
We try EGL first, but are very picky about what we accept.
If that fails, we try to go with GLX instead.
And if that also fails, we try EGL again, but this time accept anything.

The idea here is that EGL is the preferred method going forward, but GLX is
the tried and tested method that we know works. So if we detect issues with
EGL, we want to avoid using it in favor of GLX.

Also add a GDK_DEBUG=gl-egl option to force EGL at all costs and not try
GLX.
2021-07-22 16:23:56 +02:00
Benjamin Otte
74288eceaf x11: Properly record the error when initializing GL
That way, we can give a useful error message when things break down for
users.

These error messages could still be improved in places (like looking at
the actual EGL error codes), but that seemed overkill.
2021-07-22 16:23:56 +02:00
Benjamin Otte
37ba057128 x11: Do not call glXQueryExtension()
epoxy does that already.
2021-07-22 16:23:56 +02:00
Benjamin Otte
6d5ba9590b x11: Get Visual from EGL directly
Query the EGL_VISUAL_ID from the egl Config and select a config with the
matching Visual.

This is currently broken on Mesa because it does not expose any RGBA
X Visuals in any EGL config, so we always end up with opaque Windows.

https://gitlab.freedesktop.org/mesa/mesa/-/issues/149
2021-07-22 16:23:56 +02:00
Benjamin Otte
215f792851 x11: Store the GLX drawable in the surface
Also, stop using a dummy window for unattached GL contexts and instead
use the display's leader surface.

Again, this mirrors EGL.
2021-07-22 16:23:56 +02:00
Benjamin Otte
1c55b32879 x11: Use single GLX fbconfig and store it in the display
This mirrors the code for the EGL config.
2021-07-22 16:23:56 +02:00
Benjamin Otte
82eb947f41 x11: Remove glx version check
We only work with GLX >= 1.3 anyway, so don't explicitly check for it
and pretend to do something else that doesn't work otherwise.
2021-07-22 16:06:06 +02:00
Benjamin Otte
485dae9f25 x11: Remove unused struct member
We don't care if the GL context is direct at all.
2021-07-22 16:06:06 +02:00
Benjamin Otte
eb3423312f Revert "x11: Always fall back to GLX on NVIDIA"
This reverts commit c35a6725b9.

This approach doesn't work because if NVIDIA doesn't work for EGL, the
EGL implementation won't be provided by NVIDIA, so checking the vendor
doesn't work.
2021-07-22 16:06:06 +02:00
Benjamin Otte
04c2093d5c x11: Remove the dummy surface
Instead, use the display's "leader surface" when no surface is required,
because we have it lying around.

Really, we want to use EGL_NO_SURFACE, but if that's not supported...
2021-07-22 16:06:06 +02:00
Benjamin Otte
ccd5992a83 x11: Remove GdkVisual
It's not used anymore.
2021-07-22 16:06:06 +02:00
Benjamin Otte
ca8d9fbe0b x11: Rework Visual selection
Instead of going via GdkVisual, doing a preselection and letting the GL
initialization improve it, let the GL initialization pick an X Visual
directly using X Visual code directly.

The code should select the same visuals as before as it tries to apply
the same logic, but it's a rewrite, so I expect I messed something up.
2021-07-22 16:06:06 +02:00
Benjamin Otte
62bac44a21 glx: Remove Visual cache
1. We're using EGL most of the time anyway, so if we wanted to cache
   things, we'd need to port it there.
2. Our GL handling is massively configurable, so determining when to use
   the cache and when not is a challenge.
3. It makes startup nondeterministic and depend on whether a GTK4 app
   has previously been started on this display and nobody thinks about
   that when debugging.
4. The only benefit of the caching is delaying GL initialization - which
   made sense in GTK3 where almost no app used GL but doesn't make sense
   in GTK4 where almost every app uses GL.

So unless I find a big benefit to reintroducing it, this cache will be
gone for good.
2021-07-22 16:06:05 +02:00
Benjamin Otte
0ddd06113d x11: Move GL init code into the GL context
No functional changes, just shuffling code.
2021-07-22 16:06:05 +02:00
Benjamin Otte
b1fbc2ef24 x11: Store the EGL surface in the GdkSurfaceX11
Avoids having to use private data, though the benefit is somewhat
limited as we still have to put the destructor in the egl code and can't
just put it in gdk_surface_x11_finalize().
2021-07-22 16:06:05 +02:00
Benjamin Otte
c787fe7ecb x11: Store the EGL config in the display
We only have one config, because we use the same Visual everywhere.
Store this config in the GdkDisplayX11 struct for easy access.

Also do this on initialize, because if creating the config fails, we
want to switch to GLX instead of failing to do GL at all.

This also simplifies a lot of code as we can share Visual, Colormap, etc
across surfaces.
2021-07-22 16:06:05 +02:00
Benjamin Otte
bdb49720be x11: Move the EGL display into the private struct
There's no need to use g_object_set_data() for it.

We can also stop caching it elsewhere because we know the display has
it.

And finally, we can remove the display->have_egl boolean and use
display->egl_display != NULL instead. We initialize the display at
startup, so that variable is the perfect indicator.
2021-07-22 16:06:05 +02:00
Benjamin Otte
1d448a2b8a x11: Pass the display, not the screen
Screens are on their way out.
2021-07-22 16:06:05 +02:00
Benjamin Otte
c5df081904 x11: Simplify code
These variables were a lot more important in GTK3, but now we just want
to pass them through to X.
2021-07-22 16:06:05 +02:00
Benjamin Otte
8a2f3e1fe5 x11: Move function call
The GLX visual selection is GLX specific, so it can be handled by the GLX
code.

There should be no reordering here, the call was just moved.
2021-07-22 16:06:05 +02:00
Benjamin Otte
8dfc627e46 glx: Don't initialize GLX multiple times.
Either it is initialized or it isn't.
2021-07-22 16:06:05 +02:00
Benjamin Otte
0fce30070f x11: Initialize GL at startup
We need to initialize GL to select the Visual we are going to use for
all our Windows.

As the Visual needs to be known before we know if we are even gonna use
GL later, we can't avoid initializing it.

Note that this previously happened, too. It was just hidden behind the
GdkScreen initialization.
2021-07-22 16:06:05 +02:00
Benjamin Otte
8bfe82f686 x11: Don't share cached GLX visuals with GTK3
We don't want to bind ourselves to GTK3 - both because we don't want to
accidentally cause bugs in a different codebase and because we want to
deviate from it.

While doing so, also store visuals as visuals and not as integers.
And only store one Visual because GTK4 only uses one visual.

And then remove the code that is leftover for dealing with the
compatibility Visual for GTK3.

PS: I'm kinda proud of my STRINGIFY_WITHOUT_BRACKETS hack.
2021-07-22 16:06:05 +02:00
Benjamin Otte
7d32ec51e7 x11: Reorder code
Initialize the GL visuals from gdkdisplay.c so the call into the GL
stack isn't hidden in gdkvisual.c

This is relevant for further commits.
2021-07-22 16:06:05 +02:00
Benjamin Otte
5784f8c2f9 x11: Stop reordering visuals
The old code was ordering visuals by depth, but considering that these
days we either use the default visual or a 32bit RGBA visual, that
reordering does not have an effect anymore.

In theory, the only effect is that the GLX Visual selection might select
a different replacement Visual when it checks for improved GL Visuals, but
even there I can't come up with a case where that matters, because
again, the visuals are only reordered by depth and we want to keep the
depth.

In any case, make this a separate commit so bisecting can find this
problem if it ever shows up.
2021-07-22 16:06:05 +02:00
Benjamin Otte
74e01ddec5 x11: Remove unused function
Now that we can't create extra GdkX11Screens anymore, this also means
that there is exactly 1 GdkX11Screen per GdkX11Display.
2021-07-22 16:06:05 +02:00
Benjamin Otte
1347573139 x11: Move code where it belongs
Instead of the display telling the screen to tell the visuals to tell
the display to initialize itself, just init the display directly.

What a concept.
2021-07-22 16:06:05 +02:00
Benjamin Otte
f2b41e708d build: Build demos before tools
That's a sneaky trick so my edit/compile/test cycle goes faster:
I usually use demos for testing so the tools don't have to be linked for
me to start testing.
2021-07-22 16:06:05 +02:00
Matthias Clasen
a5555943ed Merge branch 'destroy-pointer-gestures' into 'master'
gdk/wayland: Clean up gestures if pointer capability is withdrawn

See merge request GNOME/gtk!3697
2021-07-21 21:33:53 +00:00
Vlad Zahorodnii
2c023cdaed gdk/wayland: Clean up gestures if pointer capability is withdrawn
If the pointer capability is added, pointer swipe and pinch gestures
will be created. However, if the pointer capability is removed, the
gesture objects won't be destroyed.

If the pointer capability is removed and added several times in a row,
for example due to plugging and unplugging physical mouse, this can lead
to leaking the old gesture objects.

In order to prevent that, this change makes the seat destroy swipe and
pinch gestures when the pointer capability is withdrawn.
2021-07-21 20:52:16 +03:00
Matthias Clasen
bcc7028640 Merge branch 'sync-icons' into 'master'
Sync included icons from adwaita-icon-theme

See merge request GNOME/gtk!3773
2021-07-21 17:49:15 +00:00
Matthias Clasen
bdee75cd0f Sync included icons from adwaita-icon-theme
Make sure we stay in sync with the Adwaita.
2021-07-20 17:26:59 -04:00
Matthias Clasen
94eb3d7ac0 Merge branch 'wip/otte/build' into 'master'
Streamline build configuration

See merge request GNOME/gtk!3391
2021-07-20 18:25:59 +00:00
Benjamin Otte
0ae2acfb1a x11: Remove XComposite
It's only used during DND to allow use of the root window's cow window
as a DND target, because apparently gnome-shell used to think that was a
great idea to DND to the overview.

Somebody complain to gnome-shell devs about it not being a good idea if
they want it fixed.
Potentially using Wayland is a better idea though.

This reverts 85ae875dcb

Related: https://bugzilla.gnome.org/show_bug.cgi?id=601731
2021-07-20 14:00:25 -04:00
Benjamin Otte
afc5f46ca9 x11: Remove unused headers 2021-07-20 14:00:25 -04:00
Benjamin Otte
e544c891ca build: Make all X11 extensions mandatory
It's not 2011 anymore, and we shouldn't randomly build one of 10.000
different combinations of X11 backends (I counted the possibilities) but
exactly the one we expect people to use.
2021-07-20 14:00:25 -04:00
Benjamin Otte
af0c95c11a build: Remove sassc option
Instead, ensure that sassc is made madatory on git builds (because
it is, we don't ship CSS files anymore) and not even looked for in
release builds (because do ship CSS files there).
2021-07-20 14:00:25 -04:00
Benjamin Otte
4d5dc18a57 build: disable Vulkan by default
We don't want people to build Vulkan support when they just want to get
GTK built.

This is in particular true for GTK as a CI subproject or for people
using jhbuild.

Worse, just having Vulkan support compiled in tends to cause crashes
in the Inspector, even if you are not using it.
2021-07-20 14:00:25 -04:00
Benjamin Otte
9f6fb161e2 build: Set proper defaults for media backends
GTK supports webm playback, which means a backend should always be
compiled.

The ffmpeg backend however is incomplete (no audio) and as such, we
don't want people to end up with it accidentally.

Since we don't want to drag an entire gstreamer build into our ci
on MacOs or msvc, explicitly disable the gstreame media backend there.
2021-07-20 14:00:25 -04:00
Matthias Clasen
3883a98771 Merge branch 'fix-dialog-docs' into 'master'
gtk/builder: Port example to GTK 4

See merge request GNOME/gtk!3772
2021-07-20 12:54:55 +00:00
Yuri Chornoivan
9b44965f13 Update Ukrainian translation 2021-07-20 12:08:13 +00:00
Maximiliano Sandoval R
aa6a9de6ba gtk/builder: Port example to GTK 4 2021-07-20 13:22:08 +02:00
Matthias Clasen
8669e8a498 Merge branch 'tooltip-hig' into 'master'
password_entry: Header Capitalization on tooltip

See merge request GNOME/gtk!3771
2021-07-20 11:17:36 +00:00
Maximiliano Sandoval R
ead31db096 password_entry: Header Capitalization on tooltip
See https://teams.pages.gitlab.gnome.org/Design/hig-www/feedback/tooltips.html
2021-07-20 13:00:05 +02:00
Matthias Clasen
69fda941c7 Merge branch 'win32.hidpi.cleanup' into 'master'
GDK-Win32: Clean up HiDPI support and WGL slightly

Closes #3796

See merge request GNOME/gtk!3767
2021-07-20 02:43:43 +00:00
Matthias Clasen
67c9e7a4a8 Merge branch 'ci-default-settings-4' into 'master'
reftests: Enforce default settings

See merge request GNOME/gtk!3769
2021-07-19 18:36:11 +00:00
Matthias Clasen
4e4f57e091 reftests: Enforce default settings
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
2021-07-19 13:26:32 -04:00
Chun-wei Fan
ac64d2d910 GDK-Win32: Clean up HiDPI support and WGL a bit
Make _gdk_win32_display_get_monitor_scale_factor() less complex, by:

*  Drop the preceding underscore.

*  Dropping an unused parameter.

*  Using a GdkSurface instead of a HWND, as the HWND that we pass into
   this function might have been taken from a GdkSurface, which are now
   always created with CS_OWNDC.  This means if a GdkSurface was passed
   in, we ensure that we only acquire the DC from the HWND once, and do
   not attempt to call ReleaseDC() on it.

*  Store the HDC that we acquire from the GdkSurface's HWND into the
   surface, and use that as the HDC we need for our GdkGLContext.

*  Drop the gl_hwnd from GdkWin32Display, as that is really should be
   stored in the GdkSurface.

*  For functions that were updated, name GdkWin32Display variables as
   display_win32 and GdkSurface variables as surface, to unify things.

*  Stop calling ReleaseDC() on the HDC that we use for OpenGL, since
   they were acquired from HWND's created with CS_OWNDC.
2021-07-19 18:30:42 +08:00
Chun-wei Fan
49a76257cd gdksurface-win32.c: Create all surfaces with CS_OWNDC
We want to ensure that we have things set up properly for drag surfaces
as well.
2021-07-19 17:36:54 +08:00
Matthias Clasen
77829cf3ed Merge branch 'pango-main' into 'master'
Use pango from the main branch

See merge request GNOME/gtk!3762
2021-07-17 13:05:42 +00:00
Yuri Chornoivan
4d10ab3d35 Update Ukrainian translation 2021-07-17 05:34:21 +00:00
Matthias Clasen
e609ede597 Use pango from the main branch
Change the Pango subproject to use the main branch.

This depends on
https://gitlab.gnome.org/GNOME/pango/-/merge_requests/379
2021-07-16 13:19:22 -04:00
Benjamin Otte
2ba69abe39 Merge branch 'wip/otte/for-master' into 'master'
cssimagecrossfade: Don't abort() when failing to parse image

Closes #4101

See merge request GNOME/gtk!3758
2021-07-16 16:26:23 +00:00
Benjamin Otte
a76f515569 cssimagecrossfade: Don't abort() when failing to parse image
The code wasn't checking if parsing an image failed and just returning
success.

Testcase from bug is attached.

Fixes #4101
2021-07-16 17:50:09 +02:00
Matthias Clasen
a663b8c313 Merge branch 'fix-negative-scales' into 'master'
ngl: Handle negative scales

Closes #4096

See merge request GNOME/gtk!3755
2021-07-16 11:59:47 +00:00
Matthias Clasen
f66fa16bd1 Merge branch 'metainfo' into 'master'
metadata: Fix license identifiers and appdata

See merge request GNOME/gtk!3757
2021-07-16 11:14:09 +00:00
Matthias Clasen
8390363abe testsuite: Avoid negative scales with gl renderer
The fix in 1c90bb522e was only for the ngl renderer,
so don't use the test with the gl renderer, until it is
fixed as well.
2021-07-16 07:11:20 -04:00
Matthias Clasen
6ff85d287a Merge branch 'wip/chergert/fix-texthistory-insert' into 'master'
texthistory: fix calculation of n_chars

See merge request GNOME/gtk!3756
2021-07-16 11:04:21 +00:00
Maximiliano Sandoval R
94c2072be8 meson: Use a valid SPDX identifier
See https://mesonbuild.com/Reference-manual.html#license
2021-07-16 11:14:46 +02:00
Maximiliano Sandoval R
64b9d53472 appdata: Use launchable rather than id
<id> should be used for the component id and <launchable> for the
desktop file.
2021-07-16 11:14:46 +02:00
Maximiliano Sandoval R
a5e7b92c5d appdata: Add content_rating
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-content_rating
2021-07-16 11:14:42 +02:00
Maximiliano Sandoval R
2da9ba63e2 appdata: Use correct SPDX license identifier
Following
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-project_license,
for the complete list of identifiers see https://spdx.org/licenses/
2021-07-16 11:09:28 +02:00
Christian Hergert
5d02a8f5db texthistory: fix calculation of n_chars
This should be the number of characters, not the end position. This fixes
an issue where we wouldn't coalesce insert actions together.
2021-07-15 21:26:30 -07:00
Benjamin Otte
834d3749c6 testsuite: Add test for crasher
Test for the crasher in !4096
2021-07-15 23:43:28 +02:00
Matthias Clasen
1c90bb522e ngl: Handle negative scales
Scale factors can be negative, but we were not
looking out for that, triggering an assertion when
trying to create a render target with negative
width of height. Avoid that.

Fixes: #4096
2021-07-15 16:40:13 -04:00
Matthias Clasen
b70b058b66 Merge branch 'transparent-optimizations' into 'master'
snapshot: Handle transparent opacity nodes correctly

See merge request GNOME/gtk!3754
2021-07-15 18:39:48 +00:00
Matthias Clasen
b99beeb552 Merge branch 'wip/baedert/for-master' into 'master'
snapshot: Replace trivial gradients with color nodes

See merge request GNOME/gtk!3753
2021-07-15 18:31:22 +00:00
Matthias Clasen
c799452973 ngl: Do nothing for transparent text nodes
Like the previous commit - a transparent text node
will not produce any visible pixels, so bail out early.
2021-07-15 13:18:23 -04:00
Matthias Clasen
fd48afb77d ngl: Do nothing for transparent color nodes
No need to send commands to the GPU to render transparency.
2021-07-15 13:18:23 -04:00
Matthias Clasen
aaa68954c3 snapshot: Handle transparent opacity nodes correctly
Eliding totally transparent content from the node tree is
not 100% correct, since filters can make things visible, so
we need to at least preserve the bounds. We can do that by
creating a transparent color node.
2021-07-15 13:18:23 -04:00
Timm Bäder
433233258b snapshot: Only compute start and end point if we have to
If the linear gradient results in a color node, we don't need the start
and end point. Only declare and compute it if we need to.
2021-07-15 16:52:38 +02:00
Timm Bäder
3eed61deba snapshot: Replace trivial gradients with color nodes
Extend this to all existing gradient types
2021-07-15 16:51:17 +02:00
Matthias Clasen
87e2a02e0c composetable: Rewrite Compose files if necessary
Apply heuristics to avoid breaking users existing configurations
with the change to not always add the default sequences.

If we find a cache that was generated before 4.4, and the Compose
file does not have an include, and doesn't contain so many sequences
that it is probably a copy of the system one, we take steps to keep
things working, and thell the user about it.
2021-07-15 09:30:09 -04:00
Matthias Clasen
264d592012 composetable: Keep the number of sequences
And print it out in tests.

Update all tests for this.
2021-07-15 09:30:01 -04:00
Matthias Clasen
0ad5094119 Remove some leftover debug code 2021-07-15 09:30:01 -04:00
Benjamin Otte
67952a9142 Merge branch 'wip/otte/for-master' into 'master'
rendernodeparser: Don't use %g when writing file

See merge request GNOME/gtk!3752
2021-07-14 18:46:36 +00:00
Benjamin Otte
ca3d942b9b rendernodeparser: Remove leftover debug prints 2021-07-14 20:19:40 +02:00
Benjamin Otte
5470a1344d rendernodeparser: Don't use %g when writing file
%g is locale dependent and can add "," where "." should be. Use
string_append_double() instead.
2021-07-14 20:18:44 +02:00
Matthias Clasen
4390f8102b imcontext: Improve the docs
Add more details about supported input methods.
2021-07-13 22:03:23 -04:00
Matthias Clasen
92129a2011 imcontext: Simplify checking compose seqs
Add the builtin table to the list of tables, and
remove the duplicated code that checks builtin
sequences separately.
2021-07-13 22:03:23 -04:00
Matthias Clasen
54dffa07f3 composetable: Drop GtkComposeTableCompact
All tables use the compact format now, and we generate
caches in that format too. Bump the cache version to 3
for this.

Replace the python script for generating the builtin table
by a small C program using the same code to generate the data
for the builtin table. This drops the restriction on only
generating a single character in the builtin sequences.
2021-07-13 22:03:23 -04:00
Matthias Clasen
1cff4bb27a composetable: Ignore length 1 sequences
It turns out that the X11 Compose file has some
length 1 sequences which are not interesting to us.
2021-07-13 22:02:33 -04:00
Matthias Clasen
8087250476 imcontext: Replace the builtin sequences
When we find a Compose file, replace the builtin
sequences with the table we found. This matches the
semantics described in Compose(5), and makes it possible
to drop unwanted sequences from the builtin table.

It is slight change of behavior for users with existing
Compose files. To match the previous behavior, you have
to add

include "%L"

to your Compose file, to keep the builtin sequences in
addition to your own.
2021-07-13 22:02:33 -04:00
Matthias Clasen
485dc052ca composetable: Allow removing sequences
Interpret an empty string as value in the Compose
file to mean: Remove this sequence.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
45d39c2802 composetable: Switch to using a hash table
This lets us naturally replace matching sequences
while parsing. That means that the semantics are now
"last one wins" if the parser sees multiple entries
for the same sequence.

Add a testcase that checks the new replacement semantics.
2021-07-13 22:02:33 -04:00
Matthias Clasen
3b4b1c6878 composetable: Reinterpret %L
When we see include "%L" in a Compose file, use the
builtin sequences. We no longer filter out duplicates
wrt. to the builtin sequences.
2021-07-13 22:02:33 -04:00
Matthias Clasen
ff4f07d76f composetable: Handle substitutions in includes
Hande the %H, %L, %S substitutions that are described
in Compose(7).

Test included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
fb6c8cd466 composetable: Handle includes
This adds the mechanics for parsing include lines in
Compose files. We do detect and prevent cycles.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
8464b0484f composetable: Move code into the parser
This is just code reshuffling.
2021-07-13 22:02:33 -04:00
Matthias Clasen
bee58fd09d composetable: Introduce a parser struct
This will be used in the following commits to
beef up Compose file parsing.
2021-07-13 22:02:33 -04:00
Matthias Clasen
d25557a5ef Clean up the GtkComposeTable api
Keep the list of composetables private to GtkIMContextSimple,
and just have an api that creates new GtkComposeTables, either
from a file or from data.

Update tests to use the new api.
2021-07-13 22:02:33 -04:00
Matthias Clasen
da3ca6604b gtk-demo: Add a slider to the menu example
This is a fun way to show that we can scale fast.
2021-07-13 22:02:33 -04:00
Matthias Clasen
74cba6c3b2 Add a simple Javascript example
This shows how to use a layout manager in a widget,
implemented in javascript. The example sets up the
environment for running from the toplevel dir, assuming
that the build dir is called 'build'.
2021-07-13 22:02:33 -04:00
Emmanuele Bassi
c09718b731 Merge branch 'doc-fixes' into 'master'
doc: Syntax fixes

See merge request GNOME/gtk!3751
2021-07-13 23:43:06 +00:00
Marco Melorio
eacfa2a966 doc: Syntax fixes 2021-07-13 22:53:19 +00:00
Matthias Clasen
e7f228e240 Merge branch 'fp16-tests' into 'master'
ngl: Make the C half-float implementation accessible

See merge request GNOME/gtk!3748
2021-07-13 13:38:21 +00:00
Matthias Clasen
fab82a7c25 tests: Add some fp16 tests 2021-07-13 09:03:49 -04:00
Matthias Clasen
fc9c34897a ngl: Make the C half-float implementation accessible
Make this accessible for tests.
2021-07-13 09:03:49 -04:00
Emmanuele Bassi
28cdd3f497 Merge branch 'gi-fixes' into 'master'
Various introspection fixes

See merge request GNOME/gtk!3747
2021-07-13 11:21:20 +00:00
Marc-André Lureau
a009e26e95 gtk: fix GtkPasswordEntryBuffer introspection
Move the source file to public_sources list, and fix tag annotation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 15:03:09 +04:00
Marc-André Lureau
ab908c23f4 Add GtkMenuButton:primary Since: annotation
Property added in commit a74420bc1a.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 11:31:09 +04:00
Marc-André Lureau
ae21f66fe5 Add GTK_DEBUG_ICONFALLBACK Since: 4.2 annotation
Introduced in commit 6f82408056.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 11:26:39 +04:00
Rafael Fontenelle
2d092ea280 Update Brazilian Portuguese translation
(cherry picked from commit c7a7fc4de6)
2021-07-10 19:30:32 +00:00
Rafael Fontenelle
0f9d39cdfd Update Brazilian Portuguese translation
(cherry picked from commit 72c3026764)
2021-07-10 17:14:31 +00:00
Matthias Clasen
a64087d481 Merge branch 'activatable-buttons' into 'master'
menubutton: Make menu buttons activatable again

Closes #4079

See merge request GNOME/gtk!3728
2021-07-10 12:59:39 +00:00
Matthias Clasen
c85f3f4942 Merge branch 'wip/chergert/fix-4094' into 'master'
joinedmenu: add helper to join menus instead of nesting

Closes #4094

See merge request GNOME/gtk!3739
2021-07-09 19:29:41 +00:00
Matthias Clasen
d7553279ff Merge branch 'gdkkeys-m' into 'master'
[master] gdkkeys-win32.c: fix initialisation of key_state in update_keymap

See merge request GNOME/gtk!3742
2021-07-09 10:58:23 +00:00
Matthias Clasen
c86631b8a9 Merge branch 'dynamic-typelib-path' into 'master'
build: Get typelib dir dynamically using gobject-introspection dependency

See merge request GNOME/gtk!3737
2021-07-09 10:57:37 +00:00
Matthias Clasen
c1af63de9b Merge branch 'invisible-char-fix' into 'master'
textbtree: Initialize to zero the tags counting array

See merge request GNOME/gtk!3740
2021-07-09 10:56:51 +00:00
Jeremy Tan
2784b03b2d gdkkeys-win32.c: fix initialisation of key_state in update_keymap
It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.
2021-07-09 12:46:49 +08:00
Marco Trevisan (Treviño)
10bdf8c645 textbtree: Initialize to zero the tags counting array
We're using the tag contents array to count the number of invisible tags
set but we always increase it without being initialized.

This may lead to unexpected behavior when traversing them and it's
causing a reliable failure in the textiter tests under s390x.

So, memset that area content to 0 once allocated. It's not needed to do
the same for the tags themselves as we always assign them.

 Conditional jump or move depends on uninitialised value(s)
   at 0x4CFAA00: _gtk_text_btree_char_is_invisible (gtktextbtree.c:2569)
   by 0x4B8A1BB: find_visible_by_log_attrs (gtktextiter.c:3244)
   by 0x10E93D: check_backward_visible_word_start (textiter.c:484)
   by 0x10E93D: test_visible_word_boundaries (textiter.c:523)
   by 0x533288F: g_test_run_suite (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x53328E7: g_test_run (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x109CC1: main (textiter.c:807)
2021-07-09 03:48:40 +02:00
Christian Hergert
d63d9b2319 joinedmenu: add helper to join menus instead of nesting
In many cases, we have an "extra-menu" property that is used to allow
applications to join menus into the native menu for the widget. Previously,
this was done by nesting that menu in a section.

Doing so increases the complexity of the rules for GtkMenuTracker as you
may want different handling from inside of the section vs toplevel
sections.

If instead we synthetically glue the menus together, we have a much more
natural joining of menus as the application developer would expect for
their menu.

This also ports GtkLabel, GtkText, GtkPasswordEntry, and GtkTextView to
use the joined menu helper.

The joined menu helper comes originally from GNOME Builder and has had
extensive use there.

Fixes #4094
2021-07-08 14:16:06 -07:00
Marco Trevisan (Treviño)
d5f2b69d0c build: Get typelib dir dynamically using gobject-introspection dependency
We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.
2021-07-08 04:59:10 +02:00
Matthias Clasen
6818eee859 Merge branch 'wip/exalm/scroll-touch' into 'master'
scrolledwindow: Don't check drag threshold when already scrolling

See merge request GNOME/gtk!3735
2021-07-07 21:37:58 +00:00
Matthias Clasen
e7f1398d85 Merge branch 'text-cursor-extents' into 'master'
text: Add API to compute cursor extents

See merge request GNOME/gtk!3734
2021-07-07 21:37:14 +00:00
Matthias Clasen
880c01f8cc Merge branch 'wl-since' into 'master'
Add missing "Since: 4.X" doc tags

See merge request GNOME/gtk!3736
2021-07-07 21:36:13 +00:00
Marc-André Lureau
337c5e5e59 Add missing "Since: 4.X" tags
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-07 23:35:38 +04:00
Florian Müllner
af52ea78c6 text: Add API to compute cursor extents
The extents that correspond to the strong/weak cursor at a given
character position can be used for example to point a popover to
text in the widget.
2021-07-07 19:33:12 +02:00
Alexander Mikhaylenko
fe633d9ef9 scrolledwindow: Don't check drag threshold when already scrolling
Checkout the drag threshold only makes sense when starting a scroll, after
that it just adds jumps when trying to scroll back and forth.
2021-07-07 19:39:06 +05:00
Matthias Clasen
e6cce283a7 Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Add a slider to the menu example

See merge request GNOME/gtk!3733
2021-07-06 00:23:30 +00:00
Matthias Clasen
c920236c54 gtk-demo: Add a slider to the menu example
This is a fun way to show that we can scale fast.
2021-07-05 19:31:54 -04:00
Matthias Clasen
6f86b4d220 Merge branch 'js-example' into 'master'
Add a simple Javascript example

See merge request GNOME/gtk!3731
2021-07-05 20:24:30 +00:00
Matthias Clasen
a085e174c5 Merge branch 'wip/remove-cloudprint' into 'master'
Remove Google Cloud Print backend

See merge request GNOME/gtk!3729
2021-07-05 20:21:52 +00:00
Florentina Mușat
d3c08789a3 Update Romanian translation
(cherry picked from commit 6ff90954dc)
2021-07-05 20:02:15 +00:00
Florentina Mușat
630488210b Update Romanian translation
(cherry picked from commit e5bd6312be)
2021-07-05 19:47:50 +00:00
Matthias Clasen
873f6ccfea Add a simple Javascript example
This shows how to use a layout manager in a widget,
implemented in javascript. The example sets up the
environment for running from the toplevel dir, assuming
that the build dir is called 'build'.
2021-07-05 13:48:51 -04:00
Patrick Griffis
af15f5d004 Remove Google Cloud Print backend
This service was shut down at the start of 2021.

This helpfully removes any dependency on json-glib, librest (and libsoup).
2021-07-05 10:54:16 -05:00
Matthias Clasen
f328175e2f appchooserbutton: Make buttons activatable again
The activation is simply forwarded to the combobox
within.
2021-07-05 10:10:44 -04:00
Matthias Clasen
fc65d6393a colorbutton: Make color buttons activatable again
The activation is simply forwarded to the toggle button
within.
2021-07-05 10:10:19 -04:00
Matthias Clasen
271afb7eab font button: Make font buttons activatable again
The activation is simply forwarded to the toggle button
within.
2021-07-05 10:09:43 -04:00
Matthias Clasen
76133dbea7 menubutton: Make menu buttons activatable again
The activation is simply forwarded to the toggle button
within.

Fixes: #4079
2021-07-05 10:08:43 -04:00
Matthias Clasen
6efe31e6f5 Merge branch 'master' into 'master'
gdk: fix gtk app startup with 'g_value_set_boxed: assertion...

See merge request GNOME/gtk!3714
2021-07-05 02:45:54 +00:00
Matthias Clasen
9885bedb7d Merge branch 'matthiasc/for-master' into 'master'
widget-factory: Add a default button

Closes #3975

See merge request GNOME/gtk!3725
2021-07-04 13:46:13 +00:00
Matthias Clasen
b6edb517e4 Merge branch 'placeholder-visibility' into 'master'
text: Update placeholder visibility more often

Closes #4066

See merge request GNOME/gtk!3724
2021-07-04 03:14:38 +00:00
Matthias Clasen
f023695f31 docs: Fix various link formatting
Make links that gi-docgen can undestand.

Fixes: #3975
2021-07-03 23:11:48 -04:00
Matthias Clasen
749ea8c30c widget-factory: Add a default button
Mark one of the buttons in the message dialog
as default, so we can see how the default appears
visually.
2021-07-03 23:01:14 -04:00
Matthias Clasen
c79f289d67 text: Update placeholder visibility more often
We need to update the visibility of the placeholder
label when we create it, otherwise we can end up
with placeholder text on top of entry content.

Fixes: #4066
2021-07-03 22:15:38 -04:00
Matthias Clasen
e516ce428a Merge branch 'fix-filechooser-critical' into 'master'
filechooser: Avoid a critical

Closes #4077

See merge request GNOME/gtk!3722
2021-07-03 21:48:41 +00:00
Matthias Clasen
1ae259aecb Merge branch 'man-page-improvement' into 'master'
docs: Improve the gtk4-launch man page

Closes #4081

See merge request GNOME/gtk!3723
2021-07-03 19:51:39 +00:00
Matthias Clasen
c609e2fef9 docs: Improve the gtk4-launch man page
Be more precise about where desktop files are found.

Fixes: #4081
2021-07-03 15:23:36 -04:00
Matthias Clasen
8ff9c851ce filechooser: Avoid a critical
This was showing up when calling some filechooser api on
a native filechooser, where we use a filechooser dialog
behind the scenes, but it does not have focus.

Fixes: #4077
2021-07-03 15:15:06 -04:00
Matthias Clasen
5ef2b9fd54 Merge branch 'matthiasc/for-master' into 'master'
Cosmetics

See merge request GNOME/gtk!3721
2021-07-03 13:40:23 +00:00
Matthias Clasen
511dc7a182 Merge branch 'fix-gir' into 'master'
meson: Fix generate_gir() dependencies

See merge request GNOME/gtk!3701
2021-07-03 13:35:22 +00:00
Matthias Clasen
c668586caf Merge branch 'scrolling-menus' into 'master'
popovermenu: Scroll when necessary

See merge request GNOME/gtk!3717
2021-07-03 13:31:23 +00:00
Benjamin Otte
390447862a Merge branch 'rerename-mediastream' into 'master'
mediastream: Rename apis one more time

See merge request GNOME/gtk!3720
2021-07-03 13:28:35 +00:00
Matthias Clasen
7f2648a013 Cosmetics
Amend LD_PRELOAD instead of replacing it, so you can just
point it at the right libgtk-4.so while running squares.py
from elsewhere.
2021-07-03 09:10:27 -04:00
Matthias Clasen
3227aa2c45 mediastream: Rename apis one more time
Before we end up with names that we are unhappy with,
rename things one more time, and update all callers.
2021-07-03 09:05:33 -04:00
Matthias Clasen
c88dc98b7c Merge branch 'python-example' into 'master'
Add a simple python example

See merge request GNOME/gtk!3719
2021-07-03 02:03:16 +00:00
Matthias Clasen
ed5b42071c Add a simple python example
This shows how to do custom drawing in a widget,
implemented in python. The example sets up the
environment for running from the toplevel dir,
assuming that the build dir is called 'build'.
2021-07-02 21:31:32 -04:00
Matthias Clasen
804d9ee828 popovermenu: Scroll when necessary
Add a scrolled window to GtkPopoverMenu, so we can scroll
long menus when there is not enough room.
2021-07-02 13:19:02 -04:00
Matthias Clasen
a90f721b74 Merge branch 'wip/baedert/wat' into 'master'
gtkffmediafile: Fix deprecated API usage

See merge request GNOME/gtk!3716
2021-07-02 17:00:41 +00:00
Timm Bäder
106417ada7 gtkffmediafile: Fix deprecated API usage 2021-07-02 18:41:55 +02:00
hudeng
fd0d3283e0 gdk: fix gtk app startup with 'g_value_set_boxed: assertion G_VALUE_HOLDS_BOXED (value) failed error message' when xsettings use 'XSETTINGS_TYPE_COLOR' type 2021-07-02 17:23:56 +08:00
Matthias Clasen
3e63e683a9 Merge branch 'text-undo-test' into 'master'
Add another text history test

See merge request GNOME/gtk!3713
2021-07-01 22:25:18 +00:00
Matthias Clasen
e415f25c8f Add another text history test
Add a tests that checks we group undo actions as expected
when the user is typing.
2021-07-01 18:08:05 -04:00
Matthias Clasen
e596e1fa7d Merge branch 'wip/chergert/fix-texthistory-grouping' into 'master'
texthistory: hoist single actions from group

Closes gnome-text-editor#97

See merge request GNOME/gtk!3711
2021-07-01 14:17:25 +00:00
Christian Hergert
d8ab2e6d03 texthistory: hoist single actions from group
In many cases across GtkTextBuffer, we end up with operations performed
inside of a begin/end user action. Those can be coalesced into a single
sub-action within the group, and hoisted out of the group. Doing so
increases the chances that we chain similar actions together for words.

Additionally, this fixes an issue introduced in
6179886b14 for #3977 where GNOME Text Editor
started to group all possible actions into a single group.

Fixes GNOME/gnome-text-editor#97
2021-06-30 16:40:54 -07:00
Benjamin Otte
e9d3d3e3cf icontheme: Fix binding annotation 2021-06-30 18:55:25 +00:00
Matthias Clasen
3a5983e387 Merge branch 'wayland-cursor-theme' into 'master'
wayland: Look for cursor themes in $HOME

Closes #4080

See merge request GNOME/gtk!3708
2021-06-29 22:17:49 +00:00
Matthias Clasen
4efb661ae6 wayland: Look for cursor themes in $HOME
We should look in the same places that libXcursor does,
so add $XDG_DATA_HOME/icons and $HOME/.icons to the list.

Fixes: #4080
2021-06-29 16:57:15 -04:00
Matthias Clasen
bcdb9c937c Merge branch 'more-vbo-overflow' into 'master'
gsk: Use the right limit for batch size

See merge request GNOME/gtk!3707
2021-06-29 20:36:42 +00:00
Matthias Clasen
f45c0b9609 gsk: Another vbo_size overflow fix
We can overflow vbo_size not just by batching
too much, but also by producing humongous text
nodes. Split them up.
2021-06-29 15:22:40 -04:00
Matthias Clasen
9ea162034a gsk: Use the right limit for batch size
We use 16 bits, so G_MAXINT16 is one bit short.
Just make it explicit as 0xffff.
2021-06-29 15:21:45 -04:00
Matthias Clasen
192e779db2 Merge branch 'hello-world-fixup' into 'master'
Update hello-world.c

See merge request GNOME/gtk!3706
2021-06-29 16:59:45 +00:00
Matthias Clasen
bda7557783 Update hello-world.c
Simplify the code a bit and make the window
match the existing screenshot.
2021-06-29 08:01:37 -04:00
Matthias Clasen
dc50c7539a Merge branch 'avoid-batch-size-overflow' into 'master'
Revert "gsk: Respect max element vertices limitation"

See merge request GNOME/gtk!3704
2021-06-28 21:35:15 +00:00
Matthias Clasen
bf97dfd998 Merge branch 'wip/exalm/buttons' into 'master'
GtkMenuButton icon+arrow support + fixes

Closes #3501

See merge request GNOME/gtk!3694
2021-06-28 19:10:57 +00:00
Matthias Clasen
c7f4131402 Merge branch 'gtklistitemfactory-autocleanup' into 'master'
gtk: Define the GtkListItemFactory autocleanup func

See merge request GNOME/gtk!3703
2021-06-28 19:10:04 +00:00
Matthias Clasen
bd5e5beee0 gsk: Don't overflow vbo_count
We use 16 bits to store vbo_count, so we can't create
batches that have more than 65535 vertices. Pay attention
to that limit when merging batches.
2021-06-28 15:00:41 -04:00
Matthias Clasen
7a493f151d Revert "gsk: Respect max element vertices limitation"
This reverts commit f58fc6b22e.
2021-06-28 14:50:58 -04:00
Adrien Plazas
0ea73c384f gtk: Define the GtkListItemFactory autocleanup func 2021-06-28 14:01:57 +02:00
Emmanuele Bassi
d8c416e8b2 Merge branch 'ebassi/issues-4076' into 'master'
docs: Use code blocks for inline XML

Closes #4076

See merge request GNOME/gtk!3702
2021-06-27 15:10:15 +00:00
Emmanuele Bassi
9bf3724d25 docs: Use code blocks for inline XML
Otherwise the markdown renderer will just ignore them.

Fixes: #4076
2021-06-27 15:25:18 +01:00
Hugo Carvalho
fd49d39184 Update Portuguese translation
(cherry picked from commit a9c68757b5)
2021-06-27 09:45:19 +00:00
Xavier Claessens
0fd790eb8d Meson: Only g-ir-scanner warnings fatal when buit with -Dwerror=true
Also fix deprecation warning that requires using fatal_warnings kwarg
from Meson 0.55.0.

Fixes: #4072.
2021-06-25 11:38:11 -04:00
Xavier Claessens
b18e95d6b3 meson: Fix generate_gir() dependencies
There is no need to search for gir variables into subprojects, they are
part of dependencies objects, meson will find them there.
2021-06-25 10:08:36 -04:00
Alexander Mikhaylenko
47b5c68df4 menubutton: Don't hardcode label<->arrow spacing
This should come from the theme instead, as it does for icon<->arrow.
2021-06-24 23:13:01 +05:00
Alexander Mikhaylenko
ac3b246858 menubutton: Add a way to always show arrow with image buttons
Make sure the button still has the .image-button style class with an icon,
also add it to the initial state with only an arrow. Add a new
.arrow-button style class for the icon+arrow state so it's possible to
style it.

Remove spacing from the label+arrow variant to match, re-add it from the
stylesheet for both.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3501
2021-06-24 23:12:26 +05:00
Alexander Mikhaylenko
51a754547e menubutton: Remove a random g_return_if_fail()
There's already one above.
2021-06-24 23:11:57 +05:00
Alexander Mikhaylenko
76df60db2b menubutton: Reset label when setting icon name and vice versa
Match GtkButton.
2021-06-24 23:06:46 +05:00
Alexander Mikhaylenko
f3befe530b button: Reset style classes when setting arbitrary children
Don't leave leftover .image-button or .text-button.
2021-06-24 23:06:46 +05:00
Matthias Clasen
59d4333e23 Merge branch 'wip/sadiq/reveal-controls-on-touch' into 'master'
video: Reveal controls on tap

See merge request GNOME/gtk!3648
2021-06-24 15:11:33 +00:00
Matthias Clasen
92177d9663 Merge branch 'wip/chergert/gdk-macos-gdkdrop' into 'master'
GdkDrop suport for macOS backend

See merge request GNOME/gtk!3683
2021-06-24 15:03:19 +00:00
Matthias Clasen
6a29b64850 Merge branch 'dnd-fixes' into 'master'
dnd: Add another assertion

See merge request GNOME/gtk!3689
2021-06-24 15:01:29 +00:00
Matthias Clasen
73cb60d053 Merge branch 'ebassi/filechooser-no-trash' into 'master'
Never show the Trash in the FileChooserWidget side bar

Closes #674

See merge request GNOME/gtk!3692
2021-06-24 14:59:43 +00:00
Matthias Clasen
47bd998e94 Merge branch 'checkbutton-release-outside' into 'master'
checkbutton: Match GtkButton behavior

Closes #4061

See merge request GNOME/gtk!3691
2021-06-24 14:58:42 +00:00
Matthias Clasen
e2cfa7bd11 Merge branch 'fix_tests_testdnd' into 'master'
make testdnd trashcan work again

See merge request GNOME/gtk!3700
2021-06-24 14:54:32 +00:00
Matthias Clasen
006633082d Merge branch 'macos-input-method' into 'master'
macos: fix the position of curosr of input method for macos.

Closes #4063

See merge request GNOME/gtk!3699
2021-06-24 14:50:59 +00:00
Caolán McNamara
bbf7454fc9 make testdnd trashcan work again
so that dragging into the 'trashcan' is detected
2021-06-23 15:09:44 +01:00
Emmanuele Bassi
85cb5509c4 Merge branch 'gtklistitem-autocleanup' into 'master'
gtk: Define the GtkListItem autocleanup func

See merge request GNOME/gtk!3698
2021-06-23 13:09:28 +00:00
Emmanuele Bassi
0e29f52841 Merge branch 'migration_patch' into 'master'
Add section about `gtk_widget_set_app_paintable`

Closes #4007

See merge request GNOME/gtk!3641
2021-06-23 13:08:07 +00:00
Jaap aarts
02893e37d3 Add section about gtk_widget_set_app_paintable 2021-06-23 13:08:06 +00:00
Zhi
1dbb5188ba macos: fix the position of curosr of input method for macos.
In the refactoring from GdkWindow to GdkSurface, GtkWidget no longer
corresponds to a GdkSurface. We have to calculate the relative position
from GtkWidget to the GdkSurface.

Closes #4063.
2021-06-22 22:57:34 +08:00
Adrien Plazas
a4d35ace78 gtk: Define the GtkListItem autocleanup func 2021-06-22 09:43:16 +02:00
Carlos Garnacho
981a638b01 Merge branch 'fix-pointer-gestures-kde-plasma' into 'master'
gdk/wayland: Fix pointer-gestures version selection

See merge request GNOME/gtk!3693
2021-06-21 21:35:06 +00:00
Vlad Zahorodnii
3969d8b028 gdk/wayland: Fix pointer-gestures version selection
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION will fail if the
compositor implements version 2 of pointer-gestures-v1.
2021-06-21 09:51:45 +03:00
Emmanuele Bassi
889709213e Never show the Trash in the FileChooserWidget side bar
The Trash is a special location: files cannot be copied or moved, there,
and the file selection dialog is not able to restore files from the
Trash.

Fixes: #674
2021-06-20 15:44:22 +01:00
Emmanuele Bassi
333a92bcff Revert "Never show the Trash in the FileChooserWidget side bar"
This reverts commit cd39e417e1.
2021-06-20 15:41:43 +01:00
Emmanuele Bassi
cd39e417e1 Never show the Trash in the FileChooserWidget side bar
The Trash is a special location: files cannot be copied or moved, there,
and the file selection dialog is not able to restore files from the
Trash.

Fixes: #674
2021-06-20 15:39:41 +01:00
Matthias Clasen
1cebf406aa docs: Fix a typo 2021-06-19 14:14:57 -07:00
Matthias Clasen
d7915fbca8 docs: Add a section about Drag-and-Drop 2021-06-19 14:14:57 -07:00
Matthias Clasen
9169315cc1 Merge branch 'wip/chergert/textview-access-to-contexts' into 'master'
textview: give application developers access to RTL and LTR context

See merge request GNOME/gtk!3690
2021-06-19 20:36:44 +00:00
Matthias Clasen
3b70cd3226 checkbutton: Match GtkButton behavior
When leaving the widget before releasing the button,
we should not activate the checkbutton, to match the
way GtkButton behaves.

Fixes: #4061
2021-06-19 13:30:31 -07:00
Christian Hergert
a6101f0181 textview: give application developers access to RTL and LTR context
This allows developers to modify the pango context that is used when
rendering text within the text view.

Such access can be useful to alter how rounding occurs with API such as
pango_context_set_round_glyph_positions() and is needed by GtkSourceView
for proper placement of glyphs within the overview map.
2021-06-19 12:28:18 -07:00
Matthias Clasen
92c6485adf docs: Tweak wording
Instead of drag'n'drop, say drag-and-drop. That is easier
to read, and less unclear on the markdown syntax implications.
2021-06-19 08:03:47 -07:00
Matthias Clasen
4df9314039 wayland: Fix some dnd corner case
We must call gdk_drag_drop_done() when the drag ends,
successfully or not. Without this, we get an unwarranted
emission of ::cancel after a successful drop.

Since only the first call to gdk_drag_drop_done() is taking
effect, it is safe to call as a fallback, after emitting
::dnd-finished. If the application connects to that signal
and calls gdk_drag_drop_done() itself, its call will take
precedence.

This matches what the X11 implementation does.
2021-06-19 08:03:21 -07:00
Matthias Clasen
c8ad4d5deb dnd: Add another assertion
Assert that gdk_drop_finish() is called after the
drop is performed.
2021-06-19 07:50:41 -07:00
Matthias Clasen
13a2db2238 Merge branch 'fix-3798' into 'master'
GDK-Win32: Fix drag surface positioning (issue #3798)

Closes #3798

See merge request GNOME/gtk!3659
2021-06-18 17:31:51 +00:00
Matthias Clasen
e8f9fb0f86 Merge branch 'gsk-big-batches' into 'master'
ci: Build Broadway on MacOS

See merge request GNOME/gtk!3686
2021-06-18 17:00:58 +00:00
Matthias Clasen
634bd2de48 Merge branch 'matthiasc/for-master' into 'master'
ci: Build Broadway on MacOS

See merge request GNOME/gtk!3685
2021-06-18 14:09:49 +00:00
Matthias Clasen
f58fc6b22e gsk: Respect max element vertices limitation
We are pretty good at batching commands now, and we can easily
produce batches that exceed the maximum number of elements per
draw call that the hw can handle. Query that number, and respect
it when merging batches.

This fixes the rendering of the overview map in GtkSourceView.
2021-06-18 06:50:59 -07:00
Matthias Clasen
fb052c8d25 ci: Build Broadway on MacOS
We've seen a build failure if Broadway is built without
the X11 backend. Lets recreate that configuration in ci
so it doesn't break again.
2021-06-18 06:09:14 -07:00
Chun-wei Fan
e35490ba5b gdkdrag-win32.c: Fix drag surface positioning
Determine the root_x and root_y coordinates of the drag surface by
relying on the coordinates of the surface where the drag is being
carried out, plus the coordinates that we receive from the drag event,
which is in-line with what the X11 backend does.

This will prevent the drag surface from being initially drawn at the
correct position, but jumping towards the top-left corner of the screen
shortly afterwards.

The DnD support will still need some more updates to function correctly
on Windows, but at least this is a small improvement.

Fixes issue #3798.
2021-06-18 18:07:50 +08:00
Matthias Clasen
be1b979e51 Merge branch 'matthiasc/for-master' into 'master'
treeviewcolumn: Clip header buttons

Closes #4045

See merge request GNOME/gtk!3682
2021-06-18 04:37:48 +00:00
Christian Hergert
3fd931d392 macos: implement GdkDrop for macOS
This gets the basic mechanics of the drop portion of DnD working on the
macOS backend. You can drag, for example, from TextEdit into GNOME
Text Editor when using the macOS backend.

Other content formats are supported, and match what is currently
supported by the clipboard backend as the implementation to read
from the pasteboard is shared.

Currently, we look up the GdkDrag for the new GdkDrop. However,
nothing is stashing the drag away for further lookup. More work is
needed on GdkMacosDrag for that to be doable.
2021-06-17 17:26:42 -07:00
Christian Hergert
6c1dce2878 macos: make pasteboard usage reusable
We will want to be able to reuse the pasteboard reading code from
the macOS DnD drop backend. This just removes the pasteboard
bits from the implementation and allows that to be passed in as in
both clipboard and DnD cases we'll have a specific NSPasteboard
to read from.
2021-06-17 17:19:19 -07:00
Christian Hergert
ad1260505d macos: check for GdkMacosBaseView before using as such
We can get events for external windows such as those from native
file chooser dialogs.
2021-06-17 17:18:19 -07:00
Matthias Clasen
d92f8a1b8e treeviewcolumn: Clip header buttons
We don't want to overdraw when dragging a narrow column
around, and we also need the clipping to avoid picking
the wrong column, when a later column button overlaps
an earlier one.

Fixes: #4045
2021-06-17 17:14:14 -07:00
Matthias Clasen
22827f2cc7 macos: Fix a compiler warning 2021-06-17 17:14:14 -07:00
Christian Hergert
b64370cd48 macos: move drag motion to GdkMacosDrag
This doesn't help to be pushed off into the surface, as it makes things
more different than the X11 implementation.
2021-06-17 13:24:39 -07:00
Christian Hergert
6c8e176cc0 macos: fix position of drag surface 2021-06-17 13:23:38 -07:00
Christian Hergert
057bda6cd7 macos: register known clipboard types for drag destination 2021-06-17 13:23:18 -07:00
Matthias Clasen
8df2cce5c1 Merge branch 'wip/chergert/fix-broadway-build' into 'master'
inspector: fix compilation with broadway

See merge request GNOME/gtk!3681
2021-06-17 19:45:16 +00:00
Christian Hergert
352898ae9e inspector: fix compilation with broadway 2021-06-17 11:54:00 -07:00
Matthias Clasen
1bda665662 Merge branch 'matthiasc/for-master' into 'master'
action muxer fixes

See merge request GNOME/gtk!3678
2021-06-17 17:53:16 +00:00
Hugo Carvalho
fad4c60499 Update Portuguese translation
(cherry picked from commit 807537dd5d)
2021-06-17 14:44:54 +00:00
Matthias Clasen
47bb556327 testsuite: Avoid a compiler warning
This was showing up in ci on macos.
2021-06-17 09:37:45 -04:00
Matthias Clasen
4d00f1903a widget-factory: Show Ctrl-? in the menu
We use our own action for showing the shortcuts window,
so we need to associate this shortcut with our action
for it to show up.
2021-06-17 08:59:30 -04:00
Matthias Clasen
7344a03aa3 shortcutcontroller: Don't reinject menu accels
The normal way to associate accels with actions is
to attach a shortcut controller to the widget. The shorcut
controller will inject the accel into the action muxer
tree, so that it can get displayed in widgets that activate
the action (say, in menus.

This approach does not works for generated menus, since the
widgets are not in the hands of the app developer, so attaching
shortcut controllers to them is impractical.

Instead, GtkModelButton has an accel property that gets
bound to the accel coming from the action muxer tree (most
likely put there via gtk_application_set_accel_for_action),
and creates a shortcut controller itself.

The change in this commit is to prevent the shortcut controller
from injecting the accel into the action muxer tree in this case.
Otherwise, the accels get 'stuck' and we won't update them if the
global accels are later changed.

This is a hack, and needs a better solution.
2021-06-17 08:50:26 -04:00
Matthias Clasen
64af90111e window: Propagate accel changes
When the global accels change, tell the
shortcut controller to re-inject them into
the action muxer hierarchy.
2021-06-17 08:50:26 -04:00
Matthias Clasen
3254a3feab shortcutcontroller: Add a way to update accels
This will be used to make accel changes propagate.
2021-06-17 08:50:26 -04:00
Matthias Clasen
d5054f9b99 action muxer: Propagate registrations further up
We were pretty aggressive about not registering
observers further than necessary, stopping at the
first muxer that provides an action.

But even though action changes further up in the tree
won't be relevant in that case, we need to listen to
accel changes, since they may come from higher up
in the tree (e.g. when using
gtk_application_set_accels_for_action with an action
that is defined on a widget.

So, register all the way to the top, and stop propagating
action changes when we hit a muxer that provides the action.
2021-06-17 08:50:26 -04:00
Matthias Clasen
db93090ea8 menutrackeritem: Be more careful with accel changes
In some cases (such as when getting a new parent), the
action muxer doesn't know exactly which detailed actions
have changed accels, so we call primary_accel_changed with
just an action name.

Make the menu tracker item handle that case by matching
either against the detailed name or the the action name.
2021-06-17 08:50:26 -04:00
Matthias Clasen
15c65595b8 action muxer: Propagate accel changes
When we set a new parent on an action muxer,
accels may change, so call primary_accel_changed
for involved actions.
2021-06-17 08:50:26 -04:00
Benjamin Otte
e59e9ad6a9 Merge branch 'wip/otte/for-master' into 'master'
spinner: Behave like any other icon

See merge request GNOME/gtk!3677
2021-06-17 11:47:28 +00:00
Benjamin Otte
e6c4dbfc6d spinner: Behave like any other icon
Take the size from -gtk-icon-size.

Note that min-width/height still works, as those properties are handled
by the generic widget sizing machinery in GTK4.
2021-06-17 12:54:56 +02:00
Matthias Clasen
424dd8a463 actionobserver: Clarify primary_accel_changed docs
Either action_name or action_and_target may be NULL
here, and observer implementations should be careful
when checking those values.
2021-06-16 10:34:37 -04:00
Matthias Clasen
7b1a7629bc print-editor: Make accels work
Sadly, they don't show up anymore with this.
2021-06-16 10:17:49 -04:00
Matthias Clasen
df1116a010 bloatpad: Add icons as resources
This can serve as a useful example for how to add
themed icons as resources.
2021-06-16 09:35:00 -04:00
Matthias Clasen
11916bac7e bloatpad: Give the toolbar a facelift
Make it look more like a toolbar.
2021-06-16 09:26:15 -04:00
Matthias Clasen
d675ae5cc5 bloatpad: Improve accel dialog
Make this dialog a bit less of an eyesore.
2021-06-16 09:09:24 -04:00
Matthias Clasen
43eeff8f15 examples: Use existing icons
The sunny icon doesn't exist anymore.
2021-06-16 08:45:04 -04:00
Matthias Clasen
ece9e7e240 examples: Drop a redundant frame
The frame in the drawing example adds nothing
and looks wrong.
2021-06-16 08:40:01 -04:00
Matthias Clasen
1abbf00dcf Merge branch 'fix-3793' into 'master'
gdksurface-win32.c: Fix up popup placement (fix issue #3793)

Closes #3793

See merge request GNOME/gtk!3674
2021-06-16 10:08:52 +00:00
Matthias Clasen
10564514e8 Merge branch 'media-stream-name-collision' into 'master'
mediastream: Some more api renaming

Closes #4023

See merge request GNOME/gtk!3673
2021-06-16 10:07:29 +00:00
Chun-wei Fan
ba7ec29dc0 gdksurface-win32.c: Fix up popup placement
If we are undergoing a surface move, just apply the next_layout anyways,
even if we are not moving a toplevel surface.

Update the way how we obtain the x and y coordinates of a surface, if it
is a toplevel, apply the x and y coordinates from the results from we
obtained the underlying Win32 HWND, as we did before.  But if it is a
popup, use gdk_win32_surface_get_geometry() to obtain the correct x and
y coordinates to place our popup surface.

Also correct how we compute the shadow dimensions, and the final popup
rectangle as we attempt to layout the popup surface, since GDK-Win32
keeps track of the shadow dimensions in system (unscaled) units, not GDK
units.

Fixes issue #3793.
2021-06-16 16:25:29 +08:00
Chun-wei Fan
85b595bd14 gdksurface-win32.c: Fix formatting for popup functions 2021-06-16 15:02:56 +08:00
Matthias Clasen
56c486abbf Merge branch 'drop-target-name-collision' into 'master'
droptarget: Rename :drop to :current-drop

Closes #4028

See merge request GNOME/gtk!3669
2021-06-16 00:12:53 +00:00
Matthias Clasen
96fc5dc3a7 mediastream: Some more api renaming
Also rename gtk_media_stream_ended to
gtk_media_stream_set_ended, to avoid naming
collision with GtkMediaStream:ended.

The existing entry points still exist, deprecated
and marked as non-introspectable.

Update all internal uses.

Fixes: #4023
2021-06-15 18:33:23 -04:00
Matthias Clasen
b09087d634 droptarget: Rename :drop to :current-drop
Rename the GtkDropTraget:drop property to :current-drop,
to avoid naming collision with the signal of the same
name.

We leave the old property and getter in place, deprecated
and marked as non-introspectable.

Fixes: #4028
2021-06-15 18:21:28 -04:00
Matthias Clasen
5e99513507 Merge branch 'cherry-pick-4ba89f25' into 'master'
cellarea: Don't shrink area too much

See merge request GNOME/gtk!3672
2021-06-15 20:29:28 +00:00
Matthias Clasen
0a9d2f248e Merge branch 'label-underline-markup' into 'master'
label: Fix mnemonic handling

Closes #4041

See merge request GNOME/gtk!3670
2021-06-15 19:43:40 +00:00
Benjamin Otte
16ff055b42 cellarea: Don't shrink area too much
Do not compute rectangles with negative width/height. This avoids
assertion failures further down when those rectangles were actually
checked.

https://bugzilla.redhat.com/show_bug.cgi?id=1962215


(cherry picked from commit 4ba89f25b8)
2021-06-15 18:00:25 +00:00
Matthias Clasen
89f57d4ff6 Add a mnemonic testcase
Add a testcase that tests the label mnemonic handling
that was fixed in the previous commit.
2021-06-15 13:32:31 -04:00
Matthias Clasen
c4a2234a28 label: Fix mnemonic handling
We were not handling the case right in which we
want to use underlines, but not use markup. Since
we are now using pango_parse_markup for this case,
we need to escape the xml markup.

Fixes: #4041
2021-06-15 13:06:10 -04:00
Matthias Clasen
a3882763d8 Revert "progressbar: Avoid redundant storage"
This reverts commit 95747b1a40.

This was wrong - it turns out that while GtkProgressBar
allows you to change its orientation, its box layout is
always vertical.

Fixes: #4037
2021-06-15 07:37:57 -04:00
Emin Tufan Çetin
787fa6bd0d Update Turkish translation 2021-06-15 09:02:34 +00:00
Matthias Clasen
a6b4e53dca Merge branch 'macos-input-method' into 'master'
fix: make input method work again in gtk4

Closes #3968

See merge request GNOME/gtk!3668
2021-06-14 19:20:06 +00:00
Matthias Clasen
00d25ae89c Merge branch 'media-stream-name-collision' into 'master'
mediastream: Rename an api to avoid name collisions

Closes #4023

See merge request GNOME/gtk!3667
2021-06-14 18:44:10 +00:00
Zhi
5776fcd955 fix: make the new nsview as the first responder.
Make the new view as the first responder(focused) so the new view can
accept events from input method.

Fixes #3968.
2021-06-15 00:09:46 +08:00
Matthias Clasen
86b5dba43b mediastream: Rename an api to avoid name collisions
Some bindings can't handle the coexistence of
GtkMediaStream:prepared and gtk_media_stream_prepared.
Help them out by renaming the function to
gtk_media_stream_set_prepared, and rename
gtk_media_stream_unprepared as well, to match.

The existing entry points still exist, deprecated.

Update all internal uses.

Fixes: #4023
2021-06-14 07:50:12 -04:00
Matthias Clasen
e888364d3c Merge branch 'columnview-double-activation' into 'master'
listitemwidget: Claim gesture when activating

Closes #4015

See merge request GNOME/gtk!3663
2021-06-14 10:39:43 +00:00
Matthias Clasen
276f85c9e3 listitemwidget: Claim gesture when activating
Claim the gesture when we are activating a list item.

Otherwise we end up with double activations in
columnviews: first GtkColumnViewCell handles
the event, and then GtkListItemWidget handles
it again.

Fixes: #4015
2021-06-13 08:03:39 -04:00
Matthias Clasen
68eb422333 listitemwidget: Match activation conditions
Make the conditions used for activation in the single-
and double-click case properly match, so that it is
obvious that we won't trigger both of them.
2021-06-13 08:02:06 -04:00
Matthias Clasen
c0f54f899d Merge branch 'filename-annotations' into 'master'
Add type annotations for filename arguments

Closes #633

See merge request GNOME/gtk!3665
2021-06-13 11:38:50 +00:00
Matthias Clasen
65212535df Merge branch 'msvc-fix' into 'master'
Fix illegal instruction crash on x64 CPUs without POPCNT instruction when compiled with MSVC

See merge request GNOME/gtk!3664
2021-06-13 11:38:22 +00:00
Sebastian Cherek
106ac7c782 Update gtkpopcountprivate.h: undefined macro outside msvc 2021-06-12 17:35:13 +00:00
scherek
bc7b6a0e53 Dropped defined() for readability 2021-06-12 19:10:11 +02:00
scherek
e5b89569fd Replaced && with || for POPCNT checks to fix the logic. 2021-06-12 17:32:19 +02:00
Matthias Clasen
938bfff3dd Add type annotations for filename arguments
Add missing "(type filename)" annotations for string
arguments that are filenames.

Fixes: #633
2021-06-12 11:12:06 -04:00
scherek
6835fcf3cf Fix illegal instruction crash on x64 CPUs without POPCNT instruction when compiled with MSVC 2021-06-12 16:18:26 +02:00
Matthias Clasen
2554ee27d9 Merge branch 'listmodel-get-item' into 'master'
docs: Mention the GtkWidget.destroy vfunc

Closes #4024

See merge request GNOME/gtk!3662
2021-06-11 19:56:06 +00:00
Matthias Clasen
007cdf8787 Add tests for empty list models
Test that all our models return NULL for out-of-range
get_item calls, as expected.
2021-06-11 15:38:20 -04:00
Matthias Clasen
a526daf310 selectionfiltermodel: Fix an oversight
When the position is out of range, get_item needs
to return NULL.

Fixes: #4024
2021-06-11 15:37:16 -04:00
Matthias Clasen
ee34e1acc5 docs: Mention the GtkWidget.destroy vfunc
Mention GtkWidget.destroy in the migration guide.
2021-06-11 10:11:53 -04:00
Matthias Clasen
a08fbfa586 docs: Fix a typo in the migration guide 2021-06-11 07:52:30 -04:00
Matthias Clasen
d29f57fd1d Merge branch 'wip/chergert/fix-delayed-focus' into 'master'
window: clear move_focus when focus is already set

See merge request GNOME/gtk!3658
2021-06-10 21:31:47 +00:00
Christian Hergert
a4c5d1d94d window: clear move_focus when focus is already set
This can get set in other places, so we need to ensure it is cleared so
that an after-paint handler does not move the focus to a new widget.
2021-06-10 14:01:41 -07:00
Matthias Clasen
17f1bb1632 Merge branch 'actionable-fixes' into 'master'
tests: Fix check vs toggle button confusion

Closes #4022

See merge request GNOME/gtk!3656
2021-06-10 13:30:25 +00:00
Matthias Clasen
3418504b4b checkbutton: Fix actionable state tracking
If we have a GAction as model, we just have to
call gtk_action_helper_activate() and let
the action helper handle the state updates,

Fixes: #4022
2021-06-10 08:38:12 -04:00
Matthias Clasen
0a78a592ff togglebutton: Fix actionable state tracking
If we have a GAction as model, we just have to let
the action helper handle the state updates. GtkButton
already calls gtk_action_helper_activate() for us.
2021-06-10 08:36:08 -04:00
Matthias Clasen
208c527fb3 button: Add a private getter for the action helper
GtkToggleButton needs to know if it needs to actively
maintain its state, or defer to the action helper.
2021-06-10 08:36:01 -04:00
Matthias Clasen
28990285e2 testgaction: Add more widgetry
Add some toggle and check buttons to test that they
work as expected as GtkActionables.
2021-06-10 08:10:25 -04:00
Matthias Clasen
c7ad8d29e9 Fix the GAction test
We weren't setting the state of the stateful actions.
2021-06-10 08:10:08 -04:00
Matthias Clasen
dba8d1ff77 tests: Fix check vs toggle button confusion
Check buttons aren't toggle buttons anymore.
2021-06-10 07:49:08 -04:00
Matthias Clasen
143770f16d 4.3.1 2021-06-09 18:23:47 -04:00
Matthias Clasen
8a890238f5 Merge branch 'ebassi/docs-for-master' into 'master'
docs: Mention Window::close-request in the migration guide

See merge request GNOME/gtk!3655
2021-06-09 17:30:02 +00:00
Emmanuele Bassi
71be3a8de1 docs: Mention the ::damage-event signal in the migration guide
There is no replacement for damage event tracking.
2021-06-09 18:11:10 +01:00
Emmanuele Bassi
17373c3e77 docs: Mention GdkSurface:mapped
It replaces the ::map-event and ::unmap-event signals on GtkWidget.
2021-06-09 18:08:31 +01:00
Emmanuele Bassi
078ada75d4 docs: Mention Window::close-request in the migration guide
The Widget::delete-event signal was moved to Window::close-request.
2021-06-09 18:03:12 +01:00
Matthias Clasen
51a60b88b7 Merge branch 'ci-install-build' into 'master'
Make a standalone hello world

See merge request GNOME/gtk!3652
2021-06-09 12:59:46 +00:00
Matthias Clasen
193903ce4a ci: Update the image
v32 of the image includes wayland-protocols 1.21, and
other updates from Fedora 34.

While we are at it, drop gtk-doc from the image, and drop
the separate DOCS_IMAGE - no longer used.
2021-06-09 08:42:37 -04:00
Matthias Clasen
386002597b ci: Collect hello build logs 2021-06-09 08:42:30 -04:00
Matthias Clasen
e5a6d4a1c8 ci: Test building against installed GTK
This is meant to ensure that we e.g. install the
right header files, and so on.
2021-06-09 08:42:30 -04:00
Matthias Clasen
06caa57f9a Make a standalone hello world
We want to test building against the installed GTK
in ci, so lets add a standalone project.
2021-06-08 17:41:11 -04:00
Matthias Clasen
5ef6944a41 Merge branch 'row-activated-annotation' into 'master'
treeview: Add a few missing annotations

Closes #3828

See merge request GNOME/gtk!3647
2021-06-08 17:17:45 +00:00
Matthias Clasen
2e415e266f Merge branch 'wip/carlosg/spin-button-swipe-gesture' into 'master'
spinbutton: Connect swipe gesture to the text entry

Closes #4008

See merge request GNOME/gtk!3649
2021-06-08 14:54:26 +00:00
Zhi
970bb804de fix: replace deprecated metods.
Use NSInputContext to replace NSInputManager, which has been deprecated
since 10.6.

Sync from 0e30a96 in gtk3.
2021-06-08 22:47:53 +08:00
Carlos Garnacho
915388cfdb spinbutton: Mind the step in the swipe gesture
The swipe gesture forces values in the spin button that are
"impossible" according to the adjustment. This can break things
in creative ways.

Ensure the steps provided are always multiples of the adjustment
step value, and keep the remainder for further interaction.
2021-06-08 15:18:14 +02:00
Carlos Garnacho
1bf7f5eacb spinbutton: Connect swipe gesture to the text entry
In the GTK3 days, the spin button was an entry, with buttons on
top, and the swipe gesture affected the input on the entry bits.
Now the spin button is a container, so this gesture in the capture
phase applies to all contained children (incl. buttons).

Attach this gesture to the entry itself, so the buttons are left
outside this business. The gesture is still in the capture phase
in order to prevent text selection/edition/etc to happen.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4008
2021-06-08 15:17:56 +02:00
Matthias Clasen
6a86acb9ce Apply 1 suggestion(s) to 1 file(s) 2021-06-08 12:59:57 +00:00
Matthias Clasen
e35e7bcd4a Apply 1 suggestion(s) to 1 file(s) 2021-06-08 12:59:38 +00:00
Mohammed Sadiq
517b5173f9 video: Reveal controls on tap
So that the controls shall be shown on touch
2021-06-08 18:06:51 +05:30
Matthias Clasen
37acfcfcd5 Merge branch 'password-entry-buffer' into 'master'
Install gtkpasswordentrybuffer.h

See merge request GNOME/gtk!3646
2021-06-08 12:09:01 +00:00
Matthias Clasen
c2f2a45227 treeview: Documentation tweaks 2021-06-08 07:59:47 -04:00
Matthias Clasen
621e0a13e9 Install gtkpasswordentrybuffer.h 2021-06-08 07:49:42 -04:00
Matthias Clasen
92fcd37a19 Merge branch 'password-entry-buffer' into 'master'
Make GtkPasswordEntryBuffer public

See merge request GNOME/gtk!3645
2021-06-08 11:25:12 +00:00
Matthias Clasen
d8bde48b87 Make GtkPasswordEntryBuffer public 2021-06-08 11:25:11 +00:00
Matthias Clasen
825ffb9422 Merge branch 'ebassi/issue-3892' into 'master'
a11y: Update the level property for tree expanders

Closes #3892

See merge request GNOME/gtk!3470
2021-06-07 18:10:12 +00:00
Emmanuele Bassi
046ef010b3 Merge branch 'glib-main' into 'master'
subprojects: Use GLib main branch

See merge request GNOME/gtk!3642
2021-06-07 14:53:04 +00:00
Philip Withnall
b71ec6cb59 subprojects: Use GLib main branch
GLib upstream has renamed its `master` branch to `main`.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2348.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-07 14:56:49 +01:00
Matthias Clasen
b1beb3650b treeview: Add a few missing annotations
gtk_tree_view_row_activated and the ::row-activated signal
can (and do) receive NULL for the column occasionally.

This is an introspection api change.

Fixes: #3828
2021-06-06 08:24:52 -04:00
Matthias Clasen
fca19e72ad Merge branch 'matthiasc/for-master' into 'master'
Docs: Tweaks

Closes #3638

See merge request GNOME/gtk!3639
2021-06-05 22:13:21 +00:00
Matthias Clasen
98d2320c93 gtk-builder-tool: Replace can-focus with focusable
The focusable property has the meaning that can-focus had
in GTK 3.

Update tests, and mention this in the migration guide.

Fixes: #3638
2021-06-05 17:56:35 -04:00
Matthias Clasen
effc7a619d Docs: Tweaks
Remove some more redundant "or NULL" blurbs.
2021-06-05 17:38:23 -04:00
Matthias Clasen
0ec017fcc0 Merge branch 'matthiasc/for-master' into 'master'
popovermenu: doc tweaks

See merge request GNOME/gtk!3638
2021-06-05 21:36:06 +00:00
Matthias Clasen
94ad177176 popovermenu: doc tweaks 2021-06-05 17:19:39 -04:00
Matthias Clasen
4616104742 Merge branch 'submenu-action-fixes' into 'master'
Submenu action fixes

Closes #3721

See merge request GNOME/gtk!3272
2021-06-05 13:36:10 +00:00
Matthias Clasen
a3a24b81c8 Merge branch 'msvc-aarch64' into 'master'
gtkpopcountprivate.h: Fix build on ARM/aarch64 Visual Studio

See merge request GNOME/gtk!3637
2021-06-05 13:05:15 +00:00
Matthias Clasen
debcc62775 menusectionbox: Fix submenu-action for nested menus
We were not updating the state of submenu-actions
for nested submenus.

Fixes: #3721
2021-06-05 08:49:18 -04:00
Matthias Clasen
b11f31afea popovermenubar: Make submenu-actions work
We were not updating submenu-action state
for items in menubars.
2021-06-05 08:49:17 -04:00
Matthias Clasen
db2e5648c9 menutrackeritem: Make submenu-actions work again
This broke when GtkActionMuxer stopped being a
GActionGroup.
2021-06-05 08:49:17 -04:00
Matthias Clasen
46d1f04a7c bloatpad: Bring back the menubar
This was lost at some point.
2021-06-05 08:49:17 -04:00
Matthias Clasen
fe774c1ad8 Merge branch 'powimod_icon' into 'master'
Load icon from executable on Windows

Closes #3713

See merge request GNOME/gtk!3326
2021-06-05 12:47:08 +00:00
Chun-wei Fan
08ee36e7c4 gtkpopcountprivate.h: Fix build on ARM/aarch64 Visual Studio
__popcnt() is not supported for ARM nor ARM64 Visual Studio builds, so we must
use the fallback implementation as intrinsics are not supported for this
purpose on ARM/ARM64 Visual Studio builds.
2021-06-05 15:41:14 +08:00
Matthias Clasen
1605ec0a44 Merge branch 'ci-file-filters' into 'master'
GtkFileFilter: Allow case-insensitive patterns

Closes #3705

See merge request GNOME/gtk!359
2021-06-05 01:47:24 +00:00
Matthias Clasen
4b46e11b22 Merge branch 'imcontext-ignore-more-keysyms' into 'master'
imcontext: Ignore more keysyms

See merge request GNOME/gtk!3634
2021-06-05 01:19:39 +00:00
Matthias Clasen
9993e91add Add GtkFileFilter tests 2021-06-04 21:10:01 -04:00
Matthias Clasen
9ac22c1088 GtkFileFilter: Add suffix matches
This is less flexible than a glob pattern, but it is
explicitly case-insensitive, to match the behavior
on Windows.

Fixes: #3705
2021-06-04 21:10:01 -04:00
Matthias Clasen
47400e4bd8 Add a helper to make case-insensitive globs
This will be used in GtkFileFilter in the future.

Tests included.
2021-06-04 21:10:01 -04:00
Matthias Clasen
8981ba4bd2 imcontext: Ignore more keysyms
It finally dawned on my that #3673 is just another
case of unexpected keysyms getting sent our way via
fringe XKB features.

Ignore them all!
2021-06-04 19:01:57 -04:00
Matthias Clasen
74a41eeb70 Merge branch 'matthiasc/for-master' into 'master'
docs: Mention <packing> in migration guide

Closes #3950 and #2271

See merge request GNOME/gtk!3630
2021-06-04 20:24:23 +00:00
Matthias Clasen
ff874318c0 Merge branch 'master' into 'matthiasc/for-master'
# Conflicts:
#   docs/reference/gtk/migrating-3to4.md
2021-06-04 20:24:09 +00:00
Matthias Clasen
a4598567b9 icontheme: Add detail to the 'not found' message
Name the icon theme we're using.

Fixes: #2271
2021-06-04 09:49:05 -04:00
Matthias Clasen
8f95661167 Clean up some comments
These XXX comments aren't useful enough to keep.
2021-06-04 09:49:05 -04:00
Matthias Clasen
e437c55142 Add a doc comment for gsk_rounded_rect_is_circular 2021-06-04 09:49:05 -04:00
Matthias Clasen
ff01067b8b Merge branch 'matthiasc/for-master' into 'master'
docs: Mention <packing> in migration guide

Closes #3950

See merge request GNOME/gtk!3629
2021-06-04 13:21:37 +00:00
Matthias Clasen
7f4630abac wayland: Add a comment
I just had to debug this to rediscover how it works, so
add a comment for next time.
2021-06-04 08:30:52 -04:00
Matthias Clasen
4c9bd6ed9a wayland: Add a comment
I just had to debug this to rediscover how it works, so
add a comment for next time.
2021-06-04 08:29:23 -04:00
Matthias Clasen
b6cd97be1e docs: Escape some xml tags
When mentioning xml tags in markdown, we must write
them as `<foo>`, or they will come out mangled.
2021-06-04 08:06:18 -04:00
Matthias Clasen
c4cbd6ec1b docs: Mention <packing> in migration guide
Add another hint for what to do with child properties.

Fixes: #3950
2021-06-04 07:59:07 -04:00
Matthias Clasen
312289fb11 docs: Mention <packing> in migration guide
Add another hint for what to do with child properties.

Fixes: #3950
2021-06-04 07:42:21 -04:00
Matthias Clasen
036dd60a4e Merge branch 'matthiasc/for-master' into 'master'
fnmatch: Support case-folding

See merge request GNOME/gtk!3628
2021-06-04 04:43:20 +00:00
Matthias Clasen
10c6c93f40 Merge branch 'gtk_combo_box_with_entry_docs_update' into 'master'
Documentation update for combo_box_new_with_entry

See merge request GNOME/gtk!3605
2021-06-04 04:02:48 +00:00
DarkTrick
4d894e08f7 Documentation update for combo_box_new_with_entry 2021-06-04 04:02:48 +00:00
Matthias Clasen
31407d0a4c Move fnmatch testcases to the testsuite
We have a well-working way to test internal
apis now, lets use it for these tests.
2021-06-03 23:58:50 -04:00
Matthias Clasen
bb53cf53e7 fnmatch: Support case-folding
This will be used in GtkFileFilter in the future.

Update all callers.
2021-06-03 23:58:21 -04:00
Matthias Clasen
da9cd4659e Merge branch 'bilelmoussaoui/markdown-links' into 'master'
docs: use markdown syntax for hyperlinks

See merge request GNOME/gtk!3589
2021-06-04 02:45:25 +00:00
Matthias Clasen
d3e6e303fc Merge branch 'GtkCellLayoutWordingImprovement' into 'master'
Added information, that "attributes" refer to CellRenderer "properties".

See merge request GNOME/gtk!3602
2021-06-04 02:21:33 +00:00
DarkTrick
a0c23b1c3d Added information, that "attributes" refer to CellRenderer "properties". 2021-06-04 02:21:31 +00:00
Matthias Clasen
50b3a952c8 Merge branch 'fix-appwindow-allocate' into 'master'
applicationwindow: Allocate tooltips

Closes #3997

See merge request GNOME/gtk!3627
2021-06-04 02:01:53 +00:00
Matthias Clasen
15b24a000d Apply 1 suggestion(s) to 1 file(s) 2021-06-04 01:53:12 +00:00
Matthias Clasen
6a509608f9 applicationwindow: Allocate tooltips
GtkApplicationWindows size_allocate does not chain
up if the menubar is visible; don't forget to allocate
the tooltip window in that case.

Fixes: #3997
2021-06-03 21:43:13 -04:00
Matthias Clasen
df6a52520c Merge branch 'matthiasc/for-master' into 'master'
Cosmetics: Eradicate gdouble

See merge request GNOME/gtk!3626
2021-06-03 21:59:26 +00:00
Matthias Clasen
578db92973 Cosmetics: Eradicate gint
Remove a handful of errant uses of gint.
2021-06-03 17:41:28 -04:00
Matthias Clasen
3ab97fac1f Cosmetics: Eradicate gdouble
Remove 3 errant uses of gdouble.
2021-06-03 17:41:28 -04:00
Matthias Clasen
e8852c9a25 Merge branch 'primary-menu-button' into 'master'
menubutton: Enable F10 for primary menus

See merge request GNOME/gtk!3580
2021-06-03 19:37:23 +00:00
Matthias Clasen
fa0b379d30 Merge branch 'wip/carlosg/no-early-popup-ungrabs' into 'master'
gdk/wayland: Break only implicit grabs on wl_pointer.leave w/ pressed buttons

See merge request GNOME/gtk!3625
2021-06-03 18:10:06 +00:00
Emmanuele Bassi
1565053842 Merge branch 'akamfoad/readme-link-fixes' into 'master'
Update broken links in README.md

Closes #4001

See merge request GNOME/gtk!3623
2021-06-03 15:23:45 +00:00
Carlos Garnacho
8288d9e87c gdk/wayland: Break only implicit grabs on wl_pointer.leave w/ pressed buttons
The releasing of grabs while a button is pressed (e.g. after starting dnd, or
dragging the window, or going to overview with a pressed button, etc...) was
generalized here in https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1879.

However we shouldn't break all grabs here. In the case of grabbing popups,
compositors will still emit crossing events between client surfaces (e.g.
popping up and selecting a menu item via press-drag-release), breaking all
grabs here means inconsistent client state, that was
https://gitlab.gnome.org/GNOME/gtk/-/issues/2746.

That was fixed in mutter, by essentially making implicit grabs
owner_events=FALSE, however that breaks the mentioned use pattern entirely.
Mutter is changing this behavior back, so GTK should handle these crossing
events.

The grab that we are interested in breaking here is the implicit pointer
one. Popups will be dismissed via other means if the compositor says their
active grab needs breaking. This still leaves dnd/move/resize drags in
one place, while not allowing #2746 to happen with popups.
2021-06-03 17:13:12 +02:00
Akam Foad
a900b30bcf Changing old Gtk4 link to the new one hosted in gtk docs 2021-06-03 14:22:06 +00:00
Akam Foad
9b671d1f79 Update broken links in README.md
Updated Release notes links from https://developer.gnome.org/gtkX/unstable/YYYY.html
to https://developer.gnome.org/gtkX/stable/YYYY.html in the README.md file in the root
folder.

Closes #4001
2021-06-03 14:02:59 +00:00
Emmanuele Bassi
c2d82c23e6 Merge branch 'ebassi/doc-fixes' into 'master'
Small doc fixes

See merge request GNOME/gtk!3622
2021-06-03 10:32:01 +00:00
Emmanuele Bassi
a88b4f517e docs: Fix link to the interactive debugging section
It's in the "running" document.
2021-06-03 09:31:13 +01:00
Emmanuele Bassi
f9f9fa6dc6 docs: Fix the license field
It's LGPL-2.1-or-later, not GPL.
2021-06-03 09:11:09 +01:00
Matthias Clasen
a1789ee2b8 Merge branch 'wip/chergert/fix-use-after-free-switcher' into 'master'
stackswitcher: clear timer when widget id disposed

See merge request GNOME/gtk!3621
2021-06-02 20:21:57 +00:00
Matthias Clasen
ffb7df2cc4 Merge branch 'macos-menubar' into 'master'
macos: fix weird menubar rendering.

Closes #3967

See merge request GNOME/gtk!3607
2021-06-02 20:13:16 +00:00
Christian Hergert
c2ca246aee stackswitcher: clear timer when widget id disposed
If the widget is disposed while the cursor has a drag timeout queued, it
can activate after finalization.
2021-06-02 10:20:32 -07:00
Matthias Clasen
80c33ca2dd Merge branch 'wip/otte/for-master' into 'master'
x11: Be more careful with NVIDIA workaround

See merge request GNOME/gtk!3620
2021-06-02 14:57:52 +00:00
Matthias Clasen
7307c6fdfb Merge branch 'entry-docs-typo' into 'master'
entry: Fix a typo in the docs

See merge request GNOME/gtk!3619
2021-06-02 11:15:10 +00:00
Matthias Clasen
039fc2e567 entry: Fix a typo in the docs 2021-06-02 06:47:27 -04:00
Matthias Clasen
1dcf9d5c95 Merge branch 'wip/exalm/treeview-click' into 'master'
treeview: Don't handle clicks on any child widgets

Closes #3996

See merge request GNOME/gtk!3618
2021-06-02 10:33:50 +00:00
Matthias Clasen
742482e0e1 Merge branch 'box-orientation' into 'master'
progressbar: Avoid redundant storage

See merge request GNOME/gtk!3617
2021-06-02 10:16:17 +00:00
Alexander Mikhaylenko
80497debbb treeview: Don't handle clicks on any child widgets
We already skip them on the edited cell widget, but it's also a problem for
header buttons. Overall, there's no real reason to let it propagate here.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3996
2021-06-02 13:49:11 +05:00
Matthias Clasen
bffc6c5b9a spinbutton: Avoid redundant storage
GtkBoxLayout stores the orientation; no need for
GtkSpinButton to duplicate that.
2021-06-01 17:37:07 -04:00
Matthias Clasen
95747b1a40 progressbar: Avoid redundant storage
GtkBoxLayout stores the orientation; no need for
GtkProgressBar to duplicate that.
2021-06-01 17:37:01 -04:00
Matthias Clasen
775dbec2e6 Merge branch 'demo-appdata' into 'master'
demos: Generate appdata

Closes #3993

See merge request GNOME/gtk!3613
2021-06-01 20:17:16 +00:00
Matthias Clasen
25ee6d3f47 demos: Generate appdata
We don't maintain a release history here, but at least
we can put in the right version and date for the current
build.

Fixes: #3993
2021-06-01 15:36:33 -04:00
Matthias Clasen
1f3f2f1dca Merge branch 'wip/chergert/switcher-orientable' into 'master'
stackswitcher: implement GtkOrientable

Closes #3988

See merge request GNOME/gtk!3606
2021-06-01 18:28:23 +00:00
Christian Hergert
c848a51395 stackswitcher: implement GtkOrientable
In GTK 3, GtkStackSwitcher implemented GtkOrientable via the parent GtkBox
type. In GTK 4, that was changed to inherit from GtkWidget and lost this
interface implementation.

This adds that back, along with a note in the documentation that the
interface was added in GTK 4.4.

Fixes #3988
2021-06-01 10:57:27 -07:00
Matthias Clasen
7d3c3cb653 Merge branch 'fix_cast_warning_adding_notebook_page' into 'master'
invalid cast from 'GtkButton' to 'GtkBox'

See merge request GNOME/gtk!3615
2021-06-01 16:18:31 +00:00
Caolán McNamara
9c79b8b877 invalid cast from 'GtkButton' to 'GtkBox'
on adding a page to a GtkNotebook

(soffice): Gtk-CRITICAL **: gtk_box_remove: assertion 'GTK_IS_BOX (box)' failed
2021-06-01 14:56:53 +01:00
Matthias Clasen
c137f4017f Merge branch 'screensaver-async-4' into 'master'
gtkapplication-dbus: Fetch inital screen saver state async

See merge request GNOME/gtk!3599
2021-06-01 11:14:38 +00:00
Matthias Clasen
c92b21b5fd Merge branch 'fix-has-actionable-function' into 'master'
texthistory: fix has_actionable function

See merge request GNOME/gtk!3612
2021-06-01 11:04:56 +00:00
liferooter
44f07f7708 texthistory: fix has_actionable function 2021-06-01 11:04:55 +00:00
Matthias Clasen
b85b4f2cd6 Merge branch 'box-orientation' into 'master'
box: Avoid redundant storage

See merge request GNOME/gtk!3611
2021-05-31 23:05:11 +00:00
Matthias Clasen
d1a7a55d7e box: Avoid redundant storage
GtkBoxLayout stores the orientation; no need for
GtkBox to duplicate that.
2021-05-31 18:38:52 -04:00
Zhi
75868dfee4 macos: fix weird menubar rendering.
As app menu has been deprecated, the function of app menu should be
merged into the menubar, which behaves like the original API of NSApp.

This also brings back the default app menu, which looks like native
macOS apps.

For future refactoring, please note that the menubar must contain at
least one menu before being set to NSApp to avoid weird menubar
rendering.

Fixes #3967.
2021-05-30 21:59:57 +08:00
Fabio Tomat
44bc9a24f8 Update Friulian translation
(cherry picked from commit a80804ccef)
2021-05-27 16:13:50 +00:00
Matthias Clasen
c9785c4cd3 Merge branch 'placeholder-alignment' into 'master'
text: Propagate xalign to the placeholder

Closes #3979

See merge request GNOME/gtk!3604
2021-05-27 11:44:33 +00:00
Matthias Clasen
9f93883dc9 text: Propagate xalign to the placeholder
This is what we were doing in GTK 3, and there's
no reason not to continue.

Fixes: #3979
2021-05-27 06:57:23 -04:00
Matthias Clasen
4362f7e6e2 Merge branch 'bilelmoussaoui/for-gi-docgen-grid' into 'master'
docs: fix gtk grid formatting

See merge request GNOME/gtk!3603
2021-05-27 10:31:24 +00:00
Bilal Elmoussaoui
90a829f25a docs: fix gtk grid formatting 2021-05-27 09:58:42 +00:00
Emmanuele Bassi
d0e29cc901 Merge branch 'bilelmoussaoui/for-gi-docgen' into 'master'
docs: fix broken links

See merge request GNOME/gtk!3601
2021-05-27 00:43:31 +00:00
Bilal Elmoussaoui
8ebdd256a5 docs: fix broken links 2021-05-27 00:18:23 +00:00
Matthias Clasen
4b5f8e6ceb Merge branch 'test-text-buffer-undo' into 'master'
Add a test for text buffer history

See merge request GNOME/gtk!3596
2021-05-26 19:33:58 +00:00
Matthias Clasen
ffbfafb189 textbuffer: Add some docs for undo
Mention what is undoable and what isn't.
2021-05-26 14:36:16 -04:00
Matthias Clasen
994a38c7ad textbuffer: Improve the docs
Add getter/setter annotations.
2021-05-26 14:36:16 -04:00
Matthias Clasen
0268c9d642 Add tests for text buffer history
Check that things can be undone.
2021-05-26 14:36:16 -04:00
Matthias Clasen
f729912913 Merge branch 'wip/chergert/fix-3977' into 'master'
textbuffer: ensure user actions are propagated to history

Closes #3977

See merge request GNOME/gtk!3600
2021-05-26 17:43:34 +00:00
Christian Hergert
6179886b14 textbuffer: ensure user actions are propagated to history
This was an oversight when porting the GtkTextHistory into GTK. We simply
need to bind the GtkTextBuffer action into the text history for grouping
to work correctly.

Fixes #3977
2021-05-26 10:11:33 -07:00
Guido Günther
3aa34c1211 gtkapplication-dbus: Fetch inital screen saver state async
Avoid a sync call that can make the application block for no good
reason.

Fixes 6bfe171058
2021-05-26 18:47:38 +02:00
Matthias Clasen
24f0ae1d39 Merge branch 'move-text-history-tests' into 'master'
Move text history tests

See merge request GNOME/gtk!3597
2021-05-26 12:01:58 +00:00
Matthias Clasen
c0ca3c642a Merge branch 'picture-nullable-setters' into 'master'
picture: Make setters actually take NULL

Closes #3974

See merge request GNOME/gtk!3598
2021-05-26 11:46:23 +00:00
Matthias Clasen
b2b044ce95 Move text history tests
We can test internal apis in our testsuite now,
so move the text history tests there, to have them
run in ci.
2021-05-26 07:34:28 -04:00
Matthias Clasen
8f4b0cd30d picture: Make setters actually take NULL
gtk_picture_set_file was claiming to be nullable,
but choked on NULL.

Fixes: #3974
2021-05-26 07:30:57 -04:00
Matthias Clasen
cbe2aa716d Merge branch 'bilelmoussaoui/for-gi-docgen-link' into 'master'
gtk: drop unwanted char on Switch::state-set docs link

See merge request GNOME/gtk!3594
2021-05-25 23:23:39 +00:00
Bilal Elmoussaoui
23ea33b656 gtk: drop unwanted char on Switch::state-set docs link 2021-05-25 20:29:46 +00:00
Matthias Clasen
ee80a22db4 Merge branch 'wip/exalm/checks' into 'master'
checkbutton: Sync the indicator state with the widget

See merge request GNOME/gtk!3568
2021-05-25 20:29:06 +00:00
Matthias Clasen
d32c343657 Merge branch 'fix.vs2013.link' into 'master'
gtk/meson.build: Fix linking on Visual Studio 2013

See merge request GNOME/gtk!3575
2021-05-25 20:27:54 +00:00
Emmanuele Bassi
90d8c94819 Merge branch 'ebassi/introspection-error' into 'master'
Turn introspection scanner warnings into errors

See merge request GNOME/gtk!3588
2021-05-25 18:51:54 +00:00
Emmanuele Bassi
e13da35d4d Turn introspection scanner warnings into errors
We want to catch errors in our annotations or our API.
2021-05-25 19:16:37 +01:00
Emmanuele Bassi
f50450485c docs: Add missing documentation on Windows
The gtk_print_run_page_setup_dialog() function, and its asynchronous
variant, are declared in the common gtkprintoperation.h header, but
implemented in different source files depending on the platform.
2021-05-25 19:16:37 +01:00
Matthias Clasen
264d08abc4 Merge branch 'ignore-nosymbol-press' into 'master'
imcontext: Ignore NoSymbol key events

Closes #3973

See merge request GNOME/gtk!3591
2021-05-25 17:44:45 +00:00
Matthias Clasen
8c441756df imcontext: Ignore NoSymbol key events
These can happen with some XKB options.

Fixes: #3973
2021-05-25 13:20:12 -04:00
Emmanuele Bassi
cdf2a9ddce Merge branch 'bilelmoussaoui/for-gi-docgen' into 'master'
gdk: fix wrong doc annotation

See merge request GNOME/gtk!3590
2021-05-25 16:23:15 +00:00
Bilal Elmoussaoui
a196a35d1d gdk: fix wrong doc annotation 2021-05-25 16:07:51 +00:00
Yuri Chornoivan
aeda5b2f58 Update Ukrainian translation 2021-05-25 13:19:55 +00:00
Bilal Elmoussaoui
02672a521a docs: use markdown syntax for hyperlinks 2021-05-25 13:14:01 +00:00
Emmanuele Bassi
da1e43c1e6 Merge branch 'ebassi/docs-fixes' into 'master'
Enable fatal warnings for gi-docgen

See merge request GNOME/gtk!3587
2021-05-25 12:57:28 +00:00
Emmanuele Bassi
6d06b0f076 Enable fatal warnings when build the docs
We want to fail the CI pipeline when the documentation generator emits a
warning.
2021-05-25 13:32:32 +01:00
Emmanuele Bassi
7da2e86d4b docs: Fix the PANGO_SCALE link
The fragment for constants is `const`.
2021-05-25 13:31:49 +01:00
Matthias Clasen
1f99723a9f Merge branch 'fix-im-reset' into 'master'
imcontextsimple: Fix a possible problem

See merge request GNOME/gtk!3584
2021-05-25 12:09:38 +00:00
Matthias Clasen
c3c16bd2be Merge branch 'matthiasc/for-master' into 'master'
doc: Syntax fixes

See merge request GNOME/gtk!3583
2021-05-25 11:57:48 +00:00
Matthias Clasen
4c2761302a doc: Syntax fixes
No, we can't have links that say [constructor@...] or
[mehtod@...] or [methoc@...] or [methos@...] or [metohd@...].
And no, not [signals@...] either.
2021-05-25 07:33:55 -04:00
Emmanuele Bassi
3d19b1108a Merge branch 'bilelmoussaoui/gi-docgen-link-fix' into 'master'
gtk: fix gi-docgen link type

See merge request GNOME/gtk!3582
2021-05-25 11:26:08 +00:00
Bilal Elmoussaoui
4728d7b70b gtk: fix gi-docgen link type
constructors are supposed to use "ctor" as a link type, not new
2021-05-25 09:25:32 +00:00
Matthias Clasen
cbd34cd239 Merge branch 'quartz-elide-underscores' into 'master'
Bring back elide_underscores

See merge request GNOME/gtk!3581
2021-05-24 22:55:10 +00:00
Matthias Clasen
d0ca4a1255 imcontextsimple: Fix a possible problem
We were forgetting to handle the compose sequence
case in reset().
2021-05-24 18:53:14 -04:00
Matthias Clasen
16623d4e71 quartz: Elide underscores again
We don't want a literal _File to show up in the
global menubar on OS X, so use the revivied
_gtk_elide_underscores.

Related: #3967
2021-05-24 17:39:05 -04:00
Matthias Clasen
dab7ceaa24 Bring back elide_underscores
This used to live in gtktoolbar.c, which is gone.
We still need it, so put it in gtkprivate.c.
2021-05-24 17:37:05 -04:00
Matthias Clasen
a74420bc1a menubutton: Enable F10 for primary menus
Add a ::primary property to GtkMenuButton, which can
be set to make the menu activatable with F10, like
menubars.
2021-05-24 17:27:40 -04:00
Emmanuele Bassi
b05f3f5614 Merge branch 'gallery-reflow-fix' into 'master'
docs: Convince the widget gallery to reflow

See merge request GNOME/gtk!3579
2021-05-24 15:44:26 +00:00
Matthias Clasen
808e5421a9 docs: Convince the widget gallery to reflow 2021-05-24 10:51:02 -04:00
Matthias Clasen
f1f225c6b3 Merge branch 'gst.gl.win32' into 'master'
media/gstreamer: Support using GL for video for Windows

See merge request GNOME/gtk!3506
2021-05-24 11:37:06 +00:00
Chun-wei Fan
16f307b305 media-gstreamer: Provide fallback mode for playback
Make the "gl-context" property of the GstGLSink readable as well so that
we can query whether the GstGLContext sharing really succeeded.  If it
did, then we proceed to playback our video using the glimagesink as we
did before.  If it didn't, throw out the GtkGstSink we were creating, and
re-create the GtkGstSink without the "gl-context" property, meaning that
we won't be using the glimagesink in this case.
2021-05-24 19:04:37 +08:00
Chun-wei Fan
ccdec5da77 gtkgstsink.c: Support EGL on Windows as well
Add support to look for and use the EGL context in Windows if it was activated
instead of desktop OpenGL.

GstGL may have been built with or without EGL/libANGLE support, so if it were,
check in GstGL whether we have gst_gl_display_new_with_type() to create a
GstGLDisplay that is of the GST_GL_WINDOW_WIN32 type when we are using
Desktop OpenGL (WGL), otherwise we show messages indicating that envvars
need to be set to initialize GstGL properly.

Due to a bug in GstGL, the GstGLContext can only be set up successfully
if one of the following is true:

*  An OpenGL 3.x or later emulator, such as Mesa is used (for WGL)
*  The latest GstGL master is being used, at the time of writing (for
   WGL)
*  GTK, libepoxy and GstGL are all built only with WGL support (for WGL)
*  EGL is being used in GTK at runtime

Special thanks to Matthew Waters for the help during the process.
2021-05-24 19:04:14 +08:00
Chun-wei Fan
52d1c0c271 media/gstreamer: Support using GL for video for Windows
Add support to share the WGL context in GDK with the WGL context in GStreamer,
so that we can also use OpenGL in the gstreamer media backend to playback
videos.  For now OpenGL/ES is not supported for this under Windows.

The process of setting this up in Windows is a little bit more involved, as:

*  The OpenGL support in GstGL requires a GL 4.1 Core context, but we may just
   get the GL version from wglCreateContextAttribsARB() that we pass into the
   attributes, which is 3.2 by default.  So, try to ask for a 4.1 Core context
   first if we are asking for anything less.

*  There is only one GstDisplay available for Windows, so we just use
   gst_gl_display_new().

*  We must explicitly tell libepoxy that we are using wglMakeCurrent() outside
   of libepoxy that is being used in GdkGL, otherwise we would end up crashing
   as the GL/WGL function pointers would become invalid.

*  We must also deactivate temporarily the underlying WGL context that was made
   current by gdk_gl_context_make_current() so that when
   gst_gl_display_create_context() calls wglShareLists(), we won't get bitten
   by error 0xaa (resource busy), as some drivers don't handle this well when
   the GL context is current in another thread.

For the last two points we make use of macros defined by the platforms that the
build is done for to help us carry out the necessary tasks as needed.

Thanks to Matthew Waters for the info on integrating GstGL and windowing
toolkits on Windows.
2021-05-24 16:36:40 +08:00
Chun-wei Fan
943559da67 gtk/meson.build: Fix linking on Visual Studio 2013
Visual Studio 2013's linker does not suport `/WHOLEARCHIVE:`, so just
explicitly extract the objects from the static libraries that will
form the final GTK DLL.
2021-05-24 10:30:34 +08:00
Matthias Clasen
21057fb857 Merge branch 'focusable-fixes' into 'master'
label: Fix mnemonic activation

Closes #3965

See merge request GNOME/gtk!3578
2021-05-23 15:53:27 +00:00
Matthias Clasen
281bb5e2c4 treeviewcolumn: Use focusable when we mean it
The focusable property has taken over the role that
can-focus had in GTK 3.
2021-05-23 11:20:00 -04:00
Matthias Clasen
eb61f0fc63 treeexpander: Use focusable where we mean it
This does not fix keyboard activation for tree expanders,
but it is more correct than using can-focus.
2021-05-23 11:20:00 -04:00
Matthias Clasen
105b12f807 togglebutton: Fix mnemonic activation
We want to grab the focus when we're focusable, so
look at the focusable property.
2021-05-23 11:20:00 -04:00
Matthias Clasen
882893259d floxbox: Fix focus navigation
We want to find focusable children, so we need to look at
the focusable property, not at can-focus. This is a change
from GTK 3, where can-focus was the correct property to
look at.
2021-05-23 11:20:00 -04:00
Matthias Clasen
052917a67d label: Fix mnemonic activation
The intention of the code is to find a focusable ancestor,
so it needs to look at the focusable property, not at
can-focus. This is a change from GTK 3, where can-focus
was the correct property to look at.

Fixes: #3965
2021-05-23 11:19:40 -04:00
Matthias Clasen
226edf1f91 Merge branch 'matthiasc/for-master' into 'master'
demos: Clean up doc comments

See merge request GNOME/gtk!3574
2021-05-23 02:14:01 +00:00
Matthias Clasen
be944053e0 docs: More syntax fixes
The syntax for interface links is [iface@...], not
[interface@...].
2021-05-22 21:21:10 -04:00
Matthias Clasen
71aac48042 docs: More syntax fixes
[`func@Foo`] is not the right link syntax either.
2021-05-22 21:20:10 -04:00
Matthias Clasen
8bcc6b1d96 docs: Fix up syntax
There's no [type_func@...[ syntax, it is all [func@...].
2021-05-22 20:56:14 -04:00
Matthias Clasen
40f292cb13 docs: Sync up debug flag information 2021-05-22 20:46:59 -04:00
Matthias Clasen
601a8de422 treemodel: Cosmetic docs changes 2021-05-22 20:46:59 -04:00
Matthias Clasen
fe564318b6 sortlistmodel: Cosmetic docs changes 2021-05-22 20:46:16 -04:00
Matthias Clasen
09244edc15 expression: Cosmetic docs changes 2021-05-22 17:28:10 -04:00
Matthias Clasen
f5f8f83e3e textbuffer: Cosmetic docs changes 2021-05-22 17:25:27 -04:00
Matthias Clasen
74a39bbae0 textview: Cosmetic docs changes 2021-05-22 17:25:27 -04:00
Matthias Clasen
3ab34ffdc0 text: Cosmetic docs fixes 2021-05-22 17:25:26 -04:00
Matthias Clasen
13a93489b7 widget: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
b35e02db20 shortcutscontroller: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
6cb4dda5d6 gdk: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
2d12a7d9ee directorylist: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
9a7e4f4304 eventcontroller: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
876104835e sorter: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
786e28fec0 filter: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
b617ba1c82 docs: Refer to backend APIs
Add links to the backend api docs.
2021-05-22 17:25:26 -04:00
Matthias Clasen
252edbdbc6 docs: Fix a typo 2021-05-22 17:25:26 -04:00
Matthias Clasen
0bba3610c5 docs: Avoid stairstepping
If you don't put empty lines between the items in a
definition list, markdown helpfully stairsteps them.
We don't want that!
2021-05-22 17:25:26 -04:00
Matthias Clasen
fc9f580fd3 docs: Update GSK_RENDERER docs
This did not mention the opengl and ngl values yet.
2021-05-22 17:25:26 -04:00
Matthias Clasen
91f7b9663f gtk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Matthias Clasen
2d266d107b gsk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Matthias Clasen
fff2b3c710 gdk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Benjamin Otte
5af6c37f8c x11: Be more careful with NVIDIA workaround
Check that we are indeed running inside an Xorg server before enabling
the workaround.

XWayland or other nested X servers deadlock when that workaround is
applied.
2021-05-22 01:43:31 +02:00
Matthias Clasen
2d0957b732 docs: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-21 15:34:47 -04:00
Matthias Clasen
0996552708 demos: Clean up doc comments
These don't show up anywhere, but might still clean
them up.
2021-05-21 13:53:38 -04:00
Piotr Drąg
620787e56b Update POTFILES.in 2021-05-21 14:28:58 +02:00
Matthias Clasen
f5bd9f721c Merge branch 'wip/exalm/check-activate' into 'master'
checkbutton: Don't allow to uncheck radios by activating them

See merge request GNOME/gtk!3569
2021-05-21 02:06:58 +00:00
Matthias Clasen
345edb8a89 Merge branch 'doc-tweaks' into 'master'
Fix documentation syntax

See merge request GNOME/gtk!3572
2021-05-21 01:18:58 +00:00
Matthias Clasen
4a0d3d7acc docs: Reduce redundancy
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.

This adds a few missing nullable annotations too.
2021-05-20 20:45:06 -04:00
Matthias Clasen
7fe0610b68 introspection: Stop using allow-none
allow-none has been deprecated for a long time
already. Instead use optional and nullable everywhere.
2021-05-20 19:17:49 -04:00
Matthias Clasen
8ba16eb4f1 Documentation fixes
Mostly fixing up indentation of continuation lines,
and other small cleanups.
2021-05-20 19:17:49 -04:00
Matthias Clasen
ab6a5be0f8 Fix documentation syntax
Properties use : in their link syntax.
2021-05-20 19:16:59 -04:00
Matthias Clasen
94b0907534 Merge branch 'wip/exalm/switch-icons-2' into 'master'
icons: Fix switch-off icon

See merge request GNOME/gtk!3571
2021-05-20 22:49:29 +00:00
Alexander Mikhaylenko
0017b4b69a icons: Fix switch-off icon
It wasn't converted to paths and so wasn't rendered correctly.
2021-05-20 23:36:30 +05:00
Matthias Clasen
430be6f2a9 Merge branch 'popover-docs' into 'master'
popover: Update docs

Closes #3960

See merge request GNOME/gtk!3570
2021-05-20 13:55:47 +00:00
Matthias Clasen
bff7ac4a1d popover: Update docs
Remove mention of show/hide animations, and mention
cascading close instead.

Fixes: #3960
2021-05-20 09:18:47 -04:00
Alexander Mikhaylenko
fb6c6c85bf checkbutton: Don't allow to uncheck radios by activating them
Do the same check as when clicking.
2021-05-20 14:38:33 +05:00
Yuri Chornoivan
894adea2f7 Update Ukrainian translation 2021-05-20 07:29:07 +00:00
Yuri Chornoivan
0e1d6fbbbc Update Ukrainian translation 2021-05-20 07:27:43 +00:00
Alexander Mikhaylenko
bad01edd2c checkbutton: Sync the indicator state with the widget
Clicking the whole check button toggles it, so make sure the hover and
active states are propagated to the indicator like in GTK3.
2021-05-20 12:17:45 +05:00
Matthias Clasen
e9ca8d689f Merge branch 'bilelmoussaoui/gdk-return-error-annotation' into 'master'
gdk: annotate Content Serialize/Deserialize return_error

See merge request GNOME/gtk!3567
2021-05-20 03:54:15 +00:00
Bilal Elmoussaoui
c5eb2f5d16 gdk: annotate Content Serialize/Deserialize return_error 2021-05-19 18:10:34 +00:00
Benjamin Otte
7db87a8889 Merge branch 'fix-gst-media-file' into 'master'
gtkgstmediafile: Remove media-info-updated callback

Closes #3913

See merge request GNOME/gtk!3565
2021-05-19 16:22:35 +00:00
Ivan Molodetskikh
12a9a0faf7 gtkgstmediafile: Remove media-info-updated callback
Instead, rely on position-updated which is also called always, and also
a little later than media-info-updated, giving GstPlayer time to figure
out more of the video info. Tested on local and remote mount videos,
images, sound files.

Works around / fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3913,
https://gitlab.gnome.org/GNOME/gtk/-/issues/3914.
2021-05-19 18:55:37 +03:00
Matthias Clasen
fc321d8282 Merge branch 'matthiasc/for-master' into 'master'
Actually pass the devel profile to flatpak builds

See merge request GNOME/gtk!3563
2021-05-18 11:42:33 +00:00
Matthias Clasen
7d27c615b7 Actually pass the devel profile to flatpak builds
I added that to the manifests, and did not notice that
we do the last build step manually :(
2021-05-18 07:38:18 -04:00
Matthias Clasen
7de266a620 Merge branch 'wip/carlosg/sequence-accepted-in-group' into 'master'
gtkgesture: Apply gesture group state after setting up sequence

Closes #3946

See merge request GNOME/gtk!3560
2021-05-18 10:58:19 +00:00
Matthias Clasen
4cbc5ed20a Merge branch 'fix-gen-demo-conf' into 'master'
Fix generating demo_conf.h on builds without GIT in PATH

See merge request GNOME/gtk!3562
2021-05-18 10:31:57 +00:00
Chun-wei Fan
c18a1ac1a1 gen-demo-header.py: Fix running without git
The script assumes that the git program is in the PATH which may not be always
the case, so if git was not found, fallback to the former behavior of making
VCS_TAG an empty string if the profile option was not set to 'devel'.

Also fix the call to the script so that we do indeed call GIT on the source GIT
repo so that we can get the right short SHA1 sum.

Re-organize the code a bit in the process, so that things seem cleaner.
2021-05-18 11:25:20 +08:00
Matthias Clasen
ab6e4bfc8d Merge branch 'wip/carlosg/reset-after-grab' into 'master'
Fixes to GTK grab notification

Closes #3942

See merge request GNOME/gtk!3561
2021-05-17 23:35:26 +00:00
Carlos Garnacho
6b7b232114 gtkwindow: Fix "shadowed" checks for GTK grabs
We iterate here from the target widget up the toplevel checking
for the previous and new grab, there's however 2 bugs here:
- The check for is_shadowed was different to the check for was_shadowed
- The loop started with the assumption that the widgets did not hold
  a grab, just to change it if the grab widget was found. (or maybe
  it's the other way around? it's unclear with the differing checks
  for past/present state).

Make these checks consistent, and ensure we start with the right
assumption for the past/present grabbing state, and accounting that
new/old grab widgets may or may not be part of the pick stack.
2021-05-18 00:16:55 +02:00
Carlos Garnacho
0a5d21ca9e gtkwindow: Rename function
With gtk_grab_notify_foreach() just taking care of emitting crossing
notifications due to the GTK grab change, rename it to a more apt
gtk_synthesize_grab_crossing().
2021-05-18 00:16:48 +02:00
Carlos Garnacho
f003a4c6cc gtkwindow: Simplify GTK grab notification
The _gtk_widget_grab_notify() function just (maybe) did a) reset
controllers and b) hide toplevels. The second part was a testing
remnant introduced in commit 024d832d94, not part of the original
fix.

Do the former more concisely, called from the place where we figure
out whether a widget's ability to receive events changed due to
GTK grabs. It's across those changes that we are interested in
resetting the controllers.

With the gestures being reset both ways, GtkWindowHandle (and
probably other) gestures are now able to reset after a GTK grab
takes input away (e.g. GtkMenuButton). This could be seen as
a sudden jump the next time they'd be dragged with the mouse,
as the gesture would "resume" the previous interaction.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3942
2021-05-18 00:16:48 +02:00
Carlos Garnacho
53df32e6cf gtkgesture: Apply gesture group state after setting up sequence
When a new sequence is added to a GtkGesture, its state is looked
in other gestures in the same group, and made to match in this
gesture. This however happened a bit too early, before the
gesture touchpoint was fully set up. As this may result in signal
emission and whatnot, it's a good idea to make it happen with a
fully set up touchpoint.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3946
2021-05-18 00:16:12 +02:00
Matthias Clasen
8670034c86 Merge branch 'ebassi/rev-parse-fallback' into 'master'
build: Check CI envvars before rev-parse

See merge request GNOME/gtk!3559
2021-05-17 21:13:04 +00:00
Emmanuele Bassi
c1fbf654a0 build: Check CI envvars before rev-parse
The CI pipeline does not do a full clone, so we cannot use `git
rev-parse` to get the short SHA checksum for the current commit.

Of course, since nothing's ever easy, we cannot use vcs_tag() with a
custom command, so we need to generate our out `demo_conf.h` header
straight from a script.
2021-05-17 21:34:13 +01:00
Matthias Clasen
9066078928 Merge branch 'wip/exalm/activatable2' into 'master'
theme: Specificity bump for dropdowns

See merge request GNOME/gtk!3558
2021-05-17 20:10:12 +00:00
Alexander Mikhaylenko
4f16e661cf theme: Specificity bump for dropdowns
Fix a fallout from d56711b5d8
2021-05-17 23:26:08 +05:00
Matthias Clasen
45b85767c4 Merge branch 'wip/exalm/activatable' into 'master'
listitemwidget: Have .activatable style class if the item is activatable

See merge request GNOME/gtk!3557
2021-05-17 15:56:02 +00:00
Alexander Mikhaylenko
d56711b5d8 listitemwidget: Have .activatable style class if the item is activatable
Match GtkListBox, so it's possible to use the same styles for them.

Update GtkListView and GtkGridView docs to reflect that, fix a few gtk-doc
formatting leftovers along the way.
2021-05-17 18:10:35 +05:00
Matthias Clasen
df28a57ae3 Merge branch 'matthiasc/for-master' into 'master'
ngl: Add padding between cached glyphs

See merge request GNOME/gtk!3555
2021-05-17 12:12:22 +00:00
Matthias Clasen
04bac8ef2a testsuite: Run some installed tests exclusively
My suspicion is that the clipboard (and some other)
installed test interferes with others, because the
clipboard is a shared resource.
2021-05-17 07:16:42 -04:00
Matthias Clasen
7ad193787e Merge branch 'wip/exalm/emojichooser' into 'master'
emojichooser: Set selection-mode=none on the toolbar flowbox

See merge request GNOME/gtk!3556
2021-05-17 11:10:33 +00:00
Alexander Mikhaylenko
27e662cfd1 emojichooser: Set selection-mode=none on the toolbar flowbox
Selection is never used there, avoid unwanted selected states if clicking
outside the buttons.
2021-05-17 14:09:03 +05:00
Pawan Chitrakar
661a572d82 Update Nepali translation
(cherry picked from commit 597a624fc5)
2021-05-16 07:41:56 +00:00
Matthias Clasen
66b4f0cac4 ngl: Reuse texture coordinates
When uploading glyphs, reuse the position that
we get from gsk_ngl_texture_library_pack, instead
of recomputing it.
2021-05-15 22:23:14 -04:00
Matthias Clasen
81e0206465 ngl: Be consistent about padding
Make gsk_ngl_texture_library_pack always return
the position including the padding. And compute
texture coordinates accurately in all cases (we
were fudging the padding for standalone textures.
2021-05-15 22:21:26 -04:00
Matthias Clasen
cb1babeeba ngl: Add padding between cached glyphs
Without this, adjacent items in the cache sometimes
bleed into the texture for a glyph.
2021-05-15 22:15:05 -04:00
Matthias Clasen
67dc778b8f Merge branch 'gst-egl-optional' into 'master'
meson: Do not enforce GStreamer EGL lib

See merge request GNOME/gtk!3554
2021-05-15 14:21:09 +00:00
Rafał Dzięgiel
bbd4ee2986 meson: Do not enforce GStreamer EGL lib
GStreamer EGL headers are handled by GstGL lib.
No need to additionally import them.
2021-05-15 14:03:23 +02:00
Kjartan Maraas
42b2eae532 Update Norwegian Bokmål translation
(cherry picked from commit d952fa48e7)
2021-05-15 07:35:38 +00:00
Matthias Clasen
0902f45d71 Merge branch 'gst-x11-egl' into 'master'
gtkgstsink: Support EGL under x11

See merge request GNOME/gtk!3553
2021-05-14 19:57:05 +00:00
Rafał Dzięgiel
c51eb7665e gtkgstsink: Support EGL under x11
Add support for EGL under x11 windowing system to GStreamer sink
2021-05-14 19:29:00 +02:00
Matthias Clasen
1a426d6fff Merge branch 'ebassi/issue-3948' into 'master'
x11: Loosen the match for the NVIDIA driver

Closes #3948

See merge request GNOME/gtk!3549
2021-05-14 10:50:59 +00:00
Matthias Clasen
07b5072c9c Merge branch 'matthiasc/for-master' into 'master'
inspector: Use new get_egl_display apis

See merge request GNOME/gtk!3546
2021-05-14 00:40:05 +00:00
Matthias Clasen
3a0febfe79 Merge branch 'offscreen-fixes' into 'master'
Add some more transform tests

See merge request GNOME/gtk!3551
2021-05-14 00:38:52 +00:00
Matthias Clasen
8e7bc8d742 Improve transformed offscreen rendering
Preserve the scale for 2D transforms to
avoid a pixellated appearance.
2021-05-13 19:37:16 -04:00
Matthias Clasen
809299f9e4 Add some more transform tests
Test that gsk_transform_to_affine works.
2021-05-13 19:37:16 -04:00
Matthias Clasen
c391cf38e2 testzoom: Fix the in-place rotate 2021-05-13 19:37:16 -04:00
Matthias Clasen
8c75e6896e inspector: Use new get_egl_display apis
This makes the code a bit more concise.

Also, get WGL information when we are using it.
2021-05-13 15:25:18 -04:00
Emmanuele Bassi
b3d6928f35 x11: Pair eglInitialize with eglTerminate
If we bail out after EGL initialization we want to go back to a stable
state and not leave EGL hanging.
2021-05-13 18:23:50 +01:00
Emmanuele Bassi
3d8ba93f59 x11: Loosen the match for the NVIDIA driver
It seems nVidia puts a different string in the GL_VENDOR than the one it
uses for GLX.
2021-05-13 18:22:30 +01:00
Emmanuele Bassi
889bf83020 Merge branch 'ebassi/boost-url' into 'master'
Update the URL for the Boost archive

See merge request GNOME/gtk!3548
2021-05-13 11:47:28 +00:00
Emmanuele Bassi
6c63f7b0e2 Update the URL for the Boost archive
The old URL seems to have failed, and now it returns 301.

Use the URL from the Boost website.
2021-05-13 11:29:22 +01:00
Matthias Clasen
3872c3a127 Merge branch 'fix-picking-with-transforms' into 'master'
Fix picking with transforms

See merge request GNOME/gtk!3547
2021-05-13 10:09:37 +00:00
Matthias Clasen
5be785bff8 Add a transform test
This reveals some issues with scale handling.
2021-05-12 21:50:32 -04:00
Matthias Clasen
bf454e948d Fix picking with transforms
When transforms include scales, we weren't picking
children properly. The special-case in gtk_widget_do_pick
only applies to 2D translations.
2021-05-12 20:58:16 -04:00
Emmanuele Bassi
e66ec84c1e Merge branch 'ebassi/issue-3945' into 'master'
docs: Fix indentation of the arguments

Closes #3945

See merge request GNOME/gtk!3544
2021-05-12 20:12:13 +00:00
Matthias Clasen
6537728c7b Merge branch 'wip/chergert/fix-gi-typo' into 'master'
gdk: fix typo in G-I attribute

See merge request GNOME/gtk!3545
2021-05-12 18:43:33 +00:00
Matthias Clasen
95f3f8f3c4 Merge branch 'win32.egl.getter' into 'master'
Win32: Add EGLDisplay getter

See merge request GNOME/gtk!3543
2021-05-12 18:42:35 +00:00
Christian Hergert
ae9b4f8940 gdk: fix typo in G-I attribute 2021-05-12 10:53:56 -07:00
Emmanuele Bassi
8ef353a970 docs: Fix indentation of the arguments
The indentation of new lines inside documentation blurbs must be smaller
than 4 spaces, otherwise the Markdown parser will consider the line to
be part of a pre-formatted code block.

Fixes: #3945
2021-05-12 17:38:07 +01:00
Chun-wei Fan
6d33e9058c Win32: Add EGLDisplay getter
Like what was done for Wayland and X11, add an API to retrieve the EGLDisplay
if one is being used in place of WGL.
2021-05-12 22:16:56 +08:00
Matthias Clasen
78852b181a Merge branch 'ebassi/egl-display-get' into 'master'
Add backend-specific getter for the EGLDisplay

See merge request GNOME/gtk!3542
2021-05-11 12:42:50 +00:00
Emmanuele Bassi
2588f9cee6 wayland: Add EGLDisplay getter
Getting an EGLDisplay object is messy; might as well expose the function
we use internally to save some time, just like we did for the X11
backend.
2021-05-11 12:46:03 +01:00
Emmanuele Bassi
abc2d7e4a9 x11: Add EGLDisplay getter
Getting an EGLDisplay object is messy; might as well expose the function
we use internally to save some time.
2021-05-11 12:42:16 +01:00
Emmanuele Bassi
6189e343f3 build: Do not use C arguments with C++
Otherwise the C++ compiler will start to complain.

The C++ keyword test does not need additional warnings.
2021-05-11 12:24:34 +01:00
Matthias Clasen
8bfa182ed9 Merge branch 'misc-inspector-things' into 'master'
inspector: Show text direction

See merge request GNOME/gtk!3541
2021-05-11 10:51:31 +00:00
Matthias Clasen
ea162ed016 inspector: Avoid a crash with GL variants
When configuring the inspector display, preserve
debug flags that affect which GL variant we pick.
Otherwise, we may end up with a GLX context on the
default display, and an EGL context on the inspector
one. This hopelessly confuses libepoxy, and things
don't go well when that happens.
2021-05-10 21:25:08 -04:00
Matthias Clasen
e2aa161590 inspector: Show EGL info for X11 as well 2021-05-10 21:24:50 -04:00
Matthias Clasen
a723baec4b inspector: Show text direction
This is not a property, so show it on the misc tab.
2021-05-10 20:55:43 -04:00
Emmanuele Bassi
6120519e8e Merge branch 'ebassi/egl-x11' into 'master'
Prefer EGL to GLX for the GL support on X11

See merge request GNOME/gtk!3540
2021-05-10 22:51:11 +00:00
Emmanuele Bassi
69856a9aac x11: Don't update GLX visuals with EGL
We're going to get into a messy situation, with both GLX and EGL
initialized.

If we're already using EGL, skip the whole cache.
2021-05-10 21:19:14 +01:00
Matthias Clasen
564d835fba Merge branch 'broadway-display-scale' into 'master'
broadway: Add a setter for display scale

Closes #3934

See merge request GNOME/gtk!3538
2021-05-10 20:11:38 +00:00
Emmanuele Bassi
c35a6725b9 x11: Always fall back to GLX on NVIDIA
At least until we can guarantee that EGL-X11 works fine there.
2021-05-10 20:44:35 +01:00
Emmanuele Bassi
a57f79006a x11: Move the damage fences into the GLX code
It's GLX-specific anyway, there's no need to complicate things by having
half the code in the generic path, and half in the GLX one.
2021-05-10 20:44:35 +01:00
Emmanuele Bassi
6600b0b507 x11: Add debug toggle for preferring GLX
Mostly as a way to compare the EGL and GLX implementations.
2021-05-10 20:44:35 +01:00
Emmanuele Bassi
9a19e3c741 x11: Add profiler marks for SwapBuffers 2021-05-10 20:44:35 +01:00
Emmanuele Bassi
8924d614c0 x11: Use EGL for GL support
This makes the X11 backend similar to the Wayland one, when it comes to
OpenGL.

Fall back to GLX only if EGL support is not available.
2021-05-10 20:44:35 +01:00
Emmanuele Bassi
03f76eccf5 x11: Decouple GLX from GdkX11GLContext
If we want to add an EGL implementation for the X11 backend, we are
going to need to move the GLX bits into their own class. The first step
is to declare GdkX11GLContext as an abstract type, and then subclass it
into a GdkX11GLContextGLX type, which includes the whole GLX
implementation.
2021-05-10 20:44:35 +01:00
Matthias Clasen
b13c2e17f1 inspector: Support scale changes on Broadway 2021-05-10 10:55:41 -04:00
Matthias Clasen
7c1c8c53e7 Merge branch 'ci-more-clang' into 'master'
ci: Add clang-extra-tools to the image

See merge request GNOME/gtk!3539
2021-05-10 13:26:54 +00:00
Matthias Clasen
497b843e76 ci: Add clang-extra-tools to the image
Hurray for bite-size packages! Splitting
this off broke our style check in ci.
2021-05-10 08:52:12 -04:00
Matthias Clasen
7745f67583 broadway: Add a setter for display scale
This is useful when using Broadway as a headless
display server.

Fixes: #3934
2021-05-10 07:19:26 -04:00
Matthias Clasen
374225ae6a Cosmetics 2021-05-09 19:32:48 -04:00
Matthias Clasen
7259be35b0 Merge branch 'file-replace-trap' into 'master'
print-editor: Fix saving

See merge request GNOME/gtk!3536
2021-05-09 23:06:49 +00:00
Matthias Clasen
1601e204f4 Merge branch 'wip/exalm/image-button' into 'master'
Ensure consistent header bar buttons in the demo and tests

See merge request GNOME/gtk!3537
2021-05-09 23:06:25 +00:00
Alexander Mikhaylenko
43e33b2990 test: Ensure .image-button on header bar buttons 2021-05-09 20:55:26 +05:00
Alexander Mikhaylenko
7ebd9291d9 demo: Ensure .image-button on header bar buttons 2021-05-09 20:53:05 +05:00
Alexander Mikhaylenko
5d59415c2d test: Use more appropriate back/forward icons 2021-05-09 20:52:48 +05:00
Alexander Mikhaylenko
c5d2d89930 demo: Use more appropriate back/forward icons 2021-05-09 20:35:39 +05:00
Matthias Clasen
0108ffe059 inspector: Fix saving css
g_file_replace_contents() does not accept -1
as length, unlike similar apis.
2021-05-09 11:19:43 -04:00
Matthias Clasen
087935f160 print-editor: Fix saving
g_file_replace_contents() does not accept -1 as
length, unlike similar apis.
2021-05-09 11:19:43 -04:00
Matthias Clasen
fef9f1187d Merge branch 'matthiasc/for-master' into 'master'
fontbutton: Quote font family names

See merge request GNOME/gtk!3534
2021-05-09 14:43:03 +00:00
Matthias Clasen
83c9a24855 Merge branch 'wip/exalm/actionbar' into 'master'
GtkActionBar spacing fixes

See merge request GNOME/gtk!3535
2021-05-09 14:40:19 +00:00
Alexander Mikhaylenko
435a8f6337 theme: Fix GtkActionBar spacing 2021-05-09 17:01:36 +05:00
Alexander Mikhaylenko
2c8e4573f2 actionbar: Fix the css node docs 2021-05-09 16:55:48 +05:00
Alexander Mikhaylenko
b45721373a action-bar: Add start and end style classes to GtkActionBar boxes
Make it possible to add spacing to them from the theme without affecting
the center child should it happen to be a box.
2021-05-09 16:54:59 +05:00
Matthias Clasen
e0ebf4e401 fontbutton: Quote font family names
Otherwise, spaces in family names will trip up
the css parser.
2021-05-08 20:54:50 -04:00
Matthias Clasen
dc878f24d2 Merge branch 'emoji-full-locale' into 'master'
emoji: Try to load emoji data using both language and territory

See merge request GNOME/gtk!3531
2021-05-08 02:07:18 +00:00
Matthias Clasen
be1f9b2cb0 Merge branch 'wip/carlosg/map-emulated-moveresize-window' into 'master'
gdk/x11: Ensure to map the non-ewmh moveresize emulation window before use

See merge request GNOME/gtk!3529
2021-05-07 14:55:16 +00:00
Marco Trevisan (Treviño)
0769dfbd32 emoji: Try to load emoji data using both language and territory
When loading the emoji data we just try to get the data for a language
while there may be territory specializations and emojibase provides
them.

So, split the loading function and try to load the data for the fully
defined language string (i.e. `it-ch`) before loading the generic one
for the language (i.e. `it`) and eventually falling back to the generic
english.
2021-05-07 16:10:29 +02:00
Carlos Garnacho
081e127377 gdk/x11: Ensure to map the non-ewmh moveresize emulation window before use
Otherwise, we don't deem it as able to be grabbed, which we intend to do
immediately after.
2021-05-07 15:51:52 +02:00
Matthias Clasen
17a799aeb2 Merge branch 'matthiasc/for-master' into 'master'
Add some calendar tests

See merge request GNOME/gtk!3528
2021-05-07 12:57:55 +00:00
Matthias Clasen
a3f5283018 Add some calendar tests
Check that the getters and setters work as documented.

This tests the fix in 1f8985e476.
2021-05-07 07:52:11 -04:00
Matthias Clasen
633d783f0c Merge branch 'carlosgc/calendar-day' into 'master'
calendar: value of day property is shifted by 1

See merge request GNOME/gtk!3524
2021-05-07 11:42:59 +00:00
Matthias Clasen
451a5fb6d4 Merge branch 'fix-3918' into 'master'
demos: Mark non-static signal handler symbols for export

Closes #3918

See merge request GNOME/gtk!3523
2021-05-07 11:08:57 +00:00
Matthias Clasen
3ad7d304bd Merge branch 'update-emoji-data' into 'master'
emoji: Update data to CLRD v39

See merge request GNOME/gtk!3520
2021-05-07 11:05:46 +00:00
Carlos Garcia Campos
7b2b8b86e1 calendar: do not allow to set 0 as day
We no longer unselect the current day when 0 is set, so update the
documentation and the property definition.
2021-05-07 12:13:49 +02:00
Carlos Garcia Campos
1f8985e476 calendar: value of day property is shifted by 1
The day is a number between 1 and 31 and that's what we get from
GDateTime.
2021-05-07 11:10:36 +02:00
Chun-wei Fan
efb875daef demos: Mark non-static signal handler symbols for export
The symbols in the .ui files for the signal handlers and functions must be
exported so that the system can pick them up during execution.

Fixes #3918.
2021-05-07 10:38:02 +08:00
Matthias Clasen
59cc3a9f86 Merge branch 'hidden-mnemonics-fix' into 'master'
label: Make hidden mnemonics work again

See merge request GNOME/gtk!3518
2021-05-07 00:34:33 +00:00
Matthias Clasen
febd143ac8 Merge branch 'emoji-data-prefix-fix' into 'master'
emoji: Use a portable and configuration-dependent path to load the data

See merge request GNOME/gtk!3522
2021-05-06 15:33:15 +00:00
Matthias Clasen
e00785e958 Merge branch 'macos' into 'master'
Fix building both X11 and Quartz backends on macOS

See merge request GNOME/gtk!3508
2021-05-06 15:26:49 +00:00
Marco Trevisan (Treviño)
4a4525a65d emoji: remove duplicated include 2021-05-06 16:00:06 +02:00
Marco Trevisan (Treviño)
c98dd1afb9 emoji: Use a portable and configuration-dependent path to load the data
Load the emojis data in all the platforms, respecting the configured
GTK_DATA_PREFIX
2021-05-06 16:00:06 +02:00
Dan Cîrnaț
12d591178e Fix compilation of c++ test: cpp_args
The correct meson argument for c++ is cpp_args.
Remove unnecessary(?) "-Idummy-headers" - breaks build
2021-05-06 10:38:41 +02:00
Dan Cîrnaț
bd7b29a6c4 Only compile gtkmountoperation-stub if the X11 backend is not enabled 2021-05-06 10:38:41 +02:00
Dan Cîrnaț
13b94dab10 Conditional check for gdesktopappinfo header
GDesktopAppInfo is not available on macOS and needs to be disabled
2021-05-06 10:38:41 +02:00
Marco Trevisan (Treviño)
ba3cbac21a emoji: Update data to CLRD v39
This is based on version 6.2.0 of emojibase, containing CLRD 39

http://cldr.unicode.org/index/downloads/cldr-39
https://github.com/milesj/emojibase/blob/b3c9a78/packages/data/CHANGELOG.md
2021-05-06 05:08:37 +02:00
Matthias Clasen
d94c386320 label: Make hidden mnemonics work again
The change in 875a92b95f made labels strip
out underlines earlier, but overlooked that this made
mnemonics not work before the timeout to show them
has passed. That was unintentional. Make mnemonics
work regardless of their visibility, again.
2021-05-05 22:55:52 -04:00
Matthias Clasen
4e2a263c1f Merge branch 'introspection-test' into 'master'
Add an introspection api test

See merge request GNOME/gtk!3514
2021-05-06 00:52:06 +00:00
Matthias Clasen
6a24e0c7c3 Add an introspection api test
Every beginning is small... just check one constant for now.
2021-05-05 19:18:32 -04:00
Matthias Clasen
c8eeb46aa5 Merge branch 'update-ci-to-f34' into 'master'
WIP ci: Update the image to Fedora 34

See merge request GNOME/gtk!3516
2021-05-05 23:17:07 +00:00
Matthias Clasen
d143f76568 Merge branch 'msvc-ci' into 'master'
ci: Add MSVC build

See merge request GNOME/gtk!3486
2021-05-05 23:16:39 +00:00
Matthias Clasen
930ff499ee Confine -mf16c to a single source file
We can't use this flag for any code that may get run
outside the __builtin_cpu_supports() check, and meson
doesn't allow per-file cflags. So we have to split this
code off into its own static library.
2021-05-05 18:58:23 -04:00
Xavier Claessens
f4dc24c3da Meson: gdk-pixbuf jpeg/png options changed to feature 2021-05-05 16:40:57 -04:00
Matthias Clasen
399fb76652 ci: Add pygobject to the images
This will let us add introspection tests in the future.
2021-05-05 16:31:03 -04:00
Matthias Clasen
de056a3319 ci: Show OS release for our containers 2021-05-05 16:22:32 -04:00
Matthias Clasen
bafa23fa2c Add debug spew to gdk tests 2021-05-05 15:41:46 -04:00
Matthias Clasen
ab725b4ba9 Merge branch 'wl-phys-transform' into 'master'
gdk/wayland: Take transform into account when setting physical size

See merge request GNOME/gtk!3515
2021-05-05 15:23:26 +00:00
Xavier Claessens
d8f44c06e8 ci: Add MSVC build
This script is copied from glib CI.
2021-05-05 09:16:36 -04:00
Guido Günther
e40c869d0d gdk/wayland: Take transform into account when setting physical size
Width and height of a GdkMonitor are derived via wl_output which
talks about physical dimensions of a device and compositors usually
implement this as the untransformed values (e.g. weston, wlroots).

Since the GTK client has no way to figure out if a monitor was rotated,
transform the physical dimensions according to the applied wayland
transform to have the physical dimensions match the logical ones.

Mutter flips the physical dimensions itself but doesn't announce the
transform so this shouldn't break anything there.
2021-05-05 14:55:07 +02:00
Matthias Clasen
3591da517a Disable another font-challenged reftest 2021-05-05 08:17:26 -04:00
Matthias Clasen
014fb41448 Help the compiler out
gcc says: error: iteration 2147483649 invokes undefined behavior
                            [-Werror=aggressive-loop-optimizations]
which of course, never happens because ncols is always >= 2.
Add some assertions to tell the compiler.
2021-05-05 08:17:26 -04:00
Matthias Clasen
24072f26ca ci: Update the image to Fedora 34
This is in preparation to using mutter --headless
for tests.
2021-05-05 08:17:26 -04:00
Matthias Clasen
65017a0031 Merge branch 'bilelmoussaoui/trick-gir-list-position' into 'master'
gtk: trick g-ir scanner to add INVALID_LIST_POSITION

See merge request GNOME/gtk!3513
2021-05-05 00:04:16 +00:00
Bilal Elmoussaoui
dc5aab62c8 gtk: trick g-ir scanner to add INVALID_LIST_POSITION
without it, the define doesn't get picked in the introspection data
2021-05-05 00:45:21 +02:00
Matthias Clasen
a3cccbeb53 Merge branch 'wip/exalm/text-handles' into 'master'
texthandle: Add a contents css node

Closes #3475

See merge request GNOME/gtk!3511
2021-05-04 21:40:48 +00:00
Matthias Clasen
cee6525213 Merge branch 'fix-reftest' into 'master'
Fix the icon-effect-missing reftest

See merge request GNOME/gtk!3512
2021-05-04 21:03:30 +00:00
Matthias Clasen
4f81dc1eaf Fix the icon-effect-missing reftest
This was comparing the included image-missing icon
with the one in the current icontheme on the test
system. Works fine as long as we don't change
the icons (which we just did). To avoid this, set
the icontheme to hicolor for this test, which does
not have the image-missing icon, so we end up getting
the builtin icon for both ui files.
2021-05-04 16:21:37 -04:00
Alexander Mikhaylenko
0e58bfe90e texthandle: Add a contents css node
Allow to theme it including using css transforms to avoid having assets.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3475
2021-05-04 23:53:05 +05:00
Matthias Clasen
e3e0342db7 Merge branch 'wip/exalm/switch-icons' into 'master'
icons: Fix switch icon names

Closes #3920

See merge request GNOME/gtk!3509
2021-05-04 16:18:29 +00:00
Matthias Clasen
b1f12a0535 Merge branch 'wip/exalm/icons' into 'master'
Update icons from adwaita-icon-theme

Closes #2656

See merge request GNOME/gtk!3510
2021-05-04 16:18:00 +00:00
Alexander Mikhaylenko
60f4b07196 icons: Update from adwaita-icon-theme
Also add the missing edit-clear RTL variant.
2021-05-04 19:12:04 +05:00
Alexander Mikhaylenko
4c60dac9cb icons: Remove media-playback-start-symbolic-rtl
See https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/issues/101
2021-05-04 19:12:04 +05:00
Matthias Clasen
8d14bd3339 Merge branch 'wip/exalm/css-error' into 'master'
cssselector: Fix max_selector usage

Closes #3100

See merge request GNOME/gtk!3507
2021-05-04 13:17:53 +00:00
Alexander Mikhaylenko
48d95d2d7a icons: Fix switch icon names
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3920
2021-05-04 17:49:07 +05:00
Matthias Clasen
670a2be782 Merge branch 'test.msvc' into 'master'
clipboard-client.c: Include necessary headers for Windows

See merge request GNOME/gtk!3505
2021-05-04 11:53:13 +00:00
Alexander Mikhaylenko
f3633d46ca cssselector: Fix max_selector usage
Reverts 2ae8ace784 other than code style
fixes.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3100
2021-05-04 12:34:29 +05:00
Chun-wei Fan
e56754d27c clipboard-client.c: Include necessary headers for Windows
We need to include io.h and process.h for close() and exit(), as unistd.h may
not be universally available.
2021-05-04 12:12:50 +08:00
Matthias Clasen
40ebed3a03 4.3.0 2021-05-03 20:31:18 -04:00
Matthias Clasen
14ac4903b6 Fix dist script for theme reorg 2021-05-03 20:31:18 -04:00
Matthias Clasen
da613c504b Merge branch 'wip/exalm/textview-selection' into 'master'
textview: Selection rendering fixes

See merge request GNOME/gtk!3503
2021-05-03 23:55:46 +00:00
Matthias Clasen
7ac3507be2 Merge branch 'gnome-todo-dnd-crash' into 'master'
dragsource: Keep the source alive long enough

See merge request GNOME/gtk!3504
2021-05-03 21:35:55 +00:00
Alexander Mikhaylenko
316c783fce label: Update selection node and redraw on state changes
Mirror GtkText and GtkTextView.
2021-05-04 02:29:10 +05:00
Matthias Clasen
9e952bc7ff dragsource: Keep the source alive long enough
When a drop causes the event controller to be finalized
(directly or indirectly), we end up segfaulting while
trying to wrap up the drag operation. So, keep a reference
on the GtkDragSource from when the drag begins to when
it is done.

This fixes a crash in gnome-todo when dragging tasks.
2021-05-03 17:00:17 -04:00
Alexander Mikhaylenko
e4832a9e94 text: Queue redraw on state changes
Mirror GtkTextView.
2021-05-04 01:20:53 +05:00
Alexander Mikhaylenko
70ee86c951 textlayout: Clip selection bounds to the line extents
The rest of the line will be painted separately.
2021-05-04 01:08:19 +05:00
Matthias Clasen
ed97339ef1 NEWS: Updates 2021-05-03 15:38:11 -04:00
Matthias Clasen
b012a5c67e Merge branch 'static-analysis-fixes' into 'master'
Static analyis fixes

See merge request GNOME/gtk!3501
2021-05-03 19:21:42 +00:00
Matthias Clasen
642f32e14d Merge branch 'ebassi/for-master' into 'master'
Install documentation in the appropriate place

See merge request GNOME/gtk!3408
2021-05-03 19:21:18 +00:00
Matthias Clasen
7b735b88b4 Merge branch 'wip/carlosg/xdg-activation' into 'master'
gdk/wayland: Support the xdg-activation wayland protocol

See merge request GNOME/gtk!3502
2021-05-03 19:20:18 +00:00
Alexander Mikhaylenko
167134e1a8 textlayout: Support fully transparent selection text
Pango treats 0 alpha value as a unset alpha, so we have to special case it.
2021-05-04 00:16:05 +05:00
Alexander Mikhaylenko
0fa4b7a249 textview: Invalidate selection when its style changes 2021-05-04 00:16:05 +05:00
Alexander Mikhaylenko
f413d5ef22 textlayout: Only special case selection rendering for opaque colors
If the selection is partially transparent, it may still be desirable to
see the colors from tags underneath.
2021-05-04 00:16:05 +05:00
Carlos Garnacho
be4216e051 gdk/wayland: Support the xdg-activation wayland protocol
This protocol implements the IPC necessary to focus application
windows across launcher/launchee. Add support for it.
2021-05-03 17:20:50 +02:00
Matthias Clasen
fa10264759 updateiconcache: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
5fbfe5203c buildertool: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
f472cb53ae printbackendlpr: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
a49ff5a1c4 textbtree: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
faf56a8abe stack: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
e510538f37 printoperation: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
b2bf48c3f0 listbase: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
cf0330d601 filterlistmodel: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
2f51f5affe emojichooser: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
a69ae36a99 fnmatch: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
6863528df1 a11y: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
e2722f03ac x11: A few static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
1be4684441 gdktoplevelsize: Comment out some unused code
This is not currently useful, and clang complains.
2021-05-03 07:44:38 -04:00
Matthias Clasen
4a96e790b1 Merge branch 'inspector-layouts' into 'master'
Various small inspector improvements

See merge request GNOME/gtk!3500
2021-05-03 01:40:46 +00:00
Matthias Clasen
f9d6134247 inspector: Improve monitor information display
Avoid a nested listbox, show the connector,
don't show information we don't have. Also,
disconnect all signal handlers from the display
when the inspector is going away.
2021-05-02 21:02:09 -04:00
Matthias Clasen
dfecc8fe02 inspector: Show keyboard layouts 2021-05-02 21:02:09 -04:00
Matthias Clasen
2b0c474117 Add gdk_wayland_device_get_xkb_keymap
This can be useful to get more detailed information
about keyboard configuration.
2021-05-02 21:02:09 -04:00
Matthias Clasen
0f74798a82 Add 4.4 version macros 2021-05-02 21:02:09 -04:00
Matthias Clasen
ead06fdb35 Bump version to 4.3.0
We are going to add new API.

Fix up affected tests.
2021-05-02 21:01:56 -04:00
Matthias Clasen
687e589950 Merge branch 'shifted-mnemonics' into 'master'
shortcuts: Ignore consumed modifiers for mnemonics

Closes #3912

See merge request GNOME/gtk!3499
2021-05-02 23:51:41 +00:00
Matthias Clasen
945b32ca1b Merge branch 'mesa.win32.fixes' into 'master'
gdkglcontext-win32.c: Fix running with Mesa drivers

See merge request GNOME/gtk!3483
2021-05-02 22:42:35 +00:00
Matthias Clasen
0768cfb7df shortcuts: Ignore consumed modifiers for mnemonics
This is necessary to make mnemonics like Alt-1 work in
layouts where numeric keys are shifted, like AZERTY.

Fixes: #3912
2021-05-02 18:33:44 -04:00
Matthias Clasen
b5e245762d Merge branch 'more-content-serializer-tests' into 'master'
Add a test for custom serializers

See merge request GNOME/gtk!3497
2021-05-02 14:00:51 +00:00
Matthias Clasen
4c6c0b9099 Add a test for custom serializers 2021-05-02 09:17:20 -04:00
Matthias Clasen
23af39b5b4 Merge branch 'matthiasc/for-master' into 'master'
Add tests for content serialization

See merge request GNOME/gtk!3496
2021-05-02 04:30:19 +00:00
Matthias Clasen
a5cab71c9b Add tests for content serialization
Test that roundtripping various types of content
through a stream of a given mimetype works as
expected.
2021-05-02 00:01:57 -04:00
Matthias Clasen
d4f43f1a7c Merge branch 'matthiasc/for-master' into 'master'
contentdeserializer: Fix an oversight

See merge request GNOME/gtk!3495
2021-05-02 03:09:41 +00:00
Matthias Clasen
7ab8109ef8 contentdeserializer: Fix an oversight
The argument passed with string_deserializer must be
a charset name. Passing the mimetype there does not
make sense.
2021-05-01 22:44:41 -04:00
Matthias Clasen
0f49a5068a Merge branch 'fix-gst-type' into 'master'
gtkgstmediafile: Fix callback argument type

See merge request GNOME/gtk!3494
2021-05-01 16:06:26 +00:00
Matthias Clasen
a6e0b6e5ce Merge branch 'wip/baedert/for-master' into 'master'
clipboard tests: Add noreturn annotations where possible

See merge request GNOME/gtk!3493
2021-05-01 15:59:30 +00:00
Matthias Clasen
bf563e0926 Merge branch 'matthiasc/for-master' into 'master'
wayland: Rewrite shm format debug spew

See merge request GNOME/gtk!3492
2021-05-01 15:59:21 +00:00
Ivan Molodetskikh
03ca7081df gtkgstmediafile: Fix callback argument type 2021-05-01 18:17:40 +03:00
Matthias Clasen
97afffba4e wayland: Rewrite shm format debug spew
Rewrite this in a way that doesn't depend on kernel
header defines at the time the wayland scanner was run.

This was causing the build to break on Centos 8, where
a bunch of fourcc formats are missing.
2021-05-01 11:17:28 -04:00
Timm Bäder
6b6246f7b4 clipboard tests: Add noreturn annotations where possible
Clang complains when they are missing.
2021-05-01 17:14:23 +02:00
Matthias Clasen
f1e006c88c Merge branch 'matthiasc/for-master' into 'master'
Check for root being a GtkWindow in a few places

See merge request GNOME/gtk!3491
2021-04-30 19:29:15 +00:00
Matthias Clasen
32280090fe Check for root being a GtkWindow in a few places
These things were showing up as crashes during DND,
when the root is a GtkDragIcon. I'm sure there's more.
2021-04-30 13:45:39 -04:00
Matthias Clasen
cdd8f7cd53 Merge branch 'bilelmoussaoui/gdk-content-formats-annotations' into 'master'
gdk: add length annotation to gdk_content_formats_get_mime_types

See merge request GNOME/gtk!3488
2021-04-30 16:48:04 +00:00
Matthias Clasen
d69ac108d4 Merge branch 'clipboard-test' into 'master'
Add more clipboard tests

See merge request GNOME/gtk!3478
2021-04-30 15:25:50 +00:00
Matthias Clasen
c1b614772c Install the clipboard-client binary
It is needed for the installed test.
2021-04-30 09:59:58 -04:00
Bilal Elmoussaoui
ec38e53249 gdk: add zero-terminated annotation to content_formats_get_gtypes 2021-04-30 15:43:33 +02:00
Bilal Elmoussaoui
e473e7a83a gdk: fix content_formats_get_mime_types annotation 2021-04-30 15:43:17 +02:00
Matthias Clasen
5636384449 Skip clipboard tests when they don't work
On headless weston, we have no seat, so focusing
the window won't work, and thus claiming the clipboard
won't either. Skip the tests in that case.
2021-04-30 09:17:39 -04:00
Matthias Clasen
f72ca060b5 Run gdk tests with an unset D-Bus address
If the session bus address is unset, GLib will
helpfully try to autolaunch a bus, which will
fail and timeout. If we set an empty address,
it gives up early.
2021-04-30 08:10:48 -04:00
Matthias Clasen
6482954c6e Fix the clipboard test under X11
We don't have a signal handler to worry about here.
2021-04-30 08:02:35 -04:00
Matthias Clasen
e1a0e4bfbe Make clipboard tests run installed
Use dedicated data files, and install them.
As usual, to run the test binary by hand, you
will need to set G_TEST_SRCDIR.
2021-04-30 07:47:19 -04:00
Pawan Chitrakar
ae3ae428a0 Update Nepali translation
(cherry picked from commit 24e924720d)
2021-04-30 10:52:21 +00:00
Matthias Clasen
be42644091 Add more clipboard tests
This tests the simple cases of copying text,
files, colors or images between processes.
2021-04-30 06:48:52 -04:00
Chun-wei Fan
66e7f3b404 gdkglcontext-win32.c: Fix running with Mesa drivers
Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL/NGL on Windows using the Mesa drivers.
2021-04-29 12:12:01 +08:00
Matthias Clasen
604d171d56 Merge branch 'bookmark-fix' into 'master'
gtkplacessidebar.c: add bookmark null checking

See merge request GNOME/gtk!3479
2021-04-28 16:09:32 +00:00
Geyslan G. Bem
65575fe0d0 gtkplacessidebar.c: fix coding style
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-04-28 08:42:59 -03:00
Emmanuele Bassi
ac5f0ba341 Merge branch 'ebassi/issue-3905' into 'master'
docs: Add missing extra files for gdk4 sub-references

Closes #3905

See merge request GNOME/gtk!3481
2021-04-28 09:50:55 +00:00
Matthias Clasen
e637ed739f Merge branch 'memfd_create' into 'master'
gdk/wayland/cursor/os-compatibility: fix build when memfd_create is not available

See merge request GNOME/gtk!3480
2021-04-28 00:50:42 +00:00
Emmanuele Bassi
29382360ed docs: Add missing extra files for gdk4 sub-references
The Wayland and X11 references need the gtk-logo.svg and the urlmap.js
extra files.

Fixes: #3905
2021-04-28 01:44:47 +01:00
David Lechner
2a610267eb gdk/wayland/cursor/os-compatibility: fix build when memfd_create is not available
When building for homebrew/linuxbrew on Ubuntu 16.04, memfd_create() is
not available and causes the build to fail.

This adds a proper check for the function.
2021-04-27 11:46:39 -05:00
Geyslan G. Bem
1635998ac3 gtkplacessidebar.c: add bookmark null checking
This fixes nautilus crash and perhaps other callers issues.
Nautilus (and sometimes glib) crashes with malformed URI inside of the
bookmarks file .config/gtk-3.0/bookmarks when it has no LABEL.

This is result from the closed glib MR #2065 analysis and agreement.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2065#note_1091979

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-04-27 11:58:31 -03:00
Matthias Clasen
82f8fc3bee Merge branch 'fix-panel-monitor' into 'master'
x11: Try harder to find the right monitor

Closes #3900

See merge request GNOME/gtk!3477
2021-04-27 03:48:13 +00:00
Matthias Clasen
f37662c655 x11: Try harder to find the right monitor
If we deal with a panel, we end up with no monitor,
and crash, which isn't great and isn't necessary.

Fixes: #3900
2021-04-26 23:20:10 -04:00
Benjamin Otte
1a12ea6e5a Merge branch 'wip/otte/for-master' into 'master'
clipboard: Make sure G_TYPE_STRING is nul-terminated

Closes #3899

See merge request GNOME/gtk!3476
2021-04-26 21:15:32 +00:00
Benjamin Otte
1be899459c clipboard: Fix reading of files
Make sure writing a terminating null byte actually works and we don't
just ignore the error message.
2021-04-26 21:32:57 +02:00
Benjamin Otte
f34e3c573b clipboard: Make sure G_TYPE_STRING is nul-terminated
When reading text, we need to check we terminate the G_TYPE_STRING
string with a null byte, because the clipboard does not guarantee one.

So just append a \0 to the stream.

Fixes #3899
2021-04-26 21:32:57 +02:00
Matthias Clasen
b23529d940 Merge branch 'matthiasc/for-master' into 'master'
wayland: Print all layouts in debug spew

See merge request GNOME/gtk!3475
2021-04-26 11:59:01 +00:00
Matthias Clasen
2c34abed20 wayland: Print all layouts in debug spew 2021-04-26 00:16:41 -04:00
Pawan Chitrakar
b3b63a2c8f Update Nepali translation
(cherry picked from commit 193747fadf)
2021-04-26 01:10:45 +00:00
Jordi Mas
4a1a9b1f44 Update Catalan translation 2021-04-25 20:08:19 +02:00
Matthias Clasen
215d4cbfe5 Merge branch 'fix-x11-shadows' into 'master'
x11: Fix shadows

Closes #3896

See merge request GNOME/gtk!3473
2021-04-25 11:43:23 +00:00
Matthias Clasen
8cd8aa2cb3 Merge branch 'matthiasc/for-master' into 'master'
Mention nightly flatpaks in the README

See merge request GNOME/gtk!3474
2021-04-24 21:27:38 +00:00
Matthias Clasen
b3b9dd493e Apply 4 suggestion(s) to 1 file(s) 2021-04-24 17:47:43 +00:00
Matthias Clasen
8909ad1859 Mention nightly flatpaks in the README 2021-04-24 11:42:21 -04:00
Matthias Clasen
aa569acaa1 window: Don't let solid-csd linger
Just from reading the code, it seems that we
should unset .csd and .solid-csd at the same
time, since the are mutually exclusive and
we unset them here so realize() can set one
of them again.
2021-04-24 11:29:19 -04:00
Matthias Clasen
1c1c030b8e Simplify shadow conditions
The code in gtkwindow.c for dealing with the various
combinations of client-side decorations and client-side
shadows is entirely too complicated.

This commit does not really clean it up, but simplifies
one of the shadow conditions far enough to make some
sense.

With this change, I get the expected decorations in
all the cases I can easily reproduce locally.
2021-04-24 11:07:20 -04:00
Matthias Clasen
628d5406d7 x11: Fix shadows
Commit a2cd21cab6 changed a condition and inadvertedly
broke client-side shadows on X11. Change this back.

Fixes: #3896
2021-04-24 09:19:18 -04:00
Emmanuele Bassi
5d563fcde6 Merge branch 'a11y-properties' into 'master'
a11y: Don't sent redundant property changes

See merge request GNOME/gtk!3472
2021-04-23 12:04:47 +00:00
Matthias Clasen
b2f3a3220e a11y: Don't sent redundant property changes
We were sending a property changed event for every set
property whenever we were sending any updates.
2021-04-23 07:34:00 -04:00
Matthias Clasen
4e66e782ea Merge branch 'synthetic-motion-grab' into 'master'
gdk: Avoid synthetic motion confusion

Closes #3439

See merge request GNOME/gtk!3471
2021-04-23 03:11:36 +00:00
Matthias Clasen
d225f14657 gdk: Avoid synthetic motion confusion
Don't emit a synthetic motion event on a surface
that is grab-shadowed by a popup. This has been
known to confuse GTK, at times.

Fixes: #3439
2021-04-22 21:09:54 -04:00
Matthias Clasen
13f9ca60d5 Merge branch 'gtk4-listbox-selection' into 'master'
Allow repeated selection extension on gtklistbox

Closes #3887

See merge request GNOME/gtk!3461
2021-04-22 23:29:45 +00:00
Emmanuele Bassi
8789e78796 a11y: Update the level property for tree expanders
We already have the depth of a tree expander in order to compute the
indentation.

Fixes: #3892
2021-04-22 14:40:35 +01:00
Matthias Clasen
be927d9ce6 Merge branch 'resize-borders' into 'master'
window: Fix up resize borders

Closes #3856

See merge request GNOME/gtk!3467
2021-04-22 11:13:20 +00:00
Matthias Clasen
dcb5a74275 Merge branch 'a11y-debug' into 'master'
Some a11y improvements

See merge request GNOME/gtk!3455
2021-04-22 11:04:30 +00:00
Matthias Clasen
8f70f1449d Merge branch 'gtk4-compose-modifiers' into 'master'
imcontextsimple: Ignore more modifiers in compose

See merge request GNOME/gtk!3468
2021-04-22 10:58:24 +00:00
Matthias Clasen
b25bc36d33 Merge branch 'wip/muktupavels/solid-csd' into 'master'
theme: fix solid-csd style

See merge request GNOME/gtk!3460
2021-04-22 10:48:22 +00:00
Matthias Clasen
da4e2a2976 theme: Make solid borders look better
As pointed out by Alberts Muktupāvels, without this,
we are missing the inner edge of the frame.
2021-04-22 06:45:28 -04:00
Matthias Clasen
f8dcda80cf theme: Fix solid-csd borders
The selectors did not apply anymore.
Based on a patch by Alberts Muktupāvels.
2021-04-22 06:45:28 -04:00
Matthias Clasen
01d81ffc17 window: Make resize border size independent
Deriving the resize border size from the shadows
carries the risk that we might end up with uneven
resize borders (or none at all, on some sides).

So, justs enforce that we have a big enough shadow
width on all sides.
2021-04-22 06:45:28 -04:00
Ulli Kehrle
c78ec37d83 imcontextsimple: Ignore more modifiers in compose
Previously it was impossible to compose characters on higher levels of
some keyboard layouts as pressing the level selection key would just
exit compose mode.

Examples for affected keyboard layouts include the Latvian
apostrophe-variant "lv(apostrophe)" (latched third level), the extended
German keyboard layout "de(e1)" (latched fifth level) as well as the
multilingual Canadian keyboard layout "ca(multix)" and the German
neo-layout "de(neo)" and its descendants (shifted fifth level).

To reproduce, set a compose key and select the Latvian apostrophe layout.
Notice that you now can input [ by pressing first the ' and then the 8-key.
Then pressing <compose>'8'8 should produce ⟦, but prior to this patch it
did not.
2021-04-22 03:56:30 +02:00
Matthias Clasen
a2cd21cab6 window: Tweak resize borders
Make windows resizable in the padding and border
area of the css box as well. This naturally makes
solid-csd borders work again.
2021-04-21 21:09:09 -04:00
Matthias Clasen
760e60fa04 window: Fix up resize borders
The invisible resize borders have been wider than they
should, for a while. Go back to a size close to what
we have in GTK3.

To summarize: resize borders will be at most 12 pixels
on each size, but never wider than the windows shadow.
The resize corners have 'legs' of 24 pixels where you
still get a corner resize cursor.

Fixes: #3856
2021-04-21 20:09:38 -04:00
John Renner
81914f466d Allow repeated selection extension on gktlistbox 2021-04-21 14:18:29 -07:00
Matthias Clasen
ebd8338795 Merge branch 'im-cursor-pos' into 'master'
imcontext: Fix cursor positions

Closes #3885

See merge request GNOME/gtk!3464
2021-04-21 17:43:12 +00:00
Matthias Clasen
11d637f869 Merge branch 'wip/oholy/placesview-default-location-regression' into 'master'
placesview: Open location even if mount was not found

Closes nautilus#1811

See merge request GNOME/gtk!3435
2021-04-21 12:22:17 +00:00
Emmanuele Bassi
b24fedda49 a11y: Update the labelled-by relation of GtkTreeExpander
Whenever we change the :child property, we need to update the
labelled-by relation.
2021-04-21 11:43:16 +01:00
Emmanuele Bassi
57cc2c4918 a11y: Set state on the GtkTreeExpander widget
Instead of setting it on its internal child.
2021-04-21 11:43:11 +01:00
Matthias Clasen
15483ac9df imcontext: Fix cursor positions
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.

Fixed: #3885
2021-04-21 06:28:52 -04:00
Matthias Clasen
142984cbf7 Merge branch 'untrusted-beep' into 'master'
x11: Don't beep on untrusted displays

Closes #3862

See merge request GNOME/gtk!3463
2021-04-21 10:12:39 +00:00
Emmanuele Bassi
8f9145109b a11y: Pair window:activate with window:deactivate signal
Orca needs both events in order to decide whether or not to subscribe to
other event/state changes in a window.
2021-04-21 10:22:20 +01:00
Matthias Clasen
5587ee0c30 x11: Don't beep on untrusted displays
This can trigger BadAccess, and we don't
want that.

Fixes: #3862
2021-04-20 21:42:57 -04:00
Matthias Clasen
99750ac7ed a11y: Realize notebook tabs when switching
We're not moving focus here, so we can't rely
on that to conjure the a11y objects into existence.
2021-04-20 20:35:22 -04:00
Alberts Muktupāvels
f89bad7f33 theme: fix solid-csd style
Move .solid-csd style out of .csd parent and adjust it so windows
look similar / same to GTK 3 windows:
- 4px padding.
- extra shadow.

https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086351
https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086377
2021-04-20 22:02:10 +03:00
Matthias Clasen
b97d0a3940 a11y: Avoid spurious selection changed events
Only send selection-changed events when we either
had a non-empty selection before, or have one now.

This should help orca speak the right things, and
not the wrong things.

Related: #3549
2021-04-20 13:23:56 -04:00
Emmanuele Bassi
639932ad8a a11y: Emit window:activate event
Orca uses the window:activate event type to track top levels, and avoid
being spammed by events coming from non-focused windows.
2021-04-20 17:24:13 +01:00
Matthias Clasen
1a944b2824 stackswitcher: Set accessible label properties
This makes the tabs in about dialogs come out as
'About', 'Credits', and 'System', instead of
'Tab', 'Tab', 'Tab'.
2021-04-19 22:11:55 -04:00
Matthias Clasen
ae83b79984 a11y: Emit focus events
Orca relies on these to keep track of the focus location,
ignoring the focused state. With this change, orca can
once again speak text in entries as I type.
2021-04-19 21:29:17 -04:00
Matthias Clasen
5f2c08cef1 a11y: Make things appear on focus in
We are starting with a pretty empty a11y object tree,
and we want orca to bring more of it into existence
by navigating the tree. But that only happens when we
send it events. Primarily focus events, which come in
from GTK via the platform_change mechanism. So realize
the context when we are sending platform_changes,
otherwise, orca never gets the mesage.
2021-04-19 20:39:32 -04:00
Matthias Clasen
119d0b666c Merge branch 'fix-uri-crash' into 'master'
Fix a possible crash in gtk_show_uri

Closes #3883

See merge request GNOME/gtk!3457
2021-04-19 21:09:44 +00:00
Matthias Clasen
ce2a433ca1 Fix a possible crash in gtk_show_uri
g_file_get_basename can return NULL.
Deal with it somehow.

Fixes: #3883
2021-04-19 16:49:02 -04:00
Matthias Clasen
a455db01a0 a11y: Actually set accessible roles
With most context realization happening inside
GtkAtspiContext in response to D-Bus calls, the
code in gtk_widget_realize_at_context that sets
the role is not executed for most accessibles,
causing them to be stuck with the 'filler' role
that makes orca ignore them.

To fix this, split gtk_widget_realize_at_context
into the actual context realization (getting on
the bus) and the setting of widget-specific
properties, and do the latter part when the
widget is rooted.

This makes accerciser report proper roles for
entries and buttons. Orca still has an issue
with getting the hierarchy populated.
2021-04-19 19:22:20 +01:00
Matthias Clasen
9e8187bdc4 a11y: Track window states more closely
Orca ignores events unless the object is inside an object
with role window and states ACTIVE and SHOWING. To arrange
for this, introduce a new ACTIVE platform state, and set it
for windows when they are active.

This gets orca to be a lot more talkative.
2021-04-19 19:22:20 +01:00
Matthias Clasen
9fbd11e1be a11y: Add the root object to the cache
Not 100% sure this is necessary, but maybe it helps
to get orca up to speed.
2021-04-19 19:22:20 +01:00
Matthias Clasen
aa09737d4d atspicontext: Remove an unused field
We don't make any use of the cache field, so drop it.
2021-04-19 19:22:20 +01:00
Matthias Clasen
435ed3158c Merge branch 'wip/exalm/shader' into 'master'
gsk: Fix shader gresource paths

See merge request GNOME/gtk!3453
2021-04-19 18:01:44 +00:00
Pawan Chitrakar
72600516b9 Update Nepali translation
(cherry picked from commit 2a8fd6a488)
2021-04-19 16:00:38 +00:00
Pawan Chitrakar
fbc8317c5c Update Nepali translation
(cherry picked from commit 4e243d7d12)
2021-04-19 15:58:08 +00:00
Alexander Mikhaylenko
ae7f380396 gsk: Fix shader gresource paths
They were never updated after having been moved.
2021-04-19 20:01:33 +05:00
Piotr Drąg
2e031e47dd Update Polish translation 2021-04-18 12:44:35 +02:00
Emmanuele Bassi
dbe4543969 Merge branch 'gtksecurememory-updates' into 'master'
gtksecurememory: Request that secure memory not be dumped to disk

See merge request GNOME/gtk!3452
2021-04-17 23:46:38 +00:00
Jason Francis
b27ec5ebde meson: check for madvise() 2021-04-17 19:30:20 -04:00
Matthew Garrett
6622ebb310 gtksecurememory: Request that secure memory not be dumped to disk
Linux 3.4 added support for the MADV_DONTDUMP option to madvise(), which
requests that the covered memory not be included in coredumps. It makes
sense to use this to prevent cases where application crashes could
result in secrets being persisted to disk or included in dumps that are
uploaded to remote servers for analysis. I've avoided making this fatal
since there's a chance this code could be built on systems that have
MADV_DONTDUMP but run on systems that don't.
2021-04-17 19:29:42 -04:00
Matthias Clasen
1530c90e37 Merge branch 'a11y-debug' into 'master'
testatcontext: Print out platform changes

See merge request GNOME/gtk!3451
2021-04-17 16:39:20 +00:00
Matthias Clasen
a804e4bd8c a11y: Add more debug spew
This is in an attempt to figure out why orca won't speak.
2021-04-17 12:00:17 -04:00
Matthias Clasen
a04ce41799 testatcontext: Print out platform changes
This helps debugging what changes orca sees.
2021-04-17 12:00:11 -04:00
Matthias Clasen
5e3e1dd6ba Merge branch 'matthiasc/for-master' into 'master'
image, picture: Move pixbuf code to gdkpixbufutils

See merge request GNOME/gtk!3449
2021-04-16 23:51:10 +00:00
Matthias Clasen
379bb6c9f5 placesview: Fix server mount feedback
We weren't properly resetting the in-entry progress.
2021-04-16 19:34:24 -04:00
Matthias Clasen
3df3a0499f placesview: Fix mounting remote locations
This was broken by a stupid copy-paste error.
2021-04-16 19:17:37 -04:00
Matthias Clasen
0d308d09f3 mountoperation: Some cosmetics
Fix up the dialog minimally.
2021-04-16 19:05:14 -04:00
Matthias Clasen
1331d5cf97 cssimageurl: Remove direct pixbuf use
Rely on the gdkpixbufutils api that gives us
a paintable.
2021-04-16 18:27:40 -04:00
Matthias Clasen
91f3f5c63b image, picture: Move pixbuf code to gdkpixbufutils
This cleans up and moves the code to load files
while taking the scale into account. Along the way,
we drop the last uses of GdkPixbufAnimation, and
consolidate the pixbuf using code in one place.
2021-04-16 18:27:40 -04:00
Matthias Clasen
486a2c9651 Merge branch 'matthiasc/for-master' into 'master'
pixbufutils: Remove an unused function

See merge request GNOME/gtk!3447
2021-04-16 15:16:48 +00:00
Matthias Clasen
05af726446 Merge branch 'wayland-xdg-surface-setup' into 'master'
wayland: Don't duplicate xdg_surface setup code

See merge request GNOME/gtk!3191
2021-04-16 15:16:28 +00:00
Jonas Ådahl
36347b21e6 Merge branch 'wayland-parent-shadow-refactor' into 'master'
wayland: Avoid directly accessing shadow property of parent surface

See merge request GNOME/gtk!3190
2021-04-16 14:34:42 +00:00
David Keijser
db8bf5e7b9 wayland: Don't duplicate xdg_surface setup code 2021-04-16 16:23:16 +02:00
David Keijser
5bbdf3a807 wayland: Avoid directly accessing shadow property of parent surface 2021-04-16 16:13:07 +02:00
Matthias Clasen
08b101ace8 pixbufutils: Remove an unused function 2021-04-16 09:19:06 -04:00
Matthias Clasen
5e53c0473a Merge branch 'latest.glib.msvc' into 'master'
Fix builds against latest stable GLib with MSVC

See merge request GNOME/gtk!3443
2021-04-16 12:25:43 +00:00
Matthias Clasen
9d1e5aa0dc Merge branch 'fix-focus-unsetting' into 'master'
window: Fix deferred focus unsetting

Closes #3413

See merge request GNOME/gtk!3446
2021-04-16 11:47:44 +00:00
Matthias Clasen
4d19de4e03 window: Fix deferred focus unsetting
In commit 4a76abffd4, we deferred unsetting focus
and default until after the next draw, overlooking the
case where the focus is set to another widget before we
ever get to the unsetting.

Fixes: #3413
2021-04-16 07:35:26 -04:00
Chun-wei Fan
153019a794 GTK: Fix builds against latest stable GLib with MSVC
GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.
2021-04-16 11:39:24 +08:00
Chun-wei Fan
8df32e93be GSK: Fix builds against latest stable GLib with MSVC
GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.
2021-04-16 11:39:17 +08:00
Chun-wei Fan
14632e11da GDK: Fix builds against latest stable GLib with MSVC
GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.
2021-04-16 11:39:09 +08:00
Matthias Clasen
24cd05672e Merge branch 'im-context-event-leak' into 'master'
imcontext: Eat key events during preedit

See merge request GNOME/gtk!3440
2021-04-15 22:16:49 +00:00
Matthias Clasen
74a68a5803 Merge branch 'theme-fallback-fix' into 'master'
themes: Make fallback work a bit better

See merge request GNOME/gtk!3441
2021-04-15 21:31:09 +00:00
Matthias Clasen
9f6b3e179f themes: Make fallback work a bit better
One case we did not include in fd329e0ec5 is

Adwaita-dark -> Default:dark

It turns out that it is needed.
2021-04-15 17:09:46 -04:00
Matthias Clasen
20fb64704d imcontext: Eat key events during preedit
Avoid passing through random key press or release
events while we are showing preedit. That prevents
'accidents' like typing Ctrl-. bringing up the
Emoji chooser during preedit, or hitting Ctrl-a
after the Compose key moving the 'dot' around in
vim in terminals.
2021-04-15 16:59:02 -04:00
Matthias Clasen
9b7f927b3c Merge branch 'demo-manpages' into 'master'
meson: only build demo manpages when demos are enabled

See merge request GNOME/gtk!3438
2021-04-15 11:15:24 +00:00
Matthias Clasen
eb3df6a2e8 Merge branch 'theme-icon-filter-fixes' into 'master'
theme: Use -gtk-icon-filter for full-color icons

See merge request GNOME/gtk!1990
2021-04-15 11:12:28 +00:00
nana-4
c6483d431f theme: Use -gtk-icon-filter for full-color icons
Not for symbolic icons.

Don't apply `-gtk-icon-filter: opacity(0.5);` to the symbolic icons as
they already have the "gray" colors indicating the disabled state.
Symbolic icons can be styled using the `color` property.

Also remove the obsolete comment.
2021-04-15 18:39:08 +09:00
Eli Schwartz
e5b0d225de meson: only build demo manpages when demos are enabled
Installing them even when manpages are enabled, but the demos are
disabled, produces manpages for unavailable programs...
2021-04-13 22:55:03 -04:00
Matthias Clasen
d1d009b491 Merge branch 'x11-quiet-exit' into 'master'
x11: Be quiet on exit by default

See merge request GNOME/gtk!3436
2021-04-14 00:32:05 +00:00
Matthias Clasen
4465ee5414 Merge branch 'ngl-crash' into 'master'
ngl: Fix a rare assertion violation

Closes #3853

See merge request GNOME/gtk!3434
2021-04-13 22:02:44 +00:00
Matthias Clasen
6f11165dd1 x11: Be quiet on exit by default
The condition we check for to catch X servers going away
may not be accurate anymore, and the warning shows up in
logs, causing customers to be concerned. So, be quiet by
default, unless the user explicitly asked for a message.
2021-04-13 14:52:48 -04:00
Ondrej Holy
ddeabc7e19 placesview: Open location even if mount was not found
Some locations have to be mounted, but their mounts are not user-visible
(e.g. smb-browse). Though this is maybe a bit weird, it is how it works
for years. The problem is that the commit 267ea755, which tries to get the
default location for opening, caused regression as it doesn't expect such
possibility. Before this commit, such locations were opened without any
issue, but nothing happens currently after clicking to "Connect" except of
clearing the "Connect to Server" entry. Let's fallback to the original
location if the mount was not found to fix this regression.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1811
2021-04-13 17:33:03 +02:00
Matthias Clasen
f5d90826f3 Merge branch 'flatpak-highlight' into 'master'
flatpak: Include highlight in gtk4-demo flatpak

Closes #3867

See merge request GNOME/gtk!3433
2021-04-13 11:38:45 +00:00
Matthias Clasen
11154ba119 flatpak: Include highlight in gtk4-demo flatpak
Include the highlight utility to make syntax
highlighting work in gtk4-demo. This requires
building its dependencies as well, boost and lua.
2021-04-12 23:55:11 -04:00
Matthias Clasen
c66b030427 ngl: Fix a rare assertion violation
When we clean up the uniform allocations after a frame,
it can happen that our space requirements actually increase,
due to padding that depends on the order of allocations.

Instead of asserting that it doesn't happen, just make
it work by growing our allocation.

Fixes: #3853
2021-04-12 22:53:48 -04:00
Matthias Clasen
0c3dd0cf30 Merge branch 'testsuite-asserts' into 'master'
testsuite: Reduce the use of g_assert

Closes #3864

See merge request GNOME/gtk!3432
2021-04-13 02:46:07 +00:00
Matthias Clasen
4164abd9f7 build: Quiet the compiler
Don't use -Wnull-dereference when assertions are
disabled, since that causes the compiler to see
NULL everywhere.
2021-04-12 22:11:05 -04:00
Emmanuele Bassi
b0990aa8e2 wayland: Build with G_DISABLE_ASSERT 2021-04-12 21:26:02 -04:00
Emmanuele Bassi
a871a1bdb5 build: Don't append multiple flags as a string
The gtk_debug_cflags variable is an array, with each argument stored in
a separate string; if we add multiple arguments inside the same string
we break the escaping rules.

Fixes: #3864
2021-04-12 21:23:57 -04:00
Emmanuele Bassi
31e08d4629 gsk/ngl: Build with G_DISABLE_ASSERT enabled 2021-04-12 21:23:18 -04:00
Matthias Clasen
f98353c20b Force g_test_init to cooperate
Change all g_test_init calls in the testsuite
to avoid the macro, so they work regardless of
G_DISABLE_ASSERT.
2021-04-12 21:22:46 -04:00
Matthias Clasen
13ece4ee9b Make gtk_test_init work without assertions
The g_test_init macro 'helpfully' refuses to work when
assertions are disabled. So we just use the function.
2021-04-12 21:22:46 -04:00
Matthias Clasen
6e40f4f357 Remove assertions in tests 2021-04-12 21:22:46 -04:00
Matthias Clasen
ecfba2d31b Inspector: Fix a possible undefined use 2021-04-12 21:22:46 -04:00
Matthias Clasen
367dfee36e Fix unused variable warnings
These happen for variables which are only used
in assertions, when assertions are disabled.
2021-04-12 21:22:46 -04:00
Matthias Clasen
5e7b5fe085 gtk-demo: Avoid compiler warnings without assertions
Avoid an unused variable warning.
2021-04-12 21:22:46 -04:00
Matthias Clasen
9d3aa2cfce gsk: Avoid compiler warnings without assertions
Disabling assertions was provoking some unused variable
warnings from the compiler. Avoid these.
2021-04-12 21:22:46 -04:00
Matthias Clasen
8c156e6b80 testsuite: Reduce the use of g_assert
Stop using g_assert() in the gtk tests.
2021-04-12 21:22:46 -04:00
Matthias Clasen
4d1075a082 testsuite: Reduce the use of g_assert
Stop using g_assert() in the gsk tests.
2021-04-12 21:22:46 -04:00
Matthias Clasen
442f485591 Merge branch 'f16c.msvc' into 'master'
Fix F16C build/runtime detection on Visual Studio

See merge request GNOME/gtk!3429
2021-04-12 20:35:10 +00:00
Matthias Clasen
74238b5429 Merge branch 'testsuite-asserts' into 'master'
testsuite: Reduce use of g_assert

See merge request GNOME/gtk!3431
2021-04-12 12:47:09 +00:00
Matthias Clasen
f9fa92766b testsuite: Reduce use of g_assert
Stop using g_assert() in the css tests.
2021-04-12 08:33:41 -04:00
Matthias Clasen
90d187894d testsuite: Reduce use of g_assert
Stop using g_assert() in the reftests.
2021-04-12 08:30:56 -04:00
Matthias Clasen
03db2690e2 testsuite: Reduce use of g_assert
Stop using g_assert() in the gdk tests.
2021-04-12 08:18:00 -04:00
Chun-wei Fan
65b35457fd meson.build: Check for F16C on 32-bit Visual Studio
It is also possible to enable F16C instructions on 32-bit Visual Studio builds,
so also check for the compiler's ability to build F16C code on Visual Studio
32-bit instead of just bailing out.
2021-04-12 18:13:42 +08:00
Chun-wei Fan
d5ced21264 gsk/ngl/fp16.c: Implement runtime F16C detection on MSVC
We need to use __cpuid() to check for the presence of F16C instructions on
Visual Studio builds, and call the half_to_float4() or float_to_half4()
implementation accordingly, as the __builtin_cpu...() functions are strictly
for GCC or CLang only.

Also, since __m128i_u is not a standard intrisics type across the board, just
use __m128i on Visual Studio as it is safe to do so there for use for
_mm_loadl_epi64().

Like running on Darwin, we cannot use the alias __attribute__ as __attribute__
is also for GCC and CLang only.
2021-04-12 18:13:42 +08:00
Chun-wei Fan
6d6c8c59eb meson.build: Improve F16C detection on Visual Studio
The __builtin_cpu...() intrisics are strictly for GCC/CLang-based compilers, so
don't use them in the checking code on Visual Studio.  The test code will still
compile without this change, but will certainly fail if we want it to link.
2021-04-12 18:13:42 +08:00
Matthias Clasen
46ed7540b2 Merge branch 'ngl-shadow-fixes' into 'master'
ngl: Fix outset blurred shadows

See merge request GNOME/gtk!3427
2021-04-12 05:07:29 +00:00
Matthias Clasen
3ad56a762f Merge branch 'grouped-toggle-fix' into 'master'
togglebutton: Fix expected group behavior

See merge request GNOME/gtk!3425
2021-04-12 02:40:43 +00:00
Matthias Clasen
21a1a40555 Merge branch 'shadow-reduction' into 'master'
gsk: Don't overshadow

See merge request GNOME/gtk!3419
2021-04-12 02:39:55 +00:00
Matthias Clasen
849692b24b ngl: Fix unevenly scaled shadows
Ensure that we don't cut them off at the edges.
2021-04-11 22:35:02 -04:00
Matthias Clasen
f3bf4e4876 ngl: Don't slice unsliceable shadows
When the corners are too big to make slicing work,
don't do it, since it leads to broken results.
2021-04-11 22:10:33 -04:00
Matthias Clasen
46270d3dcd ngl: Fix a case of flipped shadow
In the non-sliced case, we were rendering the shadow
upside down.
2021-04-11 22:10:33 -04:00
Matthias Clasen
da6096faaf ngl: Add code to dump shadows
This can be helpful in understanding shadow bugs.
2021-04-11 21:13:47 -04:00
Matthias Clasen
2a7b5a5156 Merge branch 'matthiasc/for-master' into 'master'
menubutton: Propagate focus-on-click

See merge request GNOME/gtk!3424
2021-04-11 22:41:26 +00:00
Matthias Clasen
233e662294 togglebutton: Fix expected group behavior
The expectation is that a grouped button stays
active when you click it. Grouped check buttons
behave this way, and grouped toggle buttons should
too.
2021-04-11 18:29:53 -04:00
Matthias Clasen
ae41697d83 node-editor: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
e2fb59798e icon browser: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
d0fc3e166d widget-factory: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
e4ce46e75f gtk-demo: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
e2420f62fe menubutton: Propagate focus-on-click
Propagate the focus-on-click setting to the button
inside, so that setting menubuttons as !focus-on-click
works as expected. This helps for menubuttons in
header bars, where dragging on the button will otherwise
steal focus from the content.
2021-04-11 15:32:15 -04:00
Yuri Chornoivan
6712106c25 Update Ukrainian translation 2021-04-11 18:39:40 +00:00
Matthias Clasen
5b55138729 Merge branch 'matthiasc/for-master' into 'master'
some small optimizations

See merge request GNOME/gtk!3423
2021-04-11 18:23:54 +00:00
Matthias Clasen
1d9c581f10 ngl: Allow passing bounds to update_clip
update_clip only uses the bounds of the node that
we are currently passing. This opens the door to
updating the clip while handling a single node.
2021-04-11 12:54:17 -04:00
Matthias Clasen
6bfb57db16 ngl: Small optimization for shadows
When 9-slicing shadows, omit the center tile when it is
entirely contained in the outline (that is not always
the case, depending on corners and offsets).
2021-04-11 12:54:07 -04:00
Matthias Clasen
f8f2f2944f roundedrect: Speed up contains_rect and friends
gsk_rounded_rect_contains_rect was calling
gsk_rounded_rect_contains_point, which potentially
checks all four corners, for a total of up to 16
corner/point checks. But there is no need to do
more than 4 such checks to answer the question.
2021-04-11 12:52:30 -04:00
Matthias Clasen
aaf17fd3d0 ngl: Small optimization
We really want equality here.
2021-04-11 12:50:50 -04:00
Matthias Clasen
678e6fc6d6 nodeeditor: Make the help window wide enough
Make the help window wide enough to show the
tables without wrapping.
2021-04-11 12:50:34 -04:00
Matthias Clasen
fcf39170e1 Merge branch 'media-memory-leak' into 'master'
media: Fix a memory leak

See merge request GNOME/gtk!3420
2021-04-10 13:42:41 +00:00
Matthias Clasen
187072c3fa media: Fix a memory leak
This was introduced in e7dc82fa32.
2021-04-10 09:02:59 -04:00
Matthias Clasen
e6599c6c4f gsk: Don't overshadow
Reduce the cairo shadows to the same size as their GL brethren.
2021-04-09 21:47:55 -04:00
Matthias Clasen
87a8ff90d6 Merge branch 'popover-list-lockup' into 'master'
window: Defer focus setting until after paint

Closes #3725

See merge request GNOME/gtk!3417
2021-04-10 00:34:24 +00:00
Matthias Clasen
4a76abffd4 window: Defer focus setting until after paint
Commit 3dbf5038fa tried to defer focus changes
until after rendering is done. But it failed to do so, since
the toplevel ::render handler is still before rendering of
popups that are attached to that toplevel. To do this
properly, we need to do it in the AFTER_PAINT frame clock
phase.

Fixes: #3725
2021-04-09 19:44:10 -04:00
Matthias Clasen
715449695c Merge branch 'ngl-coloring-underlines' into 'master'
Optimize underlines in text

See merge request GNOME/gtk!3414
2021-04-09 15:36:21 +00:00
Matthias Clasen
d15b0afca9 Merge branch 'no-scroll-cursor' into 'master'
scrolledwindow: Stop using scroll cursors

See merge request GNOME/gtk!3416
2021-04-09 13:30:36 +00:00
Matthias Clasen
0d6bbc035d Merge branch 'ebassi/ci-docs' into 'master'
ci: Drop the split Fedora images

See merge request GNOME/gtk!3415
2021-04-09 12:35:49 +00:00
Matthias Clasen
9313d4b6b4 scrolledwindow: Stop using scroll cursors
We used to override cursor to use all-scroll while the
content is being scrolled. Unfortunately, there is several
problems with this:
- It is really only expected certain devices, and we don't
  have the device information on Wayland
- With the way cursor setting works in GTK4, non-NULL cursors
  of the content (eg the text views ibeam) win, making the
  scroll cursor not show up
- Under X11, we seem to miss scroll end events and then
  the scroll cursor gets stuck
Therefore, just remove this feature.
2021-04-09 08:26:09 -04:00
Emmanuele Bassi
ed412f43d1 ci: Drop the split Fedora images
Now that we don't need the whole of Pandoc to build our documentation,
we can go back to a single Fedora image for our CI.
2021-04-09 12:28:08 +01:00
Matthias Clasen
bfe4aea981 ngl: Add a program change counter
Count how often we change programs during a frame.
2021-04-09 00:52:18 -04:00
Matthias Clasen
0caa28c1de ngl: Optimize underlines in text
Opportunistically use the coloring program for
drawing underlines instead of the color program.
This avoids program changes in the middle of
text.

For the Emoji text scrolling benchmark, this reduces
the program changes per frame from > 1000 to around 100.
2021-04-08 23:37:51 -04:00
Matthias Clasen
d8ba4b4114 ngl: Reserve a pixel in texture atlases
This will be used for coloring from the texture.
2021-04-08 23:34:37 -04:00
Matthias Clasen
e7963945bb ngl: Fix an oversight
All the rest of debug spew goes to stderr here.
2021-04-08 23:34:37 -04:00
Matthias Clasen
e4a6101ae0 gtk-demo: Make one text scroll benchmark harder
Add underlines into the mix with the Emoji heavy
text, to see if we can optimize lines.
2021-04-08 23:34:36 -04:00
Matthias Clasen
5d0a3bd4cb Merge branch 'half-float' into 'master'
ngl: Use fp16 for colors

See merge request GNOME/gtk!3405
2021-04-09 03:34:05 +00:00
Matthias Clasen
1c2238cc2a Merge branch 'font-fallback-fix' into 'master'
wayland: Improve font setting fallback more

Closes #3838

See merge request GNOME/gtk!3412
2021-04-08 11:24:09 +00:00
Matthias Clasen
2d7169fd5f Work around compiler shortcomings on macOS
alias attributes don't work on Darwin, so
do without.
2021-04-07 22:38:47 -04:00
Matthias Clasen
885a6b8ebc gsk: Add runtime checks for F16C
Use an IFUNC resolver to determine whether we can use
intrinsics for FP16 conversion. This requires the functions
to be no longer inline.

Sadly, it turns out that __builtin_cpu_supports ("f16c")
doesn't compile on the systems where we want it to prevent
us from getting a SIGILL at runtime.
2021-04-07 22:21:23 -04:00
Matthias Clasen
9d81c129fc Add an option to disable F16C
And add a compile time check for the presence of this
CPU feature.
2021-04-07 22:21:23 -04:00
Matthias Clasen
38c6fe2ce4 Move color conversion up
Doing the color conversion early lets us reuse
the results whenever we do more than one draw
per node.
2021-04-07 21:30:43 -04:00
Matthias Clasen
7fe7b7ac7d ngl: Use a constant for (fp16)-1
No need to convert that again for every glyph.
2021-04-07 21:30:43 -04:00
Matthias Clasen
ae7f52d301 ngl: Reduce vertex storage
We only have one shader that uses the color2 attribute,
and it doesn't use the uv attribute, so save vertex
memory by putting those in the same space.

This reduce the per vertex space from 32 to 24 bytes.
2021-04-07 21:30:43 -04:00
Matthias Clasen
8b1fcb58e8 ngl: Use fp16 for colors
This reduces the size of our Vertex struct from
48 to 32 bytes. It would be nicer if we could store
the colors in fp16 format in the rendernodes, and
avoid conversion here. But this is still good.
2021-04-07 21:30:43 -04:00
Matthias Clasen
cce36ae701 wayland: Improve font setting fallback more
We may get a response from the portal that contains
no useful settings at all. In that case, we should
fallback as well.

Fixes: #3838
2021-04-07 19:24:09 -04:00
Matthias Clasen
2f0a02eecb Merge branch 'wip/carlosg/stuck-frames' into 'master'
surface: Always set PHASE_PAINT as pending when updates are scheduled

Closes #3750

See merge request GNOME/gtk!3411
2021-04-07 23:18:25 +00:00
Carlos Garnacho
07167fdf22 surface: Always set PHASE_PAINT as pending when updates are scheduled
At times (most often when closing subsurfaces that are scheduling
relayouts) the PHASE_PAINT handling gets broken with the following
sequence:

1. Surface receives wl_callback.done for the previous frame.
   Surface is thawed.
2. A new update on the surface is scheduled. PHASE_PAINT is
   requested directly on the frame clock. priv->pending_phase is
   left unset in the surface.
3. Surface gets frozen
4. Frame clock processes the update scheduled at 2. The surface
   is frozen, so paint is prevented. PHASE_PAINT is considered
   handled.
5. Compositor emits wl_callback.done again. Surface is thawed.
6. At this point the machinery is off
   - The surface didn't paint but has pending update regions
   - priv->draw_needed is set in the toplevel and other portions
     of the widget tree
   - So queueing redraws is ineffective at eventually calling
     gdk_surface_schedule_update() again on the toplevel surface.
   - We don't paint anymore, so this broken state is not flushed
     until other subsurface changes manage to schedule the missing
     update.

To fix this, always set PHASE_PAINT in priv->pending_phase when
doing gdk_surface_schedule_update(). If the frame clock turns
around before the surface is thawed, it will still be waiting to
be processed the next iteration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3750
2021-04-07 23:06:06 +02:00
Emmanuele Bassi
99c7ba7840 Install documentation in the appropriate place
We're already installing each reference into its own namespaced
directory, so we don't need to add further path elements.

Additionally, with the changes in:

  https://gitlab.gnome.org/GNOME/devhelp/-/merge_requests/20
  https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/54

we can browse the GTK API references in DevHelp.
2021-04-07 14:57:31 +01:00
Matthias Clasen
5710df685b Merge branch 'font-settings-fallback-4' into 'master'
wayland: Improve font setting fallback

See merge request GNOME/gtk!3407
2021-04-07 13:21:38 +00:00
Matthias Clasen
62f10b1b8f wayland: Improve font setting fallback
When we don't get stettings from the portal, the current
fallback is 'awful fonts'. There is no need for that. Instead,
set the fallback values to grayscale antialiasing with slight
hinting.
2021-04-07 08:50:14 -04:00
Matthias Clasen
d50d55228b Merge branch 'textview-last-line' into 'master'
textview: Fix a problem with the last line

Closes #3835

See merge request GNOME/gtk!3403
2021-04-06 16:15:55 +00:00
Matthias Clasen
288a5d4151 textview: Fix a problem with the last line
Sometimes, we missed the last line for display.

Fixes: #3835
2021-04-06 11:09:05 -04:00
Matthias Clasen
748b8497c9 Merge branch 'matthiasc/for-master' into 'master'
window: Actually enable the inspector by default

Closes #3831

See merge request GNOME/gtk!3401
2021-04-05 19:05:15 +00:00
Matthias Clasen
303ff60d5e modelbutton: Avoid a crash
We may not have a popover menu ancestor. The check for
this was forgotten in one of the branches here.

Fixes: #3831
2021-04-05 14:06:42 -04:00
Matthias Clasen
b79eb55b34 window: Actually enable the inspector by default
427d216081 changed the default in the schema,
but didn't handle cases where the schema isn't found.
2021-04-05 11:54:37 -04:00
Matthias Clasen
0ca573142a Merge branch 'matthiasc/for-master' into 'master'
textlayout: Remove some unnecessary code

See merge request GNOME/gtk!3400
2021-04-05 13:19:29 +00:00
Matthias Clasen
a1ece16143 ngl: Fix an oversight
We were special-casing 2D affine transforms,
but overlooked even simpler transforms.
2021-04-05 08:47:53 -04:00
Matthias Clasen
2e18f1b6e3 textlayout: Remove an unused function 2021-04-05 08:47:53 -04:00
Matthias Clasen
6cf712591f textlayout: Avoid allocations for line iteration
No need to collect the lines firs, and allocate memory
for that. We can just iterate over them right away.
2021-04-04 23:42:58 -04:00
Matthias Clasen
b32cd5d328 textlayout: Introduce some locals
No need to call _gtk_text_buffer_get_btree over and over.
2021-04-04 22:44:09 -04:00
Matthias Clasen
2af99bd65e textlayout: Create the cursor snapshot on demand
We don't need it all the time.
2021-04-04 22:27:53 -04:00
Matthias Clasen
5b0ea70d1c textattributes: Small docs fix 2021-04-04 22:27:53 -04:00
Matthias Clasen
d719a3d877 textbtree: Return tags in a GPtrArray
One of the callers prefers that, it lets us avoid
copying the array in one place, and generally makes
for better code.
2021-04-04 22:27:53 -04:00
Matthias Clasen
b0df8910ba textlayout: Only get selection color once
No need to do this for every paragraph that is
inside the selection.
2021-04-04 14:20:25 -04:00
Matthias Clasen
5b8bf04035 texttag: Just use qsort
No point in trying to optimize this.
2021-04-04 14:20:25 -04:00
Matthias Clasen
58e44e296f textbtree: Inline node data handling 2021-04-04 14:20:25 -04:00
Matthias Clasen
0334d002c0 textbtree: Speed up _gtk_text_btree_find_line_top
Another place where we can avoid allocating a stack
piecemeal.
2021-04-04 14:20:25 -04:00
Matthias Clasen
d731ce49ad textbtree: Don't opencode realloc
We can just use g_realloc here.
2021-04-04 14:20:25 -04:00
Matthias Clasen
a93614409e textbtree: Speed up _gtk_text_line_char_index
No need to allocate a stack piecemeal here.
2021-04-04 14:20:25 -04:00
Matthias Clasen
214e2d14be textbtree: Avoid malloc in one place 2021-04-04 14:20:25 -04:00
Matthias Clasen
67ee6b2740 textlayout: Don't call render_para too much
render_para produces no nodes for an empty paragraph.
Don't call it over and over for those.
2021-04-04 14:20:25 -04:00
Matthias Clasen
07a3fb833c textlayout: Remove some unnecessary code
The same field is set again 2 lines down.
2021-04-04 14:20:25 -04:00
Chao-Hsiung Liao
1c419f762b Update Chinese (Taiwan) translation
(cherry picked from commit 3d3912d7f4)
2021-04-03 23:54:29 +00:00
Matthias Clasen
8d6c7b81e9 Merge branch 'matthiasc/for-master' into 'master'
gsk: Rename resource paths

See merge request GNOME/gtk!3399
2021-04-03 20:14:29 +00:00
Matthias Clasen
fcaadf6724 Merge branch 'dotted-lines3' into 'master'
Modernize error underlines

See merge request GNOME/gtk!3398
2021-04-03 20:14:13 +00:00
Matthias Clasen
ff38d8cdc0 Modernize error underlines
Implement PANGO_UNDERLINE_ERROR as a dotted line, instead of
squiggly, which looks quite dated.
2021-04-03 13:52:56 -04:00
Matthias Clasen
900a4e4d31 gsk: Move shader resources
Move the resources of each renderer to its subdirectory.
We've previously done that for the ngl renderer, but it
is better to be consistent and do it for all the renderers.
2021-04-03 08:24:58 -04:00
Matthias Clasen
ee63b84b6a gsk: Rename resource paths
Make the shaders of the gl renderer live under
/org/gtk/libgsk/gl. This is purely cosmetic.
2021-04-03 08:10:58 -04:00
Matthias Clasen
2f1ff307da Merge branch 'matthiasc/for-master' into 'master'
node test: Improve --generate

See merge request GNOME/gtk!3397
2021-04-03 03:20:17 +00:00
Matthias Clasen
a8e8e04496 settings: Make font-size changes apply immediately
We need to invalidate the style when font-size changes,
because we propagate this value through the initial
value of the CSS font-size property, and it will not
be recomputed otherwise.
2021-04-02 23:04:09 -04:00
Matthias Clasen
91bcf6f0ba immulticontext: Unset client widget on delegate change
Forgetting to do so was causing the Wayland im context
to leave behind a dead event controller. This was showing
up as a crash when closing the inspector after changing
the im-module property of a GtkText widget. The crash
was delayed until closing the inspector because the
inspector keeps a ref on the event controllers of the
currently shown widget.
2021-04-02 22:24:19 -04:00
Matthias Clasen
a228b2de64 imwayland: Name event controllers
This helps with debugging.
2021-04-02 22:24:00 -04:00
Matthias Clasen
cb18437908 widget-factory: Name an event controller
This helps with debugging.
2021-04-02 22:23:34 -04:00
Matthias Clasen
23dab885cd text: Name all event controllers
This helps with debugging.
2021-04-02 22:23:03 -04:00
Matthias Clasen
e7284c23da inspector: Support copying nodes to clipboard
Add a button that copies the serialization of the
selected node to the clipboard.
2021-04-02 21:38:14 -04:00
Matthias Clasen
1e1f199b56 node-editor: Support pasting the image
Add a button that copies the image to the clipboard.
2021-04-02 21:24:59 -04:00
Matthias Clasen
efb5e793a4 nodeparser: Change the serialization
Arrange things so that non-child parameters
are always printed before the children. This
greatly helps with readability, which really
suffers when there's hundreds of lines of indented
children between the node start and its parameters.

Update all affected tests.
2021-04-02 20:38:32 -04:00
Matthias Clasen
f2edf40e48 node test: Improve --generate
This is a pet peeve of mine: When we call
g_test_init() before handling --generate,
the random seed spew pollutes the output.
Highly annoying. I've fixes many test binaries
over the years, but more keep popping up.
2021-04-02 20:35:39 -04:00
Matthias Clasen
7cb99a0866 Merge branch 'fix-downscaled-textures' into 'master'
ngl: Fix downscaled textures

See merge request GNOME/gtk!3395
2021-04-03 00:18:48 +00:00
Matthias Clasen
36da7c3075 Merge branch 'matthiasc/for-master' into 'master'
comboboxtext: Remove misleading docs

Closes #3824

See merge request GNOME/gtk!3396
2021-04-03 00:04:36 +00:00
Matthias Clasen
a3b69f1101 Merge branch 'fix-initial-font-selection' into 'master'
fontchooser: Fix initial font selection

Closes #3687

See merge request GNOME/gtk!3392
2021-04-02 23:45:59 +00:00
Matthias Clasen
9f2d1ff264 comboboxtext: Remove misleading docs
The entry is no longer accessible.
The docs were outdated.

Fixes: #3824
2021-04-02 19:44:30 -04:00
Matthias Clasen
8d603dfe99 ngl: Avoid huge intermediate textures
Instead of rendering the unclipped child to a texture
(and risking blowing the texture size limit, and bad
downscaling), just render the clipped region, and live
with the fact that we can't cache the rendered texture.

This avoid bad artifacts when scrolling long textviews
in rounded clips.
2021-04-02 19:33:44 -04:00
Matthias Clasen
3ff04976e3 ngl: Plug a memory leak
This was introduced in f9457af128.
2021-04-02 18:41:53 -04:00
Matthias Clasen
54ff4fd45f ngl: Fix downscaled textures
It is not pretty, but at least it works now.
2021-04-02 18:33:01 -04:00
Matthias Clasen
0d135d90f0 Merge branch 'flat-button-activating' into 'master'
button: Style .keyboard-activating on frameless buttons

See merge request GNOME/gtk!3394
2021-04-02 18:50:16 +00:00
Chris Mayo
ffa9814dd0 button: Style .keyboard-activating on frameless buttons
The use of the keyboard-activating CSS class for buttons was added
in [1], but the style did not apply to buttons with has-frame=FALSE.

[1] 00923615f4 ("button: Add back visual feedback for keynav", 2021-04-01)
2021-04-02 19:24:51 +01:00
Nathan Follens
a2fec9134b Update Dutch translation
(cherry picked from commit a356bf6fac)
2021-04-02 18:09:34 +00:00
Matthias Clasen
8caadaf404 fontchooser: Fix initial font selection
The change in 740559a54f to populate the list incrementally
broke initial font selection. Fix that, by trying to select
until the incremental filling is done.

Fixes: #3687
2021-04-02 01:06:23 -04:00
Matthias Clasen
469228fcd7 Merge branch 'theme-reorg' into 'master'
Reorganize our themes

See merge request GNOME/gtk!3079
2021-04-02 03:02:49 +00:00
Matthias Clasen
fd329e0ec5 Make theme fallback working with the new names
Since we are likely going to see theme names like
Adwaita and HighContrast, make fallback work as follows:

Adwaita -> Default
Adwaita:dark -> Default:dark
HighContrast -> Default:hc
HighContrast:dark -> Default:hc-dark
HighContrastInverse -> Default:hc-dark

Other themes will fall back to Default, as before.
2021-04-01 22:02:38 -04:00
Matthias Clasen
7f4041ec30 Merge branch 'matthiasc/for-master' into 'master'
testsuite: Sort gsk compare tests

See merge request GNOME/gtk!3389
2021-04-02 00:38:55 +00:00
Matthias Clasen
5cb5bdc4eb testsuite: Sort gsk compare tests
Easier to find things that way.
2021-04-01 20:07:13 -04:00
Matthias Clasen
08913deba5 Add some more gsk tests
The css-background test contains a node pattern that
is optimized in the ngl renderer.
2021-04-01 20:06:40 -04:00
Matthias Clasen
aceeef47f4 Add one more compose test 2021-04-01 20:06:40 -04:00
Matthias Clasen
ddda0ca1db Merge branch 'button-activate-feedback' into 'master'
button: Add back visual feedback for keynav

Closes #3813

See merge request GNOME/gtk!3390
2021-04-01 23:36:32 +00:00
Matthias Clasen
00923615f4 button: Add back visual feedback for keynav
We lost the visual feedback for activating a button
via Space or Enter when the :active pseudo-state became
managed. Bring it back with a style class.

Fixes: #3813
2021-04-01 18:38:11 -04:00
Matthias Clasen
63945bc408 Merge branch 'matthiasc/for-master' into 'master'
Add one more compose test

See merge request GNOME/gtk!3388
2021-04-01 20:50:04 +00:00
Matthias Clasen
076f79745b Add one more compose test 2021-04-01 16:32:30 -04:00
Matthias Clasen
8e9effcc1e Merge branch 'us-intl-compose' into 'master'
Revert Compose sequence changes

Closes #3807

See merge request GNOME/gtk!3386
2021-04-01 20:01:06 +00:00
Matthias Clasen
7f4522a3f1 Add more compose tests
Test the sequences whose demise made people
unhappy.
2021-04-01 15:32:32 -04:00
Matthias Clasen
f98abe4400 Revert Compose sequence changes
This was breaking muscle memory of people with
the us intl keyboard layout, for important keys
such as '. The unfortunate side-effect is that
our handling of <dead_acute> is a bit hampered
by sequences that don't fit the pattern. But
such is life.

Fixes: #3807
2021-04-01 15:31:21 -04:00
Emmanuele Bassi
2ee8f676c3 Merge branch 'builder-tag' into 'master'
docs: Escape tags in GtkBuilder description

See merge request GNOME/gtk!3385
2021-04-01 18:49:38 +00:00
Chris Mayo
7216f71825 docs: Escape tags in GtkBuilder description
Fixes the tags and the rest of the gi-docgen created HTML page not being
visible in a browser.
2021-04-01 19:21:57 +01:00
Matthias Clasen
0bf3e4c25b Drop Adwaita and HighContrast themes
These themes will reappear in libadwaita in due course.
2021-04-01 12:39:30 -04:00
Matthias Clasen
e964e176f9 widget-factory: Use the new themes
Update the Style menu to switch between the variants
of the Default theme.
2021-04-01 12:27:35 -04:00
Matthias Clasen
8938b09bc9 Change the default theme to "Default"
We are not shipping Adwaita anymore.
2021-04-01 12:27:35 -04:00
Matthias Clasen
3654bcfbe8 Make the theme variants available as themes
This makes it easier to implement the theme switching
in widget-factory, since we don't have a variant setting.
2021-04-01 12:27:26 -04:00
Matthias Clasen
0dcf95b898 Reorganize our themes
Rename the included theme to Default, with 4 variants:
light, dark, hc, hc-dark. This replaces Adwaita,
Adwaita:dark, HighContrast and HighContrastInverse.
We still make the themes available under these names,
and we still set up Adwaita-dark and HighContrastInverse
as the dark variants of Adwaita and HighContrast.

The unification of the theme variants under Default
is not quite perfect; it would be nice to merge
the assets/ and assets-hc/ subdirectories and render
all assets from a single svg file.
2021-04-01 11:42:17 -04:00
Benjamin Otte
405fab8b36 Merge branch 'wip/otte/for-master' into 'master'
snapshot: scale border widths when appending border nodes

Closes #3819

See merge request GNOME/gtk!3384
2021-04-01 15:10:50 +00:00
Benjamin Otte
ef455f5c85 snapshot: Move sanity checks to a better place
Fixes cases where the sanity checks would reject valid code, like when
using GL shaders on a scaled transform.

Fixes #3819
2021-04-01 16:53:33 +02:00
Benjamin Otte
05e4cd1579 snapshot: scale border widths when appending border nodes
Found by Matthias on IRC while arguing about GtkSnapshot being too
complicated.
2021-04-01 16:37:43 +02:00
Matthias Clasen
0ea96e3b0c Merge branch 'filechooser-signal-disconnect' into 'master'
filechooserwidget: Disconnect settings signal on dispose

See merge request GNOME/gtk!3383
2021-04-01 14:25:08 +00:00
Carlos Garnacho
1e9e7bf0d9 Merge branch 'wip/exalm/overshoot-changes' into 'master'
scrolledwindow: Cancel overshoot on dimension changes

Closes #3752

See merge request GNOME/gtk!3300
2021-04-01 12:11:15 +00:00
Alexander Mikhaylenko
d7a5dedd4f scrolledwindow: Cancel overshoot on dimension changes
If we scroll down in a list that's still being filled, we hit the edge and
initiate overshoot, and then the adjustment's upper value increases. This
leads to an unwanted bounce back.

Additionally, if in a similar situation the upper value decreases, the
overscroll glow gets stuck.

Update kinetic scrolling upper and lower value on changes, and immediately
cancel it if dimensions on that side change.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3752
2021-04-01 16:37:30 +05:00
Rafał Dzięgiel
2e65416270 filechooserwidget: Reduce code duplication for disconnecting settings signal
Instead of getting current display before calling settings signal removal,
do it inside remove function and only if there is a signal connection to remove.
2021-04-01 09:36:23 +02:00
Rafał Dzięgiel
13c22e4e2f filechooserwidget: Disconnect settings signal on dispose
Settings signal was not being disconnected on dispose causing
application crash when user changed icon theme after dialog disposal.
2021-04-01 09:28:37 +02:00
Matthias Clasen
65a061f3c2 Merge branch 'ebassi/broadway-docs' into 'master'
docs: Update the Broadway instructions

See merge request GNOME/gtk!3380
2021-03-31 21:42:59 +00:00
Matthias Clasen
fc63e6856f Merge branch 'ebassi/docs-links' into 'master'
docs: Update the links to the docs of GTK dependencies

Closes #3817

See merge request GNOME/gtk!3381
2021-03-31 21:42:49 +00:00
Matthias Clasen
94747d53eb Merge branch 'offscreen-fixes' into 'master'
Offscreen fixes

See merge request GNOME/gtk!3379
2021-03-31 21:27:18 +00:00
Matthias Clasen
b5df1299ec gsk: Add another test
Compare clipped repeat nodes. Must skip cairo here
since it blurred the child by scaling after rendering.

Also skip the gl renderer, since it hasn't been fixed
for this yet. ngl passes this test.
2021-03-31 16:49:31 -04:00
Emmanuele Bassi
7bfff6c51e docs: Update the links to the docs of GTK dependencies
Use docs.gtk.org where appropriate.

Fixes: #3817
2021-03-31 20:51:27 +01:00
Emmanuele Bassi
3fdedce8f6 docs: Update the Broadway instructions
The Broadway server binary is now versioned, and it's not compatible
with the GTK3 server.
2021-03-31 20:06:54 +01:00
Matthias Clasen
6f62107656 testsuite: Rename next to ngl
Use specific names for renderers in the gsk tests.
Otherwise the tests may use the wrong renderer, or
the same renderer twice.
2021-03-31 14:59:43 -04:00
Matthias Clasen
f9457af128 ngl: Fix offscreen rendering with transforms
There was confusion here about the handling of the
modelview transform. The modelview transform we are
getting is already set up for rendering the node
we are given, so keep it - except for possible adding
an extra scale on top when the texture would otherwise
be too big.
2021-03-31 14:36:24 -04:00
Matthias Clasen
94f0a4ef2c ngl: Be explicit about offscreen clipping
Explicitly set all the input arguments.
This makes it clearer what is going on.
2021-03-31 14:34:16 -04:00
Matthias Clasen
53e75936cb ngl: Add sonme comments
The GskNglRenderOffscreen struct is a mix of in and
out arguments. Better annotate that a little bit.
2021-03-31 14:32:47 -04:00
Matthias Clasen
5f0fe09423 Merge branch 'ebassi/for-master' into 'master'
Update the gi-docgen repository

See merge request GNOME/gtk!3352
2021-03-31 11:34:56 +00:00
Benjamin Otte
9e402fa064 Merge branch 'wip/otte/for-master' into 'master'
gstmedia: Properly detect stream metadata when preparing

See merge request GNOME/gtk!3377
2021-03-30 21:54:57 +00:00
Emmanuele Bassi
d84440969a Merge branch 'ebassi/docs-ci' into 'master'
ci: Add missing graphviz dependency

See merge request GNOME/gtk!3376
2021-03-30 20:44:51 +00:00
Benjamin Otte
e7dc82fa32 gstmedia: Properly detect stream metadata when preparing
We can look at the GstPlayerMediaInfo to get all the info we care about.
2021-03-30 22:26:26 +02:00
Emmanuele Bassi
f1b3492700 ci: Add missing graphviz dependency
We generate the hierarchy graph for GTK types, and in order to do so, we
need the dot utility from graphviz in the CI image.
2021-03-30 21:08:43 +01:00
Anders Jonsson
6c95fc7e87 Update Swedish translation 2021-03-30 17:13:11 +00:00
Matthias Clasen
f4cc9a47ad Merge branch 'docs' into 'master'
docs: Cover corner-case of @line_number = total lines in buffer

See merge request GNOME/gtk!3373
2021-03-30 16:09:34 +00:00
Matthias Clasen
ccbbc2f2ba 4.2.0 2021-03-30 11:00:55 -04:00
Matthias Clasen
8bc2ee63eb Actually build docs for releases 2021-03-30 11:00:54 -04:00
Matthias Clasen
68d634b31c Disable the border-image-url reftest
It seems to make assumptions about text positioning that
are not holding with subpixel positioning. I'm not 100%
sure how that leads to exactly the artifacts that are seen
here, but I am just disabling the test until that is fully
understood.
2021-03-30 11:00:54 -04:00
Matthias Clasen
d1c66f75e3 Disable flaky focus tests 2021-03-30 11:00:54 -04:00
Matthias Clasen
eba9cd8775 Disable the label-background reftest
It makes assumptions about text positioning that are
not holding with subpixel positioning. There is no
guarantee that the next word in a multi-word text
starts on an even pixel boundary, as it does when
you break the text into multiple, separately rendered
blocks.
2021-03-30 11:00:54 -04:00
Matthias Clasen
9606945ed8 Fix tests for new version 2021-03-30 11:00:54 -04:00
Matthias Clasen
d50d382032 Merge branch 'ebassi/dist-docs' into 'master'
build: Dist the API references

See merge request GNOME/gtk!3375
2021-03-30 14:58:53 +00:00
Emmanuele Bassi
5da3308572 build: Dist the API references
Copy them into the dist root from the build root, so that they will be
available in the release archive.
2021-03-30 15:42:40 +01:00
Jonas Ådahl
fb48699ba4 Merge branch 'issue3791-gtk4' into 'master'
gdk/wayland: Defer processing of globals closures

Closes #3791

See merge request GNOME/gtk!3374
2021-03-30 14:06:33 +00:00
Robert Mader
56d37ceed0 gdk/wayland: Defer processing of globals closures
... until all globals have been received.

The dependency tracking introduced in 4e9be39518 only allows to
specify required globals and processes the closures as soon as
the requirements have been met. There are, however, also optional
dependencies - most notably the primary_selection protocol.
Currently we rely on the fact that compositors like Mutter announce
it before `wl_seat`, even though the order is not specified in
the spec.

Process globals closures only after all globals have been announced,
so optional dependencies can be accommodated.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/3791
2021-03-30 15:20:00 +02:00
Avinash Sonawane
622bb9186e docs: Cover corner-case of @line_number = total lines in buffer 2021-03-30 17:00:33 +05:30
Matthias Clasen
b77e05ce37 Merge branch 'ngl-text-tweaks' into 'master'
Ngl text tweaks

See merge request GNOME/gtk!3367
2021-03-30 11:15:13 +00:00
Matthias Clasen
ba4e66d189 ngl: Avoid a goto
Reshuffle the code slightly, so we can use a continue
instead.
2021-03-30 00:34:52 -04:00
Matthias Clasen
2c33550048 gsk: Avoid empty glyphs early
Strip out PANGO_GLYPH_EMPTY when text nodes are
constructed. Then we don't have to check this special
case in the inner loop in visit_text_node.
2021-03-30 00:34:52 -04:00
Matthias Clasen
3add99a9a8 ngl: Speed up glyph loop
Move some work out of the loop in visit_text_node.
This takes advantage of the fact that the yoffset
of most glyphs is zero, so yphase generally does
not change in a line of text.
2021-03-30 00:19:28 -04:00
Matthias Clasen
d4ea2e848d ngl: We only need two bits for phases
We use 4 phases, so 2 bits are enough.
2021-03-30 00:19:28 -04:00
Matthias Clasen
4c06889243 Updates 2021-03-30 00:18:48 -04:00
Matthias Clasen
ef544a8c3b Merge branch 'ngl-trivia' into 'master'
Ngl trivia

See merge request GNOME/gtk!3372
2021-03-30 04:16:00 +00:00
Matthias Clasen
6db9215dd1 Merge branch 'video-player-images' into 'master'
gtk-demo: Allow opening images in video player

See merge request GNOME/gtk!3371
2021-03-30 03:54:13 +00:00
Matthias Clasen
8b64f0147c gtk-demo: Allow opening images in video player
It works, so why not.
2021-03-29 23:40:17 -04:00
Matthias Clasen
5847f75c57 ngl: Cosmetics
Remove a local variable in gsk_render_job_visit_text_node.
2021-03-29 15:17:20 -04:00
Matthias Clasen
ce2c3efc91 ngl: Improve packing
Pack texture cache entries slightly better.

There was a 4 byte hole here.
2021-03-29 15:17:10 -04:00
Matthias Clasen
2599c5aed3 gsk: Typo fix 2021-03-29 15:16:44 -04:00
Matthias Clasen
bca39e2605 ngl: Typo fix 2021-03-29 15:16:25 -04:00
Matthias Clasen
ca0e1be03e Merge branch 'frame-rate-benchmark' into 'master'
Add a frame benchmark

See merge request GNOME/gtk!3364
2021-03-29 15:52:51 +00:00
Benjamin Otte
6569a877d8 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #3810

See merge request GNOME/gtk!3366
2021-03-29 15:41:55 +00:00
Benjamin Otte
38fff37dae mediastream: Insist streams are prepared when they start playing
Applications expect that behavior, so don't let implementations get away
without preparing the stream.
2021-03-29 17:08:34 +02:00
Benjamin Otte
06be1f8b52 gstmedia: Ensure we prepare files without duration
In particular this fixes playback of images.

Fixes #3810
2021-03-29 17:08:34 +02:00
Matthias Clasen
43a1641dd7 Add a frame benchmark
This can be used to gauge what fps we can hope for
in the best case, on a given system.
2021-03-29 08:27:43 -04:00
Yosef Or Boczko
b21fba117f Update Hebrew translation
(cherry picked from commit 1beb550830)
2021-03-28 22:34:55 +00:00
Yosef Or Boczko
37d5f93610 Update Hebrew translation
(cherry picked from commit 4a7e08bb8e)
2021-03-28 21:31:44 +00:00
Matthias Clasen
52aea624a6 Merge branch 'text-node-tweak' into 'master'
textview: Tweak render nodes

See merge request GNOME/gtk!3362
2021-03-28 17:25:36 +00:00
Matthias Clasen
711acb6aa7 Merge branch 'smarter-diff' into 'master'
Smarter diff

See merge request GNOME/gtk!3361
2021-03-28 17:24:23 +00:00
Hugo Carvalho
3e94c5afa4 Update Portuguese translation
(cherry picked from commit ef7cbad45d)
2021-03-28 16:35:59 +00:00
Matthias Clasen
a75c038e09 textview: Tweak render nodes
Arrange for the contents to be in a single transform
node that is updated as we scroll. This makes the job
of the render node differ a lot easier, since it does
not have to compare to big containers one-by-one.
2021-03-28 10:59:55 -04:00
Matthias Clasen
146069058f Add some tests for node diffing
Nothing deep yet, but more can be added.
2021-03-28 10:45:40 -04:00
Matthias Clasen
2d5dd7b3d7 gsk: Make rendernode diffing smarter
Allow comparing container nodes to any other
node, by pretending the other node is a single
child container (if it isn't one already).

This fixes a glitch where we redraw the full
entry text when the blinking cursor goes to
opacity 0, since GskSnapshot then optimizes
away first the opacity node, and then the
single-child container.
2021-03-28 10:26:06 -04:00
Matthias Clasen
0904dd29c2 gsk: Use floorf for floats 2021-03-28 10:26:06 -04:00
Matthias Clasen
279b9347fd gsk: Cosmetics 2021-03-28 10:26:02 -04:00
Matthias Clasen
2a2ae16894 ngl: Cosmetics
Remove a commented out line that snuck in with
a recent commit.
2021-03-28 10:26:02 -04:00
Matthias Clasen
3e1a8aa286 Merge branch 'fix-memleaks' into 'master'
Fix memleaks

See merge request GNOME/gtk!3360
2021-03-28 14:23:35 +00:00
Matthias Clasen
db126a19b6 Plug a test memleak 2021-03-27 21:52:49 -04:00
Matthias Clasen
ffa50f4c24 Plug a memory leak in an error path 2021-03-27 21:44:19 -04:00
Matthias Clasen
e1866d8fbe Ignore pthread allocations in valgrind 2021-03-27 21:43:59 -04:00
Matthias Clasen
d24a0e9606 tests: Plug a memory leak 2021-03-27 21:13:25 -04:00
Matthias Clasen
b8693cc4f4 tests: Make the pixbuf test use TAP
Otherwise, meson just considers this test skipped.
2021-03-27 21:03:43 -04:00
Matthias Clasen
5d5adf6ee7 asan: Ignore leaks from librsvg
Turns out that there are some leaks from librsvg.
2021-03-27 21:03:43 -04:00
Matthias Clasen
dda69bd16d tests: Plug memory leaks
This one was pointed out by asan.
2021-03-27 21:03:43 -04:00
Matthias Clasen
926b855d14 Merge branch 'fix-memleaks' into 'master'
Fix memleaks

See merge request GNOME/gtk!3359
2021-03-27 23:47:05 +00:00
Matthias Clasen
afc3de6e04 notebook: Don't leak the pages property
We were misuing a transfer-full getter here.
2021-03-27 19:11:56 -04:00
Matthias Clasen
45f4090eec stack: Don't leak the pages property
We were misusing a transfer-full getter here.
2021-03-27 19:11:56 -04:00
Matthias Clasen
4cf69fbc5e builder: Plug a small memory leak
We were forgetting to free expression info
objects in one place.
2021-03-27 19:11:56 -04:00
Matthias Clasen
0c6da97147 builder: Add an assertion
This case is clearly not meant to happen.
Assert that it doesn't.
2021-03-27 19:11:56 -04:00
Matthias Clasen
8994635d39 settings: Plug a memory leak
It is rare that settings are finalized, but we
still shouldn't leak in that case.
2021-03-27 19:11:56 -04:00
Matthias Clasen
7644605dfc Plug a small memory leak 2021-03-27 19:11:56 -04:00
Matthias Clasen
97a9e23b85 bookmarklist: Avoid an invalid read
This shows up when running the objects-finalize
test under valgrind.
2021-03-27 19:11:56 -04:00
Matthias Clasen
478ecf8db4 Merge branch 'ngl-uninitialized-matrix' into 'master'
Ngl uninitialized matrix

See merge request GNOME/gtk!3358
2021-03-27 20:59:54 +00:00
Anders Jonsson
0e857862ab Update Swedish translation
(cherry picked from commit 86f3c11d1e)
2021-03-27 20:43:39 +00:00
Matthias Clasen
2bb4859031 ngl: Fix an uninitialized read
We were using the wrong matrix here.
valgrind pointed this point.
2021-03-27 16:32:58 -04:00
Matthias Clasen
7aef77a21a reftests: Plug a few memory leaks
Noticed in passing.
2021-03-27 16:25:28 -04:00
Matthias Clasen
e7f9d56da5 ngl: Fix an uninitialized read
We were using the wrong matrix here.
valgrind pointed this point.
2021-03-27 16:23:40 -04:00
Matthias Clasen
34883b7142 reftests: Plug a few memory leaks
Noticed in passing.
2021-03-27 16:23:17 -04:00
Matthias Clasen
23706a4a6d release: Actually include docs 2021-03-27 14:22:19 -04:00
Matthias Clasen
c52c944e33 Updates 2021-03-27 14:21:04 -04:00
Matthias Clasen
8540bea65e Merge branch 'file-chooser-fixes' into 'master'
File chooser fixes

See merge request GNOME/gtk!3356
2021-03-27 14:23:15 +00:00
Matthias Clasen
8ea4721d1e filechooser: Make / work as shortcut again
Typing / is meant to open the location entry, so
prevent search from capturing that key.
2021-03-27 09:57:00 -04:00
Matthias Clasen
e8a6b504f3 filechooser: Fix fallout from GtkText
Ever since the GtkText split, the focus is no longer
on an entry, but inside it. The filechooser was never
updated for that.
2021-03-27 09:54:20 -04:00
Matthias Clasen
06ab8f2167 filechooser: Make Ctrl-L work again
Prevent search from preempting the Ctrl-L shortcut
that is meant to show the location entry.
2021-03-27 09:53:43 -04:00
Matthias Clasen
b5558f3e97 layout: Be quiet about trivialities
Commit 8b82993dde added a noisy warning
to gtk_distribute_natural_allocation to quiet a
compiler warning. It turn out that the file chooser
managed to trigger this warning, so make it a quiet
return.
2021-03-27 08:59:21 -04:00
Matthias Clasen
bdd281c9ea release: Update included subprojects 2021-03-27 08:55:51 -04:00
Matthias Clasen
c9ab7c5750 Merge branch 'double-dead-keys' into 'master'
Double dead keys

See merge request GNOME/gtk!3355
2021-03-27 01:22:41 +00:00
Matthias Clasen
01f4e5c8cd Add some more compose tests
These tests changes to the algorithmic dead key
matching.
2021-03-26 20:38:45 -04:00
Matthias Clasen
8a567d7932 imcontext: Tweak dead key handling
Reshuffle things to allow for a limited amount of
dead key 'chaining'. We keep up to 2 dead keys in
the preedit, so you can type
<dead_acute> <dead_cedilla> <c>
to produce ḉ, while still getting ```c with
<dead_grave> <dead_grave> <dead_grave> <c>.
2021-03-26 20:38:45 -04:00
Matthias Clasen
dbcd24adf4 composetable: Limit algorithmic checking
Only check for combinations of up to 2 dead keys with
a base character. We don't want to spend ages generating
all permutations of long sequences.
2021-03-26 20:27:55 -04:00
Matthias Clasen
f6f07ba238 Merge branch 'icon-fallback' into 'master'
Icon fallback

See merge request GNOME/gtk!3353
2021-03-26 19:33:13 +00:00
Matthias Clasen
3ab07203ce widget-factory: Add missing icons
This removes all the cases where we were showing a missing-image
when running with the hicolor icontheme.
2021-03-26 14:34:40 -04:00
Emmanuele Bassi
70e26d12fb Update the gi-docgen repository
Do not use my personal workspace.
2021-03-26 17:41:58 +00:00
Matthias Clasen
6ba414216c widget-factory: Drop two icons from the iconview
This avoids the scrollbar by default, which is nice.
2021-03-26 13:30:46 -04:00
Matthias Clasen
775b45ef57 icons: Add text-x-generic
The file chooser needs at least one icon that we can
fall back to for non-directories. text-x-generic is
that icon.
2021-03-26 13:17:51 -04:00
Matthias Clasen
23cb72875d filechooser: Check that icons exist
Otherwise we end up showing missing-image in the
file chooser, and thats sad.
2021-03-26 13:17:51 -04:00
Matthias Clasen
5940de98dd icontheme: Add gtk_icon_theme_has_gicon
Add a utility function to check whether the icontheme
will produce something better than missing-image for
a GIcon. Obviously, we can only answer this question
if the GIcon is a themed icon the begin with.
2021-03-26 13:17:51 -04:00
Matthias Clasen
4028bd5bce widget-factory: Add emblem-shared-symbolic icon
We use it, so include it.
2021-03-26 11:59:37 -04:00
Matthias Clasen
b5608e93d2 icons: Sync color-select-symbolic with Adwaita
This icon changed a bit since we incorporated it.
2021-03-26 11:59:01 -04:00
Matthias Clasen
1ea2ea520f icons: Add system-run-symbolic
This is used by Adwaita for devel headers, so include it.
2021-03-26 11:42:09 -04:00
Matthias Clasen
922b2683b3 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3351
2021-03-26 15:30:51 +00:00
Matthias Clasen
6dcef28e12 icon: Add a printer icon
This showed up as missing icon in the print dialog when
used with the hicolor icontheme.
2021-03-26 11:30:14 -04:00
Matthias Clasen
08f68cce40 gdk: Add an arg check to gdk_device_get_timestamp
Pointed out by Emmanuele Bassi.
2021-03-26 11:09:50 -04:00
Matthias Clasen
7849590a82 gdk: Add gdk_device_get_timestamp
Give each device a timestamp that reflects the last
user activity with that device, as reflected in the
events that are produced for this device.
2021-03-26 11:09:05 -04:00
Matthias Clasen
c9b312c860 icons: Add icons that are used in the inspector
These were showing up as missing icons when opening
the Inspector with the hicolor icontheme:

system-search-symbolic
go-previous-symbolic
go-next-symbolic
display-brightness-symbolic
2021-03-26 11:00:01 -04:00
Matthias Clasen
6110980012 Merge branch 'device-timestamp' into 'master'
Device timestamp

Closes #3792

See merge request GNOME/gtk!3350
2021-03-26 14:51:37 +00:00
Matthias Clasen
019855a27f textview: Use device timestamps for obscured cursors
Stash away the device timestamp when obscuring
the pointer, and compare it when we decice whether
to unobscure it. This fixes a problem where synthetic
motion events would make the cursor reappear
prematurely.

Fixes: #3792
2021-03-26 10:30:33 -04:00
Matthias Clasen
cdfdf031b5 text: Use device timestamps for obscured cursors
Stash away the device timestamp when obscuring
the pointer, and compare it when we decice whether
to unobscure it. This fixes a problem where synthetic
motion events would make the cursor reappear
prematurely.
2021-03-26 10:30:33 -04:00
Matthias Clasen
f131d68fef gdk: Add gdk_device_get_timestamp
Give each device a timestamp that reflects the last
user activity with that device, as reflected in the
events that are produced for this device.
2021-03-26 10:30:33 -04:00
Matthias Clasen
3014649455 Merge branch 'pixbuf-loader-check' into 'master'
Make testsuite fail if we lack pixbuf loaders

See merge request GNOME/gtk!3348
2021-03-26 11:29:47 +00:00
Matthias Clasen
2496ab0902 Be explicit when building gdk-pixbuf subproject
We require png and jpeg loaders.
2021-03-25 22:52:30 -04:00
Matthias Clasen
50d42093b5 Make testsuite fail if we lack pixbuf loaders
Add a test that requires that we have png and jpeg
loaders.
2021-03-25 21:23:11 -04:00
Matthias Clasen
44481d355e Make testsuite fail if we lack pixbuf loaders
Add a test that requires that we have png and jpeg
loaders.
2021-03-25 21:22:23 -04:00
Matthias Clasen
6f82408056 Add logging for icon fallback
Add GTK_DEBUG=iconfallback which prints out what icon names
we fall back to image-missing for.
2021-03-25 17:26:15 -04:00
Matthias Clasen
cc64dbafbc Merge branch 'carlosgc/clipboard-crash' into 'master'
clipboard: Fix a crash when GdkContentProviderUnion doesn't support the given data format

See merge request GNOME/gtk!3346
2021-03-25 20:48:28 +00:00
Carlos Garcia Campos
50b70298c0 clipboard: Fix a crash when GdkContentProviderUnion doesn't support the given data format
After iterating all the providers, all of them returning unsupported
error, gdk_content_provider_union_get_value() returns FALSE without
filing the given GError. Then gdk_clipboard_read_value_internal()
assumes there's a GError when FALSE is returned and
g_task_return_error() fails. We can just chain up to parent
implementation to ensure the GError is filled with unsupported error.
2021-03-25 15:10:00 +01:00
Matthias Clasen
bd7df4b816 Merge branch 'shader' into 'master'
ngl: Fix crash with intel driver on Windows when compiling shaders

Closes #3783

See merge request GNOME/gtk!3344
2021-03-25 12:37:12 +00:00
Xavier Claessens
086e1ed39f ngl: Fix crash with intel driver on Windows when compiling shaders
Fixes #3783.
2021-03-25 08:20:30 -04:00
Matthias Clasen
fa57f20b87 Merge branch 'wip/fix-stack-get-item' into 'master'
stack: Fix some list model issues

See merge request GNOME/gtk!3345
2021-03-24 20:34:47 +00:00
Mohammed Sadiq
e211740da6 stack: Fix check if page is selected
When there is no visible child, gtk_selection_model_is_selected()
was returning TRUE for any invalid position.

So check if the page is non-NULL and match
2021-03-24 20:23:09 +05:30
Mohammed Sadiq
0351bc766c stack: Increase reference only if page is non-NULL
g_list_nth_data() may return NULL if position is off the end
2021-03-24 20:21:13 +05:30
Matthias Clasen
5531906973 Merge branch 'gles-fallback' into 'master'
gdkglcontext-wayland: Fallback to GLES 2.0 after legacy failed

See merge request GNOME/gtk!3327
2021-03-24 11:21:21 +00:00
Matthias Clasen
9d6190bc3c Merge branch 'gdkmacosglcontext-fix' into 'master'
gdkmacosglcontext: fix compilation error

See merge request GNOME/gtk!3342
2021-03-24 11:09:51 +00:00
Tom Schoonjans
d5de73fb9d gdkmacosglcontext: fix compilation error
See https://developer.apple.com/documentation/appkit/nsopenglpixelformat/1436219-initwithattributes?language=occ
2021-03-24 10:08:11 +00:00
Matthias Clasen
b539c92312 Merge branch 'builder-tool-placeholder-crash' into 'master'
gtk-builder-tool: Avoid a crash with <placeholder/>

Closes #3781

See merge request GNOME/gtk!3339
2021-03-23 21:02:39 +00:00
Matthias Clasen
272d8a6800 Merge branch 'wip/chergert/ngl-fix-windows-intel-driver' into 'master'
ngl: move uniform key mapping into uniform state

Closes #3780

See merge request GNOME/gtk!3340
2021-03-23 21:02:11 +00:00
Christian Hergert
f8a6a09896 ngl: move uniform key mapping into uniform state
Previously, we translated the uniform key (an enum) into a location within
the shader program in GskNglProgram. A number of performance improvements
were focused around having low nubers for the uniform locations. Generally
this is the case, but some drivers such as old Intel drivers on Windows
may use rather large numbers for those.

To combat this, we can push the translation of uniform keys into locations
at the GskNglUniformState level so that we work with unranslated keys
through the process until applying them.

Fixes #3780
2021-03-23 13:44:26 -07:00
Matthias Clasen
6a66ccd3e6 gtk-builder-tool: Avoid a crash with <placeholder/>
Not sure we can do much with a ui file that has
<placeholder/> elements littered throughout. But
at least we can avoid crashing while trying to
convert it.

Fixes: #3781
2021-03-23 15:25:53 -04:00
Emmanuele Bassi
1f6b556972 Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!3338
2021-03-23 15:39:47 +00:00
Emmanuele Bassi
3668541eaa docs: Add a side bar to the docs.gtk.org landing page
Make it look like the API references hosted on docs.gtk.org.
2021-03-23 14:58:03 +00:00
Emmanuele Bassi
a6727326e3 docs: Update the Cairo reference link 2021-03-23 14:49:20 +00:00
Emmanuele Bassi
1507099dc7 Merge branch 'ebassi/for-master' into 'master'
Publish docs for Pango and GdkPixbuf

See merge request GNOME/gtk!3337
2021-03-23 13:39:18 +00:00
Emmanuele Bassi
2bc7abceae docs: Drop the external class for links to docs.gtk.org 2021-03-23 13:13:53 +00:00
Emmanuele Bassi
a9a5622214 docs: Link Pango and GdkPixbuf on docs.gtk.org 2021-03-23 13:13:53 +00:00
Emmanuele Bassi
0560397aa8 ci: Build Pango and GdkPixbuf's docs
We want to publish them alongside GTK's own API reference.
2021-03-23 13:13:53 +00:00
Matthias Clasen
4e06787a1b Merge branch 'bilelmoussaoui/expressions-annotations' into 'master'
Add missing nullable annotations to BoolFilter/StringFilter

See merge request GNOME/gtk!3334
2021-03-23 00:49:54 +00:00
Matthias Clasen
610ba0e764 Merge branch 'issue3715-gtk4' into 'master'
[gtk4] x11/dnd: Ignore XErrors from the COW

Closes #3715

See merge request GNOME/gtk!3336
2021-03-22 15:09:42 +00:00
Olivier Fourdan
80ba38a0b3 x11/dnd: Ignore XErrors from the COW
The DnD code for X11 adds the composite overlay window (aka COW) to the
cache.

Yet the X11 requests to get and release the COW may trigger XErrors that
we ought to ignore otherwise the client will abort.

Fixes: #3715
2021-03-22 15:38:58 +01:00
Chun-wei Fan
5d3af346dd Merge branch 'really-fix-3581' into 'master'
GDK-Win32: Remove extraneous call to _gdk_win32_append_event() (really fix issue #3581)

Closes #3581

See merge request GNOME/gtk!3306
2021-03-22 14:18:44 +00:00
Matthias Clasen
d882def373 Merge branch 'meson-install-script' into 'master'
Meson: Use gnome.install_script()

See merge request GNOME/gtk!3135
2021-03-22 12:45:45 +00:00
Bilal Elmoussaoui
3761dbba8b gtk: add missing nullable annotations to StringFilter 2021-03-22 12:42:19 +01:00
Bilal Elmoussaoui
ae7b19c760 gtk: add missing nullable annotations to BoolFilter 2021-03-22 12:42:13 +01:00
Matthias Clasen
157218c507 Merge branch 'wip/baedert/for-master' into 'master'
ngl: Remove unused function

See merge request GNOME/gtk!3332
2021-03-22 11:17:58 +00:00
Matthias Clasen
60325df7db Merge branch 'better-dead-keys' into 'master'
Better dead keys

See merge request GNOME/gtk!3329
2021-03-22 02:37:14 +00:00
Matthias Clasen
64a62ebcfb Regenerate compose sequence file
Update our compose sequences based on the current
update xorg Compose.pre file. Beyond that, remove
some deadkey sequences that we are now handling
(better) in code.
2021-03-21 21:48:03 -04:00
Matthias Clasen
a42a133a18 Move compose related tooling to a subdir
This reduces the clutter in gtk/.
2021-03-21 21:48:03 -04:00
Matthias Clasen
a41cd9b1fa compose-parse: Add a negative lookaside
Make this script parse gtk-compose-remove.txt for
sequences to remove from the xorg Compose file.
This will be used for removing some deadkey combinations
that we can handle better in code.

Also, make this script explicitly python2. I tried
porting it to python3, but gave up in the end.
2021-03-21 21:48:03 -04:00
Matthias Clasen
8bfc6afe33 imcontext: Improve dead key handling more
For sequences like ``, we want to commit the first
deadkey and then continue preedit with the second.

The alternative is to do chained deadkeys, where
entering ~~a yields ̃̀̃̃a. But we don't do that, and
I think that would be more controversial.
2021-03-21 21:48:03 -04:00
Matthias Clasen
5b67e6817c imcontext: Improve dead key handling
For sequences like `x, where we don't have a compose
sequence, we still want to commit "`x", and not silently
eat the keys.
2021-03-21 21:48:01 -04:00
Matthias Clasen
48f87c1eea Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3328
2021-03-21 20:48:04 +00:00
Emmanuel Gil Peyrot
aced6030ee gdkglcontext-wayland: Fallback to GLES 2.0 after legacy failed
This lets the NGL backend be selected instead of the Cairo backend on
devices which expose both GL and GLES, but have better support of GLES.

Tested on a PinePhone.
2021-03-21 20:37:04 +00:00
Matthias Clasen
c5aa35f8ef inspector: Allow inspecting Unicode
Add a way to show text as a Unicode sequence.
This can be helpful in understanding what is
happening with text.
2021-03-21 16:05:10 -04:00
Matthias Clasen
7a56aa910e ngl: Fix a rounding error in subpixel positioning
1024 / 4 is 256, not 250.
2021-03-21 16:05:10 -04:00
Matthias Clasen
bd0df03248 gl: Fix a rounding error in subpixel positioning
1024 / 4 is 256, not 250.
2021-03-21 16:05:10 -04:00
Matthias Clasen
df4b564d69 build: Disable g_assert in release builds
The ngl renderer is heavily using g_assert, and it
is written with the assumption that these assertions
will be compiled out in release builds.
2021-03-21 16:05:10 -04:00
Matthias Clasen
9640bfb3fe calendar: Typo fix 2021-03-21 16:05:10 -04:00
Matthias Clasen
2e69273922 ngl: Remove an unused field
We are ignoring the debug nodes, so the
debug_groups string chunk is unused.
2021-03-21 16:05:10 -04:00
Matthias Clasen
1e014f4291 ngl: Always populate the glyph front cache
There is no reason not to do this also in the
case when we upload the glyph.
2021-03-21 16:05:10 -04:00
Matthias Clasen
fbe47106e7 ngl: Use floorf consistently 2021-03-21 16:05:10 -04:00
Timm Bäder
ea93c40644 ngl: Remove unused function 2021-03-21 18:00:10 +01:00
dparisot
82b11623f4 Load icon from executable on Windows 2021-03-21 15:24:28 +01:00
Piotr Drąg
1a3f2acb95 Update Polish translation 2021-03-20 15:41:34 +01:00
Emmanuele Bassi
fb8592952d Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!3324
2021-03-20 12:31:10 +00:00
Emmanuele Bassi
216a262651 docs: Put core deps below UI links
We assume people will be more interested in GTK if they get to
docs.gtk.org.
2021-03-20 12:18:42 +00:00
Emmanuele Bassi
0178cdbdf2 docs: Fix typo in the docs landing page 2021-03-20 12:18:26 +00:00
Yuri Chornoivan
b84d959d31 Update Ukrainian translation 2021-03-20 08:54:01 +00:00
Yuri Chornoivan
3eca28e4b5 Update Ukrainian translation 2021-03-20 08:51:46 +00:00
Emmanuele Bassi
98a91a3290 Merge branch 'a11y-strdup' into 'master'
a11y: Don't copy attribute names in attribute sets

See merge request GNOME/gtk!3323
2021-03-19 22:31:37 +00:00
Matthias Clasen
3cfe69d711 a11y: Don't copy attribute names in attribute sets
We only need these names when serializing a11y information
for tests. And copying these strings is entirely unnecessary.
So, just pass a callback instead.
2021-03-19 17:01:28 -04:00
Matthias Clasen
b9da74590b Merge branch 'ngl-glyph-cache' into 'master'
Ngl glyph cache

See merge request GNOME/gtk!3322
2021-03-19 18:59:33 +00:00
Matthias Clasen
b253aca883 ngl: Improve the glyph front cache
The effectiveness of the front cache is limited by
subpixel positioning making it very likely that we
will meet the same glyph in  different x phases inside
a single line of text.

Factoring the xphase into the front cache key makes things
better. For the string eeeeeeeeeeeeeeeeeee

before: 0% front cache hits
after: >90% front cache hits
2021-03-19 14:32:03 -04:00
Matthias Clasen
5ac7f7c2f6 ngl: Drop an unused struct member
GskNglGlyphLibrary.hash_table wasn't used.
2021-03-19 14:05:15 -04:00
Matthias Clasen
9981f19409 texttag: A few typo fixes 2021-03-19 14:04:27 -04:00
Emmanuele Bassi
dae59112d7 Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!3321
2021-03-19 17:57:42 +00:00
Emmanuele Bassi
f25beff7a6 docs: Restructure the list of UI libraries
Put GTK at the top.
2021-03-19 17:23:46 +00:00
Emmanuele Bassi
130ed3d5e5 docs: Fix typo in the docs landing page 2021-03-19 17:23:29 +00:00
Matthias Clasen
830efa6ce2 Revert "ngl: Remove duplicate check"
This reverts commit 1fd534ef1e.

This change revealed that we are not treating damage regions
correctly, and we regularly end up with
2021-03-19 13:17:02 -04:00
Emmanuele Bassi
a33e32ef60 Merge branch 'ebassi/for-master' into 'master'
Fix the landing page structure

See merge request GNOME/gtk!3320
2021-03-19 14:55:12 +00:00
Emmanuele Bassi
aaffd902fd Fix the landing page structure 2021-03-19 14:36:34 +00:00
Emmanuele Bassi
972a06c038 Merge branch 'pages-index' into 'master'
Add a landing page for the GitLab pages root

See merge request GNOME/gtk!3319
2021-03-19 14:14:46 +00:00
Emmanuele Bassi
1763ede9ce Add a landing page for the GitLab pages root
Right now, we land inside a 404 if we go to:

  https://gnome.pages.gitlab.gnome.org/gtk/

as we have all our API references in a sub-level. We should have a
landing page for the root, similar to developer.gnome.org/references/.
2021-03-19 13:54:32 +00:00
Matthias Clasen
f5fb8a95f4 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3317
2021-03-19 05:44:39 +00:00
Matthias Clasen
948e032072 text tag: Typo fix 2021-03-18 22:53:37 -04:00
Matthias Clasen
21aa8ae29f Cosmetics
Remove a stale comment.
2021-03-18 22:53:37 -04:00
Matthias Clasen
4fce3ceffc Cosmetics
Pack the GtkTextAttributes struct better.
2021-03-18 22:53:37 -04:00
Matthias Clasen
95a5e7b438 release script: Include gi-docgen
This lets us say 'you don't need to package this'
about gi-docgen.
2021-03-18 22:53:27 -04:00
Matthias Clasen
8fdedbd73b Merge branch 'ngl-by-default' into 'master'
gsk: Make ngl the default OpenGL renderer

See merge request GNOME/gtk!3313
2021-03-19 02:01:34 +00:00
Matthias Clasen
b962a0f166 Merge branch 'wip/chergert/fix-ngl-cache-eviction' into 'master'
fix ngl cache eviction

Closes #3771

See merge request GNOME/gtk!3316
2021-03-19 01:59:29 +00:00
Christian Hergert
0f0ee97e1e ngl: clear Glyph front cache at the beginning of a frame
We don't want to be responsible for duplicating the effort of the hash
table, we just want to speed up subsequent lookups. Otherwise, we risk
not marking glyph usage when tracking usage for compaction.
2021-03-18 18:00:04 -07:00
Christian Hergert
af80f3a976 ngl: implement atlas compaction
This required finishing up the begin_frame/end_frame semantics for
GskNglTextureLibraryw which was apparently overlooked.

The driver was changed to provide more information to the library when
beginning frames. We do not need to use end_frame so that was removed.

The frame age is the same as GL (60) but I do wonder if that is based
on seconds if we should be using something longer for situations where
we have higher frame rates.

Fixes #3771
2021-03-18 17:59:56 -07:00
Matthias Clasen
1536f6a59c Merge branch 'matthiasc/for-master' into 'master'
inspector: Respect GDK_DEBUG=vulkan-disable

Closes #3748

See merge request GNOME/gtk!3312
2021-03-18 21:43:14 +00:00
Matthias Clasen
574b0bf48a Merge branch 'bilelmoussaoui/4.2-annotations' into 'master'
IMContext: add since annotations to the new APIs

See merge request GNOME/gtk!3315
2021-03-18 21:42:35 +00:00
Bilal Elmoussaoui
0b100229e3 IMContext: add since annotations to the new APIs 2021-03-18 22:25:38 +01:00
Matthias Clasen
19d9c78514 gsk: Make ngl the default OpenGL renderer
We will keep the original GL renderer around for
a while, to have an alternative. But we want to
get wider testing of the new renderer.
2021-03-18 15:00:39 -04:00
Matthias Clasen
140b7f0a61 Merge branch 'wip/chergert/fix-3770' into 'master'
ngl: ensure vertices buffer allocates enough vertices

Closes #3770

See merge request GNOME/gtk!3314
2021-03-18 17:55:26 +00:00
Christian Hergert
56daad9c35 ngl: ensure vertices buffer allocates enough vertices
It's not guaranteed that a single power of two growth will be enough.

Fixes #3770
2021-03-18 10:43:24 -07:00
Matthias Clasen
eaf09a4625 Cosmetics
Pango lets us pass NULL for the font desc and language
in pango_context_get_font_metrics() to use the context
values.
2021-03-18 07:52:03 -04:00
Matthias Clasen
a576bd190b inspector: Respect GDK_DEBUG=vulkan-disable
Respect the debug settings for disabling Vulkan or GL,
and do not try to initialize those contexts. This can
be necessary to work around crashes.

Fixes: #3748
2021-03-17 23:19:08 -04:00
Matthias Clasen
2ce92085e1 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3765

See merge request GNOME/gtk!3311
2021-03-18 00:31:10 +00:00
Matthias Clasen
e6b1443fbb label: Fix tooltips on links
Fix pointed out by Timm Baeder.

Fixes: #3765
2021-03-17 19:46:02 -04:00
Matthias Clasen
60ccae000b media: Always use GL with gstreamer
As long as we can create a GL context, pass one to
gstreamer. This at least gets us GL textures with
the ngl renderer, the previous code was arbitrarily
refusing that.
2021-03-17 16:28:12 -04:00
Timm Bäder
7ecd004d50 Merge branch 'gsk-border-node-diff-fix-typo' into 'master'
Fix a typo in gsk_border_node_diff

See merge request GNOME/gtk!3310
2021-03-17 16:04:57 +00:00
Andrey Kozlovskiy
6b48fb767d Fix a typo in gsk_border_node_diff
Typo was introduced in !3278 and results in an incorrect handling of different uniformity.
2021-03-17 15:38:01 +00:00
Emmanuele Bassi
6d4f93bb7f Merge branch 'select-list-model-null' into 'master'
gtk: Allow selection models to take null list model during construction

See merge request GNOME/gtk!3309
2021-03-17 14:09:37 +00:00
Matthias Clasen
cfe8c0e187 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3763

See merge request GNOME/gtk!3308
2021-03-17 12:32:45 +00:00
Matthias Clasen
6d5657eee7 lpr: Fix various compiler warnings
gcc 11 is warning about some const mixups here.
Fix them.
2021-03-17 07:56:07 -04:00
Matthias Clasen
600cbdb7ba treestore: Initialize some local variables
gcc 11 is warning that these might be used uninitialized
otherwise.
2021-03-17 07:51:27 -04:00
Matthias Clasen
8b82993dde sizerequest: Avoid a corner case
gcc 11 warns that the code isn't safe when
n_requested_sizes is 0. Add a precondition check
to make it clear that that never happens.
2021-03-17 07:50:24 -04:00
Matthias Clasen
ea185cbdda cssshadowvalue: Handle error condition propertly
We were parsing off the end of our array before noticing
that we've gone too far. gcc 11 warns about this.
2021-03-17 07:49:06 -04:00
Matthias Clasen
ee837dfc12 checkbutton: Add a warning about cyclic groups
Setting up check or toggle button group relationships
in a cycle will lead to lockups. Add a warning about
this, and catch the simplest case with a precondition
check.

Fixes: #3763
2021-03-17 07:38:57 -04:00
Matthias Clasen
1d888bff43 Drop the gtk-doc subproject
No longer used.
2021-03-17 07:28:31 -04:00
Chun-wei Fan
38ad068d9b GDK-Win32: Remove extraneous call to _gdk_win32_append_event()
Apparently, by comparing with the other backends, we should not call
_gdk_win32_append_event() after calling gdk_scroll_event_new() but we should
call it after calling gdk_scroll_event_new_discrete(), which was why we didn't
restore the cursor after we scroll using the mouse wheel and didn't manage to
remove the shade that appears after we scrolled to the very top or very bottom.

Also, as suggested by the reporter, use IDC_SIZEALL for the system cursor that
we fall back to if no cursor theme is installed, as with other Windows
programs.

This should really fix issue #3581.
2021-03-17 11:22:23 +08:00
Balázs Úr
45c8c6c77f Update Hungarian translation 2021-03-16 23:49:27 +00:00
Matthias Clasen
ceed7d1ba4 Merge branch 'matthiasc/for-master' into 'master'
dnd: Add some warnings to the docs

See merge request GNOME/gtk!3305
2021-03-16 19:12:05 +00:00
Matthias Clasen
74e2bb4cf1 dnd: Add some warnings to the docs
Add some warnings about pitfalls of the async dnd api.
2021-03-16 14:48:44 -04:00
Matthias Clasen
cc6bb13242 Merge branch 'kjellahl/cairo-subproject' into 'master'
Fix build when cairo is a subproject

See merge request GNOME/gtk!3304
2021-03-16 11:43:06 +00:00
Kjell Ahlstedt
50beae7541 meson: Find libcairo-script-interpreter when cairo is a subproject
If cairo is a subproject, it's not necessarily installed when gtk
is built. In the build tree, libcairo-script-interpreter is not stored
in the same directory as other cairo libraries.
2021-03-16 11:47:28 +01:00
Kjell Ahlstedt
0f6b91109e gdkglcontext-x11: Don't assume that cairo-xlib.h is in cairo directory
If cairo is a subproject, it's not necessarily installed when gtk
is built. In the source tree, cairo's headers are not stored in
a directory called 'cairo'.
2021-03-16 11:47:16 +01:00
Matthias Clasen
f279c7b1c2 Merge branch 'fix-3581' into 'master'
gdkcursor-win32.c: Add cursor map for all-scroll (issue #3581)

Closes #3581

See merge request GNOME/gtk!3298
2021-03-15 22:32:23 +00:00
Matthias Clasen
08b27848e1 Merge branch 'fix-wayland-layout-changes' into 'master'
Fix wayland layout changes

See merge request GNOME/gtk!3303
2021-03-15 22:31:08 +00:00
Matthias Clasen
e3dcc3d369 wayland: Fix cross-layout accelerators
GTK traditionally lets you activate keyboard shortcuts
even if they are for a non-active layout. But it is meant
to only activate with a keysym from a non-active layout
when that symbol is not present in the current layout.
That last condition was lost when key event handling
was redone for GTK4. Bring it back.
2021-03-15 17:14:49 -04:00
Matthias Clasen
568fe2e97b wayland: Add debug spew for active keyboard layouts
Print out what we think the active keyboard layout is,
when it changes, with GDK_DEBUG=input.
2021-03-15 17:14:49 -04:00
Jason Francis
cd77485193 gtk: Allow selection models to take null list model during construction
This brings it in line with the documentation, and with the respective
set_model() functions.
2021-03-15 15:55:47 -04:00
Matthias Clasen
ec0e76dabd Merge branch 'issue-3757' into 'master'
docs: Update annotations for WidgetClass.query_action()

Closes #3757

See merge request GNOME/gtk!3301
2021-03-15 19:28:17 +00:00
Matthias Clasen
1eebf0ebd1 wayland: Emit keys-changed on layout changes
We were forgetting to do this in when layout changes are
communicated via handle_modifiers.
2021-03-15 12:34:23 -04:00
Emmanuele Bassi
0a7af75639 docs: Update annotations for WidgetClass.query_action()
The parameter_type and property_name out arguments can be set to NULL.

Fixes: #3757
2021-03-15 13:48:35 +00:00
Milo Casagrande
72012113fd Update Italian translation
(cherry picked from commit affeff5472)
2021-03-15 09:25:36 +00:00
Chun-wei Fan
54b3048584 gdkcursor-win32.c: Add cursor map for all-scroll
This makes sure that we don't have cursors disappearing on Windows upon
scrolling because we can't find a cursor that exists on the system during
a scroll, and unlike GTK-3.x, we do not default to the arrow pointer on GTK4.

Just mimic what we have on X11 and Wayland: the trusty standard arrow pointer.

Fixes issue #3581.
2021-03-15 17:16:33 +08:00
Matthias Clasen
3daad8fe87 release-script: Actually compress the docs tarball
Somehow an x got lot and the tarball got very big. Oops...
2021-03-14 23:33:10 -04:00
Benjamin Otte
a1c1ad317b Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!3297
2021-03-15 02:31:45 +00:00
Benjamin Otte
dbd19bf27a x11: Don't call _gdk_surface_update_size() all the time
We were calling _gdk_surface_update_size() every frame, even if the
window size didn't change. This would cause us to discard all cached
buffers and redraw the whole screen.

This was BAD.
2021-03-15 03:16:50 +01:00
Benjamin Otte
97fad45237 surface: Remove unused gdk_surface_get_unscaled_size()
Also remove unscaled_width/height members in the win32 backend.

Both of those are unused.
2021-03-15 02:56:28 +01:00
Matthias Clasen
cbda61d3fb 4.1.2 2021-03-14 21:48:48 -04:00
Matthias Clasen
afe195a862 Update release script
With gi-docgen based docs, we can try to go back to
including the docs in the main release tarball.
2021-03-14 21:48:46 -04:00
Matthias Clasen
e6adee2403 Merge branch 'menubar-accel' into 'master'
window: Add a way to disable F10 shortcut

Closes #3727

See merge request GNOME/gtk!3296
2021-03-15 01:27:45 +00:00
Benjamin Otte
1fd534ef1e ngl: Remove duplicate check
We check the extents, so there's no need to check overlap before.
2021-03-15 01:30:34 +01:00
Matthias Clasen
cfc91b62b0 window: Add a way to disable F10 shortcut
This is needed for terminal emulators.

Fixes: #3727
2021-03-14 19:47:06 -04:00
Matthias Clasen
24ec2cc6a6 Merge branch 'ngl-less-shaders' into 'master'
Assorted ngl improvements

See merge request GNOME/gtk!3295
2021-03-14 21:04:37 +00:00
Matthias Clasen
28de2eecc9 ngl: Special-case css backgrounds
Recognize a common pattern: A rounded clip with
a color node, followed by a border node, with the
same outline. This is what CSS backgrounds frequently
produce, and we can render it more efficiently with
a combined shader.
2021-03-14 16:49:31 -04:00
Matthias Clasen
ed3f0012b1 ngl: Don't bother with uniform border nodes
Now that colors aren't uniforms anymore, we don't
win much by using the inset_shadow shader. The fragment
shaders of inset_shadow and border are identical. And
the regular border setup does nine-slicing.
2021-03-14 16:49:31 -04:00
Matthias Clasen
51074ca5df ngl: Small shader improvements
Add a variant of gskSetOutputColor that saves a
few multiplications, and use it where possible.
2021-03-14 16:49:31 -04:00
Matthias Clasen
8aac574d63 ngl: Improve the coloring shader
Since we are now passing a float anyway, we can avoid
the branch in the fragment shader.
2021-03-14 16:49:31 -04:00
Matthias Clasen
c1f98d6837 ngl: Improve the gradient shaders
Use a define for MAX_COLOR_STOPS, and give the loop
a fixed limit.
2021-03-14 16:49:31 -04:00
Matthias Clasen
3f60c39de4 ngl: Rewrite gsk_ngl_render_job_visit_text_node
Make this more compact, and thus easier to read.
2021-03-14 16:49:31 -04:00
Matthias Clasen
4aa570ba88 ngl: Drop gsk_ngl_render_job_set_color
Colors are not state that we carry across draw ops,
so setting the color on the render job doesn't make
much sense. Instead, pass the color to the various
draw calls. Add a few new ones for that purpose.

Also, shorten the names of some by going from
'load_vertices_from_offscreen' to 'draw_offscreen'.
2021-03-14 16:49:31 -04:00
Matthias Clasen
233969e9e4 ngl: Refactor gsk_ngl_render_job_visit_border_node
With color sorting out of the picture, this can
be much simpler.
2021-03-14 16:49:31 -04:00
Matthias Clasen
19e3a6af5d ngl: Consistently use gsk_scaled_premultiply
Its not going to make much of a difference, but we
can just as well be consistent.
2021-03-14 16:49:31 -04:00
Matthias Clasen
29501f5398 ngl: Fix up uniform enums
This got messed up when color was changed from
a uniform to an attribute in 06d5c8e72d.
2021-03-14 16:49:31 -04:00
Jiri Grönroos
3408240ba6 Update Finnish translation
(cherry picked from commit f5a34b53af)
2021-03-14 17:03:07 +00:00
Guillaume Bernard
e6725aa16f Update French translation
(cherry picked from commit 21039681d6)
2021-03-14 13:38:24 +00:00
Piotr Drąg
f34c0f4a99 Update Polish translation 2021-03-14 13:30:26 +01:00
Marek Černocký
52c7fd166b Updated Czech translation 2021-03-14 09:28:17 +01:00
Matthias Clasen
346b29ad8f Merge branch 'gles-coloring' into 'master'
ngl: Fix the coloring shader on GLES 2.0

See merge request GNOME/gtk!3294
2021-03-13 22:27:04 +00:00
Emmanuel Gil Peyrot
064947356a ngl: Fix the coloring shader on GLES 2.0
Integer varyings didn’t exist in GLSL ES 1.00, neither did the flat
attribute.
2021-03-13 22:00:54 +00:00
Kjartan Maraas
d2258fb316 Update Norwegian Bokmål translation
(cherry picked from commit 70ee21db71)
2021-03-13 16:05:15 +00:00
Matthias Clasen
dda66d580f Merge branch 'ebassi/for-master' into 'master'
docs: Fix the dependencies links

See merge request GNOME/gtk!3284
2021-03-13 12:36:56 +00:00
Matthias Clasen
1d773df9f2 Merge branch 'ngl-textview-cursor' into 'master'
Ngl textview cursor

See merge request GNOME/gtk!3292
2021-03-13 12:33:15 +00:00
Matthias Clasen
9be2f130f0 textview: Fix blinking block cursors
When we have a block cursor, we need to discard the
cached node of the line containing the cursor, in order
to get a blinking cursor.
2021-03-12 21:50:07 -05:00
Matthias Clasen
e345f9a4db textview: Fix blinking block cursors
When we have a block cursor, we need to discard the
cached node of the line containing the cursor, in order
to get a blinking cursor.
2021-03-12 19:44:31 -05:00
Matthias Clasen
3a928c8980 textlayout: Render cursors at the end
Don't place the insertion cursor render nodes in the
middle of the text nodes for all the text. This helps
the renderer batching the text draw calls together.
2021-03-12 19:28:36 -05:00
Matthias Clasen
42dfc21b2d ngl: Fix up some debug printouts 2021-03-12 18:26:15 -05:00
Matthias Clasen
daed57c30e Merge branch 'wip/chergert/fewer-uniforms' into 'master'
ngl: apply fewer uniforms

See merge request GNOME/gtk!3289
2021-03-12 22:55:00 +00:00
Matthias Clasen
de0860c1bf Merge branch 'pgriffis/readme-fixes' into 'master'
readme: Fix broken doc links

See merge request GNOME/gtk!3291
2021-03-12 22:51:16 +00:00
Patrick Griffis
4fbc63f50a readme: Fix broken doc links 2021-03-12 22:02:55 +00:00
Matthias Clasen
3e1524fade Merge branch 'ngl-vertex-attributes' into 'master'
Ngl vertex attributes

See merge request GNOME/gtk!3290
2021-03-12 21:26:52 +00:00
Matthias Clasen
ebe30d851b ngl: Identify shaders
Add a comment with a name to each shader. That makes
identifying the shaders in apitrace much easier.
2021-03-12 15:35:40 -05:00
Christian Hergert
f97ce21e59 ngl: reintroduce comparison checks
This reduces how many changes we make when recording uniform state, which
increases the chances that the data offset will be the same when applying
uniforms.
2021-03-12 11:47:15 -08:00
Christian Hergert
0b7d8e19c3 ngl: add front cache to reduce uniform changes
Since we make full snapshots when recording uniform state of batches, we
need to perform some deduplication to avoid so many repeated uniform calls.

This uses a closed hashtable to determine if we are likely changing the
value to something new.

This does not currently compare values, it instead only compares that we
are going to point at a new offset into the uniform buffer. We could go
further if we compare upon updating values (we did that early on in the
prototype) so that offsets are less likely to be changed.
2021-03-12 11:22:59 -08:00
Matthias Clasen
0ee6868b7f gtk-demo: Add a test for scrolling with Emoji
Make a text with lots of Emoji and text. This
is exercising the GL renderers switching between
different shaders for color and plain glyphs.
2021-03-12 13:19:37 -05:00
Matthias Clasen
6a30c6b01c ngl: Make the coloring shader more versatile
When the color passed is transparent black, use
the color from the texture as source, instead of
as mask. This lets use use the coloring program
both for regular and color glyphs, avoiding
program changes in text with Emoji.
2021-03-12 13:19:37 -05:00
Matthias Clasen
06d5c8e72d ngl: Set color as vertex attribute
Instead of using uniforms for color used in multiple
programs, pass it as vertex attributes. This will let
us batch more draw calls, since we don't have to change
uniforms so often. In particular, for syntax-highlighted
text.
2021-03-12 13:18:47 -05:00
Matthias Clasen
3252f1e301 gsk: Give ngl its own shader sources
We may want to change the interface between the
shaders and the renderer for ngl, and therefore,
sharing the shaders between gl and ngl will not
be practical, going forward.
2021-03-12 13:18:47 -05:00
Matthias Clasen
7f292d34bd Merge branch 'fix-3704' into 'master'
gdksurface-win32.c: Fix window menu positioning (issue #3704)

Closes #3704

See merge request GNOME/gtk!3286
2021-03-12 14:06:33 +00:00
Emmanuele Bassi
7c29847fbf build: Install the API references
We are building them, but not installing them.
2021-03-12 11:32:09 +00:00
Emmanuele Bassi
66f0547ebf docs: Fix the dependencies links
Use the GitLab pages location until we can link to a proper space on
developer.gnome.org.
2021-03-12 11:18:37 +00:00
Chun-wei Fan
e941e2be7d gdksurface-win32.c: Fix window menu positioning
We ought to get the coordinates of where the window menu should be
displayed using gdk_win32_surface_get_root_coords(), instead of rounding
the position that we obtained with gdk_event_get_position().

Also rename items a bit in the same function, and call
gdk_event_get_event_type() for consistency with the other backends.

Fixes issue #3704.
2021-03-12 18:45:43 +08:00
Changwoo Ryu
28e33bc26c Update Korean translation
(cherry picked from commit 7774d5d85e)
2021-03-12 08:51:03 +00:00
Emmanuele Bassi
372513a5e2 Merge branch 'bilelmoussaoui/shortcuts-annotation' into 'master'
g-i: fix gtk_shortcut_label_new annotation

See merge request GNOME/gtk!3285
2021-03-11 18:40:32 +00:00
Bilal Elmoussaoui
5c505aefc4 g-i: fix gtk_shortcut_label_new annotation 2021-03-11 18:21:56 +00:00
Emmanuele Bassi
9b3ca7f6b1 Merge branch 'ebassi/gidocgen' into 'master'
Move API reference to gi-docgen

See merge request GNOME/gtk!3222
2021-03-11 17:11:57 +00:00
Emmanuele Bassi
c5ddf5b381 docs: Add URL maps for cross links 2021-03-11 16:46:02 +00:00
Emmanuele Bassi
61712bfb3b docs: Enable search 2021-03-11 16:37:38 +00:00
Emmanuele Bassi
c3eb3f2943 docs: Update the "running GTK apps" section
Style the content a bit better, and use the appropriate links.
2021-03-11 16:37:38 +00:00
Matthias Clasen
d13e592dbf Small updates to the coding and documentation style
Mention summary sentences, and a few other things.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
686f65f267 build: Add missing variable definition 2021-03-11 16:37:38 +00:00
Emmanuele Bassi
bb2ee71cd8 build: Add a GIR dependency to PangoCairo
This is not strictly needed from an introspection perspective, but:

 - GTK strictly depends on PangoCairo internally
 - we want to integrate the GDK docs with PangoCairo's

So even though we don't have an explicit dependency on PangoCairo types
in our ABI, we do assume that people will be able to use the PangoCairo
API with GTK.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
816383e9ef Handle static inline GtkOrdering function
The introspection scanner does not handle `static inline` functions:
they are not in the shared library, so cannot be dlsym() out of it; and
the `static` keyword tells g-ir-scanner to skip the function declaration
entirely.

We can trick the scanner into thinking the gtk_ordering_from_cmpfunc()
symbol is a real, public one, by declaring and defining a regular
function under the `__GI_SCANNER__` guard; the symbol does not appear
when actually building GTK, or any code using GTK, so we don't risk
collisions.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
90cf6bb686 docs: Show class hierarchy in the API references 2021-03-11 16:37:38 +00:00
Matthias Clasen
e930433800 label: Fix some external links
I had put in a bunch of [class@Pango.Attribute],
but it needs to be [struct@Pango.Attribute].

Know your dependencies` type hierarchy!
2021-03-11 16:37:38 +00:00
Matthias Clasen
a6b2994f8b text: Fix some copy-paste mishap
A bunch of occurrances of "the self" looked like
absurdist short fiction:

"...the self scrolled off the screen to the left"
2021-03-11 16:37:38 +00:00
Matthias Clasen
8d7103116a widget: Fix up some links
Fix up some links to vfuncs and to sections, as well as class methods.
2021-03-11 16:37:38 +00:00
Matthias Clasen
9d95c5a26d shortcuttrigger: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
9fbe61e01f shortcutlabel: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
7c442c1736 shortcutcontroller: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
48a3b4e7cd shortcutaction: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
90ecf58a9c shortcut: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
0a966e59e6 sizegroup: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
acb78afc2d testutils: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
d0ed62e747 snapshot: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
44e977ef35 tooltip: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
f93f975e42 settings: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
9fa8b446cc recentmanager: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
e065b28d1a mountoperation: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
6108759d63 menutrackeritem: Remove SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
4e315b81cc menutracker: Remove SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
802c976d07 treesortable: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
a5018ed029 treeselection: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
1a09c361f5 treemodelsort: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
58f64c85ca treemodelfilter: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
9a6886e5e2 treemodel: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
deef6425b3 treednd: Add summaries 2021-03-11 16:37:37 +00:00
Matthias Clasen
9e3df3fac1 treestore: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
03e21fc957 liststore: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
3ed729e1d7 treeviewcolumn: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
1cde6a2e08 treeview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
f937fe4a87 windowgroup: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
190292a7da listbox: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
86d2a44850 iconview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
ef429c587b constraintsolver: Remove SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
f9cb67b32c cellview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
f6932b885d cellrenderertoggle: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
b1ba7f4380 cellrenderertext: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
2eae3e8e78 cellrendererspinner: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
077fe55d81 cellrendererspin: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
e92e14c845 cellrendererprogress: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
8b7f39ead8 cellrendererpixbuf: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
48a94ccbfc celleditable: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
a9b163cd7f cellrenderercombo: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
3236b1d1c9 cellrendereraccel: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
d85fa8854e cellrenderer: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
522ae8d02f celllayout: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
7173223df5 cellareacontext: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
186d2c2964 cellareabox: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
ccb40688ec cellarea: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
8d888203f0 actionobserver: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
a63223b25b actionobservable: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
3cccb00f51 actionmuxer: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
cc0df3c315 accessiblevalue: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
7b08e9b5d3 cssdataurl: Drop SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
b019cabd0c bloomfilter: Drop the SECTION
This is private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
260a4db854 accelgroup: Convert docs
Drop an unused SECTION, and convert links.
2021-03-11 16:37:37 +00:00
Matthias Clasen
8497f285c4 scrollbar: Tweak docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
6925843221 placesview: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
a6a7799dc5 placessidebar: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
3205cc79a7 modelbutton: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
71fce93088 filechooserwidget: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
537d6e5e65 treelistmodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
d0b1e2f7de treeexpander: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
eb675e3e7e shortcuttrigger: Tweak docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
3f201aeb21 selectionmodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
da6b6d44c1 multiselection: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
b873b83691 listlistmodel: Remove SECTION
Private, no point.
2021-03-11 16:37:37 +00:00
Matthias Clasen
19f649ec1d noselection: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
a786af0c19 selectionfiltermodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
42e9cf88cf immulticontext: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
33d7aff67e imcontextsimple: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
4e4050813a gestureswipe: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
2d55e3343a papersize: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
8d8fd63b93 gesturestylus: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
e2cab4d406 imcontext: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
3eeaef0834 widgetpaintable: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
4921497904 singleselection: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
71ce79bfb8 slicelistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c76bd17ddd gesturesingle: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ecd8d7596b maplistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
97fd0fe889 scrollable: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
96fe1218f2 overlaylayout: Add docs for GtkOverlayLayoutChild 2021-03-11 16:37:36 +00:00
Matthias Clasen
14c45be89c gesturerotate: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d5d0cf61b9 padcontroller: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
7606329617 gesturezoom: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
7a1da45fff mediafile: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
4905f5e722 mediastream: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ca3363466f gesturepan: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
207c4cd9e1 propertylookuplistmodel: Remove SECTION
This is private, no need.
2021-03-11 16:37:36 +00:00
Matthias Clasen
6221d1b407 version: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f6ff03bf09 viewport: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ae315c1106 stringlist: Add docs to GtkStringObject 2021-03-11 16:37:36 +00:00
Matthias Clasen
8164cbbc5f listbase: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
2d76ce829c gesturelongpress: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e604c3b77c gesturedrag: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d4f2121bc2 infobar: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f328e5ecc1 gestureclick: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
19df22f784 icontheme: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
3556b605c9 gesture: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c26ac6b695 flowbox: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
9f08c50791 flattenlistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
95b2107728 filefilter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
2915c72a26 eventcontrollerscroll: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
207a45b7e0 eventcontrollermotion: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
32b3386d23 eventcontrollerlegacy: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
094d5d5260 eventcontrollerkey: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
8b26894759 eventcontrollerfocus: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f4ad0f32f8 expander: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ca74f46b3e spinner: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d7e0af62e3 eventcontroller: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
21f2a824ad entrycompletion: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
6bd46779fc editable: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
b3f6e95d62 droptargetasync: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
39dac1ff22 droptarget: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
30236be2fd dragsource: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
a9d4b6a61c dragicon: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c1e10473fb builder: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e8bba52190 border: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
1a504feab9 accessible: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
406e4a6928 csssection: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f89e1bce90 csslocation: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d1b472c1c8 windowcontrols: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
cabe2f5f20 treelistrowsorter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
970ae74cd5 texttag: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
50139ad184 textview: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d74666de58 texttagtable: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e0df1b3fd9 textmark: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
bf978ba5a6 textiter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
05b13dca55 textchild: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
720f6e7a17 textbuffer: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
71649fce29 text: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
42aa2edf19 styleprovider: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
b66c74767f stylecontext: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
39394da850 stringsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
da9a320a40 sortlistmodel: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5bdcd66117 sorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
930912fd0d revealer: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5ebd0edf72 numericsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
dda6458142 multisorter: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5568025f1d listview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5189d3b485 listitem: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
901f60bc54 gridview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
9f90100019 fixedlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
8db6d6750c fixed: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
36f6a76272 filterlistmodel: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
8696b78e59 expression: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
493d773c18 enums: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
9247460c2f entrybuffer: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
ebadece27b dropcontrollermotion: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
f4b498031a dragsource: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
eb77ff9696 dragicon: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
c11ec03642 directorylist: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
7744be938f customsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
646a6726a8 customlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
460955d578 cssprovider: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
2e1114c9fa customfilter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
a814c3b3c4 constraintlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5e41ea1d2f constraintguide: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
350a775963 Constraint: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
c0da6b935d columnviewcolumn: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
a9162d2218 columnview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
102884faf1 docs: Remove anchors from list overview
Our markdown doesn't support this.
2021-03-11 16:37:35 +00:00
Matthias Clasen
497a399372 windowcontrols: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
292643890b window: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
c46480fe7e textview: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
29f2e5f84e switch: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
9ab40d2899 stringlist: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
cc03ca9df1 spinbutton: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
bcb0b36238 searchentry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
7e7c81c5d2 searchbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
d7ce5c55c8 scrollbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
59c0bee4b8 scalebutton: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
33f611a596 scale: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
495c3d9c44 progressbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
b4ad1fa44f popovermenubar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
b093900e48 popover: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
27b338a90b passwordentry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
ca51d6dfd9 paned: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
47c1b50eba cursor: Use a table for cursor names
This gets all the names into view at the same time.
2021-03-11 16:37:35 +00:00
Matthias Clasen
5d68a23b55 menubutton: Put images in a table 2021-03-11 16:37:35 +00:00
Matthias Clasen
9f6e4e60d0 label: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
7a60c66940 headerbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
31245353d5 frame: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
c91e141a6c fontbutton: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
87c0363cd5 expander: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
71bad39f5a entry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
40574f9ca3 emojichooser: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
752477b1ae editablelabel: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
ad9849bf26 dropdown: Small doc tweak 2021-03-11 16:37:35 +00:00
Matthias Clasen
9bfe163cf1 comboboxtext: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
22f072faea combobox: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
57c7d77cdf colorbutton: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
7ac7bb9543 checkbutton: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
c82b5b8d8a centerbox: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
15aa7de547 calendar: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
ee62d19115 button: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
cdcabb7fb7 atcontext: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
494bdad887 contentprovider: Convert some more markup 2021-03-11 16:37:34 +00:00
Matthias Clasen
ef09696ee5 stringfilter: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8da60587e1 stackswitcher: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3a7e9a28d3 stacksidebar: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3535b582a1 stack: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
07573ef2a6 overlaylayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
92838f9972 printdialog: Add an example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
ca5f66b368 multifilter: Docs tweaks. 2021-03-11 16:37:34 +00:00
Matthias Clasen
af6af482c4 pagesetupdialog: Add an example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
c65239155f notebook: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
12f0d963d9 levelbar: Docs tweaks 2021-03-11 16:37:34 +00:00
Matthias Clasen
6ab8ca4669 headerbar: Add example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
d65a98f828 gridlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
79417d8d40 centerlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8bdb2ea667 overlay: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8e887fbbf4 listitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
dc42dcf962 signallistitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
68cd66b210 builderlistitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
39a9bea066 builderscope: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
0776f645fd builder: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b408dc0706 boxlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
626ee40970 boolfilter: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
f86c8f2077 bookmarklist: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
1a501e3d53 binlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
c611fcc709 assistant: Small doc tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
de1101df19 aspectframe: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
aca07954af applicationwindow: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
06a51c045c application: Tweak docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
7f7231038d adjustment: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
fd6faabe16 actionable: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
26ca77d01b aboutdialog: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
b983133675 Include low-level printing in the gir
We add the sources, but not the headers. Oops.
2021-03-11 16:37:34 +00:00
Matthias Clasen
02fc352bfb windowhandle: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
180de1041b shortcutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
ded9903a83 root: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
921e8e02f4 printoperationpreview: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
9d536b9aef printunixdialog: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
d11b263ac2 printsettings: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
a710e64bad printeroperation: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b257a58417 printjob: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
eca14b763c printer: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
5225a0f253 printcontext: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
60b3effce3 pagesetupdialog: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b3e7e31bb0 pagesetup: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3ab954882d layoutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
7dd436ab17 filter: Add sections for AnyFilter and EveryFilter 2021-03-11 16:37:34 +00:00
Matthias Clasen
085b0b7c08 adjustment: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
76fa6dcef6 shortcutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
dde3de34c9 popovermenubar: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
e88f0d4b77 popovermenu: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
172ab2f20a native: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
0ca97cd218 emojichooser: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
645c951fb6 mediacontrols: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
4bed24a816 windowcontrols: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
9104420c87 shortcutswindow: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
0d238f4c99 range: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
9b9c9ae8d4 popover: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
1f06cfd5d8 headerbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
ddcb76ac2d appchooserwidget: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
e21156b30b appchooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
166edeed91 appchooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
465aca029e Add some more widgets to the gallery
We already have images for menus, menubars and emoji chooser.
Use them.
2021-03-11 16:37:33 +00:00
Matthias Clasen
86604d8e01 nativedialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
bb393f6496 fontchooserwidget: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7a099604c9 fontchooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
92009413f2 fontchooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7763fc55bb filechoosernative: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
042af94048 filechooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
d91fb26409 filechooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
3124a784fe searchbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
936a2c2c59 colorchooserdialog: Fixup 2021-03-11 16:37:33 +00:00
Matthias Clasen
53d3b46d4a actionbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
fc55478890 paned: Convert docs
Convert links, add example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
d41c3e3c2d colorchooser: Convert docs
Convert link syntax.
2021-03-11 16:37:33 +00:00
Matthias Clasen
886ba1680d colorchooserwidget: Convert docs
Convert links, and clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
11c5523142 colorchooserdialog: Convert docs
Convert link syntax, add example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
c0be9c5b97 colorbutton: Small doc tweaks 2021-03-11 16:37:33 +00:00
Matthias Clasen
ad2dad6612 assistant: Convert docs
Convert link syntax, an example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
5950bcd754 frame: Convert docs
Convert link syntax, add an example image, add property
annotations.
2021-03-11 16:37:33 +00:00
Matthias Clasen
067b43fb5b aboutdialog: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
b39160243f aboutdialog: Improve example image
Use our logo, and update the copyright years.
2021-03-11 16:37:33 +00:00
Matthias Clasen
b460ffd120 dialog: Convert docs
Convert links, add an example image, generally clean up docs.
2021-03-11 16:37:33 +00:00
Matthias Clasen
a61c677a0d docs: Add dialogs to the gallery 2021-03-11 16:37:33 +00:00
Matthias Clasen
7afc1291a8 window: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
cc2d9f0cb5 scrollable: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
73b66428a7 viewport: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
3a62b28344 scrolledwindow: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f3b16d0e9d messagedialog: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
e999773566 grid: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
6aaa98f669 expander: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f800178e7f centerbox: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
07a2b60f45 box: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f5fe5c1fa6 appchooserbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
e353cf38ec colorbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
947ebee7d4 dropdown: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d4eb11142a fontbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
e4054d62fe switch: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
37855e2b53 spinbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
08371b25dc menubutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
26100ad5d1 lockbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
69427e98d5 editablelabel: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d3e8607f58 combobox: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
cf6f57b41c passwordentry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d5a024c7f8 linkbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
67fdc0491a checkbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
5d69584a53 togglebutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
ef5b781e0c entry: Minor docs fixes 2021-03-11 16:37:33 +00:00
Matthias Clasen
72505acb9e searchentry: Minor docs tweaks 2021-03-11 16:37:33 +00:00
Matthias Clasen
d7b55cfd0c editable: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7803a09f31 entry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Emmanuele Bassi
4f36509e5f Mark padding fields as private
And mention that they should be removed in the next version of GTK.
Padding fields in interfaces are unnecessary, as they don't contribute
to the ABI.
2021-03-11 16:37:33 +00:00
Emmanuele Bassi
198c0be5e7 flowbow: Mark private fields as private 2021-03-11 16:37:33 +00:00
Matthias Clasen
c0bd352c88 scale: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
3a62913a97 entry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
abb951daf1 button: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
4131cb4c7b bitset: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
7450427757 gsktransform: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
b836707979 gskroundedrect: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
70f805cdfe rendernode: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
458bc5500c gskrenderer: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
22b375534e glshader: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
e60afc6011 docs: Remove stray backtick 2021-03-11 16:37:32 +00:00
Matthias Clasen
30073de932 widget: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
b674bba155 video: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
50df5e0ec2 textview: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
693f3d6b41 separator: Add property annotations
Connect properties, getters, and setters with annotations.t
2021-03-11 16:37:32 +00:00
Matthias Clasen
e78302c4e5 scrollbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
0559e9e763 scale: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
8eacbc3a20 picture: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
3fd3187d8f orientable: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
723d979be2 infobar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
0c56522de1 image: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
8db308be4d glarea: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
30d32a1f9d drawingarea: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
08509acc04 claendar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
6ff78c99fa accessible: Annotate properties 2021-03-11 16:37:32 +00:00
Matthias Clasen
34443546a8 visual index: Reorder some widgets
This improves the alignment a bit.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d5e9e10d0a toplevel: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d262f740b2 texture: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d886ab9229 surface: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
6be66205cc seat: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
abb6fe326f popup: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d6c763f2ae monitor: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
34533b544a glcontext: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d92647a92b drop: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
553a959102 drawcontext: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
9a33a1852a drag: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
ce83a0e5bb displaymanager: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d724ea294d display: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
038006d582 devicetool: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
4a4301be38 device: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
50fe533246 cursor: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
11022fc485 contentprovider: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
c51585bab1 clipboard: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
701ebd55c7 applaunchcontext: Add property annotations
Connect properties and getters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
4c50c312c1 statusbar: Remove SECTION 2021-03-11 16:37:32 +00:00
Matthias Clasen
55f1ed171a infobar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
97c4e46e39 progressbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
3ed2e94f29 levelbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
e98ea46d87 spinner: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
a8a15d48ad label: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
6bc69a12cc docs: Update the documentation style guide 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
c6b23f8f89 constraint: Port to the new docs format
- Drop the "SECTION".
 - Add attributes annotations for properties and getter methods.
 - Remove excessive linking and redundant types
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
be93dd98f7 Hide GtkSettingsValue
This is a private type that has no public API, and no business being in
a public header.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
a8f36b8381 Hide GtkTextBTree's typedef
It's a private type, and has no business in a public header.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
1fb5824e1e treemodel: Update the description format
Also add a description for GtkTreePath.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
35e438a62e treeview: Update the description format 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
cf707cbfaa expression: Update docs format
And add documentation stanzas for GtkExpression sub-types.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
1eb9d699b5 Box GtkExpressionWatch
Otherwise bindings won't know how to deal with memory management.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
da94b461e0 csssection: Update docs syntax 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
ec32ff04b8 application: Convert docs
Drop mentions of command line arguments parsed by gtk_init(), and of the
GDK lock.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
8d12dce174 docs: Fix property annotation 2021-03-11 16:37:32 +00:00
Matthias Clasen
63dc97fb29 spinbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
6c315b1b8a searchentry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
231a19abb9 passwordentry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
99a3dbef00 editablelabel: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
9934f9c43b constrainttarget: Convert docs 2021-03-11 16:37:31 +00:00
Matthias Clasen
c4e43c1cd5 buildable: Convert docs
Change link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3549914d0f accessible: Convert docs
Change link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e034046724 widget: Convert docs
Some work toward converting the docs to markdown.

More work needed, in particular around vfuncs and
class functions.
2021-03-11 16:37:31 +00:00
Matthias Clasen
c975216f47 entry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
18e5192a58 switch: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
dc8ee5a992 volumebutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e75c3d0380 fontbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
47cb0771f5 colorbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
6884a1a5c6 dropdown: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
d028f7ed9a appchooserbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
fc6f16cb61 lockbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
1692b41b30 comboboxtext: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
8e6b6ae26e combobox: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
9a16b1b971 docs: Remove duplicate documentation stanzas 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
895aa1d3ab docs: Fix typos 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
da6861188b docs: Fix value annotation
Drop the `:`.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
1dd240974b docs: Fix copy-paste error in GdkDevice 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
b6b30c9bcf docs: Fix the MenuButton direction property links 2021-03-11 16:37:31 +00:00
Matthias Clasen
47b9a554ac menubutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3d8c810ab7 checkbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
dfb68fb13d docs: Split images for check and radio buttons
Its the same widget, but two images fit better in the gallery,
and will be easier to use as example images in the docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
f854136676 linkbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
18f525f7b4 docs: Improve the togglebutton image
Make it actually show toggles.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4ee4c88e43 wayland: Fix a link
gi-docgen currently can't handle links without namespace
in the Wayland docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
ec78bf3309 togglebutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4bf7bfb41a button: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
538f935d44 docs: Fix the annotation for GtkTextView:justification 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
952fc31dbc docs: Fix up the 3-to-4 migration guide 2021-03-11 16:37:31 +00:00
Matthias Clasen
93326164e2 docs: Add backend links to the gdk docs
These are placeholders for when we know how to
link across namespaces.
2021-03-11 16:37:31 +00:00
Matthias Clasen
b78895e449 docs: Add separate toml files for gdk backends
Reusing the same one duplicates the standalone
docs, which doesn't quite seem right.
2021-03-11 16:37:31 +00:00
Matthias Clasen
205a13eaa0 docs: Brush up the Wayland backend docs
Add some content here.
2021-03-11 16:37:31 +00:00
Matthias Clasen
a9dd352986 gdk: Some more tweaks of the docs 2021-03-11 16:37:31 +00:00
Matthias Clasen
e82d090bf5 docs: Add some links to the pango chapter 2021-03-11 16:37:31 +00:00
Matthias Clasen
9132f1831c docs: Rework the gdk docs
Convert links, make things more concise.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3d04c0f4be docs: Move GdkEvent docs inline
This is not really worth a chapter of its own.
2021-03-11 16:37:31 +00:00
Matthias Clasen
ca3120919f docs: Improve gsk docs
Convert link formats, add summaries, and make
a few missing things show up in the docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e5bed812f5 docs: Tweak X11 section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
d88a4629f9 docs: Tweaks Windows section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
24c04b5bb9 docs: Tweak Wayland section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4c3ea25745 docs: Tweak a11y section
Convert link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
231814a595 docs: Tweak running chapter
Remove unsupported heading anchors, fix definition
list use.
2021-03-11 16:37:31 +00:00
Matthias Clasen
820f37be0b docs: Tweak input overview
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
02ec00dc5a docs: Tweak drawing model overview
Fix link syntax, remove gtk-doc markup.
2021-03-11 16:37:30 +00:00
Matthias Clasen
4d2e4309f0 docs: Tweak css properties section
Fix the use of definition lists.
2021-03-11 16:37:30 +00:00
Matthias Clasen
d2ba09ec98 docs: Tweak the actions overview
Fix use of definition lists, and remove some gtk-doc
markup.
2021-03-11 16:37:30 +00:00
Matthias Clasen
41ddce152a building: Minor tweaks
Remove unsupported anchors from headings.
2021-03-11 16:37:30 +00:00
Matthias Clasen
df9c469acd video: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
8cf04b3345 glarea: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
1072b56970 drawingarea: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f94fc28eb5 textview: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
3b42440805 picture: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
dcf53bced2 scale: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
76e9a7bbb4 image: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
12ccc68c99 separator: Convert docs
Change link syntax and add an example image.
2021-03-11 16:37:30 +00:00
Matthias Clasen
834295dde0 calendar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
b7f4f5d234 scrollbar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
61d85f32a2 infobar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6d489a9e81 docs: Generate the DevHelp file for our namespaces 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
85774d2bcd docs: Update the "Getting Started" page
Drop the Pandoc stuff, add the gi-docgen links, and remove a stray
docbook element.
2021-03-11 16:37:30 +00:00
Matthias Clasen
03c5b680ec statusbar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
8de0a2c7c6 infobar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
d58655b4ae progressbar: Convert docs
Change link syntax, add an example image, generally clean
things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f2b482ef65 levelbar: Convert docs
Change link syntax, add an example image, generally
clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
a2e8bd24ca spinner: Convert docs
Change link syntax and add an example image.
2021-03-11 16:37:30 +00:00
Matthias Clasen
584e978840 aboutdialog: tweak the docs
Add a short summary.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f00f900224 label: Convert docs
Change link syntax, add singl-line summaries,
add missing property docs.
2021-03-11 16:37:30 +00:00
Matthias Clasen
b9a02b0c24 docs: Bring the widget gallery back
We have all the images, lets put them to use.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
af8d8113eb docs: Remove the last few remaining '+' from GTK 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
e8b6e6cad0 docs: Clean up the first paragraph for various symbols
The documentation engine will use the first paragraph as the summary for
a type or constant.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
701f1b837b docs: Show summary in the namespace index 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6781de96a5 docs: Start porting GtkImage to the new style 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
4fef62c38d docs: Port GtkAboutDialog to the new syntax
We should also clean up the annotations, while we're at it.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3ef95b4065 build: Quiet down gi-docgen
We are only interested in the warnings and errors.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
d621a37a60 docs: Fix up the style of the X11 content file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6f93e63d21 docs: Move detached sections into their own content file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
04fb95ce9f docs: Split GdkDrag and GdkDrop sections
This way we have a section for each class.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
548280da9f docs: Rename GdkTexture section
The name needs to match the class.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
b9f0cf1c8b docs: Move gdkcairo section to an external file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
abb33bd65f docs: Move the gtkmain section to its own document
The introspection data does not handle unattached sections like gtk-doc
does, so we need to move what was gtkmain into its own Markdown
document.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
542b959933 docs: Use new link syntax 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
b2a99642a9 docs: Begin porting GtkWidget to the new format 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6f7e933713 doc: Port GtkConstraint to the new format 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3c0f047597 docs: De-indent GtkRecentInfo.get_applications() return value
Otherwise the four spaces will be treated as a pre-formatted block by
Markdown.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
a6da2db4ea docs: Start porting GtkConstraintLayout to the new doc format
Drop the old gtk-doc'isms, and use the gi-docgen links instead.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
f85b847410 docs: Add metadata preamble to GTK's content files 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
a6ee0dd8aa docs: Drop gtk-doc files
We don't use gtk-doc to generate our API reference, so we don't need its
files lying around any more.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
0ba2a3a191 Generate GTK API reference(s) with gi-docgen
Stop using gtk-doc, and switch to gi-docgen.

The gi-docgen tool generates API references through the introspection
data, which has various benefits:

 - it does not parse C code
 - it does not generate and run C code to introspect types at build time
 - it does not present a different API from the one we're exporting

Additionally, gi-docgen:

 - does not generate DocBook XML in order to generate HTML
 - does not go through xsltproc
 - parses proper Markdown

Which makes it markedly faster than gtk-doc has ever been.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
761c327ac5 Add gi-docgen as a subproject
While we're developing gi-docgen it's better to have it as part of our
build.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3760051169 ci: Update the fedora-docs Docker image
Use the latest base image.
2021-03-11 16:37:29 +00:00
Emmanuele Bassi
787830d360 ci: Update the CI image for docs building
We don't use Pandoc any more, but we need a bunch of Python modules for
gi-docgen.
2021-03-11 16:37:29 +00:00
Emmanuele Bassi
4018417ceb ci: Update the reference job 2021-03-11 16:37:29 +00:00
Emmanuele Bassi
386256a424 Rename base version argument in run-docker.sh
The `--base-version` argument trips up everyone. Might as well rename it
to `--version`.
2021-03-11 16:37:29 +00:00
Matthias Clasen
f3701ff961 Merge branch 'fix-menubutton-tooltips' into 'master'
Limit tooltip queries to the same native

Closes #3719

See merge request GNOME/gtk!3283
2021-03-11 14:25:53 +00:00
Matthias Clasen
27295bc555 Limit tooltip queries to the same native
Without this, the menubuttons tooltip pops up
when hovering the popover, which is suprising
and unintended.

Fixes: #3719
2021-03-11 08:56:56 -05:00
Matthias Clasen
e62f9e33a1 Merge branch 'gdk-win32-use-window-from-point-for-master' into 'master'
GdkWin32: Fix mouse events in presence of transparent windows on the desktop

Closes #370, #417, and gimp#1082

See merge request GNOME/gtk!2800
2021-03-11 01:09:39 +00:00
Matthias Clasen
fe45f283af Merge branch 'matthiasc/for-master' into 'master'
inspector: Fix surface transform regression

See merge request GNOME/gtk!3280
2021-03-09 23:59:05 +00:00
Matthias Clasen
5556907194 inspector: Fix surface transform regression
Ever since we added surface-to-widget transforms,
the autofading of the fps overlay did not work anymore,
since it was given the transient transform node, most
of the time.

Fix this by passing both the root of the node tree and
the node for the toplevel widget to prepare_render, and
hande the widget node to the overlays. Update the
affected overlays that need to have their positioning
adjusted.
2021-03-09 18:27:04 -05:00
Мирослав Николић
9d51821e84 Update Serbian translation
(cherry picked from commit f33a2febc7)
2021-03-09 21:23:22 +00:00
Benjamin Otte
c696385130 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!3279
2021-03-09 19:11:09 +00:00
Benjamin Otte
0a9d075b47 wayland: Fix memleaks when rendering with Cairo
We were leaking buffers. This wasn't caught by valgrind and friends
because it was shared memory (with the compositor), but top(1) would
instantly see memory consumption of the app and the shell go through the
roof.
2021-03-09 19:52:59 +01:00
Benjamin Otte
b63c4d6722 wayland: Don't call _gdk_surface_update_size() all the time
We were calling _gdk_surface_update_size() every frame, even if the
window size didn't change. This would cause us to discard all cached
buffers and redraw the whole screen.

This was BAD.
2021-03-09 19:50:56 +01:00
Matthias Clasen
221825394f Merge branch 'ngl-rect-borders' into 'master'
Speed up border rendering

See merge request GNOME/gtk!3278
2021-03-09 17:56:57 +00:00
Matthias Clasen
124f60593b nodeparser: Print debug message before child
This puts the message up top, where it can be seen,
and not at the other end of an endless tree of children.

Update tests to match.
2021-03-09 12:15:25 -05:00
Matthias Clasen
09af40faeb ngl: Render simple borders simply
Use 4 color commands for uniform, rectilinear
borders. Most of our borders are rounded with
Adwaita, but there are still some of these.
2021-03-09 12:15:25 -05:00
Matthias Clasen
bf59ddd01d gsk: Add gsk_border_node_get_uniform_color
Maintain this bit of information separately,
it will be useful in the next commit.
2021-03-09 12:15:25 -05:00
Benjamin Otte
fea67dea6a vulkan: Improve rounded rect clipping
Handle the case where the inner rounded rect is fully contained
within the outer rounded rect.
2021-03-09 17:43:28 +01:00
Benjamin Otte
9f18c138d1 vulkan: Fix invalid read
Look at the right rect to compute circularness
2021-03-09 17:43:28 +01:00
Matthias Clasen
bfa68223e1 Merge branch 'meson-override-dep' into 'master'
meson: override gtk4 dependency

See merge request GNOME/gtk!3277
2021-03-09 03:00:18 +00:00
Xavier Claessens
629e70f89d Meson: Use gnome.post_install()
See https://github.com/mesonbuild/meson/pull/8272 and
https://github.com/mesonbuild/meson/issues/8268.
2021-03-08 21:19:09 -05:00
Xavier Claessens
405dc7f557 meson: override gtk4 dependency
This allows applications that depends on gtk4 to build it as subproject
without hardcoding 'gtk_dep' variable name in their build definition.
2021-03-08 21:06:33 -05:00
Matthias Clasen
cba8c40aa0 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3276
2021-03-09 00:12:11 +00:00
Matthias Clasen
98b13933d9 Merge branch 'bilelmoussaoui/size-request-annotations' into 'master'
g-i: update distribute_natural_allocation annotation

See merge request GNOME/gtk!3271
2021-03-08 23:07:18 +00:00
Matthias Clasen
062383bfd3 node-format: Small docs fixes 2021-03-08 17:49:21 -05:00
Matthias Clasen
91e94556ad spinbutton: Interpret localized digits
Interpret input where the characters have numeric values.

See #3387
2021-03-08 17:49:21 -05:00
Matthias Clasen
07ca46e92c Merge branch 'ngl-clip-classification' into 'master'
Ngl clip classification

See merge request GNOME/gtk!3274
2021-03-08 20:20:50 +00:00
Matthias Clasen
57e354c297 glsl: Make rounded rect clipping cheaper
Add early acceptance checks for non-corner cases.
2021-03-08 14:41:48 -05:00
Matthias Clasen
fb0814602e Merge branch 'matthiasc/for-master' into 'master'
Revert "ngl: Remove a few redundant checks"

See merge request GNOME/gtk!3273
2021-03-08 13:38:12 +00:00
Matthias Clasen
5f664dbbbb Revert "ngl: Remove a few redundant checks"
This reverts commit 4375f8e382.

These were not redundant after all, as pointed out by Timm.
2021-03-08 08:10:35 -05:00
Matthias Clasen
5d30569575 Add some more rounded rect tests 2021-03-07 21:28:19 -05:00
Matthias Clasen
46d1fc1c24 gsk: Use clip defines in shaders
Use the NO_CLIP and RECT_CLIP defines to make
simpler shaders for these cases.

Note: This does not work yet.
2021-03-07 20:30:45 -05:00
Matthias Clasen
2c05b758c7 ngl: Add infrastructure for clip-variants of shaders
Make ngl compile each shader three times.
Once with #define NO_CLIP 1
once with #define RECT_CLIP 1
and once as before.
2021-03-07 20:30:45 -05:00
Matthias Clasen
5788338a14 ngl: Classify clips
Maintain the 'fully contained' information in the clip
stack. This will let us pick simpler shaders in the future.
2021-03-07 20:30:45 -05:00
Matthias Clasen
d786e1d614 Merge branch 'ebassi/iface-macros' into 'master'
Remove invalid class macros

See merge request GNOME/gtk!3270
2021-03-07 20:22:14 +00:00
Matthias Clasen
c60a316e22 Move gtk_rounded_rect_scale_affine to the right place
This function should live with the rest of the
GskRoundedRect code in gskroundedrect.c.
2021-03-07 15:17:32 -05:00
Matthias Clasen
b73c9e992f imcontext: Fix a docs mishap 2021-03-07 15:16:59 -05:00
Bilal Elmoussaoui
4980f620f9 g-i: update distribute_natural_allocation annotation 2021-03-07 20:59:01 +01:00
Matthias Clasen
87b800c11d Merge branch 'bilelmoussaoui/gi-annotations' into 'master'
g-i: add missing since annotations for 4.2

See merge request GNOME/gtk!3268
2021-03-07 19:46:59 +00:00
Bilal Elmoussaoui
6e903e13a5 g-i: add missing since annotations for 4.2 2021-03-07 19:50:32 +01:00
Matthias Clasen
83c466dcd1 Merge branch 'scalable-svg' into 'master'
icons: Rename two icons which had the wrong extension

See merge request GNOME/gtk!3269
2021-03-07 18:43:50 +00:00
Emmanuele Bassi
676ea489cc docs: Remove invalid macros 2021-03-07 18:34:53 +00:00
Emmanuele Bassi
70fbfd8ede treesortable: Remove class check macro 2021-03-07 18:26:31 +00:00
Emmanuele Bassi
6234ccc974 orientable: Remove class macros 2021-03-07 18:25:55 +00:00
Emmanuele Bassi
0cfe3d45f5 celleditable: Remove class cast check macro 2021-03-07 18:25:07 +00:00
Emmanuele Bassi
41371ccae6 buildable: Remove "class" macro 2021-03-07 18:23:23 +00:00
Emmanuel Gil Peyrot
5807fee893 icons: Rename two icons which had the wrong extension
Fixes two warnings when opening the inspector on my PinePhone, these two
files were attempted to be loaded as PNG (as per the extension) instead
of SVG.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-03-07 18:59:04 +01:00
Christian Hergert
b2c1d6bc9b Merge branch 'ngl-misc-fixes' into 'master'
Ngl misc fixes

See merge request GNOME/gtk!3267
2021-03-07 15:59:59 +00:00
Rūdolfs Mazurs
5fd22e5981 Update Latvian translation
(cherry picked from commit 1d62020a19)
2021-03-07 15:26:30 +00:00
Matthias Clasen
d0dce4cfa1 ngl: Treat radial gradients like others
Handle colorstop overflow for radial gradients
the same way we do for linear and conic gradients.
2021-03-07 10:18:47 -05:00
Matthias Clasen
4375f8e382 ngl: Remove a few redundant checks
We bail early on invisible nodes. No need to
repeat that check in individual visit functions.
2021-03-07 10:18:47 -05:00
Matthias Clasen
42b515a1e5 Merge branch 'matthiasc/for-master' into 'master'
Revert "flatpak: No need to build sassc anymore"

See merge request GNOME/gtk!3266
2021-03-07 14:59:57 +00:00
Matthias Clasen
6ab779cd06 roundedrect: Remove unclear language from the docs
The various intersection function for rounded rects are
precise. No need to add wordy disclaimers about the handling
of the corners.
2021-03-07 09:04:43 -05:00
Matthias Clasen
a261e9fca2 Revert "flatpak: No need to build sassc anymore"
This reverts commit 9a540841fd.
2021-03-06 16:03:41 -05:00
Matthias Clasen
50ccab487f Merge branch 'matthiasc/for-master' into 'master'
vulkan: Add visible fallback rendering

See merge request GNOME/gtk!3264
2021-03-06 19:29:50 +00:00
Guillaume Bernard
ddd5e5717d Update French translation
(cherry picked from commit 5b18df9b5e)
2021-03-06 18:49:41 +00:00
Мирослав Николић
390a278606 Update Serbian translation
(cherry picked from commit b9a451423f)
2021-03-06 18:43:51 +00:00
Changwoo Ryu
00423c54b5 Update Korean translation
(cherry picked from commit 60a714a25f)
2021-03-06 18:11:58 +00:00
Jordi Mas
f8f90d85ad Update Catalan translation 2021-03-06 09:44:50 +01:00
Benjamin Otte
91932ada63 vulkan: Handle simple transforms in the clipping code
Requires pushing the GskTransform into the clipping code so that we
can actually look at its category.
2021-03-05 19:36:36 -05:00
Matthias Clasen
dbb264dfc9 vulkan: Add visible fallback rendering
Hook up the "Show fallback rendering" switch for Vulkan.

This brings home the sobering truth that the Vulkan renderer
is doing *all* fallback, since we switched from offset nodes
to transform nodes.
2021-03-05 18:42:04 -05:00
Matthias Clasen
3aa89efcf4 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3263
2021-03-05 20:30:54 +00:00
Matthias Clasen
82f40a92c1 searchentry: Typo fix 2021-03-05 15:07:02 -05:00
Matthias Clasen
ae1a950a93 flatpak: Fix the gtk4-demo build
This was overlooked in 8e7e821033.
2021-03-05 15:06:20 -05:00
Matthias Clasen
2228181b35 Merge branch 'wip/exalm/window-shadow-dark-4' into 'master'
Adwaita: Use transparent black for window border in dark too

See merge request GNOME/gtk!3261
2021-03-05 19:41:39 +00:00
Matthias Clasen
7357120c81 Merge branch 'wip/jimmac/fix-flatpak-build' into 'master'
Flatpak: Update build manifests

See merge request GNOME/gtk!3259
2021-03-05 19:11:36 +00:00
Alexander Mikhaylenko
0942e863f2 Adwaita: Use transparent black for window border in dark too
Avoid smear when the background behind the window is dark. Adjust opacity
to make it appear roughly the same as before on white background.
2021-03-05 22:59:25 +05:00
Matthias Clasen
08f3618a47 Merge branch 'wip/jimmac/sidebar-focus' into 'master'
Adwaita: Regular focus ring for sidebar rows

Closes #3708

See merge request GNOME/gtk!3258
2021-03-05 17:17:04 +00:00
Jakub Steiner
8e7e821033 Flatpak: Update build manifests
- point to the upstream repo for wayland
- disable disabling of sassc
- switch wayland from autotools to meson
2021-03-05 18:00:17 +01:00
Jakub Steiner
11d6f2ddd0 Adwaita: Regular focus ring for sidebar rows
- style sidebar rows as regular items like buttons wrt focus
- define transition as part of the focus-ring(),
  only animate outline related properties rather than `all`

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3708
2021-03-05 17:45:58 +01:00
Kukuh Syafaat
490384c69f Update Indonesian translation
(cherry picked from commit e54dc87a15)
2021-03-05 11:53:01 +00:00
Matthias Clasen
468242b13b Merge branch 'iconbrowser-fix' into 'master'
iconbrowser: fix search<>category interaction

Closes #3717

See merge request GNOME/gtk!3257
2021-03-05 01:11:11 +00:00
Matthias Clasen
d3d49ce7f1 iconbrowser: fix search<>category interaction
Make search act like a separate, filtered view of
all icons. This is how it worked in gtk3, and how
it should be.

Fixes: #3717
2021-03-04 19:30:02 -05:00
Matthias Clasen
c303ec1553 Merge branch 'preedit-selection-fix' into 'master'
Preedit selection fix

Closes #1123

See merge request GNOME/gtk!3255
2021-03-04 22:48:25 +00:00
Matthias Clasen
d28df0b87e textview: Delete selection when preedit starts
This prevents confusing misrendering when the preedit text
pushes the selection text out of the rendered selection.

Fixes: #1123
2021-03-04 15:18:30 -05:00
Matthias Clasen
d1fbfb9c4e textview: Send anchor with surrounding
We have the api to do it now.
2021-03-04 15:18:30 -05:00
Matthias Clasen
ccae0e1732 text: Optimize away 0-change insertions and deletions
We can short-circuit insert and delete calls that are
not causing any change.
2021-03-04 15:18:30 -05:00
Matthias Clasen
447203ce52 text: Delete selection when preedit starts
This prevents confusing misrendering when the preedit text
pushes the selection text out of the rendered selection.

Fixes: #1123
2021-03-04 15:18:30 -05:00
Matthias Clasen
feccdad9d2 text: Send anchor with surrounding
We have the api to do it now.
2021-03-04 15:18:30 -05:00
Matthias Clasen
35fceca157 imwayland: Pass anchor with surrounding
This was missing in the initial implementation since
GtkIMContext did not have it in its api, but it was
added now, so we can send the information.
2021-03-04 15:18:30 -05:00
Matthias Clasen
97db959305 immulticontext: Implement [gs]et_surrounding_with_selection
This is the recommended api, going forward.
2021-03-04 15:18:30 -05:00
Matthias Clasen
4b9aeaf9e3 imcontext: Add [gs]et_surrounding_with_selection
The Wayland text protocol expects to get both ends
of the selection with its surrounding call, so make
that available via GtkIMContext. We add this as new
api and vfuncs, and fall back, so that existing
implementations keep working.
2021-03-04 15:18:30 -05:00
Matthias Clasen
053d7cfe9f Merge branch 'wip/chergert/remove-zero-suffix-array' into 'master'
ngl: remove unnecessary suffix array

See merge request GNOME/gtk!3254
2021-03-03 21:53:27 +00:00
Jordi Mas
2959f219e4 Update Catalan translation 2021-03-03 22:31:04 +01:00
Christian Hergert
b368d3abde ngl: remove unnecessary suffix array
We didn't end up using this in the final version, so we can just delete
it and avoid MSVC issues.
2021-03-03 13:03:24 -08:00
Matthias Clasen
b533bba3f3 Merge branch 'bilelmoussaoui/annotations-fix' into 'master'
update annotation of gtk_single_selection_get_selected_item

See merge request GNOME/gtk!3253
2021-03-03 15:11:00 +00:00
Bilal Elmoussaoui
aae67b8fbd gtk: update annotation of gtk_single_selection_get_selected_item 2021-03-03 14:19:45 +01:00
Matthias Clasen
d79354dbf5 Merge branch 'wip/exalm/headerbar-css' into 'master'
Header bar CSS tweaks

See merge request GNOME/gtk!3252
2021-03-03 13:11:22 +00:00
Alexander Mikhaylenko
aa693159dc adwaita: Remove the nested headerbars hack
We clip the window now, it's not necessary anymore.
2021-03-03 17:35:15 +05:00
Alexander Mikhaylenko
5fef637e84 adwaita: Remove headerbar sheen on backdrop
It's gone from active windows since c9807f5afe,
but was still there in backdrop.
2021-03-03 17:34:22 +05:00
Matthias Clasen
208a53fa39 Merge branch 'label-mnemonic-fix' into 'master'
label: Fix markup parsing interactions

See merge request GNOME/gtk!3250
2021-03-03 12:00:37 +00:00
Matthias Clasen
875a92b95f label: Fix markup parsing interactions
We were not handling mnemonics vs markup right
in all cases. Rewrite the _-stripping code to
do it during the link parsing, instead of as
a separate function. This avoids the issue of
stripping _ from attribute names in markup.

Add tests.

Fixes: 3706
2021-03-02 23:25:01 -05:00
Matthias Clasen
c23848c03e Merge branch 'fix-glyph-serialization' into 'master'
rendernode: Fix glyph serialization

Closes #3710

See merge request GNOME/gtk!3248
2021-03-02 20:31:09 +00:00
Matthias Clasen
96ac85038b rendernode: Fix glyph serialization
We serializing to a string of ASCII, we need to
escape some chars, such as '\' and '"'.

Fixes: #3710
2021-03-02 11:32:29 -05:00
Baurzhan Muftakhidinov
69f051798e Update Kazakh translation
(cherry picked from commit 62e9dff536)
2021-03-02 03:35:10 +00:00
Matthias Clasen
1c6da51000 Merge branch 'wip/chergert/fix-ngl-gles' into 'master'
ngl: fix typo from NGL rename

See merge request GNOME/gtk!3246
2021-03-02 00:37:00 +00:00
Christian Hergert
d6694a4408 ngl: fix typo from NGL rename 2021-03-01 10:28:26 -08:00
Matthias Clasen
0ccca910df Merge branch 'submodules' into 'master'
Allow GTK4 to be added as a subproject

See merge request GNOME/gtk!3242
2021-03-01 16:01:25 +00:00
Matthias Clasen
fd2909abb2 Merge branch 'broadway-guint32' into 'master'
broadway: Restore guint32 type for memory size

Closes #3702

See merge request GNOME/gtk!3244
2021-02-27 23:16:28 +00:00
Rafał Dzięgiel
d586410416 broadway: Restore guint32 type for memory size
guint32 is used as part of the protocol in broadway backend.
Memory size declared with it was mistakenly replaced with size_t type
which does not guarantee being 32bit on all platforms, leading to a crash.
2021-02-27 23:43:12 +01:00
Jiri Grönroos
4721e760e7 Update Finnish translation
(cherry picked from commit 3cb5a831e3)
2021-02-26 12:10:10 +00:00
BogDan Vatra
72700d1644 Allow GTK4 to be added as a subproject 2021-02-26 09:27:02 +02:00
Emin Tufan Çetin
c274c35583 Update Turkish translation 2021-02-25 14:28:49 +00:00
Emin Tufan Çetin
d2c3f8f496 Update Turkish translation 2021-02-25 14:02:50 +00:00
Matthias Clasen
bffb666914 Merge branch 'matthiasc/for-master' into 'master'
imcontext: Fixes to the state machine

See merge request GNOME/gtk!3238
2021-02-25 12:25:02 +00:00
Matthias Clasen
ab615104f5 Merge branch 'wip/carlosg/touchpad-gesture-devices' into 'master'
gdk/wayland: Assign logical pointer to touchpad gesture events

See merge request GNOME/gtk!3240
2021-02-25 12:23:26 +00:00
Jiri Grönroos
9c2674ee1e Update Finnish translation
(cherry picked from commit 0fd0b00ec9)
2021-02-25 10:46:56 +00:00
Carlos Garnacho
68ced9b553 gdk/wayland: Assign logical pointer to touchpad gesture events
These events don't make sense on physical devices (for starters, they
are relative to the logical pointer position). Use this device for
those events, also happens to be what the upper parts expect of them.
2021-02-25 01:08:07 +01:00
Matthias Clasen
177f6b377d Merge branch 'bilelmoussaoui/gdk-draw-context' into 'master'
gdk: drop the latest mention of DrawingContext

See merge request GNOME/gtk!3232
2021-02-24 22:28:47 +00:00
Matthias Clasen
55f871c193 imcontext: Fixes to the state machine
It turns out that we we were sometimes emitting
preedit-end multiple times, and sometimes not at
all. Same for preedit-start. To fix this up, introduce
a in_compose_sequence flag, maintain it, and use it
in the right places.

After these changes, both

C-S-u 1 2 3 Enter
Compose a e

generate the right signals:

preedit-start, preedit-changed,..., preedit-end, commit
2021-02-24 13:31:31 -05:00
Carlos Garnacho
ce2835265b Merge branch 'wip/carlosg/mark-settings-valid-again' into 'master'
gdk/wayland: Make more matched settings from the portal as valid

See merge request GNOME/gtk!3236
2021-02-24 16:12:13 +00:00
Carlos Garnacho
75ae0e04e1 gdk/wayland: Make more matched settings from the portal as valid
Commit 97b5fad131 was a forward port from a gtk3 patch, but the hunk
was applied on the wrong bits of code.

Ensure the initialization paths also do mark settings read from the
portal as valid, so the checks for optional/newer settings actually have
the expected result. It is also desirable to mark settings as valid
after configuration changes (as that patch did effectively do), but not
enough to fix all situations.
2021-02-24 16:41:13 +01:00
Matthias Clasen
1f284fcd70 4.1.1 2021-02-23 20:59:16 -05:00
Matthias Clasen
718a95c1d2 Merge branch 'matthiasc/for-master' into 'master'
composetable: Remove some redundant code

See merge request GNOME/gtk!3234
2021-02-24 01:57:47 +00:00
Matthias Clasen
cd2854a5c6 Merge branch 'wip/chergert/glproto' into 'master'
gsk: add OpenGL based GskNglRenderer

See merge request GNOME/gtk!3225
2021-02-24 01:14:14 +00:00
Fran Dieguez
86151622db Updated Galician translations 2021-02-24 01:51:12 +01:00
Matthias Clasen
915e3f0e28 composetable: Remove some redundant code
Pointed out by Peter Bloomfield.
2021-02-23 19:14:26 -05:00
Matthias Clasen
a4e7b03185 inspector: Fix a typo
When selecting the "ngl" renderer, the inspector was
saying Renderer: Unknown, due to a typo. Fix that.
2021-02-23 18:37:32 -05:00
Matthias Clasen
e9ed874231 gsk: Replace a last instance of "next"
The output of GSK_RENDERER=help was still talking about
the "next" renderer, while actually looking for "ngl".
2021-02-23 18:36:41 -05:00
Christian Hergert
2a38cecd33 gsk: add OpenGL based GskNglRenderer
The primary goal here was to cleanup the current GL renderer to make
maintenance easier going forward. Furthermore, it tracks state to allow
us to implement more advanced renderer features going forward.

Reordering

This renderer will reorder batches by render target to reduce the number
of times render targets are changed.

In the future, we could also reorder by program within the render target
if we can determine that vertices do not overlap.

Uniform Snapshots

To allow for reordering of batches all uniforms need to be tracked for
the programs. This allows us to create the full uniform state when the
batch has been moved into a new position.

Some care was taken as it can be performance sensitive.

Attachment Snapshots

Similar to uniform snapshots, we need to know all of the texture
attachments so that we can rebind them when necessary.

Render Jobs

To help isolate the process of creating GL commands from the renderer
abstraction a render job abstraction was added. This could be extended
in the future if we decided to do tiling.

Command Queue

Render jobs create batches using the command queue. The command queue
will snapshot uniform and attachment state so that it can reorder
batches right before executing them.

Currently, the only reordering done is to ensure that we only visit
each render target once. We could extend this by tracking vertices,
attachments, and others.

This code currently uses an inline array helper to reduce overhead
from GArray which was showing up on profiles. It could be changed to
use GdkArray without too much work, but had roughly double the
instructions. Cycle counts have not yet been determined.

GLSL Programs

This was simplified to use XMACROS so that we can just extend one file
(gskglprograms.defs) instead of multiple places. The programs are added
as fields in the driver for easy access.

Driver

The driver manages textures, render targets, access to atlases,
programs, and more. There is one driver per display, by using the
shared GL context.

Some work could be done here to batch uploads so that we make fewer
calls to upload when sending icon theme data to the GPU. We'd need
to keep a copy of the atlas data for such purposes.
2021-02-23 14:41:52 -08:00
Ask Hjorth Larsen
9698d4aa2a Updated Danish translation of gtk-properties 2021-02-23 01:23:03 +01:00
Ask Hjorth Larsen
dd2851a0ff Updated Danish translation 2021-02-23 01:23:03 +01:00
Bilal Elmoussaoui
adf9377b61 gdk: drop the latest mention of DrawingContext 2021-02-22 22:15:14 +00:00
Matthias Clasen
700f39bfca Merge branch 'compose-warning' into 'master'
imcontext: Take out the warnings

See merge request GNOME/gtk!3230
2021-02-22 20:31:19 +00:00
Matthias Clasen
baec7079e0 imcontext: Take out the warnings
Don't warn about Compose file constructs we don't
support. We haven't supported these for a long time,
and nobody has every complained. No need to wake
up sleeping dogs.
2021-02-22 15:08:58 -05:00
Timm Bäder
f83644edee Merge branch 'SilverRainZ-master-patch-42810' into 'master'
gtk-demo: Fix typo GtkKabel -> GtkLabel

See merge request GNOME/gtk!3229
2021-02-22 08:20:34 +00:00
Emin Tufan Çetin
30d4417064 Update Turkish translation 2021-02-21 17:56:30 +00:00
Emin Tufan Çetin
b428fafade Update Turkish translation 2021-02-21 17:51:14 +00:00
Emin Tufan Çetin
63d1dc307a Update Turkish translation 2021-02-21 16:27:09 +00:00
Shengyu Zhang
55bfadadc4 gtk-demo: Fix typo GtkKabel -> GtkLabel 2021-02-21 16:20:22 +00:00
Piotr Drąg
179fae32a5 Update POTFILES.in 2021-02-21 12:50:44 +01:00
Matthias Clasen
e220b24b70 Merge branch 'wip/chergert/macos-gl-opaque-context' into 'master'
macos: make OpenGL context opaque when possible

See merge request GNOME/gtk!3226
2021-02-20 02:37:52 +00:00
Matthias Clasen
9061256122 Merge branch 'wip/chergert/fix-macos-resizing' into 'master'
macos: fix resizing of resizable windows on macOS

See merge request GNOME/gtk!3227
2021-02-20 02:32:15 +00:00
Christian Hergert
ea0d487f0b macos: fix resizing of resizable windows on macOS 2021-02-19 15:43:49 -08:00
Christian Hergert
b2fd09625c macos: make OpenGL context opaque when possible
If our opaque region is the entire surface, then we can make the OpenGL
context opaque like we do for decorated windows. This improves performance
as the compositor does not need to blend the surface with the contents
behind the window.
2021-02-19 13:23:26 -08:00
Matthias Clasen
5797c72e9c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3224
2021-02-19 14:41:36 +00:00
Zander Brown
d02cfceb3d Update British English translation
(cherry picked from commit 1f18d2638f)
2021-02-19 14:26:26 +00:00
Zander Brown
451af280a2 Update British English translation
(cherry picked from commit 6f26331864)
2021-02-19 14:24:32 +00:00
Matthias Clasen
516776b630 gtk-demo: Make --version match about
Print the same version information in --version
that we show in the about dialog.
2021-02-18 22:52:15 -05:00
Matthias Clasen
4d0a1a97cc widget-factory: Make --version match about
Print the same version information in --version
that we show in the about dialog.
2021-02-18 22:51:35 -05:00
Matthias Clasen
3ee5354e0f imwayland: Be careful about cursor positions
We don't want to hand out cursor positions based on
the original preedit text and then tweak the text to
be different.
2021-02-18 15:33:01 -05:00
Matthias Clasen
07295ac169 Merge branch 'unintrusive-compose-preedit' into 'master'
Unintrusive compose preedit

See merge request GNOME/gtk!3220
2021-02-18 17:36:08 +00:00
Matthias Clasen
447e6db847 Merge branch 'wip/carlosg/font-setting-lookups' into 'master'
gdk/wayland: Look for font settings recursively

Closes #3680

See merge request GNOME/gtk!3218
2021-02-18 17:18:37 +00:00
Matthias Clasen
d84a028455 imwayland: Tweak preedit text
Tweak the preedit text we get from IBus (via the compositor) to
match what GtkIMContextSimple produces for Compose sequences now.

This provides a unified experience.
2021-02-18 11:44:09 -05:00
Matthias Clasen
4327a866f4 imcontext: Make Compose preedit less intrusive
Tweak the preedit display for Compose sequences to
be not so distracting. We only show the Compose key
when it occurs in the middle of the sequence or is
the only key so far, and use · instead of ⎄ for it.

Also, make sure to display dead keys more adequately.
2021-02-18 11:44:09 -05:00
Carlos Garnacho
1fbdfe340e gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:50:45 +01:00
Matthias Clasen
4a47bdf596 Merge branch 'wip/exalm/root' into 'master'
widget: Don't assume GtkWindow root in gtk_widget_propagate_state()

See merge request GNOME/gtk!3217
2021-02-18 14:38:50 +00:00
Alexander Mikhaylenko
8e2f90e342 widget: Don't assume GtkWindow root in gtk_widget_propagate_state()
Avoid crashes with GtkDragIcon children.
2021-02-18 13:41:41 +05:00
Matthias Clasen
32c7ca50ea Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3679 and #3678

See merge request GNOME/gtk!3216
2021-02-18 05:52:44 +00:00
Matthias Clasen
19b9967a72 text: Fix sticky preedit attrs
In some cases, we were inadvertedly merging the
preedit attributes into priv->attrs, instead of
keeping them separate. This was causing the underlines
to grow beyond the preedit and never go away. One
place where this was showing up is the fontchooser
preview.

Fixes: #3679
2021-02-17 23:25:31 -05:00
Matthias Clasen
da71a37945 imwayland: Return limited preedit attributes
It should not matter, but it is the right thing to
do to limit the preedit attributes to the length
of the preedit text.
2021-02-17 22:57:41 -05:00
Matthias Clasen
05fe2441a7 imcontext: Enable font fallback for preedit
Not doing so only invites hexboxes.

Fixes: #3678
2021-02-17 22:11:57 -05:00
Matthias Clasen
35488959b4 paned: Add a paned handle class
Instead of bending GtkGizmo to the breaking point,
split off a GtkPanedHandle class that just does
what is needed here. Its simpler, and lets us keep
GtkGizmo simpler too. Everybody wins.
2021-02-17 21:45:33 -05:00
Matthias Clasen
af1981eda2 popovercontent: Few small fixes
Forgot to include config.h. Oops, and we make things
a bit shorter still.
2021-02-17 21:44:53 -05:00
Matthias Clasen
38da88908d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3676 and #3675

See merge request GNOME/gtk!3215
2021-02-17 20:49:41 +00:00
Matthias Clasen
41abda9f03 Make gtk_im_modules_init properly private
Putting non-exported symbols in public headers can
only lead to confusion and day drinking. Don't do it.

Fixes: #3676
2021-02-17 15:25:42 -05:00
Matthias Clasen
5a8e2a8c2d gsk: Add a missing GDK_AVAILABLE_IN_ALL
gsk_text_node_has_color_glyphs was not properlty exported,
by accident.

Fixes: #3675
2021-02-17 15:20:24 -05:00
Matthias Clasen
7390e2490c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3214
2021-02-17 12:55:39 +00:00
Matthias Clasen
04daa236ad Revert "gizmo: Add a css_changed function"
This reverts commit 39f72b3834.
2021-02-16 23:51:14 -05:00
Matthias Clasen
31ceb4ddfb Revert "gizmo: Chain up in css_changed"
This reverts commit bb0a1b0cfe.
2021-02-16 23:51:14 -05:00
Matthias Clasen
c2f811dd29 popover: Add a popover content class
Instead of bending GtkGizmo to the breaking point,
split off a GtkPopoverContent class that just does
what is needed here. Its simpler, and lets us keep
GtkGizmo simpler too.
2021-02-16 23:51:14 -05:00
Matthias Clasen
189e0c05fd Merge branch 'wip/smcv/reftest-dedup' into 'master'
Reduce duplication in reftests

See merge request GNOME/gtk!3203
2021-02-17 03:55:45 +00:00
Matthias Clasen
8ee4ea4282 Merge branch 'wip/jimmac/tiled-resize-area-gtk4' into 'master'
Adwaita: control surface for resize tiled windows

Closes #3670

See merge request GNOME/gtk!3211
2021-02-17 03:54:27 +00:00
Jakub Steiner
edcd4c6207 Adwaita: control surface for resize tiled windows
- window resizing control area is implemented as where the shadows are drawn
- create a 'fake' shadow for the tiled case to allow easier resizing of
  the tiled window ratio even if it's offset to the side of the border

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3670
2021-02-16 14:10:14 +01:00
Matthias Clasen
f5bd591d89 Merge branch 'wip/jimmac/scrollbars-fine-tune-fix' into 'master'
Adwaita: avoid fine-tune scrollbars jumping

Closes #3672

See merge request GNOME/gtk!3208
2021-02-16 12:26:02 +00:00
Jakub Steiner
67b5a34bad Adwaita: Avoid fine-tune scrollbars jumping
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3672
2021-02-16 11:59:45 +01:00
Matthias Clasen
27071b5cfb Merge branch 'matthiasc/for-master' into 'master'
wayland: Complete our buffer format listing

See merge request GNOME/gtk!3207
2021-02-16 04:33:08 +00:00
Matthias Clasen
19b9c42562 Merge branch 'fix-scrollbar-sizing' into 'master'
gizmo: Chain up in css_changed

See merge request GNOME/gtk!3206
2021-02-15 21:43:47 +00:00
Matthias Clasen
bf6a40f39b wayland: Complete our buffer format listing
The debug spew for printing out supported buffer
formats was missing a bunch, among them the fp16
formats that are interesting for HDR support.
Add them.

Note that we still only support ARGB8888. But
at least we can print out what don't support.
2021-02-15 16:42:17 -05:00
Matthias Clasen
bb0a1b0cfe gizmo: Chain up in css_changed
css_changed is a vfunc that *must* chain up.
Failure to do so broke the resizing of overlay scrollbars,
amongst other things.

This bug was introduced in 39f72b3834.
2021-02-15 14:26:52 -05:00
Matthias Clasen
2ac5c3282f Merge branch 'lenient-compose-parsing' into 'master'
imcontext: Be more lenient in parsing Compose

See merge request GNOME/gtk!3201
2021-02-15 18:08:45 +00:00
Matthias Clasen
6b3c356eb7 Merge branch 'wip/jimmac/larger-smaller-scrollbar-gtk4' into 'master'
Adwaita: Scrollbar transitions and size

Closes #1886

See merge request GNOME/gtk!3204
2021-02-15 18:06:00 +00:00
Jakub Steiner
5c5cd34c2f Adwaita: Scrollbar transitions and size
- tone down the size of the controller again
- transition between the indicator and control fluidly

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1886
2021-02-15 12:25:09 +01:00
Simon McVittie
1c6cf7a3b6 reftests: Share reftest-compare.[ch] between GSK and GTK tests
The only non-whitespace difference is that the copy in GSK does not
set the symbol's visibility.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Simon McVittie
6b29eeeb1c reftest-compare: Fix spelling of "diff"
This is the only non-whitespace difference between the copies in
testsuite/reftests/ and testsuite/gsk/.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Matthias Clasen
2f43b8dc49 imcontext: Improve compose table parsing
Avoid leaking value in error cases, and actually
emit a warning for a missing quote. Pointed out
by Peter Bloomfield.
2021-02-15 01:46:00 -05:00
Jordi Mas
7b4cfd38bc Update Catalan translation 2021-02-14 21:52:55 +01:00
Matthias Clasen
d2e074e36b imcontext: Be more lenient in parsing Compose
X11 allows keysyms to be specified in addition to strings.
We only support the strings. In the past, we ignored everything
after the string. Go back to doing that, but issue a warning
that we've ignored the keysym.
2021-02-14 12:56:00 -05:00
Matthias Clasen
2623932886 Merge branch 'fix-compose-comments' into 'master'
Fix compose comments

Closes #3664

See merge request GNOME/gtk!3199
2021-02-14 17:25:58 +00:00
Matthias Clasen
b0a82b1dfe Merge branch 'popup-shadow-width' into 'master'
Support shadows on popovers

See merge request GNOME/gtk!3089
2021-02-14 17:22:50 +00:00
Matthias Clasen
f15aa2f3e5 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back. Test included.

Fixes: #3664
2021-02-14 11:56:24 -05:00
Matthias Clasen
5d6792137d testsuite: Add a missing file 2021-02-14 11:56:24 -05:00
Matthias Clasen
52a2891933 window: Add some more details to css docs
Mention more of the supported style classes.
2021-02-14 11:22:44 -05:00
Matthias Clasen
7ebc3a9489 Update popover css docs
Mention that shadows are now possible.
2021-02-14 11:14:23 -05:00
Matthias Clasen
04fb1421dc Merge branch 'antoniof-master-patch-32022' into 'master'
docs: Mark heading in migration guide

See merge request GNOME/gtk!3198
2021-02-14 15:59:29 +00:00
Matthias Clasen
a4f17eaa8b macos: Apply popup shadow width 2021-02-14 10:52:33 -05:00
Matthias Clasen
e0c48e74bd win32: Apply popup shadow width 2021-02-14 10:52:33 -05:00
António Fernandes
a810f600bf docs: Mark heading in migration guide
This heading was missing from the index because it was not marked as one
2021-02-14 15:20:54 +00:00
Matthias Clasen
ad9c813ed1 x11: Apply popup shadow with 2021-02-14 10:12:10 -05:00
Matthias Clasen
aa1d08687d popover: Handle shadow changes
When the box-shadow css property of the contents
widget changes, queue a resize on the popover.
2021-02-14 10:12:10 -05:00
Matthias Clasen
39f72b3834 gizmo: Add a css_changed function
In a break from the current gizmo api, add a separate
setter, since the calls with long argument lists full
of NULL are getting out of hand.
2021-02-14 10:12:10 -05:00
Matthias Clasen
7332b4f1d9 Add a test for popover positioning
This is useful for testing the interaction of arrows, shadows
or offsets with popover positioning.
2021-02-14 10:11:17 -05:00
Matthias Clasen
b948799778 popover: Support shadows
Use gdk_popup_layout_set_shadow_width to take shadows into
account when positioning popovers, and set the input region
to exclude the shadow, since we aren't doing interactive
resizing and the like.

When the popover has a beak, we make the surface size be
content size + shadow + tail, and then position the content
according to the final position inside this slightly too large
surface. The surface being too large doesn't matter, since we
set up an input region.
2021-02-14 10:11:17 -05:00
Matthias Clasen
aec738745a wayland: Set shadow width on popup surfaces
Take the shadow width from the popup layout into account.
2021-02-14 10:11:17 -05:00
Matthias Clasen
ea19f7c360 popuplayout: Add shadow width
Add shadow width to the GdkPopupLayout struct. This
information is needed by the compositor to make correct
positioning decisions about popups.
2021-02-13 21:01:46 -05:00
Matthias Clasen
0222d389ee Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3197
2021-02-14 01:59:35 +00:00
Matthias Clasen
b3a055a9b7 popover: Queue a resize when position changes
At least with an arrow, changing the position
requires a resize
2021-02-13 20:27:01 -05:00
Matthias Clasen
bd877ccf06 popover: Cosmetics 2021-02-13 20:26:54 -05:00
Balázs Meskó
a8d87f80f3 Update Hungarian translation 2021-02-14 00:07:07 +00:00
Matthias Clasen
6601d79b2d Merge branch 'revert-82ab039a' into 'master'
Revert "Merge branch 'disable-macos-ci' into 'master'"

See merge request GNOME/gtk!3192
2021-02-12 21:29:08 +00:00
Matthias Clasen
5ff843f97d Stop passing introspection=false to graphene
This should no longer be possible (and the introspection
option is no longer a boolean.
2021-02-12 16:04:15 -05:00
Matthias Clasen
b1c1e02c28 ci: Add debug spew on macos 2021-02-12 15:24:27 -05:00
Bartłomiej Piotrowski
0ce0402edf Revert "Merge branch 'disable-macos-ci' into 'master'"
This reverts merge request !3183
2021-02-12 19:40:57 +00:00
Matthias Clasen
5d13bb7aa2 Merge branch 'win32.surface.resize' into 'master'
Some fixes for resizing of GDK/Win32 surfaces

See merge request GNOME/gtk!3144
2021-02-12 14:07:07 +00:00
Matthias Clasen
c5e69e83b5 Merge branch 'flatpak-tweaks' into 'master'
Flatpak tweaks

See merge request GNOME/gtk!3187
2021-02-12 14:03:54 +00:00
Matthias Clasen
bcfca52e9e Merge branch 'ci-fedora-33' into 'master'
ci: Update the Fedora image to F33

See merge request GNOME/gtk!3188
2021-02-12 13:46:14 +00:00
Matthias Clasen
919e06a831 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!3189
2021-02-12 12:45:51 +00:00
Timm Bäder
0d5957b97a nativedialog: Remove unused run state 2021-02-12 08:39:40 +01:00
Timm Bäder
6e4bba3d75 build: Check for mallinfo2 instead of mallinfo
Similar to e89fcbfad6
but the tests we use mallinfo() in really aren't important to not worth
the effort to differentiate between mallinfo and mallinfo2. Only check
for mallinfo2().
2021-02-12 08:39:40 +01:00
Matthias Clasen
3e426e4c5b flatpak: Try harder to disable sassc 2021-02-12 00:26:10 -05:00
Matthias Clasen
8d4f4af8ef Add devel styling to nightly flatpaks
Pass -Dprofile=devel to the gtk build for our nightly
flatpaks, so they pick up devel styling.
2021-02-12 00:10:30 -05:00
Matthias Clasen
3aa3c21d69 demos: Add devel styling
Add a -Dprofile=devel meson option, and add some visual
hints to the demos that you are running a nightly build.
2021-02-12 00:08:55 -05:00
Matthias Clasen
9a540841fd flatpak: No need to build sassc anymore
We should be able to do a gtk build without rebuilding
css nowadays.
2021-02-11 23:00:19 -05:00
Matthias Clasen
0a3fa40923 ci: Update the Fedora image to F33 2021-02-11 22:02:39 -05:00
Matthias Clasen
9f10f9a595 Merge branch 'fix-network-places' into 'master'
placesview: Avoid use-after-free

See merge request GNOME/gtk!3186
2021-02-11 19:41:10 +00:00
Matthias Clasen
560e27a3f4 Merge branch 'wip/jimmac/tiled-shadow-fix-fix-gtk4' into 'master'
Adwaita: bring borders for tiled

Closes #3661

See merge request GNOME/gtk!3184
2021-02-11 17:04:47 +00:00
Matthias Clasen
4df7cc948c Merge branch 'ebassi/memdup2' into 'master'
Use g_memdup2()

See merge request GNOME/gtk!3157
2021-02-11 17:02:00 +00:00
Emmanuele Bassi
b74a9445af tests: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
a63a2b26cf Ensure we don't overflow when using g_memdup2()
When we turn integers into size_t we should check we're not going to
make a mess.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
43fd9d16c5 win32: Move from g_memdup() to g_memdup2()
Use `size_t` and `gsize` consistently for the length argument in every
function taking a bytes array and a length.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
78e3908a00 gtk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
a9c616284a gsk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
386d8326ca gdk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
cf3f742ad8 x11: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
3a3e029270 wayland: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
435d12680d macos: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
504b5bbd1b broadway: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Jakub Steiner
f953dfef11 Adwaita: bring borders for tiled
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3661
2021-02-11 15:16:57 +01:00
Matthias Clasen
95d48ac2e8 placesview: Avoid use-after-free
The places view has questionable code for handling
'destroy', which seems to trigger use-after-free in
some cases. Clean this up a bit by acknowledging the
cancellation fully, rather than relying on the
destroyed flag.
2021-02-11 09:14:34 -05:00
Emmanuele Bassi
965e74f902 Add compatibility shim for g_memdup2()
We don't necessarily want to depend on a newer version of GLib, given
that we're not really using g_memdup() in the wrong way.
2021-02-11 12:57:38 +00:00
Matthias Clasen
0cc43e10a5 Merge branch 'wip/chergert/inline-transform-category' into 'master'
gsk: move transform structure to private.h

See merge request GNOME/gtk!3182
2021-02-11 01:14:21 +00:00
Matthias Clasen
82ab039abe Merge branch 'disable-macos-ci' into 'master'
ci: Temporarily disable macOS CI job as runner is offline

See merge request GNOME/gtk!3183
2021-02-11 01:14:01 +00:00
Matthias Clasen
e823fa6665 Merge branch 'fix-filter-value' into 'master'
css: Avoid an invalid read

See merge request GNOME/gtk!3181
2021-02-11 00:51:40 +00:00
Matthias Clasen
8cd4b338db ci: Temporarily disable macOS CI job as runner is offline
See https://gitlab.gnome.org/Infrastructure/GitLab/-/issues/495
2021-02-10 19:50:17 -05:00
Matthias Clasen
9af30aca35 Merge branch 'wip/chergert/fix-unused' into 'master'
snapshot: fix warning when asserts are disabled

See merge request GNOME/gtk!3180
2021-02-11 00:47:08 +00:00
Christian Hergert
6fab195643 gsk: move transform structure to private.h
This allows using the category without having to call a function from the
hot paths of the renderer.
2021-02-10 16:14:59 -08:00
Christian Hergert
c90ffc7363 snapshot: fix warning when asserts are disabled 2021-02-10 16:13:38 -08:00
Matthias Clasen
3eb4ec89f3 css: Avoid an invalid read
This was broken in ea7185bdb1.

Pointed out by Christian Hergert.
2021-02-10 19:13:36 -05:00
Matthias Clasen
6c85a4b2f5 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3177
2021-02-10 13:55:50 +00:00
Matthias Clasen
befc2c3ed6 iconbrowser: Use the right icon
We have an app icon, lets use it.
2021-02-10 08:04:11 -05:00
Matthias Clasen
62788d5b0d print-editor: Use the non-devel icon
We are no longer a nightly print editor.
2021-02-10 07:52:29 -05:00
Matthias Clasen
3c91a2b0a8 node-editor: Use the non-devel icon
We're now a respectable, stable node editor.
2021-02-10 07:44:59 -05:00
Matthias Clasen
d3096f079f Merge branch 'fix-clipped-texture' into 'master'
gl: Fixed clipped offscreen rendering

Closes #3651

See merge request GNOME/gtk!3175
2021-02-10 05:15:14 +00:00
Matthias Clasen
dff2aa20ff gl: Fixed clipped offscreen rendering
When we are rendering a texture node to an offscreen,
and we have a clip, we must force the offscreen rendering.
Otherwise, the code will notice: Hey, it already is a texture
node, so no need to render it to a texture again. But when
clipping is involved, that is exactly what we want to do.

Testcase included.

Fixes: #3651
2021-02-09 22:43:15 -05:00
Matthias Clasen
dae42c8f55 Merge branch 'wip/chergert/fix-maximized-shadows' into 'master'
adwaita: disable shadows when window is maximized or fullscreen

See merge request GNOME/gtk!3173
2021-02-09 23:16:49 +00:00
Jakub Steiner
da64856f37 Adwaita: don't cast shadows for halt-tiled windows
- while the case of a single half tiled window casting shadow is valid,
  the main use case for half tiled windows is when they have a neighbor.
  The :backdrop should be enough of a focus indicator and we avoid shadow
  casting on neighbors that are on the same Z level.
2021-02-09 18:57:31 +01:00
Christian Hergert
461fe36707 adwaita: disable shadows when window is maximized or fullscreen
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-09 09:27:22 -08:00
Matthias Clasen
4ce071721f Merge branch 'win32-drop-formats-leak' into 'master'
win32: Fix some leaks

See merge request GNOME/gtk!3167
2021-02-09 12:27:35 +00:00
Matthias Clasen
3cdfb779c7 Merge branch 'wip/chergert/fix-bgr8-uploads' into 'master'
gl: handle B8G8R8 texture data when uploading

See merge request GNOME/gtk!3171
2021-02-09 12:11:49 +00:00
Christian Hergert
3a43663630 gl: handle B8G8R8 texture data when uploading
We do not need to translate this on the CPU when we can instead push it
to the GPU in the same format and allow it to swizzle.

This fixes a huge number of memory allocations found while uploading the
GTK animation in widget-factory.
2021-02-08 15:32:12 -08:00
Matthias Clasen
360a66e945 Merge branch 'wip/chergert/macos-perf-fixes' into 'master'
macos: various OpenGL performance fixes

See merge request GNOME/gtk!3170
2021-02-08 20:30:27 +00:00
Christian Hergert
13e162c404 macos: improve use of swap rectangles with OpenGL 2021-02-08 11:30:11 -08:00
Christian Hergert
65296228d7 macos: only flush when not attached
This makes it so we only flush the context for the NSView, not the context
that is the center of our center of the GL context spokes.
2021-02-08 11:30:05 -08:00
Christian Hergert
443d199868 macos: mark region as unlikely 2021-02-08 11:29:56 -08:00
Christian Hergert
86c5f2df6e gsk: make gsk_render_node_get_node_type() use const
There isn't any state to modify in the type so we can use const here.
Doing so allows some of the renderer code to use const across a
number of functions so that repeated calls are elided if inlined.
2021-02-08 11:29:43 -08:00
Christian Hergert
09b447a9e1 gsk: make render node getters pure
These do not do modify anything so they can be marked as pure to
potentially ellide calls. Since they do dereference, I do not believe
we can make them const although that is unclear since we could technically
just return a pointer + offset. Therefore it *might* be possible to also
make these G_GNUC_CONST.
2021-02-08 11:29:39 -08:00
Christian Hergert
161ddcfa92 gsk: make render node getters const
This also removes the return if fail macros from these as a good portion
of them didn't have them anyway. I think it's fair to say that access to
these incorrectly is a programmer error.

It significantly reduces the amount of code generated into generally a
movss,ret.
2021-02-08 11:29:36 -08:00
Christian Hergert
226dc49602 profiler: allow using gdk profiler functions without braces
Just compiling these out means you have to write code slightly differently
so that you don't end up with "if ();" afterwards.

This adds a "do {} while (0)" so that we're still semantically a statement
but will also compile out.
2021-02-08 11:29:32 -08:00
Matthias Clasen
207569c4ed Merge branch 'wip/exalm/headerbar' into 'master'
headerbar: Don't use gtk_widget_unparent() with GtkBox

See merge request GNOME/gtk!3169
2021-02-08 15:38:48 +00:00
Alexander Mikhaylenko
cf61d96188 headerbar: Null-check boxes when removing window controls
Prevent a crash when show-title-buttons value changes to FALSE during
destruction.
2021-02-08 18:46:35 +05:00
Alexander Mikhaylenko
319755662f headerbar: Don't use gtk_widget_unparent() with GtkBox
gtk_widget_unparent() is for widget implementations, it's not supposed to
be used from outside.
2021-02-08 18:46:27 +05:00
Matthias Clasen
055cd9aaad Merge branch 'printing-temporary-queues-gtk4' into 'master'
printing: Create temporary queues for Avahi printers

See merge request GNOME/gtk!3160
2021-02-07 16:13:46 +00:00
Matthias Clasen
15697d5c0c Merge branch 'focus' into 'master'
listbox: Fix handling of non-focusable rows

Closes #3633

See merge request GNOME/gtk!3152
2021-02-07 15:57:11 +00:00
Matthias Clasen
0cd2d01f3f Merge branch 'fix-x11-drop' into 'master'
x11: More dnd fixes

Closes #3654

See merge request GNOME/gtk!3166
2021-02-07 14:52:24 +00:00
Matthias Clasen
67877e403f win32: Fix some leaks
My reading of the code is that gdk_drop_new() is not
consuming the content formats it is given, so the caller
must not pass a new reference.

Needs testing on Windows.
2021-02-07 09:41:34 -05:00
Matthias Clasen
0bce63e3ab x11: More dnd fixes
Whenever we communicate targets, we need to the union, otherwise
we don't tell the other side about our serialization. This makes
drops of images from gtk4-icon-browser to gimp and libreoffice
succeed in transferring data.

Fixes: #3654
2021-02-07 09:03:22 -05:00
Matthias Clasen
6396bf6d89 Merge branch 'fix-x11-drop' into 'master'
Fix x11 drop

Closes #3652

See merge request GNOME/gtk!3165
2021-02-07 06:52:45 +00:00
Matthias Clasen
5b45f267d6 x11: Pass mimetypes when creating output stream
When creating the output stream for a drop, we must
pass the mimetypes we support, otherwise the picking
of the right handler does not work.

Fixes: #3652
2021-02-07 01:32:39 -05:00
Matthias Clasen
f26f15fced x11: Fix a memory leak
We ref the content formats here, so we better unref it
when done.
2021-02-07 01:31:40 -05:00
Matthias Clasen
a37044f36c x11: Some code cleanups
Fix some glaring misindentation.
2021-02-07 01:30:50 -05:00
Marek Kasik
a93ab37ea9 printing: Show all Avahi advertised printers
This commit unsubscribes CUPS backend from a DBus
signal in idle when listening for new items on Avahi.

Since GDBus emits gathered signals in idle while
checking whether the signal has been unsubscribed
it could happen that a signal was not processed
because it was removed from hash table of
subscribed signals.
This caused the situation where printers advertised
on Avahi were not listed in CUPS backend sometimes.

We need those signals since this happens when switching
from a general subscription which listens to signals
for all Avahi services to a specific one which listens
to just _ipp._tcp and _ipps._tcp (chicken and egg problem).
2021-02-05 18:35:56 +01:00
Marek Kasik
5d7364960a printing: Create temporary queues for Avahi printers
This change extends set of Avahi advertised printers which
works with Gtk's CUPS print backend.

It creates a temporary queue (local printer) for each
Avahi printer in CUPS instead of accessing them directly
(via CUPS library).

This makes some printers work which did not work before and
also gives users more options to change in the print dialog.

This also changes naming of printers to be in accordance with CUPS.
It uses '_' instead of '-' and has hostname appended for CUPS remote
printers.
2021-02-05 18:35:56 +01:00
Elias Projahn
a7ae94c06e listbox: Fix handling of non-focusable rows
This commit modifies the gtk_list_box_row_grab_focus() implementation to
correctly return FALSE in case the row couldn't be focused. This behavior will
also be honored by gtk_list_box_row_focus() to properly handle focus in that
case. To achieve that, the method has been restructured slightly.

Closes #3633
2021-02-03 21:22:55 +01:00
Chun-wei Fan
39e136e9b7 Gdk/Win32: Fix resizing surfaces
This attempts to fix the counter-intuitive resizing of surfaces in GTK4 where
the surface grows or shrinks at the right and/or bottom edge when the window
resized from the top and/or left edge(s).

This is not yet perfect as the window stutters upon resizing from the top
and/or left edges, but at least makes resizing more intuitive.
2021-02-02 17:36:32 +08:00
Chun-wei Fan
652b892fc1 gdkwin32surface.[c|h]: Clean up code a bit
Remove the 'resized' member from the GdkWin32Surface structure, as we already
have a structure with a member that keeps track of whether a surface is being
resized, so we can just use that and avoid some confusion in the process
2021-02-02 17:36:32 +08:00
Luca Bacci
aec87a3514 GdkWin32: Fix mouse events in presence of transparent windows on the desktop
In gdkdevice-win32.c we are interested in knowing which window
receives mouse input at a specific location.

Only WindowFromPoint is the right API for the task, other API's
(such as (Real)ChildWindowFromPoint(Ex)) have shortcomings because
they are really designed for other purposes. For example, only
WindowFromPoint is able to look through transparent layered windows.

So even if we want to find a direct child we have to use
WindowFromPoint and then walk up the hierarchy.

Fixes: #370, #417
See: !2800
2020-11-11 12:46:52 +01:00
1872 changed files with 228963 additions and 189513 deletions

View File

@@ -7,6 +7,7 @@ stages:
- analysis
- docs
- flatpak
- publish
- deploy
.cache-paths: &cache-paths
@@ -24,9 +25,8 @@ variables:
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
MESON_TEST_TIMEOUT_MULTIPLIER: 3
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v27"
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v33"
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v25"
.only-default:
only:
@@ -58,8 +58,10 @@ style-check-diff:
- "${CI_PROJECT_DIR}/_build/report*.xml"
- "${CI_PROJECT_DIR}/_build/report*.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
- "${CI_PROJECT_DIR}/_build_hello/meson-logs"
cache:
key: "$CI_JOB_NAME"
paths:
@@ -77,10 +79,16 @@ fedora-x86_64:
variables:
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
- mkdir _install
- meson --prefix=${CI_PROJECT_DIR}/_install
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
- ninja -C _build
- meson compile -C _build
- meson install -C _build
- PKG_CONFIG_PATH=${CI_PROJECT_DIR}/_install/lib64/pkgconfig:${CI_PROJECT_DIR}/_install/share/pkgconfig meson setup _build_hello examples/hello
- meson compile -C _build_hello
- .gitlab-ci/run-tests.sh _build x11
- .gitlab-ci/run-tests.sh _build wayland
- .gitlab-ci/run-tests.sh _build broadway
@@ -92,6 +100,7 @@ release-build:
variables:
EXTRA_MESON_FLAGS: "--buildtype=release"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
@@ -106,6 +115,7 @@ installed-tests:
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
G_TEST_ACCESSIBLE: 1
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
@@ -155,12 +165,16 @@ macos:
- macos
needs: []
before_script:
- bash .gitlab-ci/show-execution-environment.sh
- bash .gitlab-ci/show-info-osx.sh
- pip3 install --user meson==0.56
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1
script:
- meson -Dx11-backend=false
-Dbroadway-backend=true
-Dmacos-backend=true
-Dmedia-gstreamer=disabled
-Dintrospection=disabled
-Dcpp_std=c++11
-Dpixman:tests=disabled
@@ -171,6 +185,22 @@ macos:
paths:
- "${CI_PROJECT_DIR}/_build/meson-logs"
vs2017-x64:
extends: .only-default
# TODO: Uncomment this when ready to merge.
#only:
# - branches@GNOME/gtk
stage: build
tags:
- win32-ps
needs: []
script:
- .gitlab-ci/test-msvc.bat
artifacts:
when: always
paths:
- "${CI_PROJECT_DIR}/_build/meson-logs"
.flatpak-defaults:
image: $FLATPAK_IMAGE
stage: flatpak
@@ -282,29 +312,37 @@ asan-build:
allow_failure: true
reference:
image: $DOCS_IMAGE
image: $FEDORA_IMAGE
stage: docs
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=release"
EXTRA_MESON_FLAGS: "--buildtype=release --force-fallback-for=gdk-pixbuf,pango"
script:
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true _build
- ninja -C _build gdk4-doc gsk4-doc gtk4-doc
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true -Dgdk-pixbuf:gtk_doc=true -Dpango:gtk_doc=true _build
- meson compile -C _build
- mkdir -p _reference/
- mv _build/docs/reference/gdk/html/ _reference/gdk/
- mv _build/docs/reference/gsk/html/ _reference/gsk/
- mv _build/docs/reference/gtk/html/ _reference/gtk/
- mv _build/docs/reference/gdk/gdk4/ _reference/gdk4/
- mv _build/docs/reference/gdk/gdk4-x11/ _reference/gdk4-x11/
- mv _build/docs/reference/gdk/gdk4-wayland/ _reference/gdk4-wayland/
- mv _build/docs/reference/gsk/gsk4/ _reference/gsk4/
- mv _build/docs/reference/gtk/gtk4/ _reference/gtk4/
- mv _build/subprojects/pango/docs/Pango/ _reference/Pango/
- mv _build/subprojects/pango/docs/PangoCairo/ _reference/PangoCairo/
- mv _build/subprojects/pango/docs/PangoFc/ _reference/PangoFc/
- mv _build/subprojects/pango/docs/PangoFT2/ _reference/PangoFT2/
- mv _build/subprojects/pango/docs/PangoOT/ _reference/PangoOT/
- mv _build/subprojects/pango/docs/PangoXft/ _reference/PangoXft/
- mv _build/subprojects/gdk-pixbuf/docs/gdk-pixbuf/ _reference/gdk-pixbuf/
- mv _build/subprojects/gdk-pixbuf/docs/gdk-pixdata/ _reference/gdk-pixdata/
artifacts:
paths:
- _reference
pages:
stage: deploy
publish-docs:
stage: publish
needs: ['reference']
script:
- mv _reference/ public/
artifacts:
paths:
- public
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=docs-gtk-org https://gitlab.gnome.org/api/v4/projects/665/trigger/pipeline"
only:
- master
refs:
- master

View File

@@ -17,8 +17,8 @@ branch, as well as their available versions.
### Checklist for Updating a CI image
- [ ] Update the `${image}.Dockerfile` file with the dependencies
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh build --base ${image} --version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --version ${number}`
once the Docker image is built; you may need to log in by using
`docker login` or `podman login`
- [ ] Update the `image` keys in the `.gitlab-ci.yml` file with the new
@@ -30,8 +30,8 @@ branch, as well as their available versions.
- [ ] Write a new `${image}.Dockerfile` with the instructions to set up
a build environment
- [ ] Add the `pip3 install meson` incantation
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh build --base ${image} --version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --version ${number}`
- [ ] Add the new job to `.gitlab-ci.yml` referencing the image
- [ ] Open a merge request with your changes and let it run

View File

@@ -1,92 +0,0 @@
FROM fedora:31
RUN dnf -y install \
adwaita-icon-theme \
atk-devel \
at-spi2-atk-devel \
avahi-gobject-devel \
cairo-devel \
cairo-gobject-devel \
ccache \
clang \
clang-analyzer \
colord-devel \
cups-devel \
dbus-daemon \
dbus-x11 \
dejavu-sans-mono-fonts \
desktop-file-utils \
diffutils \
elfutils-libelf-devel \
fribidi-devel \
gcc \
gcc-c++ \
gdk-pixbuf2-devel \
gdk-pixbuf2-modules \
gettext \
git \
glib2-devel \
glib2-static \
glibc-devel \
glibc-headers \
gnome-desktop-testing \
gobject-introspection-devel \
graphene-devel \
gstreamer1-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
gstreamer1-plugins-base-devel \
gtk-doc \
hicolor-icon-theme \
iso-codes \
itstool \
json-glib-devel \
lcov \
libasan \
libattr-devel \
libcloudproviders-devel \
libepoxy-devel \
libffi-devel \
libmount-devel \
librsvg2 \
libselinux-devel \
libubsan \
libXcomposite-devel \
libXcursor-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXi-devel \
libXinerama-devel \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
libxslt \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libGLES-devel \
mesa-libwayland-egl-devel \
ninja-build \
pango-devel \
pcre-devel \
pcre-static \
python3 \
python3-jinja2 \
python3-pip \
python3-pygments \
python3-wheel \
redhat-rpm-config \
sassc \
systemtap-sdt-devel \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
weston \
weston-libs \
which \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson==0.55.3

View File

@@ -1,12 +0,0 @@
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v25
RUN dnf -y install pandoc
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG C.UTF-8

View File

@@ -1,4 +1,99 @@
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v27
FROM fedora:34
RUN dnf -y install \
adwaita-icon-theme \
atk-devel \
at-spi2-atk-devel \
avahi-gobject-devel \
cairo-devel \
cairo-gobject-devel \
ccache \
clang \
clang-analyzer \
clang-tools-extra \
colord-devel \
cups-devel \
dbus-daemon \
dbus-x11 \
dejavu-sans-mono-fonts \
desktop-file-utils \
diffutils \
elfutils-libelf-devel \
fribidi-devel \
gcc \
gcc-c++ \
gdk-pixbuf2-devel \
gdk-pixbuf2-modules \
gettext \
git \
glib2-devel \
glib2-static \
glibc-devel \
glibc-headers \
gnome-desktop-testing \
gobject-introspection-devel \
graphene-devel \
graphviz \
gstreamer1-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
gstreamer1-plugins-base-devel \
hicolor-icon-theme \
iso-codes \
itstool \
json-glib-devel \
lcov \
libasan \
libattr-devel \
libcloudproviders-devel \
libepoxy-devel \
libffi-devel \
libjpeg-turbo-devel \
libmount-devel \
libpng-devel \
librsvg2 \
libselinux-devel \
libubsan \
libXcomposite-devel \
libXcursor-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXi-devel \
libXinerama-devel \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
libxslt \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libGLES-devel \
meson \
ninja-build \
pango-devel \
pcre-devel \
pcre-static \
python3 \
python3-gobject \
python3-jinja2 \
python3-markdown \
python3-pip \
python3-pygments \
python3-toml \
python3-typogrify \
python3-wheel \
redhat-rpm-config \
sassc \
systemtap-sdt-devel \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
weston \
weston-libs \
which \
xorg-x11-server-Xvfb \
&& dnf clean all
# Enable sudo for wheel users
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' /etc/sudoers

View File

@@ -24,6 +24,7 @@ flatpak build ${builddir} meson \
-Dbuild-examples=false \
-Dintrospection=disabled \
-Ddemos=true \
-Dprofile=devel \
_flatpak_build
flatpak build ${builddir} ninja -C _flatpak_build install

154
.gitlab-ci/pages/fonts.css Normal file
View File

@@ -0,0 +1,154 @@
/*
* SPDX-FileCopyrightText: 2021 GNOME Foundation
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
/**
* RedHat Fonts taken from https://github.com/RedHatOfficial/RedHatFont
* License: SIL Open Font License 1.1 http://scripts.sil.org/OFL
*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&family=Red+Hat+Display:ital,wght@0,400;0,500;0,700;0,900;1,400;1,500;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap');
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-Regular.woff2") format("woff2"),
url("RedHatDisplay-Regular.woff") format("woff");
font-style: normal;
font-weight: 400;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-RegularItalic.woff2") format("woff2"),
url("RedHatDisplay-RegularItalic.woff") format("woff");
font-style: italic;
font-weight: 400;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-Medium.woff2") format("woff2"),
url("RedHatDisplay-Medium.woff") format("woff");
font-style: normal;
font-weight: 500;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-MediumItalic.woff2") format("woff2"),
url("RedHatDisplay-MediumItalic.woff") format("woff");
font-style: italic;
font-weight: 500;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-Bold.woff2") format("woff2"),
url("RedHatDisplay-Bold.woff") format("woff");
font-style: normal;
font-weight: 700;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-BoldItalic.woff2") format("woff2"),
url("RedHatDisplay-BoldItalic.woff") format("woff");
font-style: italic;
font-weight: 700;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-Black.woff2") format("woff2"),
url("RedHatDisplay-Black.woff") format("woff");
font-style: normal;
font-weight: 900;
font-display: fallback;
}
@font-face {
font-family: "RedHatDisplayWeb";
src: local('RedHatDisplayWeb'),
url("RedHatDisplay-BlackItalic.woff2") format("woff2"),
url("RedHatDisplay-BlackItalic.woff") format("woff");
font-style: italic;
font-weight: 900;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-Regular.woff2") format("woff2"),
url("RedHatText-Regular.woff") format("woff");
font-style: normal;
font-weight: 400;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-RegularItalic.woff2") format("woff2"),
url("RedHatText-RegularItalic.woff") format("woff");
font-style: italic;
font-weight: 400;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-Medium.woff2") format("woff2"),
url("RedHatText-Medium.woff") format("woff");
font-style: normal;
font-weight: 700;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-MediumItalic.woff2") format("woff2"),
url("RedHatText-MediumItalic.woff") format("woff");
font-style: italic;
font-weight: 700;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-Bold.woff2") format("woff2"),
url("RedHatText-Bold.woff") format("woff");
font-style: normal;
font-weight: 900;
font-display: fallback;
}
@font-face {
font-family: "RedHatTextWeb";
src: local('RedHatTextWeb'),
url("RedHatText-BoldItalic.woff2") format("woff2"),
url("RedHatText-BoldItalic.woff") format("woff");
font-style: italic;
font-weight: 900;
font-display: fallback;
}

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg6843"
sodipodi:version="0.32"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
version="1.0"
sodipodi:docname="gtk-logo.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs6845">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-50 : 600 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="700 : 600 : 1"
inkscape:persp3d-origin="300 : 400 : 1"
id="perspective13" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="69.874353"
inkscape:cy="64.313526"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:document-units="px"
inkscape:grid-bbox="true"
width="128px"
height="128px"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid7947" />
</sodipodi:namedview>
<metadata
id="metadata6848">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date />
<dc:creator>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:publisher>
<dc:identifier />
<dc:source />
<dc:relation />
<dc:language />
<dc:subject>
<rdf:Bag />
</dc:subject>
<dc:coverage />
<dc:description />
<dc:contributor>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="" />
</cc:Work>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccccc"
id="path6976"
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6978"
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6980"
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
sodipodi:nodetypes="ccc"
id="path6982"
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path6984"
d="M 70.434539,17.875593 L 70.434539,66.984877"
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

149
.gitlab-ci/pages/index.html Normal file
View File

@@ -0,0 +1,149 @@
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: LGPL-2.1-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>GTK Documentation</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:site_name" content="https://docs.gtk.org"/>
<meta property="og:title" content="GTK Documentation"/>
<meta property="og:url" content="https://docs.gtk.org"/>
<meta property="og:type" content="website"/>
<meta property="og:description" content="API reference for GTK"/>
<meta name="twitter:title" content="GTK Documentation"/>
<meta name="twitter:url" content="https://docs.gtk.org"/>
<meta name="twitter:card" content="summary"/>
<link rel="canonical" href="https://docs.gtk.org"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar">
<div class="section">
<img src="gtk-logo.svg" class="logo"/>
</div>
<div class="section">
<h5>Sections</h5>
<div class="links">
<a href="#user-interface">User interface</a>
<a href="#core-libraries">Core libraries</a>
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h1>GTK Documentation</h1>
</header>
<div class="toggle-wrapper">
<h4 id="user-interface">
User interface
<a href="#user-interface" class="anchor"></a>
</h4>
<div class="docblock">
<h5 id="gdk">GTK</h5>
<p>GTK is the primary library used to construct user interfaces. It
provides user interface controls and signal callbacks to respond to
user actions.</p>
<p><a href="https://docs.gtk.org/gtk4/">GTK API reference</a></p>
</div>
<div class="docblock">
<h5 id="gdk">GSK</h5>
<p>An intermediate layer which provides a rendering API implemented using Cairo, OpenGL or Vulkan.</p>
<p><a href="https://docs.gtk.org/gsk4/">GSK API reference</a></p>
</div>
<div class="docblock">
<h5 id="gdk">GDK</h5>
<p>An intermediate layer which isolates GTK from the details of the windowing system.</p>
<p><a href="https://docs.gtk.org/gdk4/">GDK API reference</a></p>
</div>
<div class="docblock">
<h5 id="pango">Pango</h5>
<p>Pango is the core text and font handling library used in GTK
applications. It has extensive support for the different writing
systems used throughout the world.</p>
<p><a href="https://docs.gtk.org/Pango/">Pango API reference</a></p>
</div>
<div class="docblock">
<h5 id="gdk-pixbuf">GdkPixbuf</h5>
<p>GdkPixbuf is a library for image loading and manipulation.</p>
<p><a href="https://docs.gtk.org/gdk-pixbuf/">GdkPixbuf API reference</a></p>
</div>
<div class="docblock">
<h5 id="cairo">Cairo</h5>
<p>Cairo is a 2D graphics library with support for multiple output
devices. It is designed to produce consistent, high quality output
on all media.</p>
<p><a href="https://www.cairographics.org/manual/" class="external">Cairo API reference</a></p>
</div>
</div>
<div class="toggle-wrapper">
<h4 id="core-libraries" style="display:flex;">
Core libraries
<a href="#core-libraries" class="anchor"></a>
</h4>
<div class="docblock">
<h5 id="glib">GLib</h5>
<p>GLib provides the core application building blocks for libraries
and applications written in C. It provides common data types
used in GTK, the main loop implementation, and a large set of
utility functions for strings and general portability across
different platforms.</p>
<p><a href="https://developer.gnome.org/glib/" class="external">GLib API reference</a></p>
</div>
<div class="docblock">
<h5 id="gobject">GObject</h5>
<p>GObject provides the object system used by GTK.</p>
<p><a href="https://developer.gnome.org/gobject/" class="external">GObject API reference</a></p>
</div>
<div class="docblock">
<h5 id="gio">GIO</h5>
<p>GIO provides a portable, modern and easy-to-use file system
abstraction API for accessing local and remote files; a set of
low and high level abstractions over the <a href="https://www.freedesktop.org/wiki/Software/dbus/" class="external">DBus</a>
IPC specification; an application settings API; portable networking
abstractions; and additional utilities for writing asynchronous
operations without blocking the user interface of your application.</p>
<p><a href="https://developer.gnome.org/gio/" class="external">GIO API reference</a></p>
</div>
</div>
</section>
<footer>
</footer>
</div>
</body>
</html>

140
.gitlab-ci/pages/main.js Normal file
View File

@@ -0,0 +1,140 @@
// SPDX-FileCopyrightText: 2021 GNOME Foundation
//
// SPDX-License-Identifier: LGPL-2.1-or-later
// eslint-disable-next-line no-unused-vars
function hasClass(elem, className) {
return elem && elem.classList && elem.classList.contains(className);
}
// eslint-disable-next-line no-unused-vars
function addClass(elem, className) {
if (!elem || !elem.classList) {
return;
}
elem.classList.add(className);
}
// eslint-disable-next-line no-unused-vars
function removeClass(elem, className) {
if (!elem || !elem.classList) {
return;
}
elem.classList.remove(className);
}
function insertAfter(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
function onEach(arr, func, reversed) {
if (arr && arr.length > 0 && func) {
var length = arr.length;
var i;
if (reversed !== true) {
for (i = 0; i < length; ++i) {
if (func(arr[i]) === true) {
return true;
}
}
} else {
for (i = length - 1; i >= 0; --i) {
if (func(arr[i]) === true) {
return true;
}
}
}
}
return false;
}
function onEachLazy(lazyArray, func, reversed) {
return onEach(
Array.prototype.slice.call(lazyArray),
func,
reversed);
}
// eslint-disable-next-line no-unused-vars
function hasOwnProperty(obj, property) {
return Object.prototype.hasOwnProperty.call(obj, property);
}
window.addEventListener("load", function() {
"use strict;"
var main = document.getElementById("main");
var btnToTop = document.getElementById("btn-to-top");
function labelForToggleButton(isCollapsed) {
if (isCollapsed) {
return "+";
}
return "\u2212";
}
function createToggle(isCollapsed) {
var toggle = document.createElement("a");
toggle.href = "javascript:void(0)";
toggle.className = "collapse-toggle";
toggle.innerHTML = "[<span class=\"inner\">"
+ labelForToggleButton(isCollapsed)
+ "</span>]";
return toggle;
}
function toggleClicked() {
if (hasClass(this, "collapsed")) {
removeClass(this, "collapsed");
this.innerHTML = "[<span class=\"inner\">"
+ labelForToggleButton(false)
+ "</span>]";
onEachLazy(this.parentNode.getElementsByClassName("docblock"), function(e) {
removeClass(e, "hidden");
});
} else {
addClass(this, "collapsed");
this.innerHTML = "[<span class=\"inner\">"
+ labelForToggleButton(true)
+ "</span>]";
onEachLazy(this.parentNode.getElementsByClassName("docblock"), function(e) {
addClass(e, "hidden");
});
}
}
onEachLazy(document.getElementsByClassName("toggle-wrapper"), function(e) {
let sectionHeader = e.querySelector(".section-header");
let fragmentMatches = sectionHeader !== null && location.hash === "#" + sectionHeader.getAttribute('id');
collapsedByDefault = hasClass(e, "default-hide") && !fragmentMatches;
var toggle = createToggle(collapsedByDefault);
toggle.onclick = toggleClicked;
e.insertBefore(toggle, e.firstChild);
if (collapsedByDefault) {
addClass(toggle, "collapsed");
onEachLazy(e.getElementsByClassName("docblock"), function(d) {
addClass(d, "hidden");
});
}
});
function scrollBackTop(e) {
e.preventDefault();
window.scroll({
top: 0,
behavior: 'smooth',
});
}
function toggleScrollButton() {
if (window.scrollY < 400) {
addClass(btnToTop, "hidden");
} else {
removeClass(btnToTop, "hidden");
}
}
window.onscroll = toggleScrollButton;
btnToTop.onclick = scrollBackTop;
}, false);

747
.gitlab-ci/pages/style.css Normal file
View File

@@ -0,0 +1,747 @@
/*
* SPDX-FileCopyrightText: 2021 GNOME Foundation
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
@import url("fonts.css");
/*********************************
* LIGHT THEME
*********************************/
:root {
/* colors */
--text-color: #333;
--text-color-muted: #999;
--primary: rgb(28, 118, 228);
--body-bg: #fff;
--sidebar-primary: rgb(144, 194, 255);
--sidebar-bg: #151515;
--sidebar-selected-bg: var(--primary);
--sidebar-text-color: #fafafa;
--sidebar-padding: 1.5em;
/* boxes, e.g. code blocks */
--box-bg: rgba(135, 135, 135, 0.085);
--box-radius: 0.35rem;
--box-padding: 0.75rem;
--box-margin: 0.75rem 0;
--box-text-color: #111;
/* typography */
--body-font-family: "Noto Serif",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
--body-font-scale: 0.95;
--body-font-size: calc(var(--body-font-scale) * clamp(16px, 1vw, 20px));
--body-font-weight: normal;
--monospace-font-family: "Source Code Pro", monospace;
--monospace-font-size: calc(0.86 * var(--body-font-size)); /* Monospace fonts are very different in terms of font-sizes. Adjust this value to scale it */
--heading-font-family: "Red Hat Display", var(--body-font-family);
--heading-weight: 900;
--heading-font-scale: 1.05;
--heading-small-font-family: var(--heading-font-family);
--heading-small-weight: 600;
--heading-small-font-scale: 1;
--heading-table-font-family: var(--heading-font-family);
--heading-table-weight: 600;
--heading-docblock-color: #6d6d6d; /* docblocks have headings from source comments. we want them to differ.*/
--heading-docblock-scale: 0.9; /* docblocks have headings from source comments. we want them to differ.*/
--symbol-font-family: var(--heading-font-family);
--symbol-font-weight: 500;
--symbol-font-scale: 1;
--table-font-size: 0.92em; /* Tables often contain lots information. It's better to scale them down a big to get more sutff fitted inside */
/* misc */
--prefered-content-width: 90ch; /* The preferred width for the readable content */
--anchor-sign: "#";
}
/*********************************
* DARK THEME (overrides)
*********************************/
@media (prefers-color-scheme: dark) {
:root {
--primary: rgb(144, 194, 255);
--text-color: #f6f6f6;
--text-color-muted: #686868;
--body-bg: #121212;
--sidebar-primary: rgb(144, 194, 255);
--sidebar-bg: #1e1e1e;
--sidebar-selected-bg: rgb(17, 112, 228);
--sidebar-text-color: #fafafa;
--box-bg: rgba(135, 135, 135, 0.1);
--box-text-color: #fff;
--heading-docblock-color: #b7b7b7;
}
/* fix dark theme syntax highlighting with a filter (for now) */
.highlight pre span {
filter: brightness(6);
}
}
/*********************************
* GENERAL STYLING
*********************************/
*,
*:before,
*:after {
box-sizing: border-box;
}
::-moz-selection {
color: white;
background: var(--primary);
}
::selection {
color: white;
background: var(--primary);
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: rgba(128, 128, 128, 0.6);
}
::-webkit-scrollbar-thumb:hover {
background: rgba(128, 128, 128, 1);
}
::-webkit-scrollbar-track {
background: rgba(128, 128, 128, 0.15);
}
* {
scrollbar-width: initial;
}
body {
font: 16px/1.5 var(--body-font-family);
font-weight: var(--body-font-weight);
font-size: var(--body-font-size);
margin: 0;
padding: 0;
position: relative;
-webkit-font-feature-settings: "kern", "liga";
-moz-font-feature-settings: "kern", "liga";
font-feature-settings: "kern", "liga";
color: var(--text-color);
background: var(--body-bg);
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--heading-font-family);
font-weight: var(--heading-weight);
margin: 1.75em 0 0.75em 0;
display: flex;
align-items: center;
}
h1 {
font-size: calc(1.75em * var(--heading-font-scale));
}
header h1 {
margin-top: 0;
}
h2 {
font-size: calc(1.4em * var(--heading-font-scale));
}
h3 {
font-size: calc(1.2em * var(--heading-font-scale));
}
header h3 {
color: var(--text-color-muted);
margin-bottom: 0;
}
h4, h5 {
font-size: calc(1em * var(--heading-font-scale));
}
h6 {
font-size: calc(1em * var(--heading-small-font-scale));
font-family: var(--heading-small-font-family);
font-weight: var(--heading-small-weight);
}
ol, ul {
padding-left: 1rem;
}
ul ul, ol ul, ul ol, ol ol {
margin-bottom: .6em;
}
p {
margin: 0 0 .6em 0;
}
a {
color: var(--primary);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
summary {
outline: none;
}
blockquote {
border-left: 3px solid var(--primary);
background: var(--box-bg);
padding: var(--box-padding);
border-radius: var(--box-radius);
margin: var(--box--margin);
}
code,
pre {
font-family: var(--monospace-font-family);
font-size: var(--monospace-font-size);
color: var(--box-text-color);
}
pre {
background: var(--box-bg);
padding: var(--box-padding);
border-radius: var(--box-radius);
overflow: auto;
}
code {
background: var(--box-bg);
padding: 0 0.35em;
border-radius: 0.35rem;
word-break: break-word;
}
a > code {
color: var(--primary);
}
pre pre,
pre code {
padding: 0;
margin: 0;
font-size: 1em;
background: none;
color: inherit;
}
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
font-family: inherit;
font-weight: inherit;
font-size: 0.85em;
}
strong, b {
font-weight: 600;
}
/* fix unwanted margins in tables, code, lists and blockquotes */
li > *:first-child,
li > *:first-child > *:first-child,
li > *:first-child > *:first-child > *:first-child,
td > *:first-child,
td > *:first-child > *:first-child,
td > *:first-child > *:first-child > *:first-child,
pre > *:first-child,
pre > *:first-child > *:first-child,
pre > *:first-child > *:first-child > *:first-child,
blockquote > *:first-child,
blockquote > *:first-child > *:first-child,
blockquote > *:first-child > *:first-child > *:first-child {
margin-top: 0;
}
li > *:last-child,
li > *:last-child > *:last-child,
li > *:last-child > *:last-child > *:last-child,
td > *:last-child,
td > *:last-child > *:last-child,
td > *:last-child > *:last-child > *:last-child,
pre > *:last-child,
pre > *:last-child > *:last-child,
pre > *:last-child > *:last-child > *:last-child,
blockquote > *:last-child,
blockquote > *:last-child > *:last-child,
blockquote > *:last-child > *:last-child > *:last-child {
margin-bottom: 0;
}
/*********************************
* PAGE STRUCTURE
*********************************/
#body-wrapper {
display: flex;
flex-wrap: nowrap;
flex-direction: row;
}
#body-wrapper:focus {
outline: none;
}
#main {
position: relative;
flex-grow: 1;
min-width: 0;
box-shadow: 0 0 134px rgba(0, 0, 0, 0.1);
}
footer {
width: 100%;
display: none;
}
/*********************************
* Button
*********************************/
#btn-to-top {
position: fixed;
bottom: 12px;
right: 32px;
z-index: 1000;
border-radius: 50%;
width: 42px;
height: 42px;
border: 1px solid var(--primary);
background: var(--box-bg);
color: var(--text-color);
cursor: pointer;
text-transform: none;
}
#btn-to-top > .up-arrow:after {
content: "🡅"
}
/*********************************
* SIDEBAR
*********************************/
.sidebar {
scrollbar-width: thin;
background: var(--sidebar-bg);
border-right: 1px solid var(--sidebar-bg);
min-width: 40ch;
padding: var(--sidebar-padding);
color: var(--sidebar-text-color);
position: sticky;
top: 0;
z-index: 2;
height: 100vh;
overflow-y: auto;
}
.sidebar a,
.sidebar a:hover {
text-decoration: none;
}
.sidebar .logo {
display: block;
margin: 2rem auto 0 auto;
width: 70%;
}
.sidebar .section > ul > li {
margin-right: -10px;
}
.sidebar .section h3, .sidebar .section h5 {
text-align: left;
padding-left: 0.5rem;
padding-right: 0.5rem;
font-weight: var(--heading-weight);
}
.sidebar .section h5 {
font-size: 1em;
margin-bottom: 0.5em;
}
.sidebar .namespace > h3 {
margin-bottom: 0;
padding: 0;
font-size: 1.5em;
text-transform: uppercase;
font-weight: 900;
}
.sidebar .namespace > p {
font-size: 0.9em;
opacity: 0.8;
padding-left: 0.5rem;
}
.sidebar .section {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.sidebar .links {
margin-bottom: 1rem;
}
.sidebar .section a {
display: block;
text-overflow: ellipsis;
overflow: hidden;
transition: background-color 150ms ease;
color: var(--sidebar-primary);
border-radius: var(--box-radius);
padding: 0.2rem 0.5rem;
margin-bottom: 0.15rem;
}
.sidebar .section a:hover {
background-color: rgba(127, 127, 127, 0.2);
color: var(--sidebar-text-color);
}
.sidebar .section a.current {
background-color: var(--sidebar-selected-bg);
color: white;
}
.sidebar .search {
box-sizing: border-box;
text-align: center;
}
.sidebar .search input[type="text"] {
border-color: transparent;
width: 100%;
border: 1px solid #ccc;
border-radius: 50px;
padding: 6px 12px;
display: inline-block;
font-size: 80%;
box-shadow: inset 0 1px 3px #ddd;
transition: border .3s linear;
}
/*********************************
* ANCHORS & TOGGLERS
*********************************/
.anchor,
.md-anchor {
position: relative;
z-index: 1;
text-decoration: none;
padding: 0 0.5em;
color: var(--text-color-muted);
}
.anchor:hover,
.md-anchor:hover {
color: var(--primary);
}
.anchor:not([href]),
.md-anchor:not([href]) {
display: none;
}
.anchor:before,
.md-anchor:before {
content: var(--anchor-sign); /*'§'*/
}
.toggle-wrapper {
position: relative;
}
.collapse-toggle {
position: absolute;
right: 0;
left: -2em;
white-space: nowrap;
text-decoration: none;
font-size: 0.8em;
color: transparent;
}
.collapse-toggle > .inner {
width: 1rem;
height: 1rem;
border-radius: calc(0.75 * var(--box-radius));
display: inline-flex;
justify-content: center;
align-items: center;
text-align: center;
vertical-align: middle;
color: var(--box-text-color);
position: relative;
left: -0.25rem;
font-family: monospace;
font-size: 0.7rem;
font-weight: bold;
background: var(--box-bg);
}
/*********************************
* UTILITY
*********************************/
.deprecated > h6 > a {
opacity: 0.65;
}
.hidden {
display: none !important;
}
/*********************************
* CONTENT STYLING
*********************************/
.content {
padding: 2em 4em;
overflow: visible;
max-width: calc(var(--prefered-content-width) + 8em);
}
.content table:not(.table-display) {
border-spacing: 0 0.25rem;
}
.content td {
vertical-align: top;
}
.content td:first-child {
padding-right: 1rem;
}
.content td p:first-child {
margin-top: 0;
}
.content td h1, .content td h2 {
margin-left: 0;
font-size: 1.1em;
}
.content tr:first-child td {
border-top: 0;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 15px monospace;
line-height: 10px;
vertical-align: middle;
border: solid 1px;
border-radius: 3px;
box-shadow: inset 0 -1px 0;
cursor: default;
}
.content tr:first-child {
border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.content td {
vertical-align: top;
}
.content td:first-child {
padding-right: 1rem;
}
.content td p:first-child {
margin-top: 0;
}
.content td h4, .content td h5 {
margin-left: 0;
font-size: 1.1em;
}
.content tr:first-child td {
border-top: 0;
}
.srclink {
color: var(--text-color-muted);
font-size: 1rem;
font-weight: var(--body-font-weight);
flex-grow: 0;
text-decoration: none;
margin-left: auto;
position: relative;
z-index: 1;
}
.meta tr > td:not(:first-child) {
width: 100%;
}
.meta tr > td:first-child {
white-space: nowrap;
}
/*********************************
* DOCBLOCK STYLING
*********************************/
.docblock {
position: relative;
text-align: left;
}
.docblock h1 {
font-size: calc(1.3em * var(--heading-docblock-scale) * var(--heading-font-scale));
}
.docblock h2 {
font-size: calc(1.2em * var(--heading-docblock-scale) * var(--heading-font-scale));
}
.docblock h3 {
font-size: calc(1.1em * var(--heading-docblock-scale) * var(--heading-font-scale));
}
.docblock h4 {
font-size: calc(1.05em * var(--heading-docblock-scale) * var(--heading-font-scale));
}
.docblock h1,
.docblock h2,
.docblock h3,
.docblock h4,
.docblock h5,
.docblock h6 {
color: var(--heading-docblock-color)
}
.docblock table {
margin: .25em 0;
max-width: 100%;
font-size: var(--table-font-size);
}
.docblock table td {
padding: .25em;
}
.docblock table th {
padding: .25em;
text-align: left;
font-family: var(--heading-table-font-family);
font-weight: var(--heading-table-weight);
}
.docblock table tr th:first-child,
.docblock table tr td:first-child {
padding-left: 0;
}
.docblock table tr th:last-child,
.docblock table tr td:last-child {
padding-right: 0;
}
table.enum-members,
table.results {
border-radius: var(--box-radius);
border: 1px solid var(--text-color-muted);
border-spacing: 0 0 !important;
font-size: 80%;
}
table.enum-members tr th,
table.results tr th {
border-top-color: var(--body-bg);
background-color: var(--box-bg);
border-bottom: 1px solid var(--text-color-muted);
}
table.enum-members tr th:first-child,
table.enum-members tr td:first-child {
min-width: 25em;
padding-left: .5em;
}
table.results tr th:first-child,
table.results tr td:first-child {
padding-left: .5em;
}
table.enum-members tr th:last-child,
table.enum-members tr td:last-child,
table.results tr th:last-child,
table.results tr td:last-child {
max-width: 35em;
padding-right: .5em;
}
table.results tr td code {
font-size: 100%;
}
.docblock ul li,
.docblock ol li {
padding-top: 0.15rem;
padding-bottom: 0.15rem;
}
.docblock ul.type {
list-style: none;
}
.docblock ul.type li::before {
content: "»";
color: var(--text-color);
display: inline-block;
width: 1em;
margin-left: -1em;
}
/**************************
RESPONSIVENESS
**************************/
@media (max-width: 700px) {
body {
padding-top: 0px;
}
#body-wrapper {
flex-direction: column;
overflow: hidden;
}
#main {
width: 100%;
padding: 2rem;
}
.sidebar {
position: static;
height: initial;
order: 1;
}
}

View File

@@ -32,7 +32,7 @@ while (($# > 0)); do
list) list=1;;
help) print_help=1;;
--base|-b) read_arg base "$@" || shift;;
--base-version) read_arg base_version "$@" || shift;;
--version|-v) read_arg base_version "$@" || shift;;
--no-login) no_login=1;;
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
esac

5
.gitlab-ci/show-info-linux.sh Executable file
View File

@@ -0,0 +1,5 @@
#! /bin/sh
. /etc/os-release
echo $PRETTY_NAME

View File

@@ -15,7 +15,7 @@ meson \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dbroadway-backend=true \
-Dvulkan=yes \
-Dvulkan=enabled \
-Dprofiler=true \
--werror \
${EXTRA_MESON_FLAGS:-} \

14
.gitlab-ci/test-msvc.bat Normal file
View File

@@ -0,0 +1,14 @@
@echo on
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
:: specified build architecture
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
@echo on
:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.56.2 || goto :error
meson -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error
goto :EOF
:error
exit /b 1

View File

@@ -40,7 +40,7 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# https://gitlab.gnome.org/GNOME/gtk/-/issues/2243
# https://gitlab.gnome.org/GNOME/gtk/-/issues/3002
if ! pkg-config --atleast-version=2.65.0 glib-2.0; then
if ! pkg-config --atleast-version=2.66.0 glib-2.0; then
git clone https://gitlab.gnome.org/GNOME/glib.git _glib
meson setup _glib_build _glib
meson compile -C _glib_build
@@ -48,7 +48,7 @@ if ! pkg-config --atleast-version=2.65.0 glib-2.0; then
fi
pkg-config --modversion glib-2.0
if ! pkg-config --atleast-version=1.47.0 pango; then
if ! pkg-config --atleast-version=1.49.1 pango; then
git clone https://gitlab.gnome.org/GNOME/pango.git _pango
meson setup _pango_build _pango
meson compile -C _pango_build

560
NEWS
View File

@@ -1,3 +1,563 @@
Overview of Changes
===================
* gsk:
- Drop the GL renderer in favor of NGL
* css:
- Add support for line-height
- Add support for text-transform
* GtkTextView:
- Add support for line height
- Add support for text transforms
* Build:
- Require Pango 1.49
Overview of Changes in 4.4.0
============================
* Input:
- Match IBus for display of Compose sequences
- Match IBus for handling of mismatches
- Handle Escape in Compose sequences
- Allow multiple dead keys
- Support 32bit keysyms
* GtkCheckButton:
- Activate when moving focus
* GtkLabel:
- Propertly ignore double underscores for mnemonics
* GtkPopoverMenu:
- Fix focus cycling
* GtkTextView:
- Improve word selection
- Fix block cursors on empty lines
* GdkToplevel:
- Support the gnome-shell titlebar gesture protocol
* GdkDropTarget:
- Allow creating drop targets in ui files
* gsk:
- Handle partial color fonts correctly
- Use harfbuzz for color font information
- Avoid pango for glyph cache rendering
- Shrink shadow extents
* Settings:
- Change the default for gtk-split-cursor to FALSE
* Demos:
- Small improvements to widget-factory
- gtk-demo: Improve the hypertext demo
- gtk-dem: Improve the clipboard demo
* X11:
- Set WM_CLASS on toplevels
* Wayland:
- Support wl_seat v7
* Windows:
- Drop the local DND protocol
- Avoid WGL if shaders don't work
- Use WinPointer API
* Translation updates:
Belarusian
Friulian
Hebrew
Khmer
Persian
Polish
Overview of Changes in 4.3.2
============================
* GtkToggleButton:
- Fix the actionable implementation
* GtkCheckButton:
- Fix the actionable implementation
- Cancel activation on when the pointer leaves
* GtkMenuButton:
- Make activatable again
- Add a way to have an icon + arrow
* GtkColorButton:
- Make activatable again
* GtkFontButton:
- Make activatable again
* GtkAppChooserButton:
- Make activatable again
* GtkColumnView:
- Fix double activation
* GtkLabel:
- Fix mnemonics without markup
* GtkTreeView:
- Clip header buttons
* GtkTextView:
- Add api to get the RTL and LTR contexts
- Fix some errors in text history grouping
* GtkText:
- Don't show placeholder text on top of entry text
- Add api to compute the cursor extents
- Fix y coordinates for text selection
* GtkFileChooser:
- Don't show Trash in the side bar
* GtkPopoverMenu:
- Add scrollbars to long menus
* GtkActionMuxer:
- Fix propagation of accel changes
* Introspection:
- Annotate all filename arguments
- Rename GtkMediaStream apis to avoid name collisions
- Rename GtkDropTarget properties to avoid name collisions
- Make GtkPasswordEntryBuffer introspectable
* Printing:
- Remove the Google Cloud Print backend
* Theme:
- Sync included icons with the Adwaita icon theme
* GSK:
- Avoid overflowing the vertex counter
- Handle negative scales correctly in the ngl renderer
* GDK:
- Cleanup and simplify OpenGL setup code
- Add a GdkDisplay::init_gl vfunc and gdk_display_prepare_gl() api
- Require EGL 1.4
- Fix EGL + NVidia
* Build:
- Enable gstreamer by default
- Disable Vulkan by default
- Remove the sassc option
- Remove options and checks for X11 extensions
* X11:
- Stop using XComposite
- Remove the Visual cache
* Wayland:
- Fix some DND corner cases
- Work with version 2 of pointer-gestures-v1
- Look for cursor themes in $HOME/.icons
* Windows:
- Fix SIGILL on x64 due to popcnt
- Fix popup placement
- Fix drag icon placement
- Clean up HiDPI and WGL support
- Default to WGL
* MacOs:
- Fix input method support
- Register known clipboard types for drop targets
- Add initial DND support
* Translation updates:
Brazilian Portuguese
Portuguese
Romanian
Turkish
Ukrainian
Overview of Changes in 4.3.1
============================
* GtkEmojiChooser:
- Update data from CLDR 39
- Load Emoji data for both language and territory
* GtkCalendar:
- Fix an off-by-one error in day numbers
* GtkListView:
- Add .activatable style class to activatable items
* GtkCheckButton:
- Don't allow unchecking grouped radio buttons
*GtkToggleButton:
- Fix mnemonic activation propagation
* GtkLabel:
- Make mnemonics work even when invisible
- Fix mnemonic activation propagation
* GtkMenuButton:
- Add a property to mark primary menus and make F10 work
* GtkApplication:
- Fix initial screensaver state async
* GtkEntry:
- Apply xalign to placeholder text (as it was in GTK 3)
* GtkSpinButton:
- Fix swipe gestures
* GtkStackSwitcher:
- Implement GtkOrientable (as it was in GTK 3)
- Fix a use-after-free problem with drag timeouts
* GtkFileChooser:
- Add support for (case-insensitive) suffix matches in GtkFileFilter
* GtkPasswordEntry:
- Make GtkPasswordEntryBuffer public, to make it easier
to write your own password entry widget
* Input:
- Fix interference between various obscure XKB features
(e.g. overlays) and Compose sequences
* Action support:
- Fix submenu-action handling
* Theme:
- Update icons from the Adwaita icon theme
- Fix icon names for GtkSwitch
- Fix switch-off icon
* GSK:
- Improve transformed offscreen rendering
- Add padding between cached glyphs
* Wayland:
- Fix monitor sizes in the presence of transforms
- Add a getter for the EGLDisplay
- Fix click-drag-release sequences for popovers
* X11:
- Support EGL for X11. Fall back to GLX if EGL isn't available
- Always fall back to GLX on NVidia
- Add a getter for the EGLDisplay
* Broadway:
- Add a setter for display scale
* Windows:
- Add a getter for the EGLDisplay
- Make GL work for media playback
* MacOS:
- Fix menubar appearance
* Tools:
- gtk4-builder-tool: Replace can-focus with focusable in 3-to-4 conversion
* Introspection:
- Add missing annotations in a few places (e.g. gtk_free_view_row_activated)
* Build:
- Only build one source file with -mf16c
- Fix devel styling for ci flatpak builds
- Generate appdata for demo flatpaks
* Docs:
- Numerous fixes and additions
* Translation updates:
Friulian
Nepali
Norwegian Bokmål
Ukrainian
Overview of Changes in 4.3.0
============================
* GtkVideo:
- Detect stream metadata when using gstreamer
* GtkFileChooser:
- Fix a crash
* GtkButton:
- Add back visual feedback for keynav activation
* GtkFontChooser:
- Fix initial font selection
* Text widgets:
- Replace squiggly error underlines by dotted lines
- Support translucent selections
* GtkTextView:
- Various improvements to rendering performance
* GtkScrolledWindow:
- Stop using scroll cursors
* GtkMenuButton:
- Make focus-on-click work
* GtkToggleButton:
- Make grouped buttons mutually exclusive
* GtkPasswordEntry:
- Use MADV_DONTDUMP for secure memory
* GtkListBox:
- Allow repeated selection extension for MULTIPLE
* Themes:
- Reorganize and rename included themes. The theme is now
called Default, with dark, hc and hc-dark variants.
Visually, the themes are unchanged.
- The theme variants are also available as standalone
themes called Default-dark, etc.
- The theme named Adwaita is moving to libadwaita
- Fix resize border sizing
- Fix solid-csd window decorations
* Input:
- Revert some Compose sequence changes (mainly around dead
acute and apostrophe)
- Consume all key events during preedit, to avoid unexpected
interactions
- Ignore more modifiers during preedit, to allow using 3rd and
5th level choosers
- Fix handling of cursor positions in non-ASCII preedit text
- Fix a problem with deferred focus setting
* GdkClipboard:
- Ensure strings are nul-terminated
* GSK:
- Improvements to the ngl renderer
- Fix offscreen rendering with transforms
- Fix downscaled textures
- Avoid huge intermediate textures
- Use fp16 for colors
- Optimize handling of underlines in text
- Fix corner cases of shadow rendering
- Reorganize shader resources
- Make shadow rendering match across renderers
* Accessibility:
- Various fixes to get Orca to speak (still a work in progress)
* Wayland:
- Improve font settings fallback
- Avoid unintentional rendering freezes with popovers
- Support the xdg_activation_v1 protocol
* X11:
- Don't beep on untrusted displays
- Don't crash when popovers are outside the workarea
* Windows:
- Fix using GL rendering with Mesa drivers
* Tools:
- Add support for copy/paste in gtk4-node-editor
- Make syntax highlighting work in the gtk4-demo flatpak
* Inspector:
- Enable the inspector by default, in all cases
- Show keyboard layouts
- Improve monitor information
* Translation updates:
Catalan
Chinese (Taiwan)
Dutch
Nepali
Polish
Swedish
Ukrainian
Overview of Changes in 4.2.0
============================
* GtkFileChooser: Make the location entry work again
* GtlLabel: Fix tooltips on links
* GtkTextView: Make scrolling work better with renderers
* X11:
- Fix damage handling
- Trap errors from the COW
* Windows:
- Use a visible scroll cursor
- Include more icons for icon-theme-less situations
* Wayland: Fix key event matching with mismatched layouts.
This was causing keyboard accelerators to trigger unexpectedly
* Inspector: Allow inspecting Unicode
* Input:
- Improve dead key handling
- Regenerate compose sequence table
* gsk:
- Fix a crash in the ngl renderer
- Fix a rounding error in subpixel glyph positioning
- ngl: Implement glyph cache eviction
- ngl: Improve the glyph cache effectiveness
- ngl: Fix uniform key mapping on Windows
- Make the ngl renderer the default
* build:
- Fix build with cairo as subproject
- Disable g_assert in release builds
- Include gi-docgen as subproject
- Include generated docs
* Translation updates:
Hebrew
Hungarian
Italian
Polish
Portuguese
Swedish
Ukrainian
Overview of Changes in 4.1.2
============================
* Input:
- Ensure preedit-start and preedit-end
are emitted properly
- Support the Wayland text protocol better
- Delete the selection when preedit starts
* Label: Fix a small issue with markup parsing
and mnemonics
* Spinbutton: Interpret localized digits
* Textview: Fix blinking block cursors
* Tooltips: Don't pop up erroneous on popovers
* Window: Add a way to disable F10 handling
* Theme:
- Use a regular focus ring for sidebar rows
* GSK
- ngl: Performance improvements
- vulkan: Add visible fallback rendering
- vukan: Handle simple transforms when clipping
* Wayland:
- Don't force a full redraw for every frame
- Don't leak buffers when rendering with cairo
* Demos:
- iconbrowser: Make search more useful
* Documentation:
- Switch to building docs from gir files with gi-docgen
* build:
- Allow GTK to be used as meson subproject
* Translation updates
Catalan
Czech
Finnish
French
Indonesian
Kazakh
Latvian
Norwegian Bokmål
Polish
Serbian
Turkish
Overview of Changes in 4.1.1
============================
* Popover:
- Support shadows on popover > contents
* Input:
- Show preedit for compose sequences
- Support long compose sequences
- Support compose sequences producing multiple characters
* Themes:
- Allow suggested and destructive actions in lists
- Disable shadows on maximized, fullscreen and tiled windows
- Fine-tune scrollbar transitions and size
* CSS:
- Support drop-shadow filters
- Correct blur filter spread interpretation
* Documentation:
- Improvements and updates for dialogs and native dialog
* Printing:
- Support Avahi-discovered printers better
* GSK:
- Add another OpenGL render. It is not the default yet.
To try it, use GSK_RENDERER=ngl
* Build:
- Lots of static analysis fixes found by pvs
- Add a -Dprofile=devel option for devel styling and
use it for nightly flatpaks
* X11:
- Fix DND of X11-specific types
* Wayland:
- Fix lookup of font settings in flatpaks
* Windows:
- Fix window resizing
- Avoid UAC for gtk-update-icon-cache
* MacOs:
- Use correct module file extension
- Make OpenGL context opaque when possible
- Fix window resizing
* Translation updates:
British English
Czech
Danish
Galician
Hungarian
Turkish
Overview of Changes in 4.1.0
============================

View File

@@ -32,9 +32,16 @@ Discussion forum
- https://discourse.gnome.org/c/platform/core/
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk/
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk4/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk4/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk4/
Nightly flatpaks of our demos can be installed from the
[GNOME Nightly](https://wiki.gnome.org/Apps/Nightly) repository:
- `flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo`
- `flatpak install gnome-nightly org.gtk.Demo4`
- `flatpak install gnome-nightly org.gtk.WidgetFactory4`
- `flatpak install gnome-nightly org.gtk.IconBrowser4`
Building and installing
-----------------------
@@ -150,8 +157,8 @@ Release notes
The release notes for GTK are part of the migration guide in the API
reference. See:
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
- [4.x release notes](https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html)
- [3.x release notes](https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html)
- [4.x release notes](https://docs.gtk.org/gtk4/migrating-3to4.html)
Licensing terms
---------------

View File

@@ -0,0 +1,43 @@
diff -ur lua-5.1.4/src/Makefile lua-5.1.4-new/src/Makefile
--- lua-5.1.4/src/Makefile 2008-01-19 20:37:58.000000000 +0100
+++ lua-5.1.4-new/src/Makefile 2012-02-23 18:26:43.000000000 +0100
@@ -23,6 +23,7 @@
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
lundump.o lvm.o lzio.o
@@ -36,7 +37,7 @@
LUAC_O= luac.o print.o
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
default: $(PLAT)
@@ -51,6 +52,11 @@
$(AR) $@ $?
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
--- lua-5.1.4/Makefile 2008-08-12 02:40:48.000000000 +0200
+++ lua-5.1.4-new/Makefile 2012-02-23 19:06:32.000000000 +0100
@@ -53,7 +53,7 @@
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua test/hello.lua

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -93,6 +93,77 @@
}
]
},
{
"name": "boost",
"buildsystem": "simple",
"build-commands": [
"./bootstrap.sh --prefix=/app --with-libraries=date_time,filesystem,iostreams,locale,regex,system,thread,python,program_options,test,serialization",
"./b2 --build-type=minimal link=shared -j $FLATPAK_BUILDER_N_JOBS",
"./b2 --build-type=minimal link=shared install"
],
"sources": [
{
"type": "archive",
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2",
"sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
}
]
},
{
"name": "lua-5.1",
"buildsystem": "simple",
"build-commands": [
"make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
"make INSTALL_TOP=$FLATPAK_DEST TO_LIB='liblua.a liblua.so.5.1.5' install",
"ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so",
"ln -sf liblua.so.5.1.5 $FLATPAK_DEST/lib/liblua.so.5.1",
"install -Dm0644 etc/lua.pc $FLATPAK_DEST/lib/pkgconfig/lua.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua51.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.1.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.1.pc"
],
"sources": [
{
"type": "archive",
"url": "https://www.lua.org/ftp/lua-5.1.5.tar.gz",
"sha256": "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"
},
{
"type": "patch",
"path": "lua-5.1.5-so.patch"
},
{
"type": "shell",
"commands": [
"sed -i \"s|/usr/local|$FLATPAK_DEST|\" etc/lua.pc src/luaconf.h"
]
}
],
"cleanup": [
"*.a",
"/bin",
"/include",
"/lib/pkgconfig",
"/man"
]
},
{
"name" : "highlight",
"buildsystem" : "simple",
"builddir" : true,
"build-commands" : [
"sed -i -e 's#^PREFIX = /usr#PREFIX = /app#' makefile",
"make",
"make install"
],
"sources" : [
{
"type" : "archive",
"url" : "http://www.andre-simon.de/zip/highlight-4.0.tar.bz2",
"sha256" : "f40dcba26e011a2c67df874f4d9b0238c2c6b065163ce8de3d8371b9dfce864d"
}
]
},
{
"name" : "gtk",
"buildsystem" : "meson",
@@ -100,7 +171,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -100,7 +100,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -100,7 +100,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import os
import shutil
import subprocess
from pathlib import PurePath
stylesheets = [
'gtk/theme/Default/Default-light.css',
'gtk/theme/Default/Default-dark.css',
'gtk/theme/Default/Default-hc.css',
'gtk/theme/Default/Default-hc-dark.css',
]
references = [
'docs/reference/gtk/gtk4',
'docs/reference/gsk/gsk4',
'docs/reference/gdk/gdk4',
'docs/reference/gdk/gdk4-wayland',
'docs/reference/gdk/gdk4-x11',
]
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
buildroot = os.environ.get('MESON_BUILD_ROOT')
distroot = os.environ.get('MESON_DIST_ROOT')
for stylesheet in stylesheets:
stylesheet_path = PurePath(stylesheet)
src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
dst = PurePath(distroot, stylesheet_path)
subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])
for reference in references:
src_path = os.path.join(buildroot, reference)
if os.path.isdir(src_path):
dst_path = os.path.join(distroot, reference)
shutil.copytree(src_path, dst_path)

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env python3
import os
from pathlib import PurePath
import subprocess
stylesheets = [ 'gtk/theme/Adwaita/Adwaita.css',
'gtk/theme/Adwaita/Adwaita-dark.css',
'gtk/theme/HighContrast/HighContrast.css',
'gtk/theme/HighContrast/HighContrast-dark.css' ]
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
distroot = os.environ.get('MESON_DIST_ROOT')
for stylesheet in stylesheets:
stylesheet_path = PurePath(stylesheet)
src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
dst = PurePath(distroot, stylesheet_path)
subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
repodir = sys.argv[1]
profile = sys.argv[2]
sys.stdout.write("/* This file is auto-generated. Do not edit. */\n")
sys.stdout.write("#pragma once\n")
sys.stdout.write("\n")
sys.stdout.write(f"#define PROFILE \"{profile}\"\n")
short_sha = os.environ.get('CI_COMMIT_SHORT_SHA')
if short_sha is None:
cmd = ["git", "-C", repodir, "rev-parse", "--short", "HEAD"]
try:
with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p:
short_sha = p.stdout.read().decode('utf-8').rstrip("\n")
except FileNotFoundError:
short_sha = ''
if profile != 'default':
short_sha = 'devel'
sys.stdout.write(f"#define VCS_TAG \"{short_sha}\"\n")

View File

@@ -76,6 +76,9 @@
/* Define to 1 if you have a working `mmap' system call. */
#mesondefine HAVE_MMAP
/* Define to 1 if you have a working `madvise' system call. */
#mesondefine HAVE_MADVISE
/* Define to 1 if you have the `posix_fallocate' function. */
#mesondefine HAVE_POSIX_FALLOCATE
@@ -121,9 +124,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H
/* Have the XCOMPOSITE X extension */
#mesondefine HAVE_XCOMPOSITE
/* Have the Xcursor library */
#mesondefine HAVE_XCURSOR
@@ -279,3 +279,8 @@
/* Define if tracker3 is available */
#mesondefine HAVE_TRACKER3
#mesondefine HAVE_F16C
/* Does the OS support GDesktopAppInfo? */
#mesondefine HAVE_DESKTOPAPPINFO

View File

@@ -128,6 +128,9 @@
<file>gtkfishbowl.c</file>
<file>gtkfishbowl.h</file>
</gresource>
<gresource prefix="/frames">
<file>frames.ui</file>
</gresource>
<gresource prefix="/gears">
<file>gtkgears.c</file>
<file>gtkgears.h</file>
@@ -276,6 +279,7 @@
<file>fishbowl.c</file>
<file>fixed.c</file>
<file>flowbox.c</file>
<file>frames.c</file>
<file>font_features.c</file>
<file>fontplane.c</file>
<file>fontrendering.c</file>
@@ -317,6 +321,7 @@
<file>paintable_emblem.c</file>
<file>paintable_mediastream.c</file>
<file>paintable_svg.c</file>
<file>paintable_symbolic.c</file>
<file>panes.c</file>
<file>password_entry.c</file>
<file>peg_solitaire.c</file>

View File

@@ -100,7 +100,11 @@ prepare_drag (GtkDragSource *source,
DemoImage *demo = DEMO_IMAGE (widget);
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (demo->image));
return gdk_content_provider_new_typed (GDK_TYPE_PAINTABLE, paintable);
/* Textures can be serialized, paintables can't, so special case the textures */
if (GDK_IS_TEXTURE (paintable))
return gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, paintable);
else
return gdk_content_provider_new_typed (GDK_TYPE_PAINTABLE, paintable);
}
static gboolean
@@ -129,7 +133,11 @@ copy_image (GtkWidget *widget,
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (demo->image));
GValue value = G_VALUE_INIT;
g_value_init (&value, GDK_TYPE_PAINTABLE);
/* Textures can be serialized, paintables can't, so special case the textures */
if (GDK_IS_TEXTURE (paintable))
g_value_init (&value, GDK_TYPE_TEXTURE);
else
g_value_init (&value, GDK_TYPE_PAINTABLE);
g_value_set_object (&value, paintable);
gdk_clipboard_set_value (clipboard, &value);
g_value_unset (&value);
@@ -138,24 +146,46 @@ copy_image (GtkWidget *widget,
g_object_unref (paintable);
}
static void
paste_image_cb (GObject *source,
GAsyncResult *result,
gpointer data)
{
GdkClipboard *clipboard = GDK_CLIPBOARD (source);
DemoImage *demo = DEMO_IMAGE (data);
const GValue *value;
value = gdk_clipboard_read_value_finish (clipboard, result, NULL);
if (value == NULL)
{
gtk_widget_error_bell (GTK_WIDGET (demo));
g_object_unref (demo);
return;
}
gtk_image_set_from_paintable (GTK_IMAGE (demo->image), g_value_get_object (value));
g_object_unref (demo);
}
static void
paste_image (GtkWidget *widget,
const char *action_name,
GVariant *parameter)
{
GdkClipboard *clipboard = gtk_widget_get_clipboard (widget);
DemoImage *demo = DEMO_IMAGE (widget);
GdkContentProvider *content = gdk_clipboard_get_content (clipboard);
GValue value = G_VALUE_INIT;
GdkPaintable *paintable;
GType type;
g_value_init (&value, GDK_TYPE_PAINTABLE);
if (!gdk_content_provider_get_value (content, &value, NULL))
return;
if (gdk_content_formats_contain_gtype (gdk_clipboard_get_formats (clipboard), GDK_TYPE_TEXTURE))
type = GDK_TYPE_TEXTURE;
else
type = GDK_TYPE_PAINTABLE;
paintable = GDK_PAINTABLE (g_value_get_object (&value));
gtk_image_set_from_paintable (GTK_IMAGE (demo->image), paintable);
g_value_unset (&value);
gdk_clipboard_read_value_async (clipboard,
type,
G_PRIORITY_DEFAULT,
NULL,
paste_image_cb,
g_object_ref (widget));
}
static void

View File

@@ -13,13 +13,13 @@
</style>
<child>
<object class="GtkButton">
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="fishbowl_prev_button_clicked_cb" object="bowl" swapped="no"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-name">go-next-symbolic</property>
<signal name="clicked" handler="fishbowl_next_button_clicked_cb" object="bowl" swapped="no"/>
</object>
</child>

View File

@@ -10,12 +10,8 @@
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
<child>
<object class="GtkImage">
<property name="icon-name">view-refresh-symbolic</property>
</object>
</child>
</object>
</child>
</object>

View File

@@ -1136,7 +1136,7 @@ done:
g_free (design_coords);
}
void
G_MODULE_EXPORT void
font_features_font_changed (void)
{
update_script_combo ();
@@ -1144,14 +1144,14 @@ font_features_font_changed (void)
update_font_variations ();
}
void
G_MODULE_EXPORT void
font_features_script_changed (void)
{
update_features ();
update_display ();
}
void
G_MODULE_EXPORT void
font_features_reset_features (void)
{
GList *l;
@@ -1197,7 +1197,7 @@ switch_to_label (void)
update_display ();
}
void
G_MODULE_EXPORT void
font_features_toggle_edit (void)
{
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (stack)), "label") == 0)
@@ -1206,7 +1206,7 @@ font_features_toggle_edit (void)
switch_to_label ();
}
void
G_MODULE_EXPORT void
font_features_stop_edit (void)
{
g_signal_emit_by_name (edit_toggle, "clicked");

View File

@@ -131,6 +131,19 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
#define VOID_ATTR(attr_name) \
{ \
tag = gtk_text_tag_table_lookup (table, #attr_name); \
if (!tag) \
{ \
tag = gtk_text_tag_new (#attr_name); \
g_object_set (tag, #attr_name, TRUE, NULL); \
gtk_text_tag_table_add (table, tag); \
g_object_unref (tag); \
} \
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
fg_alpha = bg_alpha = 1.;
attrs = pango_attr_iterator_get_attrs (iter);
@@ -255,6 +268,29 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
INT_ATTR (insert_hyphens);
break;
case PANGO_ATTR_LINE_HEIGHT:
FLOAT_ATTR (line_height);
break;
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
break;
case PANGO_ATTR_WORD:
VOID_ATTR (word);
break;
case PANGO_ATTR_SENTENCE:
VOID_ATTR (sentence);
break;
case PANGO_ATTR_BASELINE_SHIFT:
INT_ATTR (baseline_shift);
break;
case PANGO_ATTR_FONT_SCALE:
INT_ATTR (font_scale);
break;
case PANGO_ATTR_SHAPE:
case PANGO_ATTR_ABSOLUTE_SIZE:
case PANGO_ATTR_GRAVITY:
@@ -263,6 +299,10 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
case PANGO_ATTR_BACKGROUND_ALPHA:
break;
case PANGO_ATTR_TEXT_TRANSFORM:
INT_ATTR (text_transform);
break;
case PANGO_ATTR_INVALID:
default:
g_assert_not_reached ();

View File

@@ -10,6 +10,7 @@ static GtkWidget *font_button = NULL;
static GtkWidget *entry = NULL;
static GtkWidget *image = NULL;
static GtkWidget *hinting = NULL;
static GtkWidget *anti_alias = NULL;
static GtkWidget *hint_metrics = NULL;
static GtkWidget *up_button = NULL;
static GtkWidget *down_button = NULL;
@@ -37,6 +38,7 @@ update_image (void)
cairo_font_options_t *fopt;
cairo_hint_style_t hintstyle;
cairo_hint_metrics_t hintmetrics;
cairo_antialias_t antialias;
if (!context)
context = gtk_widget_create_pango_context (image);
@@ -65,6 +67,13 @@ update_image (void)
hintmetrics = CAIRO_HINT_METRICS_OFF;
cairo_font_options_set_hint_metrics (fopt, hintmetrics);
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (anti_alias)))
antialias = CAIRO_ANTIALIAS_GRAY;
else
antialias = CAIRO_ANTIALIAS_NONE;
cairo_font_options_set_antialias (fopt, antialias);
pango_context_set_round_glyph_positions (context, hintmetrics == CAIRO_HINT_METRICS_ON);
pango_cairo_context_set_font_options (context, fopt);
cairo_font_options_destroy (fopt);
pango_context_changed (context);
@@ -252,6 +261,7 @@ do_fontrendering (GtkWidget *do_widget)
entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
image = GTK_WIDGET (gtk_builder_get_object (builder, "image"));
hinting = GTK_WIDGET (gtk_builder_get_object (builder, "hinting"));
anti_alias = GTK_WIDGET (gtk_builder_get_object (builder, "antialias"));
hint_metrics = GTK_WIDGET (gtk_builder_get_object (builder, "hint_metrics"));
text_radio = GTK_WIDGET (gtk_builder_get_object (builder, "text_radio"));
show_grid = GTK_WIDGET (gtk_builder_get_object (builder, "show_grid"));
@@ -262,6 +272,7 @@ do_fontrendering (GtkWidget *do_widget)
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
g_signal_connect (hinting, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);
g_signal_connect (show_grid, "notify::active", G_CALLBACK (update_image), NULL);

View File

@@ -98,6 +98,15 @@
</layout>
</object>
</child>
<child>
<object class="GtkCheckButton" id="antialias">
<property name="label">Antialias</property>
<layout>
<property name="column">3</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="hinting">
<property name="active">0</property>

165
demos/gtk-demo/frames.c Normal file
View File

@@ -0,0 +1,165 @@
/* Benchmark/Frames
*
* This demo is intentionally as simple as possible, to see what
* framerate the windowing system can deliver on its own.
*
* It does nothing but change the drawn color, for every frame.
*/
#include <gtk/gtk.h>
typedef struct
{
GtkWidget parent_instance;
GdkRGBA color1;
GdkRGBA color2;
guint64 time2;
float t;
guint tick_cb;
} ColorWidget;
typedef struct
{
GtkWidgetClass parent_class;
} ColorWidgetClass;
G_DEFINE_TYPE (ColorWidget, color_widget, GTK_TYPE_WIDGET)
#define TIME_SPAN (3.0 * G_TIME_SPAN_SECOND)
static gboolean
change_color (GtkWidget *widget,
GdkFrameClock *frame_clock,
gpointer data)
{
ColorWidget *color = (ColorWidget *)widget;
gint64 time;
time = gdk_frame_clock_get_frame_time (frame_clock);
if (time >= color->time2)
{
color->time2 = time + TIME_SPAN;
color->color1 = color->color2;
color->color2.red = g_random_double_range (0, 1);
color->color2.green = g_random_double_range (0, 1);
color->color2.blue = g_random_double_range (0, 1);
color->color2.alpha = 1;
}
color->t = 1 - (color->time2 - time) / TIME_SPAN;
gtk_widget_queue_draw (widget);
return G_SOURCE_CONTINUE;
}
static void
color_widget_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
ColorWidget *color = (ColorWidget *)widget;
float w, h;
GdkRGBA c;
w = gtk_widget_get_width (widget);
h = gtk_widget_get_height (widget);
c.red = (1 - color->t) * color->color1.red + color->t * color->color2.red;
c.green = (1 - color->t) * color->color1.green + color->t * color->color2.green;
c.blue = (1 - color->t) * color->color1.blue + color->t * color->color2.blue;
c.alpha = 1;
gtk_snapshot_append_color (snapshot, &c, &GRAPHENE_RECT_INIT (0, 0, w, h));
}
static void
color_widget_init (ColorWidget *color)
{
gtk_widget_add_tick_callback (GTK_WIDGET (color), change_color, NULL, NULL);
gtk_widget_set_hexpand (GTK_WIDGET (color), TRUE);
gtk_widget_set_vexpand (GTK_WIDGET (color), TRUE);
}
static void
color_widget_class_init (ColorWidgetClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
widget_class->snapshot = color_widget_snapshot;
}
GtkWidget *
color_widget_new (void)
{
return g_object_new (color_widget_get_type (), NULL);
}
static gboolean
update_fps_label (gpointer data)
{
GtkWidget *label = GTK_WIDGET (data);
GdkFrameClock *frame_clock;
frame_clock = gtk_widget_get_frame_clock (label);
if (frame_clock)
{
char *fps;
fps = g_strdup_printf ("%.2f fps", gdk_frame_clock_get_fps (frame_clock));
gtk_label_set_label (GTK_LABEL (label), fps);
g_free (fps);
}
else
gtk_label_set_label (GTK_LABEL (label), "");
return G_SOURCE_CONTINUE;
}
static void
remove_id (gpointer data)
{
guint id = GPOINTER_TO_UINT (data);
g_source_remove (id);
}
GtkWidget *
do_frames (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkBuilder *builder;
GtkWidget *box;
GtkWidget *label;
guint id;
builder = gtk_builder_new_from_resource ("/frames/frames.ui");
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
label = GTK_WIDGET (gtk_builder_get_object (builder, "fps"));
box = GTK_WIDGET (gtk_builder_get_object (builder, "box"));
gtk_box_append (GTK_BOX (box), color_widget_new ());
id = g_timeout_add (500, update_fps_label, label);
g_object_set_data_full (G_OBJECT (label), "tick_cb",
GUINT_TO_POINTER (id), remove_id);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

24
demos/gtk-demo/frames.ui Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window">
<property name="resizable">1</property>
<property name="default-width">600</property>
<property name="default-height">400</property>
<property name="title">Frames</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<child type="end">
<object class="GtkLabel" id="fps">
<attributes>
<attribute name="font-features" value="tnum=1"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="box">
</object>
</child>
</object>
</interface>

View File

@@ -23,13 +23,10 @@
#include "gskshaderpaintable.h"
/**
* SECTION:gskshaderpaintable
* @Short_description: Drawing with shaders
* @Title: GskShaderPaintable
* @see_also: #GdkPaintable
* GskShaderPaintable:
*
* GskShaderPaintable is an implementation of the #GdkPaintable interface
* that uses a #GskGLShader to create pixels.
* `GskShaderPaintable` is an implementation of the `GdkPaintable` interface
* that uses a `GskGLShader` to create pixels.
*
* You can set the uniform data that the shader needs for rendering
* using gsk_shader_paintable_set_args(). This function can
@@ -38,7 +35,7 @@
*
* Commonly, time is passed to shaders as a float uniform containing
* the elapsed time in seconds. The convenience API
* gsk_shader_paintable_update_time() can be called from a #GtkTickCallback
* gsk_shader_paintable_update_time() can be called from a `GtkTickCallback`
* to update the time based on the frame time of the frame clock.
*/
@@ -186,7 +183,7 @@ gsk_shader_paintable_init (GskShaderPaintable *self)
* pixels. The shader must not require input textures.
* If @data is %NULL, all uniform values are set to zero.
*
* Returns: (transfer full): a new #GskShaderPaintable
* Returns: (transfer full): a new `GskShaderPaintable`
*/
GdkPaintable *
gsk_shader_paintable_new (GskGLShader *shader,
@@ -215,8 +212,8 @@ gsk_shader_paintable_new (GskGLShader *shader,
/**
* gsk_shader_paintable_set_shader:
* @self: a #GskShaderPaintable
* @shader: the #GskGLShader to use
* @self: a `GskShaderPaintable`
* @shader: the `GskGLShader` to use
*
* Sets the shader that the paintable will use
* to create pixels. The shader must not require
@@ -241,11 +238,11 @@ gsk_shader_paintable_set_shader (GskShaderPaintable *self,
/**
* gsk_shader_paintable_get_shader:
* @self: a #GskShaderPaintable
* @self: a `GskShaderPaintable`
*
* Returns the shader that the paintable is using.
*
* Returns: (transfer none): the #GskGLShader that is used
* Returns: (transfer none): the `GskGLShader` that is used
*/
GskGLShader *
gsk_shader_paintable_get_shader (GskShaderPaintable *self)
@@ -257,12 +254,12 @@ gsk_shader_paintable_get_shader (GskShaderPaintable *self)
/**
* gsk_shader_paintable_set_args:
* @self: a #GskShaderPaintable
* @self: a `GskShaderPaintable`
* @data: Data block with uniform data for the shader
*
* Sets the uniform data that will be passed to the
* shader when rendering. The @data will typically
* be produced by a #GskUniformDataBuilder.
* be produced by a `GskUniformDataBuilder`.
*
* Note that the @data should be considered immutable
* after it has been passed to this function.
@@ -284,7 +281,7 @@ gsk_shader_paintable_set_args (GskShaderPaintable *self,
/**
* gsk_shader_paintable_get_args:
* @self: a #GskShaderPaintable
* @self: a `GskShaderPaintable`
*
* Returns the uniform data set with
* gsk_shader_paintable_get_args().
@@ -301,9 +298,9 @@ gsk_shader_paintable_get_args (GskShaderPaintable *self)
/**
* gsk_shader_paintable_update_time:
* @self: a #GskShaderPaintable
* @self: a `GskShaderPaintable`
* @time_idx: the index of the uniform for time in seconds as float
* @frame_time: the current frame time, as returned by #GdkFrameClock
* @frame_time: the current frame time, as returned by `GdkFrameClock`
*
* This function is a convenience wrapper for
* gsk_shader_paintable_set_args() that leaves all
@@ -311,7 +308,7 @@ gsk_shader_paintable_get_args (GskShaderPaintable *self)
* index @time_idx, which will be set to the elapsed time
* in seconds, since the first call to this function.
*
* This function is usually called from a #GtkTickCallback.
* This function is usually called from a `GtkTickCallback`.
*/
void
gsk_shader_paintable_update_time (GskShaderPaintable *self,

View File

@@ -74,9 +74,9 @@ gtk_fishbowl_init (GtkFishbowl *fishbowl)
/**
* gtk_fishbowl_new:
*
* Creates a new #GtkFishbowl.
* Creates a new `GtkFishbowl`.
*
* Returns: a new #GtkFishbowl.
* Returns: a new `GtkFishbowl`.
*/
GtkWidget*
gtk_fishbowl_new (void)

View File

@@ -163,8 +163,8 @@ drag_update_cb (GtkGestureDrag *drag,
static void
drag_end_cb (GtkGestureDrag *drag,
gdouble dx,
gdouble dy,
double dx,
double dy,
gpointer user_data)
{
GtkShadertoy *shadertoy = GTK_SHADERTOY (user_data);

View File

@@ -18,8 +18,6 @@ do_headerbar (GtkWidget *do_widget)
GtkWidget *header;
GtkWidget *button;
GtkWidget *box;
GtkWidget *image;
GIcon *icon;
if (!window)
{
@@ -32,20 +30,14 @@ do_headerbar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
button = gtk_button_new ();
icon = g_themed_icon_new ("mail-send-receive-symbolic");
image = gtk_image_new_from_gicon (icon);
g_object_unref (icon);
gtk_button_set_child (GTK_BUTTON (button), image);
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class (box, "linked");
button = gtk_button_new ();
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-start-symbolic"));
button = gtk_button_new_from_icon_name ("go-previous-symbolic");
gtk_box_append (GTK_BOX (box), button);
button = gtk_button_new ();
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-end-symbolic"));
button = gtk_button_new_from_icon_name ("go-next-symbolic");
gtk_box_append (GTK_BOX (box), button);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box);

View File

@@ -61,12 +61,26 @@ show_page (GtkTextView *text_view,
int page)
{
GtkTextBuffer *buffer;
GtkTextIter iter;
GtkTextIter iter, start;
GtkTextMark *mark;
GtkWidget *child;
GtkTextChildAnchor *anchor;
GtkEventController *controller;
GtkTextTag *bold, *mono, *nobreaks;
buffer = gtk_text_view_get_buffer (text_view);
bold = gtk_text_buffer_create_tag (buffer, NULL,
"weight", PANGO_WEIGHT_BOLD,
"scale", PANGO_SCALE_X_LARGE,
NULL);
mono = gtk_text_buffer_create_tag (buffer, NULL,
"family", "monospace",
NULL);
nobreaks = gtk_text_buffer_create_tag (buffer, NULL,
"allow-breaks", FALSE,
NULL);
gtk_text_buffer_set_text (buffer, "", 0);
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
gtk_text_buffer_begin_irreversible_action (buffer);
@@ -104,17 +118,22 @@ show_page (GtkTextView *text_view,
}
else if (page == 2)
{
GtkTextTag *tag;
mark = gtk_text_buffer_create_mark (buffer, "mark", &iter, TRUE);
tag = gtk_text_buffer_create_tag (buffer, NULL,
"weight", PANGO_WEIGHT_BOLD,
"scale", PANGO_SCALE_X_LARGE,
NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, "tag", -1, tag, NULL);
tag = gtk_text_buffer_create_tag (buffer, NULL,
"family", "monospace",
NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, " /tag/ ", -1, tag, NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, "tag", -1, bold, NULL);
gtk_text_buffer_insert (buffer, &iter, " /", -1);
gtk_text_buffer_get_iter_at_mark (buffer, &start, mark);
gtk_text_buffer_apply_tag (buffer, nobreaks, &start, &iter);
gtk_text_buffer_insert (buffer, &iter, " ", -1);
gtk_text_buffer_move_mark (buffer, mark, &iter);
gtk_text_buffer_insert_with_tags (buffer, &iter, "tag", -1, mono, NULL);
gtk_text_buffer_insert (buffer, &iter, " /", -1);
gtk_text_buffer_get_iter_at_mark (buffer, &start, mark);
gtk_text_buffer_apply_tag (buffer, nobreaks, &start, &iter);
gtk_text_buffer_insert (buffer, &iter, " ", -1);
anchor = gtk_text_buffer_create_child_anchor (buffer, &iter);
child = gtk_image_new_from_icon_name ("audio-volume-high-symbolic");
@@ -132,20 +151,26 @@ show_page (GtkTextView *text_view,
"behavior of mouse and key presses, “lock” a range of text so the "
"user can't edit it, or countless other things.\n", -1);
insert_link (buffer, &iter, "Go back", 1);
gtk_text_buffer_delete_mark (buffer, mark);
}
else if (page == 3)
{
GtkTextTag *tag;
mark = gtk_text_buffer_create_mark (buffer, "mark", &iter, TRUE);
tag = gtk_text_buffer_create_tag (buffer, NULL,
"weight", PANGO_WEIGHT_BOLD,
"scale", PANGO_SCALE_X_LARGE,
NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, "hypertext", -1, tag, NULL);
tag = gtk_text_buffer_create_tag (buffer, NULL,
"family", "monospace",
NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, " /ˈhaɪ pərˌtɛkst/ ", -1, tag, NULL);
gtk_text_buffer_insert_with_tags (buffer, &iter, "hypertext", -1, bold, NULL);
gtk_text_buffer_insert (buffer, &iter, " /", -1);
gtk_text_buffer_get_iter_at_mark (buffer, &start, mark);
gtk_text_buffer_apply_tag (buffer, nobreaks, &start, &iter);
gtk_text_buffer_insert (buffer, &iter, " ", -1);
gtk_text_buffer_move_mark (buffer, mark, &iter);
gtk_text_buffer_insert_with_tags (buffer, &iter, "ˈhaɪ pərˌtɛkst", -1, mono, NULL);
gtk_text_buffer_insert (buffer, &iter, " /", -1);
gtk_text_buffer_get_iter_at_mark (buffer, &start, mark);
gtk_text_buffer_apply_tag (buffer, nobreaks, &start, &iter);
gtk_text_buffer_insert (buffer, &iter, " ", -1);
anchor = gtk_text_buffer_create_child_anchor (buffer, &iter);
child = gtk_image_new_from_icon_name ("audio-volume-high-symbolic");
@@ -159,6 +184,8 @@ show_page (GtkTextView *text_view,
"Machine-readable text that is not sequential but is organized "
"so that related items of information are connected.\n", -1);
insert_link (buffer, &iter, "Go back", 1);
gtk_text_buffer_delete_mark (buffer, mark);
}
gtk_text_buffer_end_irreversible_action (buffer);
}
@@ -358,7 +385,7 @@ do_hypertext (GtkWidget *do_widget)
sw = gtk_scrolled_window_new ();
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_window_set_child (GTK_WINDOW (window), sw);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);

View File

@@ -13,7 +13,7 @@ static GtkWidget *window = NULL;
static GtkWidget *scrolledwindow;
static int selected;
#define N_WIDGET_TYPES 7
#define N_WIDGET_TYPES 8
static int hincrement = 5;
@@ -110,6 +110,46 @@ populate_text (gboolean highlight)
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), textview);
}
static void
populate_emoji_text (void)
{
GtkWidget *textview;
GtkTextBuffer *buffer;
GString *s;
GtkTextIter iter;
s = g_string_sized_new (500 * 30 * 4);
for (int i = 0; i < 500; i++)
{
if (i % 2)
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
for (int j = 0; j < 30; j++)
{
g_string_append (s, "💓");
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
}
g_string_append (s, "\n");
}
buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_get_start_iter (buffer, &iter);
gtk_text_buffer_insert_markup (buffer, &iter, s->str, s->len);
g_string_free (s, TRUE);
textview = gtk_text_view_new ();
gtk_text_view_set_buffer (GTK_TEXT_VIEW (textview), buffer);
hincrement = 0;
vincrement = 5;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), textview);
}
static void
populate_image (void)
{
@@ -224,21 +264,26 @@ set_widget_type (int type)
break;
case 3:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling text with Emoji");
populate_emoji_text ();
break;
case 4:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a big image");
populate_image ();
break;
case 4:
case 5:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a list");
populate_list ();
break;
case 5:
case 6:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a columned list");
populate_list2 ();
break;
case 6:
case 7:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a grid");
populate_grid ();
break;

View File

@@ -13,13 +13,13 @@
</style>
<child>
<object class="GtkButton">
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="iconscroll_prev_clicked_cb"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-name">go-next-symbolic</property>
<signal name="clicked" handler="iconscroll_next_clicked_cb"/>
</object>
</child>

View File

@@ -8,8 +8,8 @@
#include <gtk/gtk.h>
/* This is the function that creates the #GListModel that we need.
* GTK list widgets need a #GListModel to display, as models support change
/* This is the function that creates the GListModel that we need.
* GTK list widgets need a GListModel to display, as models support change
* notifications.
* Unfortunately various older APIs do not provide list models, so we create
* our own.
@@ -20,10 +20,10 @@ create_application_list (void)
GListStore *store;
GList *apps, *l;
/* We use a #GListStore here, which is a simple array-like list implementation
/* We use a GListStore here, which is a simple array-like list implementation
* for manual management.
* List models need to know what type of data they provide, so we need to
* provide the type here. As we want to do a list of applications, #GAppInfo
* provide the type here. As we want to do a list of applications, GAppInfo
* is the object we provide.
*/
store = g_list_store_new (G_TYPE_APP_INFO);
@@ -39,7 +39,7 @@ create_application_list (void)
}
/* This is the function we use for setting up new listitems to display.
* We add just an #GtkImage and a #GtkKabel here to display the application's
* We add just an GtkImage and a GtkLabel here to display the application's
* icon and name, as this is just a simple demo.
*/
static void
@@ -61,8 +61,8 @@ setup_listitem_cb (GtkListItemFactory *factory,
/* Here we need to prepare the listitem for displaying its item. We get the
* listitem already set up from the previous function, so we can reuse the
* #GtkImage widget we set up above.
* We get the item - which we know is a #GAppInfo because it comes out of
* GtkImage widget we set up above.
* We get the item - which we know is a GAppInfo because it comes out of
* the model we set up above, grab its icon and display it.
*/
static void
@@ -85,7 +85,7 @@ bind_listitem_cb (GtkListItemFactory *factory,
* the listitem, but this is simple code, so the default implementations are
* enough. If we had connected signals, this step would have been necessary.
*
* The #GtkSignalListItemFactory documentation contains more information about
* The GtkSignalListItemFactory documentation contains more information about
* this step.
*/
@@ -108,8 +108,8 @@ activate_cb (GtkListView *list,
app_info = g_list_model_get_item (G_LIST_MODEL (gtk_list_view_get_model (list)), position);
/* Prepare the context for launching the application and launch it. This
* code is explained in detail in the documentation for #GdkAppLaunchContext
* and #GAppInfo.
* code is explained in detail in the documentation for GdkAppLaunchContext
* and GAppInfo.
*/
context = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (list)));
if (!g_app_info_launch (app_info,
@@ -155,13 +155,13 @@ do_listview_applauncher (GtkWidget *do_widget)
gtk_window_set_title (GTK_WINDOW (window), "Application Launcher");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &window);
/* The #GtkListitemFactory is what is used to create #GtkListItems
/* The GtkListitemFactory is what is used to create GtkListItems
* to display the data from the model. So it is absolutely necessary
* to create one.
* We will use a #GtkSignalListItemFactory because it is the simplest
* We will use a GtkSignalListItemFactory because it is the simplest
* one to use. Different ones are available for different use cases.
* The most powerful one is #GtkBuilderListItemFactory which uses
* #GtkBuilder .ui files, so it requires little code.
* The most powerful one is GtkBuilderListItemFactory which uses
* GtkBuilder .ui files, so it requires little code.
*/
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
@@ -184,7 +184,7 @@ do_listview_applauncher (GtkWidget *do_widget)
*/
g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL);
/* List widgets should always be contained in a #GtkScrolledWindow,
/* List widgets should always be contained in a GtkScrolledWindow,
* because otherwise they might get too large or they might not
* be scrollable.
*/

View File

@@ -34,6 +34,7 @@ enum {
};
#define FILE_BROWSER_TYPE_VIEW (file_browser_view_get_type ())
G_MODULE_EXPORT
G_DECLARE_FINAL_TYPE (FileBrowserView, file_browser_view, FILE_BROWSER, VIEW, GObject);
G_DEFINE_TYPE (FileBrowserView, file_browser_view, G_TYPE_OBJECT);
@@ -159,7 +160,7 @@ static void file_browser_view_init (FileBrowserView *self)
{
}
char *
G_MODULE_EXPORT char *
filebrowser_get_display_name (GObject *object,
GFileInfo *info)
{
@@ -169,7 +170,7 @@ filebrowser_get_display_name (GObject *object,
return g_strdup (g_file_info_get_attribute_string (info, "standard::display-name"));
}
char *
G_MODULE_EXPORT char *
filebrowser_get_content_type (GObject *object,
GFileInfo *info)
{
@@ -179,7 +180,7 @@ filebrowser_get_content_type (GObject *object,
return g_strdup (g_file_info_get_attribute_string (info, "standard::content-type"));
}
char *
G_MODULE_EXPORT char *
filebrowser_get_size (GObject *object,
GFileInfo *info)
{
@@ -189,7 +190,7 @@ filebrowser_get_size (GObject *object,
return g_format_size (g_file_info_get_attribute_uint64 (info, "standard::size"));
}
GIcon *
G_MODULE_EXPORT GIcon *
filebrowser_get_icon (GObject *object,
GFileInfo *info)
{
@@ -206,7 +207,7 @@ filebrowser_get_icon (GObject *object,
return icon;
}
void
G_MODULE_EXPORT void
filebrowser_up_clicked_cb (GtkButton *button,
GtkDirectoryList *list)
{
@@ -219,7 +220,7 @@ filebrowser_up_clicked_cb (GtkButton *button,
gtk_directory_list_set_file (list, file);
}
void
G_MODULE_EXPORT void
filebrowser_view_activated_cb (GtkGridView *view,
guint pos,
GtkDirectoryList *list)

View File

@@ -25,6 +25,8 @@
#include "demos.h"
#include "fontify.h"
#include "demo_conf.h"
static GtkWidget *info_view;
static GtkWidget *source_view;
@@ -196,16 +198,20 @@ activate_about (GSimpleAction *action,
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can appear here: <http://www.gtk.org>");
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Demo",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Demo (Development)"
: "GTK Demo",
"version", version,
"copyright", "©1997—2020 The GTK Team",
"copyright", "©1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK widgets",
@@ -745,7 +751,6 @@ demo_filter_by_name (gpointer item,
gpointer user_data)
{
GtkTreeListRow *row = item;
GtkFilterListModel *model = user_data;
GListModel *children;
GtkDemo *demo;
guint i, n;
@@ -756,7 +761,7 @@ demo_filter_by_name (gpointer item,
return TRUE;
g_assert (GTK_IS_TREE_LIST_ROW (row));
g_assert (GTK_IS_FILTER_LIST_MODEL (model));
g_assert (GTK_IS_FILTER_LIST_MODEL (user_data));
/* Show a row if itself of any parent matches */
for (parent = row; parent; parent = gtk_tree_list_row_get_parent (parent))
@@ -901,6 +906,9 @@ activate (GApplication *app)
window = (GtkWidget *)gtk_builder_get_object (builder, "window");
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (window));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (window, "devel");
action = g_simple_action_new ("run", NULL);
g_signal_connect (action, "activate", G_CALLBACK (activate_run), window);
g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (action));
@@ -1043,10 +1051,10 @@ out:
static void
print_version (void)
{
g_print ("gtk4-demo %d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
g_print ("gtk4-demo %s%s%s\n",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
}
static int

View File

@@ -25,6 +25,7 @@
<object class="GtkButton">
<property name="valign">center</property>
<property name="action-name">win.run</property>
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Run</property>
</object>
</child>
@@ -32,6 +33,7 @@
<object class="GtkToggleButton">
<property name="icon-name">edit-find-symbolic</property>
<property name="valign">center</property>
<property name="focus-on-click">0</property>
<property name="active" bind-source="searchbar" bind-property="search-mode-enabled" bind-flags="bidirectional|sync-create"/>
<accessibility>
<property name="label" translatable="yes">Search</property>
@@ -41,6 +43,7 @@
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="valign">center</property>
<property name="focus-on-click">0</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
<accessibility>

View File

@@ -58,7 +58,7 @@ do_markup (GtkWidget *do_widget)
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 680);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
stack = gtk_stack_new ();

View File

@@ -1,5 +1,9 @@
Text sizes: <span size="xx-small">tiny</span> <span size="x-small">very small</span> <span size="small">small</span> <span size="medium">normal</span> <span size="large">large</span> <span size="x-large">very large</span> <span size="xx-large">huge</span>
Text sizes: <span size="xx-small">tiny </span><span size="x-small">very small </span><span size="small">small </span><span size="medium">normal </span><span size="large">large </span><span size="x-large">very large </span><span size="xx-large">huge</span>
Text styles: <span style="normal">Normal</span> <span style="italic">Italic</span> <span style="oblique">Olique</span>
Text weights: <span weight="thin">thin</span> <span weight="light">light</span> <span weight="normal">normal</span> <span weight="bold">bold</span> <span weight="ultraheavy">ultraheavy</span>
Text <span color="gray">c<span color="green">o</span>l<span color="tomato">o</span>rs</span> and <span background="pink">backgrounds</span>
@@ -15,6 +19,12 @@ OpenType font features: <span font_desc="sans regular" font_features="dlig=0">fe
Shortcuts: <tt>Monospace</tt> <b>Bold</b> <i>Italic</i> <big>Big</big> <small>Small</small> <u>Underlined</u> <s>Strikethrough</s> Super<sup>script</sup> Sub<sub>script</sub>
<span allow_breaks="false">A</span> hy­phen­ation al­go­rithm is a set of rules, espe­ci­ally one co­di­fied for im­ple­men­tation in a com­pu­ter pro­gram, that de­ci­des at which points a word can be bro­ken over two lines with a hy­phen. For ex­am­ple, a hy­phen­ation al­go­rithm might de­cide that im­peach­ment can be broken as <span allow_breaks="false">impeach‧ment</span> or <span allow_breaks="false">im‧peachment</span> but not <span allow_breaks="false">impe‧achment.</span>
hy­phen­ation al­go­rithm is a <span allow_breaks="false" style="italic">set of rules</span>, espe­ci­ally one co­di­fied for im­ple­men­tation in a com­pu­ter pro­gram, that de­ci­des at which points a word can be bro­ken over two lines with a hy­phen. For ex­am­ple, a hy­phen­ation al­go­rithm might de­cide that im­peach­ment can be broken as impeach‧ment or im‧peachment but not impe‧achment.
<span insert_hyphens="false">one/two three/four five/six seven/eight nine/ten</span>
<span line_height='1.33'>Line height: This is an example of widely spaced text. It was achieved by setting the line-height factor to 1.33. You can set the line-height factor to any value between 0 and 10.
Note that the line height affects the spacing between paragraphs as well as between the wrapped lines inside a paragraph.</span>
Transforms: <span text_transform='uppercase'>straße</span> <span text_transform='capitalize'>up, up and away</span>

View File

@@ -21,8 +21,10 @@ do_menu (GtkWidget *do_widget)
if (!window)
{
GtkWidget *box;
GtkWidget *sw;
GtkWidget *widget;
GtkWidget *scale;
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Menu");
@@ -31,11 +33,23 @@ do_menu (GtkWidget *do_widget)
gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_window_set_child (GTK_WINDOW (window), box);
sw = gtk_scrolled_window_new ();
gtk_window_set_child (GTK_WINDOW (window), sw);
gtk_widget_set_vexpand (sw, TRUE);
gtk_box_append (GTK_BOX (box), sw);
widget = demo3_widget_new ("/transparent/portland-rose.jpg");
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), widget);
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.01, 10.0, 0.1);
gtk_range_set_value (GTK_RANGE (scale), 1.0);
gtk_box_append (GTK_BOX (box), scale);
g_object_bind_property (gtk_range_get_adjustment (GTK_RANGE (scale)), "value",
widget, "scale",
G_BINDING_BIDIRECTIONAL);
}
if (!gtk_widget_get_visible (window))

View File

@@ -29,6 +29,7 @@ demos = files([
'fishbowl.c',
'fixed.c',
'fontrendering.c',
'frames.c',
'gears.c',
'gestures.c',
'glarea.c',
@@ -66,6 +67,7 @@ demos = files([
'paintable_animated.c',
'paintable_emblem.c',
'paintable_mediastream.c',
'paintable_symbolic.c',
'panes.c',
'password_entry.c',
'peg_solitaire.c',
@@ -167,6 +169,8 @@ foreach flag: common_cflags
endif
endforeach
gtkdemo_deps += [ demo_conf_h ]
executable('gtk4-demo',
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
c_args: gtkdemo_args + demo_cflags,
@@ -202,4 +206,9 @@ install_data('org.gtk.Demo4.gschema.xml', install_dir: gtk_schemasdir)
gnome.compile_schemas()
# appdata
install_data('org.gtk.Demo4.appdata.xml', install_dir: gtk_appdatadir)
configure_file(
input: 'org.gtk.Demo4.appdata.xml.in',
output: 'org.gtk.Demo4.appdata.xml',
configuration: appdata_config,
install_dir: gtk_appdatadir
)

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gtk.Demo4.desktop</id>
<id>org.gtk.Demo4</id>
<launchable type="desktop-id">org.gtk.Demo4.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<project_license>LGPL-2.1-or-later</project_license>
<name>GTK Demo</name>
<summary>Program to demonstrate GTK functions</summary>
<description>
@@ -30,15 +31,11 @@
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="3.99.0" date="2020-07-30">
<release version="@BUILD_VERSION@" date="@BUILD_DATE@">
<description>
<p>A new developers snapshot towards GTK 4.0.</p>
</description>
</release>
<release version="3.94.0" date="2018-06-25">
<description>
<p>A new developers snapshot towards GTK 4.0.</p>
<p>A new build of GTK.</p>
</description>
</release>
</releases>

View File

@@ -45,26 +45,27 @@ struct _GtkNuclearIconClass
* so that it can be called from all the other demos, too.
*/
void
gtk_nuclear_snapshot (GtkSnapshot *snapshot,
double width,
double height,
double rotation,
gboolean draw_background)
gtk_nuclear_snapshot (GtkSnapshot *snapshot,
const GdkRGBA *foreground,
const GdkRGBA *background,
double width,
double height,
double rotation)
{
#define RADIUS 0.3
cairo_t *cr;
double size;
if (draw_background)
gtk_snapshot_append_color (snapshot,
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 },
&GRAPHENE_RECT_INIT (0, 0, width, height));
gtk_snapshot_append_color (snapshot,
background,
&GRAPHENE_RECT_INIT (0, 0, width, height));
size = MIN (width, height);
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT ((width - size) / 2.0,
(height - size) / 2.0,
size, size));
gdk_cairo_set_source_rgba (cr, foreground);
cairo_translate (cr, width / 2.0, height / 2.0);
cairo_scale (cr, size, size);
cairo_rotate (cr, rotation);
@@ -94,9 +95,10 @@ gtk_nuclear_icon_snapshot (GdkPaintable *paintable,
*/
gtk_nuclear_snapshot (snapshot,
&(GdkRGBA) { 0, 0, 0, 1 }, /* black */
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 }, /* yellow */
width, height,
nuclear->rotation,
TRUE);
nuclear->rotation);
}
static GdkPaintableFlags

View File

@@ -4,10 +4,11 @@
#include <gtk/gtk.h>
void gtk_nuclear_snapshot (GtkSnapshot *snapshot,
const GdkRGBA *foreground,
const GdkRGBA *background,
double width,
double height,
double rotation,
gboolean draw_background);
double rotation);
GdkPaintable * gtk_nuclear_icon_new (double rotation);
GdkPaintable * gtk_nuclear_animation_new (gboolean draw_background);

View File

@@ -65,9 +65,12 @@ gtk_nuclear_animation_snapshot (GdkPaintable *paintable,
/* We call the function from the previous example here. */
gtk_nuclear_snapshot (snapshot,
&(GdkRGBA) { 0, 0, 0, 1 }, /* black */
nuclear->draw_background
? &(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 } /* yellow */
: &(GdkRGBA) { 0, 0, 0, 0 }, /* transparent */
width, height,
2 * G_PI * nuclear->progress / MAX_PROGRESS,
nuclear->draw_background);
2 * G_PI * nuclear->progress / MAX_PROGRESS);
}
static GdkPaintable *

View File

@@ -73,9 +73,10 @@ gtk_nuclear_media_stream_snapshot (GdkPaintable *paintable,
/* We call the function from the previous example here. */
gtk_nuclear_snapshot (snapshot,
&(GdkRGBA) { 0, 0, 0, 1 }, /* black */
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 }, /* yellow */
width, height,
2 * G_PI * nuclear->progress / DURATION,
TRUE);
2 * G_PI * nuclear->progress / DURATION);
}
static GdkPaintable *
@@ -150,7 +151,7 @@ gtk_nuclear_media_stream_step (gpointer data)
* call our pause function to pause the stream.
*/
if (nuclear->progress >= DURATION)
gtk_media_stream_ended (GTK_MEDIA_STREAM (nuclear));
gtk_media_stream_stream_ended (GTK_MEDIA_STREAM (nuclear));
/* The timeout function is removed by the pause function,
* so we can just always return this value.
@@ -267,11 +268,11 @@ gtk_nuclear_media_stream_init (GtkNuclearMediaStream *nuclear)
* However, media streams need to tell GTK once they are initialized,
* so we do that here.
*/
gtk_media_stream_prepared (GTK_MEDIA_STREAM (nuclear),
FALSE,
TRUE,
TRUE,
DURATION);
gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (nuclear),
FALSE,
TRUE,
TRUE,
DURATION);
}
/* And finally, we add the simple constructor we declared in the header. */

View File

@@ -0,0 +1,208 @@
/* Paintable/Symbolic Paintable
*
* GdkPaintables can be made to follow the theme's colors. GTK calls
* icons that do this symbolic icons, paintables that want to have
* the same effect can implement the GtkSymbolicPaintable interface.
*
* We will adapt the original paintable example by adding the ability
* to recolor the paintable based on the symbolic colors.
*/
#include <gtk/gtk.h>
#include "paintable.h"
static GtkWidget *window = NULL;
/* First, add the boilerplate for the object itself.
* This part would normally go in the header.
*/
#define GTK_TYPE_NUCLEAR_SYMBOLIC (gtk_nuclear_symbolic_get_type ())
G_DECLARE_FINAL_TYPE (GtkNuclearSymbolic, gtk_nuclear_symbolic, GTK, NUCLEAR_SYMBOLIC, GObject)
/* Declare a few warning levels, so we can pick colors based on them */
typedef enum
{
WARNING_NONE,
WARNING_ALERT,
WARNING_EMERGENCY
} WarningLevel;
/* Declare the struct. */
struct _GtkNuclearSymbolic
{
GObject parent_instance;
WarningLevel warning_level;
};
struct _GtkNuclearSymbolicClass
{
GObjectClass parent_class;
};
/* Add a function to draw the nuclear icon in the given colors */
static void
gtk_nuclear_symbolic_snapshot_symbolic (GtkSymbolicPaintable *paintable,
GdkSnapshot *snapshot,
double width,
double height,
const GdkRGBA *colors,
gsize n_colors)
{
GtkNuclearSymbolic *self = GTK_NUCLEAR_SYMBOLIC (paintable);
static const GdkRGBA transparent = { 0, };
const GdkRGBA *bg_color;
/* select the right background color from the warning level */
switch (self->warning_level)
{
case WARNING_NONE:
bg_color = &transparent;
break;
case WARNING_ALERT:
bg_color = &colors[GTK_SYMBOLIC_COLOR_WARNING];
break;
case WARNING_EMERGENCY:
bg_color = &colors[GTK_SYMBOLIC_COLOR_ERROR];
break;
default:
/* This should never happen, but we better do defensive coding
* with this critical icon */
g_assert_not_reached ();
bg_color = &transparent;
break;
}
/* Draw the icon with the selected warning color */
gtk_nuclear_snapshot (snapshot,
&colors[GTK_SYMBOLIC_COLOR_FOREGROUND],
bg_color,
width, height,
0);
}
static void
gtk_nuclear_symbolic_symbolic_paintable_init (GtkSymbolicPaintableInterface *iface)
{
iface->snapshot_symbolic = gtk_nuclear_symbolic_snapshot_symbolic;
}
/* We need to implement the functionality required by the GdkPaintable interface */
static void
gtk_nuclear_symbolic_snapshot (GdkPaintable *paintable,
GdkSnapshot *snapshot,
double width,
double height)
{
/* Calling this function without passing a color is a neat trick
* to make GTK use default colors and otherwise forward the call
* to the snapshotting function above.
*/
gtk_symbolic_paintable_snapshot_symbolic (GTK_SYMBOLIC_PAINTABLE (paintable),
snapshot,
width, height,
NULL, 0);
}
static GdkPaintableFlags
gtk_nuclear_symbolic_get_flags (GdkPaintable *paintable)
{
/* This image has a static size, but the contents may change:
* We draw different things when the warning level changes.
*/
return GDK_PAINTABLE_STATIC_SIZE;
}
static void
gtk_nuclear_symbolic_paintable_init (GdkPaintableInterface *iface)
{
iface->snapshot = gtk_nuclear_symbolic_snapshot;
iface->get_flags = gtk_nuclear_symbolic_get_flags;
}
/* When defining the GType, we need to implement bot the GdkPaintable
* and the GtkSymbolicPaintable interface */
G_DEFINE_TYPE_WITH_CODE (GtkNuclearSymbolic, gtk_nuclear_symbolic, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
gtk_nuclear_symbolic_paintable_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_SYMBOLIC_PAINTABLE,
gtk_nuclear_symbolic_symbolic_paintable_init))
static void
gtk_nuclear_symbolic_class_init (GtkNuclearSymbolicClass *klass)
{
}
static void
gtk_nuclear_symbolic_init (GtkNuclearSymbolic *nuclear)
{
}
/* And finally, we add the simple constructor we declared in the header. */
GdkPaintable *
gtk_nuclear_symbolic_new (void)
{
return g_object_new (GTK_TYPE_NUCLEAR_SYMBOLIC, NULL);
}
/* Add some fun feature to the button */
static void
nuclear_button_clicked (GtkButton *button,
GtkNuclearSymbolic *nuclear)
{
if (nuclear->warning_level >= WARNING_EMERGENCY)
{
/* On maximum warning level, reset the warning */
nuclear->warning_level = WARNING_NONE;
/* And sometimes (but not always to confuse people)
* close the window.
*/
if (g_random_boolean ())
gtk_window_close (GTK_WINDOW (window));
}
else
{
/* Otherwise just increase the warning level */
nuclear->warning_level++;
}
/* Don't forget to emit the signal causing the paintable to redraw.
* Changing the warning level changes the background color after all.
*/
gdk_paintable_invalidate_contents (GDK_PAINTABLE (nuclear));
}
GtkWidget *
do_paintable_symbolic (GtkWidget *do_widget)
{
GdkPaintable *nuclear;
GtkWidget *image, *button;
if (!window)
{
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Don't click!");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
button = gtk_button_new ();
gtk_window_set_child (GTK_WINDOW (window), button);
nuclear = gtk_nuclear_symbolic_new ();
image = gtk_image_new_from_paintable (nuclear);
gtk_button_set_child (GTK_BUTTON (button), image);
g_signal_connect (button, "clicked", G_CALLBACK (nuclear_button_clicked), nuclear);
g_object_unref (nuclear);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@@ -1,7 +1,7 @@
/* Peg Solitaire
* #Keywords: GtkGridView, game
*
* This demo demonstrates how to use drag'n'drop to implement peg solitaire.
* This demo demonstrates how to use drag-and-drop to implement peg solitaire.
*
*/
@@ -98,7 +98,7 @@ solitaire_peg_init (SolitairePeg *peg)
/* Add a little setter for the peg's position.
* We want to track those so that we can check for legal moves
* during drag'n'drop operations.
* during drag-and-drop operations.
*/
static void
solitaire_peg_set_position (SolitairePeg *peg,

View File

@@ -25,43 +25,43 @@ show_shortcuts (GtkWidget *window,
g_object_unref (builder);
}
void
G_MODULE_EXPORT void
shortcuts_builder_shortcuts (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-builder", NULL);
}
void
G_MODULE_EXPORT void
shortcuts_gedit_shortcuts (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-gedit", NULL);
}
void
G_MODULE_EXPORT void
shortcuts_clocks_shortcuts (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-clocks", NULL);
}
void
G_MODULE_EXPORT void
shortcuts_clocks_shortcuts_stopwatch (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-clocks", "stopwatch");
}
void
G_MODULE_EXPORT void
shortcuts_boxes_shortcuts (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-boxes", NULL);
}
void
G_MODULE_EXPORT void
shortcuts_boxes_shortcuts_wizard (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-boxes", "wizard");
}
void
G_MODULE_EXPORT void
shortcuts_boxes_shortcuts_display (GtkWidget *window)
{
show_shortcuts (window, "shortcuts-boxes", "display");

View File

@@ -2,6 +2,7 @@
#include <float.h>
#include <math.h>
#include <glib.h>
#include <assert.h>
/* See Golub and Reinsch,
* "Handbook for Automatic Computation vol II - Linear Algebra",
@@ -39,6 +40,9 @@ householder_reduction (double *A,
double *pu, *pui, *pv, *pvi;
double half_norm_squared;
assert (nrows >= 2);
assert (ncols >= 2);
memcpy (U, A, sizeof (double) * nrows * ncols);
diagonal[0] = 0.0;
@@ -205,6 +209,9 @@ givens_reduction (int nrows,
int rotation_test;
int iteration_count;
assert (nrows >= 2);
assert (ncols >= 2);
for (i = 0, x = 0.0; i < ncols; i++)
{
y = fabs (diagonal[i]) + fabs (superdiagonal[i]);
@@ -342,6 +349,9 @@ sort_singular_values (int nrows,
double temp;
double *p1, *p2;
assert (nrows >= 2);
assert (ncols >= 2);
for (i = 0; i < ncols - 1; i++)
{
max_index = i;
@@ -433,9 +443,12 @@ singular_value_decomposition_solve (double *U,
double d;
double tolerance;
assert (nrows >= 2);
assert (ncols >= 2);
tolerance = DBL_EPSILON * S[0] * (double) ncols;
for ( i = 0, pv = V; i < ncols; i++, pv += ncols)
for (i = 0, pv = V; i < ncols; i++, pv += ncols)
{
x[i] = 0.0;
for (j = 0; j < ncols; j++)

View File

@@ -12,7 +12,7 @@
#include <math.h>
#include <stdlib.h>
int
G_MODULE_EXPORT int
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
double *new_val)
{
@@ -29,7 +29,7 @@ spinbutton_hex_spin_input (GtkSpinButton *spin_button,
return TRUE;
}
int
G_MODULE_EXPORT int
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
@@ -49,7 +49,7 @@ spinbutton_hex_spin_output (GtkSpinButton *spin_button)
return TRUE;
}
int
G_MODULE_EXPORT int
spinbutton_time_spin_input (GtkSpinButton *spin_button,
double *new_val)
{
@@ -88,7 +88,7 @@ spinbutton_time_spin_input (GtkSpinButton *spin_button,
return TRUE;
}
int
G_MODULE_EXPORT int
spinbutton_time_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
@@ -122,7 +122,7 @@ static const char *month[12] = {
"December"
};
int
G_MODULE_EXPORT int
spinbutton_month_spin_input (GtkSpinButton *spin_button,
double *new_val)
{
@@ -151,7 +151,7 @@ spinbutton_month_spin_input (GtkSpinButton *spin_button,
return TRUE;
}
int
G_MODULE_EXPORT int
spinbutton_month_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;

View File

@@ -41,11 +41,26 @@ open_clicked_cb (GtkWidget *button,
"_Open",
"_Cancel");
filter = gtk_file_filter_new ();
gtk_file_filter_add_pattern (filter, "*");
gtk_file_filter_set_name (filter, "All Files");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
g_object_unref (filter);
filter = gtk_file_filter_new ();
gtk_file_filter_add_mime_type (filter, "image/*");
gtk_file_filter_set_name (filter, "Images");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
g_object_unref (filter);
filter = gtk_file_filter_new ();
gtk_file_filter_add_mime_type (filter, "video/*");
gtk_file_filter_set_name (filter, "Video");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
g_object_unref (filter);
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
g_signal_connect (dialog, "response", G_CALLBACK (open_dialog_response_cb), video);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));

View File

@@ -4,6 +4,8 @@
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
#include "demo_conf.h"
struct _IconBrowserApp
{
GtkApplication parent;
@@ -75,21 +77,25 @@ about_activated (GSimpleAction *action,
gtk_get_minor_version (),
gtk_get_micro_version ());
g_string_append_printf (s, "\nIcon theme\n\t%s", icon_theme);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Icon Browser",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Icon Browser (Development)"
: "GTK Icon Browser",
"version", version,
"copyright", "©1997—2020 The GTK Team",
"copyright", "©1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to browse themed icons",
"authors", authors,
"logo-icon-name", "org.gtk.Demo4",
"logo-icon-name", "org.gtk.IconBrowser4",
"title", "About GTK Icon Browser",
"system-information", s->str,
NULL);
@@ -129,6 +135,10 @@ icon_browser_app_activate (GApplication *app)
IconBrowserWindow *win;
win = icon_browser_window_new (ICON_BROWSER_APP (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
gtk_window_present (GTK_WINDOW (win));
}

View File

@@ -14,8 +14,10 @@ struct _IconBrowserWindow
GtkWidget *searchbar;
GListModel *icon_filter_model;
GListStore *icon_store;
GListModel *context_model;
GListStore *context_store;
GtkFilter *name_filter;
GtkFilter *search_mode_filter;
GtkWidget *details;
GtkWidget *image1;
GtkWidget *image2;
@@ -354,6 +356,28 @@ setup_scalable_image_dnd (GtkWidget *image)
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
}
static void
search_mode_toggled (GtkSearchBar *searchbar,
GParamSpec *pspec,
IconBrowserWindow *win)
{
if (gtk_search_bar_get_search_mode (searchbar))
gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (win->context_model), GTK_INVALID_LIST_POSITION);
else if (gtk_single_selection_get_selected (GTK_SINGLE_SELECTION (win->context_model)) == GTK_INVALID_LIST_POSITION)
gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (win->context_model), 0);
gtk_filter_changed (win->search_mode_filter, GTK_FILTER_CHANGE_DIFFERENT);
}
static void
selected_name_changed (GtkSingleSelection *selection,
GParamSpec *pspec,
IconBrowserWindow *win)
{
if (gtk_single_selection_get_selected (selection) != GTK_INVALID_LIST_POSITION)
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (win->searchbar), FALSE);
}
static void
icon_browser_window_init (IconBrowserWindow *win)
{
@@ -380,6 +404,9 @@ icon_browser_window_init (IconBrowserWindow *win)
win->name_filter = GTK_FILTER (gtk_custom_filter_new (filter_by_icon_name, NULL, NULL));
gtk_multi_filter_append (GTK_MULTI_FILTER (filter), g_object_ref (win->name_filter));
g_signal_connect (win->searchbar, "notify::search-mode-enabled", G_CALLBACK (search_mode_toggled), win);
g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win);
}
static void
@@ -409,6 +436,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, searchbar);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, icon_store);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, icon_filter_model);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, context_model);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, context_store);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, details);
@@ -422,6 +450,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image8);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, label8);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, search_mode_filter);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), copy_to_clipboard);

View File

@@ -14,7 +14,7 @@ iconbrowser_resources = gnome.compile_resources('iconbrowser_resources',
executable('gtk4-icon-browser',
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
@@ -32,5 +32,10 @@ endforeach
install_data('org.gtk.IconBrowser4.desktop', install_dir: gtk_applicationsdir)
# appdata
install_data('org.gtk.IconBrowser4.appdata.xml', install_dir: gtk_appdatadir)
configure_file(
input: 'org.gtk.IconBrowser4.appdata.xml.in',
output: 'org.gtk.IconBrowser4.appdata.xml',
configuration: appdata_config,
install_dir: gtk_appdatadir
)

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gtk.IconBrowser4.desktop</id>
<id>org.gtk.IconBrowser4</id>
<launchable type="desktop-id">org.gtk.IconBrowser4.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<project_license>LGPL-2.1-or-later</project_license>
<name>GTK Icon Browser</name>
<summary>Program to browse themed icons</summary>
<description>
@@ -29,15 +30,11 @@
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="3.99.0" date="2020-07-30">
<release version="@BUILD_VERSION@" date="@BUILD_DATE@">
<description>
<p>A new developers snapshot towards GTK 4.0.</p>
</description>
</release>
<release version="3.94.0" date="2018-06-25">
<description>
<p>A new developers snapshot towards GTK 4.0.</p>
<p>A new build of GTK.</p>
</description>
</release>
</releases>

View File

@@ -25,12 +25,14 @@
</style>
<child>
<object class="GtkToggleButton" id="normal_radio">
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Normal</property>
<property name="active">1</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="symbolic_radio">
<property name="focus-on-click">0</property>
<property name="label" translatable="yes">Symbolic</property>
<property name="group">normal_radio</property>
<signal name="notify::active" handler="symbolic_toggled" swapped="yes" after="yes"/>
@@ -40,6 +42,7 @@
</child>
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
@@ -47,6 +50,7 @@
</child>
<child type="end">
<object class="GtkToggleButton" id="search">
<property name="focus-on-click">0</property>
<style>
<class name="image-button"/>
</style>
@@ -151,19 +155,32 @@
</object>
</child>
<child>
<object class="GtkStringFilter">
<property name="ignore-case">0</property>
<property name="match-mode">exact</property>
<property name="expression">
<lookup name="context" type="IbIcon"/>
</property>
<binding name="search">
<lookup name="id" type="IbContext">
<lookup name="selected-item" type="GtkSingleSelection">
context_model
</lookup>
</lookup>
</binding>
<object class="GtkAnyFilter">
<child>
<object class="GtkBoolFilter" id="search_mode_filter">
<property name="expression">
<lookup name="search-mode-enabled">
searchbar
</lookup>
</property>
</object>
</child>
<child>
<object class="GtkStringFilter">
<property name="ignore-case">0</property>
<property name="match-mode">exact</property>
<property name="expression">
<lookup name="context" type="IbIcon"/>
</property>
<binding name="search">
<lookup name="id" type="IbContext">
<lookup name="selected-item" type="GtkSingleSelection">
context_model
</lookup>
</lookup>
</binding>
</object>
</child>
</object>
</child>
</object>

View File

@@ -1,3 +1,31 @@
gen_demo_header = find_program('../build-aux/meson/gen-demo-header.py')
demo_profile = get_option('profile')
demo_conf_h = declare_dependency(
sources: custom_target('demo-header',
command: [gen_demo_header, meson.source_root(), demo_profile],
capture: true,
output: 'demo_conf.h',
build_by_default: true,
build_always_stale: true,
)
)
# appdata
today = 'unknown'
date = find_program('date',
required: false)
if date.found()
r = run_command(date, '-I')
if r.returncode() == 0
today = r.stdout().strip()
endif
endif
appdata_config = configuration_data()
appdata_config.set('BUILD_VERSION', meson.project_version())
appdata_config.set('BUILD_DATE', today)
subdir('constraint-editor')
subdir('gtk-demo')
subdir('icon-browser')

View File

@@ -2,8 +2,8 @@
<interface>
<object class="GtkWindow" id="window">
<property name="title" translatable="yes">Help</property>
<property name="default-width">720</property>
<property name="default-height">520</property>
<property name="default-width">920</property>
<property name="default-height">600</property>
<child>
<object class="GtkScrolledWindow">
<child>

View File

@@ -12,7 +12,7 @@ node_editor_resources = gnome.compile_resources('node_editor_resources',
executable('gtk4-node-editor',
sources: [node_editor_sources, node_editor_resources],
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())

View File

@@ -23,6 +23,8 @@
#include "node-editor-window.h"
#include "demo_conf.h"
static const char *css =
"textview.editor {"
" color: rgb(192, 197, 206);"
@@ -94,22 +96,26 @@ activate_about (GSimpleAction *action,
g_string_append_printf (s, "\nRenderer\n\t%s", renderer);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", gtk_application_get_active_window (app),
"program-name", "GTK Node Editor",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Node Editor (Development)"
: "GTK Node Editor",
"version", version,
"copyright", "©2019—2020 The GTK Team",
"copyright", "©2019—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to test GTK rendering",
"authors", (const char *[]){ "Benjamin Otte", "Timm Bäder", NULL},
"logo-icon-name", "org.gtk.gtk4.NodeEditor.Devel",
"logo-icon-name", "org.gtk.gtk4.NodeEditor",
"title", "About GTK Node Editor",
"system-information", s->str,
NULL);
@@ -207,6 +213,10 @@ node_editor_application_activate (GApplication *app)
NodeEditorWindow *win;
win = node_editor_window_new (NODE_EDITOR_APPLICATION (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
gtk_window_present (GTK_WINDOW (win));
}

View File

@@ -24,7 +24,7 @@
#include "gtkrendererpaintableprivate.h"
#include "gsk/gskrendernodeparserprivate.h"
#include "gsk/gl/gskglrenderer.h"
#include "gsk/ngl/gsknglrenderer.h"
#ifdef GDK_WINDOWING_BROADWAY
#include "gsk/broadway/gskbroadwayrenderer.h"
#endif
@@ -60,7 +60,7 @@ struct _NodeEditorWindow
GtkWidget *renderer_listbox;
GListStore *renderers;
GdkPaintable *paintable;
GskRenderNode *node;
GFileMonitor *file_monitor;
@@ -167,7 +167,6 @@ static void
text_changed (GtkTextBuffer *buffer,
NodeEditorWindow *self)
{
GskRenderNode *node;
char *text;
GBytes *bytes;
GtkTextIter iter;
@@ -178,10 +177,12 @@ text_changed (GtkTextBuffer *buffer,
text_buffer_remove_all_tags (self->text_buffer);
bytes = g_bytes_new_take (text, strlen (text));
g_clear_pointer (&self->node, gsk_render_node_unref);
/* If this is too slow, go fix the parser performance */
node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
g_bytes_unref (bytes);
if (node)
if (self->node)
{
/* XXX: Is this code necessary or can we have API to turn nodes into paintables? */
GtkSnapshot *snapshot;
@@ -190,10 +191,9 @@ text_changed (GtkTextBuffer *buffer,
guint i;
snapshot = gtk_snapshot_new ();
gsk_render_node_get_bounds (node, &bounds);
gsk_render_node_get_bounds (self->node, &bounds);
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- bounds.origin.x, - bounds.origin.y));
gtk_snapshot_append_node (snapshot, node);
gsk_render_node_unref (node);
gtk_snapshot_append_node (snapshot, self->node);
paintable = gtk_snapshot_free_to_paintable (snapshot, &bounds.size);
gtk_picture_set_paintable (GTK_PICTURE (self->picture), paintable);
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i++)
@@ -337,15 +337,9 @@ text_view_query_tooltip_cb (GtkWidget *widget,
}
static gboolean
load_file_contents (NodeEditorWindow *self,
GFile *file)
load_bytes (NodeEditorWindow *self,
GBytes *bytes)
{
GBytes *bytes;
bytes = g_file_load_bytes (file, NULL, NULL, NULL);
if (bytes == NULL)
return FALSE;
if (!g_utf8_validate (g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), NULL))
{
g_bytes_unref (bytes);
@@ -361,6 +355,105 @@ load_file_contents (NodeEditorWindow *self,
return TRUE;
}
static gboolean
load_file_contents (NodeEditorWindow *self,
GFile *file)
{
GBytes *bytes;
bytes = g_file_load_bytes (file, NULL, NULL, NULL);
if (bytes == NULL)
return FALSE;
return load_bytes (self, bytes);
}
static GdkContentProvider *
on_picture_drag_prepare_cb (GtkDragSource *source,
double x,
double y,
NodeEditorWindow *self)
{
if (self->node == NULL)
return NULL;
return gdk_content_provider_new_typed (GSK_TYPE_RENDER_NODE, self->node);
}
static void
on_picture_drop_read_done_cb (GObject *source,
GAsyncResult *res,
gpointer data)
{
NodeEditorWindow *self = data;
GOutputStream *stream = G_OUTPUT_STREAM (source);
GdkDrop *drop = g_object_get_data (source, "drop");
GdkDragAction action = 0;
GBytes *bytes;
if (g_output_stream_splice_finish (stream, res, NULL) >= 0)
{
bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (stream));
if (load_bytes (self, bytes))
action = GDK_ACTION_COPY;
}
g_object_unref (self);
gdk_drop_finish (drop, action);
g_object_unref (drop);
return;
}
static void
on_picture_drop_read_cb (GObject *source,
GAsyncResult *res,
gpointer data)
{
NodeEditorWindow *self = data;
GdkDrop *drop = GDK_DROP (source);
GInputStream *input;
GOutputStream *output;
input = gdk_drop_read_finish (drop, res, NULL, NULL);
if (input == NULL)
{
g_object_unref (self);
gdk_drop_finish (drop, 0);
return;
}
output = g_memory_output_stream_new_resizable ();
g_object_set_data (G_OBJECT (output), "drop", drop);
g_object_ref (drop);
g_output_stream_splice_async (output,
input,
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
G_PRIORITY_DEFAULT,
NULL,
on_picture_drop_read_done_cb,
self);
g_object_unref (output);
g_object_unref (input);
}
static gboolean
on_picture_drop_cb (GtkDropTargetAsync *dest,
GdkDrop *drop,
double x,
double y,
NodeEditorWindow *self)
{
gdk_drop_read_async (drop,
(const char *[2]) { "application/x-gtk-render-node", NULL },
G_PRIORITY_DEFAULT,
NULL,
on_picture_drop_read_cb,
g_object_ref (self));
return TRUE;
}
static void
file_changed_cb (GFileMonitor *monitor,
GFile *file,
@@ -634,6 +727,24 @@ export_image_cb (GtkWidget *button,
gtk_widget_show (dialog);
}
static void
clip_image_cb (GtkWidget *button,
NodeEditorWindow *self)
{
GdkTexture *texture;
GdkClipboard *clipboard;
texture = create_texture (self);
if (texture == NULL)
return;
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (self));
gdk_clipboard_set_texture (clipboard, texture);
g_object_unref (texture);
}
static void
testcase_name_entry_changed_cb (GtkWidget *button,
GParamSpec *pspec,
@@ -717,6 +828,7 @@ node_editor_window_finalize (GObject *object)
g_array_free (self->errors, TRUE);
g_clear_pointer (&self->node, gsk_render_node_unref);
g_clear_object (&self->renderers);
G_OBJECT_CLASS (node_editor_window_parent_class)->finalize (object);
@@ -760,7 +872,7 @@ node_editor_window_realize (GtkWidget *widget)
"Default");
#endif
node_editor_window_add_renderer (self,
gsk_gl_renderer_new (),
gsk_ngl_renderer_new (),
"OpenGL");
#ifdef GDK_RENDERING_VULKAN
node_editor_window_add_renderer (self,
@@ -822,9 +934,12 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
gtk_widget_class_bind_template_callback (widget_class, open_cb);
gtk_widget_class_bind_template_callback (widget_class, save_cb);
gtk_widget_class_bind_template_callback (widget_class, export_image_cb);
gtk_widget_class_bind_template_callback (widget_class, clip_image_cb);
gtk_widget_class_bind_template_callback (widget_class, testcase_save_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, testcase_name_entry_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, dark_mode_cb);
gtk_widget_class_bind_template_callback (widget_class, on_picture_drag_prepare_cb);
gtk_widget_class_bind_template_callback (widget_class, on_picture_drop_cb);
}
static GtkWidget *
@@ -927,7 +1042,7 @@ node_editor_window_init (NodeEditorWindow *self)
"shadow {\n"
" child: texture {\n"
" bounds: 0 0 128 128;\n"
" texture: url(\"resource:///org/gtk/gtk4/node-editor/icons/apps/org.gtk.gtk4.NodeEditor.Devel.svg\");\n"
" texture: url(\"resource:///org/gtk/gtk4/node-editor/icons/apps/org.gtk.gtk4.NodeEditor.svg\");\n"
" }\n"
" shadows: rgba(0,0,0,0.5) 0 1 12;\n"
"}\n"

View File

@@ -102,6 +102,7 @@
<object class="GtkHeaderBar" id="header">
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">document-open-symbolic</property>
<property name="tooltip-text">Open node file</property>
<signal name="clicked" handler="open_cb"/>
@@ -109,6 +110,7 @@
</child>
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">document-save-symbolic</property>
<property name="tooltip-text">Save to node file</property>
<signal name="clicked" handler="save_cb"/>
@@ -116,24 +118,30 @@
</child>
<child type="start">
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">insert-image-symbolic</property>
<property name="tooltip-text">Export to image</property>
<signal name="clicked" handler="export_image_cb"/>
</object>
</child>
<child type="start">
<object class="GtkSeparator">
<property name="orientation">vertical</property>
<object class="GtkButton">
<property name="focus-on-click">0</property>
<property name="icon-name">edit-copy-symbolic</property>
<property name="tooltip-text">Copy image to clipboard</property>
<signal name="clicked" handler="clip_image_cb"/>
</object>
</child>
<child type="start">
<object class="GtkMenuButton">
<property name="focus-on-click">0</property>
<property name="label">Save Testcase</property>
<property name="popover">testcase_popover</property>
</object>
</child>
<child type="end">
<object class="GtkMenuButton" id="gear_menu_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="menu-model">gear_menu</property>
<property name="icon-name">open-menu-symbolic</property>
@@ -141,6 +149,7 @@
</child>
<child type="end">
<object class="GtkToggleButton" id="dark_bg_button">
<property name="focus-on-click">0</property>
<property name="valign">center</property>
<property name="has-frame">0</property>
<property name="icon-name">display-brightness-symbolic</property>
@@ -191,6 +200,19 @@
<property name="can-shrink">0</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkDragSource">
<property name="actions">copy</property>
<signal name="prepare" handler="on_picture_drag_prepare_cb" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkDropTargetAsync">
<property name="actions">copy</property>
<property name="formats">application/x-gtk-render-node</property>
<signal name="drop" handler="on_picture_drop_cb" swapped="no"/>
</object>
</child>
</object>

View File

@@ -4,6 +4,6 @@
<file preprocess="xml-stripblanks">node-editor-window.ui</file>
<file preprocess="xml-stripblanks">help-window.ui</file>
<file>node-format.md</file>
<file alias='icons/apps/org.gtk.gtk4.NodeEditor.Devel.svg'>data/scalable/apps/org.gtk.gtk4.NodeEditor.Devel.svg</file>
<file alias='icons/apps/org.gtk.gtk4.NodeEditor.svg'>data/scalable/apps/org.gtk.gtk4.NodeEditor.svg</file>
</gresource>
</gresources>

View File

@@ -42,9 +42,9 @@ Creates a node like `gsk_blur_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| color | `<color>{1,4}` | black | non-default |
| colors | `<color>{1,4}` | black | non-default |
| outline | `<rounded-rect>` | 50 | always |
| width | `<number>{1,4}` | 1 | non-default |
| widths | `<number>{1,4}` | 1 | non-default |
Creates a node like `gsk_border_node_new()` with the given properties.
@@ -121,7 +121,7 @@ Creates a node like `gsk_conic_gradient_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| end | `<node>` | color { } | always |
| mode | `<number>` | 0.5 | non-default |
| progress | `<number>` | 0.5 | non-default |
| start | `<node>` | color { } | always |
Creates a node like `gsk_cross_fade_node_new()` with the given properties.
@@ -246,7 +246,7 @@ Creates a node like `gsk_rounded_clip_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| child | `<node>` | color { } | always |
| shadow | `<shadow>` | black 1 1 | always |
| shadows | `<shadow>` | black 1 1 | always |
Creates a node like `gsk_shadow_node_new()` with the given properties.

View File

@@ -1,7 +1,7 @@
executable('gtk4-print-editor',
sources: ['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gtk.PrintEditor4.desktop</id>
<id>org.gtk.PrintEditor4</id>
<launchable type="desktop-id">org.gtk.PrintEditor4.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-2.0+</project_license>
<project_license>LGPL-2.1-or-later</project_license>
<name>GTK Print Editor</name>
<summary>Program to demonstrate GTK printing</summary>
<description>
@@ -24,6 +25,7 @@
<translation type="gettext">gtk-4.0</translation>
<update_contact>matthias.clasen_at_gmail.com</update_contact>
<developer_name>Matthias Clasen and others</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="3.99.0" date="2020-07-30">
<description>

View File

@@ -2,7 +2,7 @@
Name=Print Editor
Comment=A simple editor demonstrating GTK printing
Exec=gtk4-print-editor %f
Icon=org.gtk.PrintEditor4.Devel
Icon=org.gtk.PrintEditor4
Terminal=false
Type=Application
StartupNotify=true

View File

@@ -4,6 +4,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "demo_conf.h"
static GtkWidget *main_window;
static GFile *filename = NULL;
static GtkPageSetup *page_setup = NULL;
@@ -157,7 +159,7 @@ save_file (GFile *save_filename)
error = NULL;
g_file_replace_contents (save_filename,
text, -1,
text, strlen (text),
NULL, FALSE,
G_FILE_CREATE_NONE,
NULL,
@@ -641,22 +643,26 @@ activate_about (GSimpleAction *action,
g_strfreev (backends);
g_free (setting);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", main_window,
"program-name", "GTK Print Editor",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Print Editor (Development)"
: "GTK Print Editor",
"version", version,
"copyright", "© 2006-2020 Red Hat, Inc",
"copyright", "© 2006-2021 Red Hat, Inc",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK printing",
"authors", authors,
"logo-icon-name", "org.gtk.PrintEditor4.Devel",
"logo-icon-name", "org.gtk.PrintEditor4",
"title", "About GTK Print Editor",
"system-information", sysinfo->str,
NULL);
@@ -715,7 +721,6 @@ static const char ui_info[] =
" <item>"
" <attribute name='label'>_New</attribute>"
" <attribute name='action'>app.new</attribute>"
" <attribute name='accel'>&lt;Primary&gt;n</attribute>"
" </item>"
" <item>"
" <attribute name='label'>_Open</attribute>"
@@ -724,12 +729,10 @@ static const char ui_info[] =
" <item>"
" <attribute name='label'>_Save</attribute>"
" <attribute name='action'>app.save</attribute>"
" <attribute name='accel'>&lt;Primary&gt;s</attribute>"
" </item>"
" <item>"
" <attribute name='label'>Save _As...</attribute>"
" <attribute name='action'>app.save-as</attribute>"
" <attribute name='accel'>&lt;Primary&gt;s</attribute>"
" </item>"
" </section>"
" <section>"
@@ -750,7 +753,6 @@ static const char ui_info[] =
" <item>"
" <attribute name='label'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </submenu>"
@@ -760,7 +762,6 @@ static const char ui_info[] =
" <item>"
" <attribute name='label'>_About Print Editor</attribute>"
" <attribute name='action'>app.about</attribute>"
" <attribute name='accel'>&lt;Primary&gt;a</attribute>"
" </item>"
" </section>"
" </submenu>"
@@ -788,6 +789,15 @@ startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *menubar;
struct {
const char *action_and_target;
const char *accelerators[2];
} accels[] = {
{ "app.new", { "<Control>n", NULL } },
{ "app.quit", { "<Control>q", NULL } },
{ "app.save", { "<Control>s", NULL } },
{ "app.about", { "<Control>a", NULL } },
};
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder, ui_info, -1, NULL);
@@ -796,6 +806,9 @@ startup (GApplication *app)
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
for (int i = 0; i < G_N_ELEMENTS (accels); i++)
gtk_application_set_accels_for_action (GTK_APPLICATION (app), accels[i].action_and_target, accels[i].accelerators);
g_object_unref (builder);
}
@@ -807,6 +820,10 @@ activate (GApplication *app)
GtkWidget *contents;
main_window = gtk_application_window_new (GTK_APPLICATION (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (main_window), "devel");
gtk_window_set_icon_name (GTK_WINDOW (main_window), "text-editor");
gtk_window_set_default_size (GTK_WINDOW (main_window), 400, 600);
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (main_window), TRUE);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Some files were not shown because too many files have changed in this diff Show More