gtk4.git
5 years agopathbar: Remove unneeded code
Benjamin Otte [Tue, 4 Feb 2020 23:18:41 +0000 (00:18 +0100)]
pathbar: Remove unneeded code

The icons here are GIcons, they don't depend on the theme.

5 years agocssnode: Remove redundant check
Benjamin Otte [Tue, 4 Feb 2020 22:24:50 +0000 (23:24 +0100)]
cssnode: Remove redundant check

We assert that cssnode->parent is NULL, no need to check it again.

5 years agowidget: Skip not-drawable widgets in snapshot_child
Timm Bäder [Mon, 27 Jan 2020 13:21:44 +0000 (14:21 +0100)]
widget: Skip not-drawable widgets in snapshot_child

Otherwise we transform the snapshot just to not do anything.

5 years agomaplistmodel: Add an example to the docs
Matthias Clasen [Thu, 19 Dec 2019 02:56:57 +0000 (21:56 -0500)]
maplistmodel: Add an example to the docs

5 years agotreelistmodel: Small documentation tweaks
Matthias Clasen [Thu, 19 Dec 2019 03:41:41 +0000 (22:41 -0500)]
treelistmodel: Small documentation tweaks

5 years agowidgetfocus: Remove unnecessary check
Benjamin Otte [Tue, 4 Feb 2020 16:33:14 +0000 (17:33 +0100)]
widgetfocus: Remove unnecessary check

Mapped widgets are always realized.

5 years agowidget: Remove _gtk_widget_is_drawable()
Benjamin Otte [Tue, 4 Feb 2020 16:31:18 +0000 (17:31 +0100)]
widget: Remove _gtk_widget_is_drawable()

Use _gtk_widget_get_mapped() instead.

Drawable checked visible && mapped and mapped widgets are always
visible, so that was an unnecessary check.

5 years agoMerge branch 'wip/otte/icontheme' into 'master'
Benjamin Otte [Tue, 4 Feb 2020 16:36:46 +0000 (16:36 +0000)]
Merge branch 'wip/otte/icontheme' into 'master'

Do simple icontheme API cleanups

See merge request GNOME/gtk!1378

5 years agoRename GtkIcon to GtkIconPaintable
Alexander Larsson [Tue, 4 Feb 2020 16:19:22 +0000 (17:19 +0100)]
Rename GtkIcon to GtkIconPaintable

5 years agotooltip: Don't css-validate
Benjamin Otte [Tue, 4 Feb 2020 16:07:38 +0000 (17:07 +0100)]
tooltip: Don't css-validate

That's a job for toplevels now.

See 17ca95a1617b009a76b27a8572671855435985e7 for the same comit on
popovers.

5 years agoicontheme: Remove GENERIC_FALLBACKS
Benjamin Otte [Tue, 4 Feb 2020 03:26:19 +0000 (04:26 +0100)]
icontheme: Remove GENERIC_FALLBACKS

Instead, rely on people passing fallbacks explicitly.

Alternatively, GThemedIcon provides the functionality to create
fallbacks, which is what GtkImage and the testsuite now use.
That method is slightly better, too, so the expected test results
have been updated accordingly.

5 years agoicontheme: Pass fallbacks as optional argument to lookup_icon()
Benjamin Otte [Tue, 4 Feb 2020 02:53:22 +0000 (03:53 +0100)]
icontheme: Pass fallbacks as optional argument to lookup_icon()

This way, we can remove gtk_icon_theme_choose_icon() completely.

5 years agoicontheme: Remove contexts
Benjamin Otte [Sun, 2 Feb 2020 00:19:50 +0000 (01:19 +0100)]
icontheme: Remove contexts

There is no way to query contexts or do anything useful with them.

So don't keep track of them and don't make them an argument in public
APIs with the docs saying "I don't know what to use here, maybe read
some spec somewhere".

5 years agoicontheme: Clean up includes
Benjamin Otte [Sun, 2 Feb 2020 00:13:27 +0000 (01:13 +0100)]
icontheme: Clean up includes

