Commit Graph

34022 Commits

Author SHA1 Message Date
Emmanuele Bassi
cdd7e4c5ec Add a notify function to GdkContentProvider
The callback-based content providers need a GDestroyNotify function to
free the data passed to them on construction, otherwise they are going
to leak.
2020-02-13 14:53:25 +00:00
Matthias Clasen
14ecc9ec7e Remove unused signal enum values
GtkWidget lost even more signals, so we don't need
these enum values anymore.
2020-02-12 18:25:42 -05:00
Matthias Clasen
073e8dd987 popovermenu: Avoid an uninitialized variable
Pointed out by Timm/clang.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2434
2020-02-12 17:58:41 -05:00
Matthias Clasen
6c6b3d0d11 Merge branch 'ci-pages' into 'master'
Rename the SCSS files for our themes

Closes #2423

See merge request GNOME/gtk!1423
2020-02-12 22:35:58 +00:00
Emmanuele Bassi
2ab9be54fb Rename the SCSS files for our themes
It seems that Meson's gnome.compile_resources() cannot deal with two
files with the same name under different directories, which breaks the
build parallelism because the GResource file ends up not depending on
either the Adwaita or the HighContrast gtk-contained.css file.

This commit only changes the on-disk names of the Adwaita and
HighContrast SCSS files, and the corresponding generated CSS files; the
files in the GResource are going to be aliased to the old file names, to
minimise the breakage. We might want to change the theme entry points at
some later date, if we decide to commit to this naming scheme.

Fixes: #2423

See Meson bug: https://github.com/mesonbuild/meson/issues/6615
2020-02-12 20:22:43 +00:00
Matthias Clasen
11ab39617e Fix the Emoji chooser finalize
If the Emoji chooser is finalized before the idle
has run, it would spew criticals, breaking some tests.
Avoid that.
2020-02-12 14:23:01 -05:00
Georges Basile Stavracas Neto
1b95cd27bc build: Install gtkemojichooser.h
It was made public at ef7172dc1e, but the header file
wasn't added to the public headers list.

