gtk4.git
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 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.

5 years agoCompute style change based on values structs
Matthias Clasen [Tue, 28 Jan 2020 17:13:37 +0000 (18:13 +0100)]
Compute style change based on values structs

We can save some time here by comparing struct by
struct and avoiding individual values comparisons
as much as possible.

5 years agocss: Split styles into groups
Matthias Clasen [Sun, 26 Jan 2020 04:16:06 +0000 (23:16 -0500)]
css: Split styles into groups

Introduce refcounted structs for groups of related css properties,
and use them to store the style values. Both GtkCssStaticStyle and
GtkCssAnimatedStyle fill in the structs in GtkCssStyle, and we
can avoid vfuncs for value access, which should be much faster.
We can even start accessing style->core->color directly.

5 years agoperformance test: Produce better numbers
Matthias Clasen [Wed, 29 Jan 2020 10:05:24 +0000 (11:05 +0100)]
performance test: Produce better numbers

Try to isolate the test runs from each other in the
eyes of the kernel scheduler, by sleeping a bit. And
ignore the first run, to avoid cache effects.

5 years agoMerge branch 'wip/baedert/widget-add-style-class' into 'master'
Matthias Clasen [Wed, 29 Jan 2020 09:46:36 +0000 (09:46 +0000)]
Merge branch 'wip/baedert/widget-add-style-class' into 'master'

widget: Add style class API

See merge request GNOME/gtk!1366

5 years agoSilence a compiler warning
Matthias Clasen [Wed, 29 Jan 2020 09:44:25 +0000 (10:44 +0100)]
Silence a compiler warning

5 years agoMerge branch 'gtk-doc-ci' into 'master'
Emmanuele Bassi [Wed, 29 Jan 2020 09:11:15 +0000 (09:11 +0000)]
Merge branch 'gtk-doc-ci' into 'master'

Publish the API reference

See merge request GNOME/gtk!1367

5 years agoRemove reftests from expected-fail list
Emmanuele Bassi [Wed, 29 Jan 2020 09:02:02 +0000 (10:02 +0100)]
Remove reftests from expected-fail list

With an updated version of the base CI image it seems some tests that
were failing have started to pass again.

5 years agoci: Deploy the API reference on our GitLab pages
Emmanuele Bassi [Wed, 29 Jan 2020 08:16:57 +0000 (09:16 +0100)]
ci: Deploy the API reference on our GitLab pages

Now that we can build gtk-doc as a sub-project, we can go back to
publishing the API reference for the master branch every time we
build it.

5 years agoci: Update the version of Meson in the CI image
Emmanuele Bassi [Tue, 28 Jan 2020 15:52:42 +0000 (16:52 +0100)]
ci: Update the version of Meson in the CI image

We need at least 0.52.1 to be able to use gtk-doc as a sub-project.

5 years agoAdd gtk-doc as a subproject
Emmanuele Bassi [Tue, 28 Jan 2020 15:50:53 +0000 (16:50 +0100)]
Add gtk-doc as a subproject

We rely on a specific minimum version of gtk-doc to be able to build the
GTK API reference for the new API. In order to be able to use gtk-doc as
a subproject, though, we need to use a recent version of Meson.

5 years agowidget: Add style class API
Timm Bäder [Wed, 29 Jan 2020 07:33:41 +0000 (08:33 +0100)]
widget: Add style class API

Add GtkWidget API for adding and removing style classes, as well as
checking whether a widget has a style class applied.

Everyone has to go through GtkStyleContext for this these days but with
GtkStyleContext eventually going away, it makse sense for GtkWidget to
have API for this.

5 years agoMerge branch 'fix-doc-typo' into 'master'
Timm Bäder [Wed, 29 Jan 2020 07:49:13 +0000 (07:49 +0000)]
Merge branch 'fix-doc-typo' into 'master'

Fix a doc typo

See merge request GNOME/gtk!1364

5 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Wed, 29 Jan 2020 04:35:56 +0000 (04:35 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Wip/otte/for master

See merge request GNOME/gtk!1365

5 years agocssselector: Rework how we handle the bloom filter
Benjamin Otte [Wed, 29 Jan 2020 03:20:47 +0000 (04:20 +0100)]
cssselector: Rework how we handle the bloom filter

Instead of foreaching through all the previous selectors every time we
bloom-filter, just bloom-filter the current element and return a special
value if that filter fails (FALSE). If that happens, don't try
filter-matching more nodes in the caller as we know it's an abort.

5 years agoFix a doc typo
Luca Bacci [Tue, 28 Jan 2020 20:42:03 +0000 (20:42 +0000)]
Fix a doc typo

5 years agocssselector: Reorder functions
Benjamin Otte [Tue, 28 Jan 2020 17:28:32 +0000 (18:28 +0100)]
cssselector: Reorder functions

This just changes the order of functions in the source code in
preparation for the next commit.

5 years agocss: Don't do the "all set" test
Benjamin Otte [Tue, 28 Jan 2020 16:49:37 +0000 (17:49 +0100)]
css: Don't do the "all set" test

We have so many properties that it is basically impossible that all of
them are set and the time spent checking is higher than the time saved
if it does indeed happen.

5 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Tue, 28 Jan 2020 16:43:33 +0000 (16:43 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

popover: Do not validate the css node on show()

See merge request GNOME/gtk!1363

5 years agopopover: Do not validate the css node on show()
Benjamin Otte [Tue, 28 Jan 2020 16:15:04 +0000 (17:15 +0100)]
popover: Do not validate the css node on show()

This was a good idea back in GTK3 when popovers were toplevels, but now
they're regular child widgets, so they should behave that way.

Also, with the introduction of the bloom filter, gtk_css_node_validate()
now assumes it's only called on root nodes, so assert that that is the
case.

5 years agoimwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey
Takao Fujiwara [Tue, 28 Jan 2020 14:47:16 +0000 (23:47 +0900)]
imwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey

GtkEventControllerKey can handle GDK_FOCUS_CHANGE and call
gtk_im_context_focus_in/out directly.

https://gitlab.gnome.org/GNOME/gtk/issues/2390

5 years agoMerge branch 'wip/otte/css' into 'master'
Benjamin Otte [Tue, 28 Jan 2020 03:56:49 +0000 (03:56 +0000)]
Merge branch 'wip/otte/css' into 'master'

selector: Rework iterating over subnodes

See merge request GNOME/gtk!1361

5 years agoselector: Rework iterating over subnodes
Benjamin Otte [Tue, 28 Jan 2020 02:53:48 +0000 (03:53 +0100)]
selector: Rework iterating over subnodes

Instead of a foreach() function, introduce an iterator, so that the
caller can drive the iteration.

This allows doing stuff inbetween callbacks and avoids closures when
more than one data object should be passed.

As a side effect I even get a small, but noticeable performance
improvement in the 2-10% range depending on benchmark, I guess that's
because there's no function pointer passing going on anymore.