5 years agoicontheme: Remove gtk_icon_get_base_size() and gtk_icon_get_base_dir()
Benjamin Otte [Sun, 2 Feb 2020 00:05:42 +0000 (01:05 +0100)]
icontheme: Remove gtk_icon_get_base_size() and gtk_icon_get_base_dir()

Those functions are unused and the documentation says "Returns some
random number that the icon theme creator chose" which does not seem at
all useful and an implementation detail.

So get rid of it.

5 years agoRevert "Break out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()"
Benjamin Otte [Sat, 1 Feb 2020 23:56:39 +0000 (00:56 +0100)]
Revert "Break out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()"

We're not in the business of adding Cairo APIs. That's Cairo's job.

Also, we don't need this API anywhere like the original commit claimed,
so there's no need to make it available in any way.

This reverts commit afa6cc23692f83f0d38de24c9cf58a7a494c01d2.

5 years agoicontheme: Remove crayon APIs
Benjamin Otte [Sat, 1 Feb 2020 23:48:24 +0000 (00:48 +0100)]
icontheme: Remove crayon APIs

We expose no API to get at any colors for drawing symbolics, so we
shouldn't have APIs to draw with them.

Apart from that, those APIs look like a box of crayons, not like an
icontheme.

5 years agoicontheme: Remove gtk_icon_theme_rescan_if_needed()
Benjamin Otte [Sat, 1 Feb 2020 23:44:01 +0000 (00:44 +0100)]
icontheme: Remove gtk_icon_theme_rescan_if_needed()

If the icon theme needs to be rescanned, it should just do it.
If it doesn't, there's no need for this function.

Ergo: Don't have the function.

5 years agoicontheme: Remove NO_SVG and FORCE_SVG flags
Benjamin Otte [Sat, 1 Feb 2020 23:42:43 +0000 (00:42 +0100)]
icontheme: Remove NO_SVG and FORCE_SVG flags

If the icon theme loads SVGs or not is an implementation detail and
should not be exposed in public API.

5 years agoicontheme: Remove GTK_ICON_LOOKUP_USE_BUILTIN
Benjamin Otte [Sat, 1 Feb 2020 23:35:42 +0000 (00:35 +0100)]
icontheme: Remove GTK_ICON_LOOKUP_USE_BUILTIN

It's unused.

5 years agoicontheme: Make text direction a lookup argument
Benjamin Otte [Sat, 1 Feb 2020 23:27:14 +0000 (00:27 +0100)]
icontheme: Make text direction a lookup argument

Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.

5 years agoicontheme: Remove async APIs
Benjamin Otte [Sat, 1 Feb 2020 22:51:04 +0000 (23:51 +0100)]
icontheme: Remove async APIs

Widgets would not use them properly. In fact, the only user was using
them wrong.

As icons are loaded async by default, this call isn't necessary.

5 years agoicontheme: Remove gtk_icon_theme_get_default()
Benjamin Otte [Sat, 1 Feb 2020 22:38:49 +0000 (23:38 +0100)]
icontheme: Remove gtk_icon_theme_get_default()

The API encouraged wrong usage - most of the users were indeed wrong.

Use the correct version instead:
  gtk_icon_theme_get_for_display (gtk_widget_get_display ())

5 years agocss: Fix the initial values optimization
Matthias Clasen [Tue, 4 Feb 2020 11:19:23 +0000 (12:19 +0100)]
css: Fix the initial values optimization

Fix up the index computation. We have duplicate entries
in the type enum, so to go from one of the 'initial' types
to it corresponding type you subtract one, but to find
the size array entry for a type, you divide by 2.

5 years agoMerge branch 'faster-theme-lookup' into 'master'
Matthias Clasen [Tue, 4 Feb 2020 10:51:27 +0000 (10:51 +0000)]
Merge branch 'faster-theme-lookup' into 'master'

Faster icon theme lookup

See merge request GNOME/gtk!1381

5 years agoicon-theme: Only have one copy of the icon flags enum
Alexander Larsson [Tue, 4 Feb 2020 08:35:20 +0000 (09:35 +0100)]
icon-theme: Only have one copy of the icon flags enum

It turns out with the icon cache now using the virtual SYMBOLIC_PNG_SUFFIX
flag the two enums are now identical, so lets just use one of them, the
one GtkIconCache (so we move it to the header).