Add the header file to the list.
2020-02-12 15:41:49 -03:00
Alexander Larsson
b4b00e2887 icon theme: Don't add profiler marks for short async icon loads
We do a bunch of preloads, and most of these are not really interesting
anyway.
2020-02-12 12:43:27 +01:00
Alexander Larsson
e134eef505 builder: Don't add profiler marks for short parses
There are a lot of thes (since we're recursing), so don't spew the
output with uninteresting ones.
2020-02-12 12:42:29 +01:00
Alexander Larsson
2890cd849f profiler: Add _end_mark() version of _add_mark()
These don't take a duration, instead they call g_get_monotonic_time() to
and subtract the start time for it.

Almost all our calls are like this, and this makes the callsites clearer
and avoids inlining the clock call into the call site.
2020-02-12 11:25:34 +01:00
Alexander Larsson
01d5ad2056 profiler: Make profiler-is-running a macro
When we use if (GDK_PROFILER_IS_RUNNING) this means we get an
inlined if (FALSE) when the compiler support is not compiled in, which
gets rid of all the related code completely.

We also expand to  G_UNLIKELY(gdk_profiler_is_running ()) in the supported
case which might cause somewhat better code generation.
2020-02-12 11:05:01 +01:00
Alexander Larsson
cc643df88b Convert all profiler times from nsec to usec
usec is the scale of the monotonic timer which is where we get almost
all the times from. The only actual source of nsec is the opengl
GPU time (but who knows what the actual resulution of that is).

Changing this to usec allows us to get rid of " * 1000" in a *lot* of
places all over the codebase, which are ugly and confusing.
2020-02-12 10:44:17 +01:00
Alexander Larsson
13eedf1a9f Use markf in one more place 2020-02-12 10:40:26 +01:00
Matthias Clasen
9062607d5f Merge branch 'wip/baedert/outline-radius' into 'master'
css boxes: Compute box from border box

Closes #2425

See merge request GNOME/gtk!1408
2020-02-11 16:59:11 +00:00
Alexander Larsson
dc6fe091b9 revealer: Fix child size allocation at small scales
As pointed out in https://gitlab.gnome.org/GNOME/gtk/issues/1481
and seen from critical warnings with swinging revealers in widget-factory
there are some size allocation issues in GtkRevealer.

What happens is that we request a size of the revealer itself
based on the child natural size and the current stage of the transition
by applying a scale to the natural size. We then round up to nearest
int size. However, we want the widget to render as if it did get the
natural size so we can transform it, rather than the scaled down size.
For example, a label should not start ellipsizing in the animation.
So we inverse the scale when allocating the child.

Unfortunately, for very small scales the inversion of the scale can
result in very large sizes, and for such scales we rounded up the
requested size to 1, so we will be allocating huuuuge children.

In order to avoid such issue we pick an arbitrary maximum upscale
scale factor of 100. This means that in the case where the allocated
size is 1 we never allocate the child at > 100 px. This means
that in large downscaling cases we may run into the clipping issue
described above. However, at these downscaling levels (100 times!)
we're unlikely to notice much detail anyway.
2020-02-11 13:52:12 +01:00
Matthias Clasen
af98c46d04 Typo fix 2020-02-11 07:46:12 -05:00
Timm Bäder
8561860aa1 css boxes: Compute inline box from border box
We can't just use the outline rect and apply the border radius because
the outline box is the border box grown by the outline offset, which
will also grow the resulting border radius.

Fixes #2425
2020-02-11 12:10:16 +01:00
Matthias Clasen
c0dcaccf4b calendar: Fix mismatches with GDateTime
GDatetime uses 1-based month and day numbers, whereas
GktCalendars are 0-based. Correct for this.
2020-02-10 14:59:40 -05:00
Matthias Clasen
11cd955591 Calendar: Make year/month/day writable again
Our a11y tests were relying on this.
2020-02-10 14:14:18 -05:00
Matthias Clasen
59b935af38 Merge branch 'mainloop-cleanup' into 'master'
Mainloop cleanup

See merge request GNOME/gtk!1404
2020-02-10 14:32:09 +00:00
Alexander Larsson
1698369d52 Merge branch 'icon-theme-api-rework' into 'master'
Icon theme api rework

See merge request GNOME/gtk!1390
2020-02-10 12:45:56 +00:00
Alexander Larsson
96a4bb446c Fix typo in GtkIconPaintable is-symbolic property 2020-02-10 13:30:57 +01:00
Alexander Larsson
ad0e901061 icon-theme: Add back and fix test for handling non-square icons
We test this by looking at the produced render nodes now that
we don't actualluy scale the icon. Also, it turns out that this
code was broken due to some typos, so we also fix those.
2020-02-10 13:17:15 +01:00
Alexander Larsson
ba781eca74 Expose gtk_icon_paintable_new_for_file 2020-02-10 13:17:15 +01:00
Alexander Larsson
8f1253ad26 GtkIconPaintable: Add properties for file, icon-name and is-symbolic 2020-02-10 13:17:05 +01:00
Alexander Larsson
904eecd1ed icon paintable: Replace get_filename and get_resource_path with get_file()
This returns a GFile which can represent both the above.
2020-02-10 12:33:17 +01:00
Alexander Larsson
344ad65031 Rename GTK_ICON_LOOKUP_LOAD_IN_THREAD to GTK_ICON_LOOKUP_PRELOAD 2020-02-10 11:43:47 +01:00
Alexander Larsson
14b3b684ef icontheme: Always return some icon name in get_icon_name() for lookup results
If you called gtk_icon_theme_lookup(), then always return some useful
icon name from gtk_icon_paintable_get_icon_name(), even if we picked
an unthemed icon.

Also rewrite the gtk_icon_paintable_get_icon_name() docs to make this
clearer.
2020-02-10 11:40:00 +01:00
Matthias Clasen
9309153abc Remove GTK_DEBUG=baselines
This has been reimplemented differently
in the inspector.
2020-02-10 00:10:43 -05:00
Matthias Clasen
643417dc32 widget: Stop embedding baseline debugging
The inspector has an overlay that achieves the
same, in a cleaner way.
2020-02-10 00:10:43 -05:00
Matthias Clasen
4a978dc8c4 inspector: Draw baselines as an overlay 2020-02-10 00:10:43 -05:00
Matthias Clasen
bc4637fff6 Remove unused includes
We eventually want to get rid of GtkSelectionData.
As a first step, stop including gtkselection.h unnecessarily.
2020-02-09 23:59:22 -05:00
Matthias Clasen
a8db322be6 Drop gtk_get_main_thread
This is not a very useful api, and if you need it,
you can just as easily keep track yourself which thread
called gtk_init().
2020-02-09 23:13:13 -05:00
Matthias Clasen
4dd780a96b Drop gtk_main and gtk_main_quit
The alternatives are to use GtkApplication,
or use GMainContext.
2020-02-09 23:13:13 -05:00
Matthias Clasen
4c22939dea docs: Update an example
Don't use gtk_main() in the mainloop example.
It is going away.
2020-02-09 23:12:32 -05:00
Matthias Clasen
a6c5466900 Stop using gtk_main and gtk_main_quit
Replace these calls with direct use of GMainContext api.
2020-02-09 23:12:32 -05:00
Matthias Clasen
7eb889c7aa Drop gtk_main_level
This api isn't useful without gtk_main, which is also
on the way out.
2020-02-09 23:12:32 -05:00
Matthias Clasen
49a6ad3dd1 Drop gtk_main_iteration
This function and its cousin, gtk_main_iteration_do, are
thin wrappers around GMainContext api that should just
be used directly.
2020-02-09 23:12:32 -05:00
Matthias Clasen
ebc720bfdb Drop gtk_events_pending
This was just a thin wrapper around gtk_main_context_pending,
which should be used directly instead.
2020-02-09 23:11:49 -05:00
Matthias Clasen
9eeeb631ca win32 printing: Stop using gtk_events_pending
Just use the GMainContext API directly.
2020-02-09 23:11:49 -05:00
Matthias Clasen
900ff743f1 Merge branch 'main-cleanup' into 'master'
Cleanup in gtkmain.h

See merge request GNOME/gtk!1403
2020-02-10 03:55:11 +00:00
Benjamin Otte
810f55c006 filechooser: Remove outdated hack
In GTK2, the filechooser was using a Paned, so switching between sidebar
and files list with the arrow keys didn't work (the slider would be
selected instead). So in
https://bugzilla.gnome.org/show_bug.cgi?id=161489 a crude hack was added
to make this possible.

Over the years the filechooser code has changed so that it now would do
this by default, yet the hack had been retained.
2020-02-09 16:54:38 -05:00
Benjamin Otte
fce37b137d gdk: Make gdk_keyval_name() return a const char
The string is const, so return it like that.
2020-02-09 16:50:22 -05:00
Matthias Clasen
998384aa08 Remove unused include 2020-02-09 16:50:22 -05:00
Emmanuele Bassi
327441fa3e cssprovider: Remove unused include 2020-02-09 16:50:22 -05:00
Matthias Clasen
b927609e21 Remove gtk_propagate_event from public API
This is not a function that can be safely called
outside of GTK.
2020-02-09 11:00:53 -05:00
Matthias Clasen
688f8bf085 Remove gtk_main_do_event from public API 2020-02-09 10:55:56 -05:00
Matthias Clasen
057f41532b Remove gtk_main_do_event from the docs 2020-02-09 10:55:37 -05:00
Matthias Clasen
c1970009ff docs: Remove more mentions of gtk_main_do_event 2020-02-09 10:45:33 -05:00
Matthias Clasen
c4b16f7424 css: Add a comment
All the other color values have this comment,
best to be consistent.
2020-02-09 10:23:27 -05:00