5 years agoGtkIconCache: Remove unused code
Alexander Larsson [Mon, 3 Feb 2020 10:01:48 +0000 (11:01 +0100)]
GtkIconCache: Remove unused code

We're not really using the icon theme cache much anymore, as the
individual per-directory hashes are no longer used, so delete all the
unused code.

5 years agoIconTheme: Make icon lookups faster
Alexander Larsson [Mon, 3 Feb 2020 09:35:45 +0000 (10:35 +0100)]
IconTheme: Make icon lookups faster

Traditionally the icon lookup for a theme has been:

lookup (icon_name, size):
  best_directory = NULL
  forearch theme
    foreach directory in theme
       if dir_size_matches (directory, size) && dir_has_icon (directory, icon-name)
         best_directory = chose_best_size_dir (best_directory, directory)

if best_directory
  return icon from best_directory

However, it turns out that there are a lot of subdirectories which have the same
size, as they differ only in the (essentially useless) "context" value. For example
the "16x16/apps" subdirectory is essentially the same as the "16x16/actions" one.

So, instead rathern than keeping all the directories as separate we store the
all the directories with the same size as a single entity (DirSize) and the
icon lookup in that DirSize looks up not only which suffix to use for that icon
but also which subdir it is in.

Additionally we keep a hashtable with all icon names that are
available in the entire theme (i.e. all DirSizes), which allows use
both to store each icon name only once, but also to do a quick
negative lookup and early exit in case we're looking up an icon that
doesn't exist. This is pretty common because we often look up sets of
icons like "image-png-symbolic", "image-png", "image", expecting some
to fail.

This brings down the time of the initial css validation from 20msec to 15msec for
me when running icon-factory.

5 years agoicon-cache: Add new function to list all the icons in a directory
Alexander Larsson [Mon, 3 Feb 2020 09:00:17 +0000 (10:00 +0100)]
icon-cache: Add new function to list all the icons in a directory

This lists the icons in a particular director, with their flags in a
hashtable. We also convert from "icon.symbolic" + SUFFIX_PNG to
"icon" + SUFFIX_SYMBOLIC_PNG.

5 years agoRemove last GtkWidgetPath reference
Rico Tzschichholz [Mon, 3 Feb 2020 09:51:50 +0000 (10:51 +0100)]
Remove last GtkWidgetPath reference

See 49b47c913389dc395a48c2b19ac409412623c524

5 years agoMerge branch 'wip/muktupavels/update-documentation' into 'master'
Matthias Clasen [Mon, 3 Feb 2020 08:15:30 +0000 (08:15 +0000)]
Merge branch 'wip/muktupavels/update-documentation' into 'master'

display-x11: don't mention gdk_monitor_is_primary in the docs

See merge request GNOME/gtk!1380

5 years agodisplay-x11: don't mention gdk_monitor_is_primary in the docs
Alberts Muktupāvels [Sun, 2 Feb 2020 17:12:08 +0000 (19:12 +0200)]
display-x11: don't mention gdk_monitor_is_primary in the docs

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1371#note_699272

5 years agocss: Fix an oversight in style change computation
Matthias Clasen [Sun, 2 Feb 2020 15:34:45 +0000 (16:34 +0100)]
css: Fix an oversight in style change computation

Take the 'color == NULL means currentColor' trick into account
when computing the changes between two styles.

5 years agoMerge branch 'sigma' into 'master'
Matthias Clasen [Sun, 2 Feb 2020 12:04:09 +0000 (12:04 +0000)]
Merge branch 'sigma' into 'master'

gdk: Handle small final sigma in gdk_keyval_convert_case

See merge request GNOME/gtk!1351

5 years agoMerge branch 'initial-style' into 'master'
Matthias Clasen [Sat, 1 Feb 2020 12:52:44 +0000 (12:52 +0000)]
Merge branch 'initial-style' into 'master'

Make it easy to recognize initial style values

See merge request GNOME/gtk!1375

5 years agoborder: Don't render initial borders
Matthias Clasen [Sat, 1 Feb 2020 08:12:12 +0000 (09:12 +0100)]
border: Don't render initial borders

Add a fast exist for comon case that the border
values are unset.

5 years agobackground: Don't render initial backgrounds
Matthias Clasen [Sat, 1 Feb 2020 08:11:39 +0000 (09:11 +0100)]
background: Don't render initial backgrounds

Add a fast exit for the common case that the background
values are unset.

5 years agoMake it easy to recognize initial style values
Matthias Clasen [Fri, 31 Jan 2020 16:48:36 +0000 (17:48 +0100)]
Make it easy to recognize initial style values

Reuse the type field in GtkCssValues to make initial
style values easily recognizable.

5 years agomodelbutton: Update a11y states
Matthias Clasen [Fri, 31 Jan 2020 18:14:05 +0000 (19:14 +0100)]
modelbutton: Update a11y states

We took care to set the proper role on our accessible object,
but we forgot to update the state for check and radio button
roles.

5 years agofilechooser: Remove debug spew
Matthias Clasen [Fri, 31 Jan 2020 15:55:01 +0000 (16:55 +0100)]
filechooser: Remove debug spew

5 years agoBuild fix for GtkCssValues
Matthias Clasen [Fri, 31 Jan 2020 08:35:41 +0000 (09:35 +0100)]
Build fix for GtkCssValues

5 years agoUpdate Karbi translation
Jor Teron [Fri, 31 Jan 2020 10:15:03 +0000 (10:15 +0000)]
Update Karbi translation

5 years agoUpdated Spanish translation
Daniel Mustieles [Fri, 31 Jan 2020 08:09:43 +0000 (09:09 +0100)]
Updated Spanish translation

5 years agoMerge branch 'meson-sassc-subproject' into 'master'
Matthias Clasen [Fri, 31 Jan 2020 07:26:48 +0000 (07:26 +0000)]
Merge branch 'meson-sassc-subproject' into 'master'

build: require sassc and drop generated .css files

See merge request GNOME/gtk!814

5 years agoMerge branch 'kill-primary-monitor-2' into 'master'
Matthias Clasen [Thu, 30 Jan 2020 20:51:07 +0000 (20:51 +0000)]
Merge branch 'kill-primary-monitor-2' into 'master'

Remove primary monitor api

See merge request GNOME/gtk!1371

5 years agoRemove primary monitor api
Matthias Clasen [Thu, 30 Jan 2020 20:01:24 +0000 (21:01 +0100)]
Remove primary monitor api

We only have implementations of this on X11 and Win32,
so make it available as backend api there.

Update all callers to use either the backend api, or
just monitor 0.

5 years agobuild: require sassc and drop generated .css files
Christoph Reiter [Fri, 3 May 2019 16:04:16 +0000 (18:04 +0200)]
build: require sassc and drop generated .css files

Instead of requiring sassc to be installed add meson subprojects
which build libsass and sassc (currently both forks of mine, tested
under linux/mingw/msvc) when needed.

This allows us to drop the generated .css files and build scripts from git.

See #1502

5 years agoMerge branch 'icon-theme-rework' into 'master'
Alexander Larsson [Thu, 30 Jan 2020 17:30:10 +0000 (17:30 +0000)]
Merge branch 'icon-theme-rework' into 'master'

Rework icon themes

See merge request GNOME/gtk!1368

5 years agoicon-theme: Add icon theme name in profiler mark
Alexander Larsson [Thu, 30 Jan 2020 17:22:11 +0000 (18:22 +0100)]
icon-theme: Add icon theme name in profiler mark

5 years agoicon-theme: Avoid reentrancy issues while loading icon theme
Alexander Larsson [Thu, 30 Jan 2020 17:19:56 +0000 (18:19 +0100)]
icon-theme: Avoid reentrancy issues while loading icon theme

In gtk_icon_theme_get_for_display() we were calling
gtk_icon_theme_set_display() which eventually (via the css machinery)
called back into gtk_icon_theme_get_for_display() which created a
second icon theme. We avoid this by setting the user-data earlier so
that the css machinery gets back the currently initializing theme
instead.

5 years agoGtkIconHelper: Preload icons for mapped widgets with higher priority
Alexander Larsson [Thu, 30 Jan 2020 14:41:24 +0000 (15:41 +0100)]
GtkIconHelper: Preload icons for mapped widgets with higher priority

We look at whether a widget will be mapped (the actual state is not
yet set, so we can't rely on that at css validation time) and use
that to set the i/o priority of the async task.

This means that its likely that widgets that will be displayed soon
are loaded before those that are not yet going to be needed.

5 years agoIconHelper: Only preload icons once
Alexander Larsson [Thu, 30 Jan 2020 14:17:59 +0000 (15:17 +0100)]
IconHelper: Only preload icons once

This limits the amount of preloading we to, which can for instance
avoid trashing if the icon cache is full, and in general do less work
when its likely to be wasted such as when e.g. background-color for an
icon helper changes.

5 years agoicon-theme: Show which icon loads are threaded in profile mark
Alexander Larsson [Thu, 30 Jan 2020 14:16:40 +0000 (15:16 +0100)]
icon-theme: Show which icon loads are threaded in profile mark

5 years agoicon-theme: Add i/o priority to choose_icon_async()
Alexander Larsson [Thu, 30 Jan 2020 14:15:08 +0000 (15:15 +0100)]
icon-theme: Add i/o priority to choose_icon_async()

This is set on the GTask and lower priority will be loaded before,
this can be used to prioritize some icons for preloading.

5 years agoindentation: fix various alignment issues
Alexander Larsson [Thu, 30 Jan 2020 11:27:15 +0000 (12:27 +0100)]
indentation: fix various alignment issues

Most of these stem from the GtkIconInfo -> GtkIcon rename

5 years agoRemove final references to "icon info" with just "icon"
Alexander Larsson [Thu, 30 Jan 2020 09:52:09 +0000 (10:52 +0100)]
Remove final references to "icon info" with just "icon"

5 years agoicon-theme: Update the docs
Alexander Larsson [Thu, 30 Jan 2020 09:44:12 +0000 (10:44 +0100)]
icon-theme: Update the docs

5 years agoFix warnings in gdk gir build
Alexander Larsson [Thu, 30 Jan 2020 09:43:35 +0000 (10:43 +0100)]
Fix warnings in gdk gir build

We now have graphene arguments in a gdk function, so add that to the
dependencies.

5 years agoicon-theme: Remove trailing whitespaces
Alexander Larsson [Thu, 30 Jan 2020 08:12:36 +0000 (09:12 +0100)]
icon-theme: Remove trailing whitespaces

Since everything is changing anyway lets just clean up all the
trailing whitespace issues in the whole file.

5 years agoicon-theme: Use GtkSnapshot, not GdkSnapshot
Alexander Larsson [Thu, 30 Jan 2020 07:55:44 +0000 (08:55 +0100)]
icon-theme: Use GtkSnapshot, not GdkSnapshot

5 years agoicon-theme: Fix indentation of matrix values
Alexander Larsson [Thu, 30 Jan 2020 07:53:46 +0000 (08:53 +0100)]
icon-theme: Fix indentation of matrix values

5 years agoGtkImage: Preload icons during css validation
Alexander Larsson [Wed, 29 Jan 2020 17:10:13 +0000 (18:10 +0100)]
GtkImage: Preload icons during css validation

At the end of GtkImage css validation (during style-updated) when the
css properties (like the icon size) are valid we call _gtk_icon_helper_preload
which does an async icon theme lookup and load. This will happen on a thread
in parallel with the rest of the css machinery, and hopefully by the
time we need the icon it will be ready. If not we will block when we need
it, but during that blocking all the other icons will be loaded.

Testing widget-factory this changes the time of snapshot() from 31 to
25 msec, but on the other hand we also load a few more icons that we
didn't before causing the css validation phase to be about 8 msec slower.
This is because we're preloading all the images in the window, not only
the ones that are visible.

Unfortunately we still load a bunch of icons in snapshot(), from
GtkCssImageIconTheme, and ideally we should try to preload those also.

5 years agoicon-theme: Preload default icon themes in thread
Alexander Larsson [Wed, 29 Jan 2020 10:38:05 +0000 (11:38 +0100)]
icon-theme: Preload default icon themes in thread

This happens when we first get the theme for a display, or then the
icon theme setting changes.

This means we don't have to do this scan in the first snapshot
and can do the i/o it in parallel with other stuff. This moves
a 10msec block from the first snapshot cycle to early setup.

5 years agoicon helper: Remove profiler mark
Alexander Larsson [Wed, 29 Jan 2020 13:56:13 +0000 (14:56 +0100)]
icon helper: Remove profiler mark

This was hitting every time we looked up an icon, and we already
log the actual load of the icon in the icon theme.

5 years agoicon-theme: Improve profiler mark for icon loads
Alexander Larsson [Wed, 29 Jan 2020 10:33:30 +0000 (11:33 +0100)]
icon-theme: Improve profiler mark for icon loads

This adds the actual time it took to them as well as the icon size
and scale.

5 years agoicon-theme: Only add theme load profiler mark if we actually load theme
Alexander Larsson [Tue, 28 Jan 2020 16:08:52 +0000 (17:08 +0100)]
icon-theme: Only add theme load profiler mark if we actually load theme

5 years agoicon theme: Actually use scale in choose_icon_async()
Alexander Larsson [Wed, 29 Jan 2020 16:07:22 +0000 (17:07 +0100)]
icon theme: Actually use scale in choose_icon_async()

5 years agoicon theme: Actually don't block in gtk_icon_theme_choose_icon_async()
Alexander Larsson [Wed, 29 Jan 2020 15:42:35 +0000 (16:42 +0100)]
icon theme: Actually don't block in gtk_icon_theme_choose_icon_async()

If some other thread is lock the icon or icon theme locks they are likely
to do so for a long time, doing i/o. So, switch to trylock() for the
nonblocking part of _async(). This way we can return directly if the
result is available, but do a thread otherwise, never blocking the
calling (main) thread.

5 years agoicon-theme: Clean up locking
Alexander Larsson [Wed, 29 Jan 2020 10:08:02 +0000 (11:08 +0100)]
icon-theme: Clean up locking

Move the lru cache under the global cache lock to avoid some ABBA
style deadlocks when going from icon_theme->icon lock an icon->icon_theme.
We also move all the icon lock uses to a small part of code and make
sure that code never calls out or blocks with any locks held.

Rename the GtkIcon->cache_lock to texture_lock to avoid confusion withe
the global cache_lock.

Removed any mentions of threadsafety from the API docs, we don't
want apps to rely on this, but rather use it outselves internally.

5 years agoicon-theme: Drop the _for_scale() versions and always take scale
Alexander Larsson [Tue, 28 Jan 2020 15:14:52 +0000 (16:14 +0100)]
icon-theme: Drop the _for_scale() versions and always take scale

5 years agoicon-theme: Rename GtkIconInfo to GtkIcon
Alexander Larsson [Tue, 28 Jan 2020 14:43:51 +0000 (15:43 +0100)]
icon-theme: Rename GtkIconInfo to GtkIcon

5 years agoRename GtkIcon widget to GtkBuiltinIcon
Alexander Larsson [Tue, 28 Jan 2020 14:03:42 +0000 (15:03 +0100)]
Rename GtkIcon widget to GtkBuiltinIcon

This is an internal widget whose name is not very important, and we
want to rename GtkIconInfo to GtkIcon, so lets rename this.

5 years agoprofiler: Exit gracefully on SIGTERM
Matthias Clasen [Wed, 29 Jan 2020 15:55:44 +0000 (16:55 +0100)]
profiler: Exit gracefully on SIGTERM

This is nice, since it lets me quickly launch a test app
and terminate it with Ctrl-C and still produce a usable
sysprof trace.

5 years agobuilder: Add profiler marks for parsing
Matthias Clasen [Wed, 29 Jan 2020 14:49:56 +0000 (15:49 +0100)]
builder: Add profiler marks for parsing

This is useful to understand what ui files take
long to load.

5 years agobuilder: Use a better name for templates
Matthias Clasen [Wed, 29 Jan 2020 14:48:31 +0000 (15:48 +0100)]
builder: Use a better name for templates

This name can show up in error messages or profiler
traces, so it is nice to provide some hint what
file we are dealing with.
<GtkFileChoser template> is a lot more helpful
than <input>.

5 years agoicon-theme: Drop all load() calls from GtkIconInfo
Alexander Larsson [Tue, 28 Jan 2020 13:54:18 +0000 (14:54 +0100)]
icon-theme: Drop all load() calls from GtkIconInfo

All users now either use it directly as a paintable or download
the texture to use the pixels.

5 years agoicon-theme: Use gtk_icon_theme_choose_icon_async in tests
Alexander Larsson [Tue, 28 Jan 2020 13:38:53 +0000 (14:38 +0100)]
icon-theme: Use gtk_icon_theme_choose_icon_async in tests

5 years agoicon-theme: Drop loading_themes recursion check
Alexander Larsson [Tue, 28 Jan 2020 13:35:17 +0000 (14:35 +0100)]
icon-theme: Drop loading_themes recursion check

This was added in 0b1c9b7cc26d293477a6823a40d3e1feebbd6df7 to protect
against reentrancy from the theme-changed signal, but we only emit this
from an idle these days, so thats not necessary anymore, and the recursion
check was causing issues with the async operations where a different
thread loading the theme caused the calling thread to thing the
theme is valid.

5 years agoicon-theme: Add async icon loader
Alexander Larsson [Tue, 28 Jan 2020 12:47:59 +0000 (13:47 +0100)]
icon-theme: Add async icon loader

5 years agotests: Use gtk_icon_info_download_colored_texture instead of load_symbolic
Alexander Larsson [Tue, 28 Jan 2020 11:40:14 +0000 (12:40 +0100)]
tests: Use gtk_icon_info_download_colored_texture instead of load_symbolic

5 years agoicon-theme: Add gtk_icon_info_download_colored_texture()
Alexander Larsson [Tue, 28 Jan 2020 11:06:55 +0000 (12:06 +0100)]
icon-theme: Add gtk_icon_info_download_colored_texture()

This is a way to get at recolored pixels and will replace all existing users
of _load_symbolic*()

5 years agoBreak out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()
Alexander Larsson [Tue, 28 Jan 2020 10:42:24 +0000 (11:42 +0100)]
Break out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()

This is useful in some parts of the icon theme APIs.

5 years agoicons: Convert use of load() to download_texture()
Alexander Larsson [Tue, 28 Jan 2020 09:30:01 +0000 (10:30 +0100)]
icons: Convert use of load() to download_texture()

5 years agoicon theme: Add gtk_icon_info_download_texture() function
Alexander Larsson [Tue, 28 Jan 2020 07:34:14 +0000 (08:34 +0100)]
icon theme: Add gtk_icon_info_download_texture() function

This returns a reference to the texture (if possible) and can be
used to get access to the pixels of the icon.

5 years agoAdd gtk_icon_info_snapshot_with_colors() and use instead of custom code
Alexander Larsson [Mon, 27 Jan 2020 15:42:38 +0000 (16:42 +0100)]
Add gtk_icon_info_snapshot_with_colors() and use instead of custom code

5 years agoConvert trivial users of icon theme loading to use info as paintable
Alexander Larsson [Mon, 27 Jan 2020 14:40:58 +0000 (15:40 +0100)]
Convert trivial users of icon theme loading to use info as paintable

5 years agoGtkIconHelper use GtkIconInfo as paintable
Alexander Larsson [Mon, 27 Jan 2020 13:05:00 +0000 (14:05 +0100)]
GtkIconHelper use GtkIconInfo as paintable

5 years agoGtkIconInfo: Implement paintable
Alexander Larsson [Mon, 27 Jan 2020 12:59:34 +0000 (13:59 +0100)]
GtkIconInfo: Implement paintable

This makes GtkIconInfo directly implement paintable by loading
the icon as needed. This is done in a blocking fashion for now, but
could be made more async in the future.

It also means we can't return errors to the called, but I doubt
anyone actually does anything useful with them other than showing
nothing (which we already do).

This also changes a fringe behaviour for unthemed icons. They used to
be never scaled down, but that means we can't tell without i/o the
size of the paintable. Since this is the only case we can't know the
size i took an executive decision and removed that behaviour. I don't
think picking some arbitrary much larger than requested size is ever
right, nor do i think using GtkIconTheme with unthemed icons is overly
useful. If you want to display some random non-iconish image, use
GtkImage instead.

5 years agoicon theme: Make GtkIconInfo cached data threadsafe
Alexander Larsson [Fri, 24 Jan 2020 16:46:57 +0000 (17:46 +0100)]
icon theme: Make GtkIconInfo cached data threadsafe

Whenever this is accessed or updated we just grab a lock, thus
blocking on whoever is currenly updating it.

5 years agoGtkIconTheme: Make the base GtkIconTheme threadsafe
Alexander Larsson [Fri, 24 Jan 2020 15:22:26 +0000 (16:22 +0100)]
GtkIconTheme: Make the base GtkIconTheme threadsafe

This makes the core icon theme object threadsafe, however its
not yet very useful because the IconInfo objects are not threadsafe.

5 years agoUpdate POTFILES.skip
Piotr Drąg [Wed, 29 Jan 2020 16:20:23 +0000 (17:20 +0100)]
Update POTFILES.skip

5 years agoMerge branch 'wip/muktupavels/work-areas' into 'master'
Emmanuele Bassi [Wed, 29 Jan 2020 13:38:31 +0000 (13:38 +0000)]
Merge branch 'wip/muktupavels/work-areas' into 'master'

per-monitor work areas

Closes #1086 and #980

See merge request GNOME/gtk!1300

5 years agoanimatedstyle: Fix the debug build
Matthias Clasen [Wed, 29 Jan 2020 13:02:30 +0000 (14:02 +0100)]
animatedstyle: Fix the debug build

This wasn't caught by our ci.

5 years agox11: add support for _GTK_WORKAREAS_Dn
Alberts Muktupāvels [Sun, 12 Jan 2020 22:38:12 +0000 (00:38 +0200)]
x11: add support for _GTK_WORKAREAS_Dn

If window manager supports _GTK_WORKAREAS use per-monitor work areas.

https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html
https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1300

5 years agoMerge branch 'gtk-4-im-wayland-controller-focus-in' into 'master'
Carlos Garnacho [Wed, 29 Jan 2020 11:22:11 +0000 (11:22 +0000)]
Merge branch 'gtk-4-im-wayland-controller-focus-in' into 'master'

imwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey

See merge request GNOME/gtk!1349

5 years agoMerge branch 'gdk-device-leak-fix' into 'master'
Matthias Clasen [Wed, 29 Jan 2020 10:44:42 +0000 (10:44 +0000)]
Merge branch 'gdk-device-leak-fix' into 'master'

GdkDevice leak fix

See merge request GNOME/gtk!1358

5 years agoMerge branch 'css-style-split-2' into 'master'
Matthias Clasen [Wed, 29 Jan 2020 10:39:43 +0000 (10:39 +0000)]
Merge branch 'css-style-split-2' into 'master'

css: Split styles into groups

See merge request GNOME/gtk!1362

5 years agoMerge branch 'reset-with-click' into 'master'
Matthias Clasen [Wed, 29 Jan 2020 10:39:22 +0000 (10:39 +0000)]
Merge branch 'reset-with-click' into 'master'

Always emit reset for IM preedit with mouse click

Closes #1534

See merge request GNOME/gtk!460

5 years agoMerge branch 'robertroth/shortcuts-overlay-accel' into 'master'
Matthias Clasen [Wed, 29 Jan 2020 10:25:40 +0000 (10:25 +0000)]
Merge branch 'robertroth/shortcuts-overlay-accel' into 'master'

Application: Do not reuse Ctrl+F1 for help-overlay

See merge request GNOME/gtk!307

5 years agoUse style values directly
Matthias Clasen [Tue, 28 Jan 2020 07:38:25 +0000 (07:38 +0000)]
Use style values directly

Replace uses of gtk_css_style_get_value with direct access,
throughout the tree. We don't replace all uses, just those
where we are dealing with a fixed property. Be careful to
handle the currentColor special case for color properties.