gtk4.git
5 years agoFix syntax
Matthias Clasen [Fri, 7 Feb 2020 12:50:02 +0000 (07:50 -0500)]
Fix syntax

5 years agoUpdates for 3.98
Matthias Clasen [Fri, 7 Feb 2020 12:48:04 +0000 (07:48 -0500)]
Updates for 3.98

5 years agoMerge branch 'wip/carlosg/implicit-grabs-on-leave' into 'master'
Matthias Clasen [Fri, 7 Feb 2020 07:06:45 +0000 (07:06 +0000)]
Merge branch 'wip/carlosg/implicit-grabs-on-leave' into 'master'

Handle implicit grabs on leave events

Closes #13

See merge request GNOME/gtk!1397

5 years agogtkmain: Wait for GDK_CROSSING_UNGRAB leave event with implicit grabs
Carlos Garnacho [Fri, 7 Feb 2020 00:02:47 +0000 (01:02 +0100)]
gtkmain: Wait for GDK_CROSSING_UNGRAB leave event with implicit grabs

If there is a passive grab and the pointer leaves the window we would
receive a GDK_CROSSING_NORMAL event when the pointer moves outside
the window, and a GDK_CROSSING_UNGRAB event when we do release the
button and the implicit grab.

We currently would react to the first, but want to react to the
second. In the time between both events, the client would still receive
pointer motion that will reach the implicitly grabbed widget.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/13
5 years agogtkroot: Make enum a typedef
Carlos Garnacho [Fri, 7 Feb 2020 00:00:52 +0000 (01:00 +0100)]
gtkroot: Make enum a typedef

Seems a typo, and prevents building as GtkRootProperties is deemed
to be defined multiple times.

5 years agoMerge branch 'a11y-fixes' into 'master'
Matthias Clasen [Thu, 6 Feb 2020 23:54:39 +0000 (23:54 +0000)]
Merge branch 'a11y-fixes' into 'master'

A11y fixes

See merge request GNOME/gtk!1396

5 years agotestsuite: Misc. updates of expected output
Matthias Clasen [Thu, 6 Feb 2020 22:21:22 +0000 (17:21 -0500)]
testsuite: Misc. updates of expected output

The a11y dumps for action and header bars
have changed in harmless ways.

5 years agoinfobar: Implement forall
Matthias Clasen [Thu, 6 Feb 2020 23:03:28 +0000 (18:03 -0500)]
infobar: Implement forall

As a container, that is what you have to do.

5 years agotestsuite: Clean up a11y menu tests
Matthias Clasen [Thu, 6 Feb 2020 22:12:34 +0000 (17:12 -0500)]
testsuite: Clean up a11y menu tests

We don't need some of the tests anymore, since
we just have popovers now.

5 years agotestsuite: Improve --generate support
Matthias Clasen [Thu, 6 Feb 2020 21:50:09 +0000 (16:50 -0500)]
testsuite: Improve --generate support

When using the test binary to generate expected
output, don't initialize the test machinery, since
that pollutes the output with noise.

5 years agotests: Fix infobars in ui files
Matthias Clasen [Thu, 6 Feb 2020 05:47:13 +0000 (00:47 -0500)]
tests: Fix infobars in ui files

GtkInfoBar no longer exposes the content_area
as internal child.

5 years agotestsuite: Update expected output
Matthias Clasen [Thu, 6 Feb 2020 05:46:48 +0000 (00:46 -0500)]
testsuite: Update expected output

5 years agocolorchooser: Use a composite accessible
Matthias Clasen [Thu, 6 Feb 2020 05:16:18 +0000 (00:16 -0500)]
colorchooser: Use a composite accessible

This makes the content show up in the a11y tree again.

5 years agotests: Update expected output
Matthias Clasen [Thu, 6 Feb 2020 04:17:17 +0000 (23:17 -0500)]
tests: Update expected output

The stackswitcher is no longer a box, so it doesn't
have the horizontal state anymore.

5 years agotestsuite: Update some a11y tests
Matthias Clasen [Thu, 6 Feb 2020 04:09:23 +0000 (23:09 -0500)]
testsuite: Update some a11y tests

GtkMenuButton::use-popover no longer exists, remove it
from test files.

5 years agostackswitcher: Use a composite accessible
Matthias Clasen [Thu, 6 Feb 2020 04:06:47 +0000 (23:06 -0500)]
stackswitcher: Use a composite accessible

This makes the buttons show up in the a11y tree again.

5 years agoa11y: Add an accessible for widgets with children
Matthias Clasen [Thu, 6 Feb 2020 04:05:01 +0000 (23:05 -0500)]
a11y: Add an accessible for widgets with children

We've started to turns containers into widgets which
just happen to have children, and some of these need
to be exposed to the a11y stack.

This adds a very minimal implementation, it does not
currently emit change notification when children are
added or removed.

5 years agoa11y: Report children of widgets
Matthias Clasen [Thu, 6 Feb 2020 04:07:33 +0000 (23:07 -0500)]
a11y: Report children of widgets

We want children of composite accessibles to be
reported.

5 years agoMerge branch 'flatpak-build-sassc' into 'master'
Matthias Clasen [Thu, 6 Feb 2020 20:09:29 +0000 (20:09 +0000)]
Merge branch 'flatpak-build-sassc' into 'master'

Flatpak build sassc

See merge request GNOME/gtk!1392

5 years agoBuild sassc as a dependency for flatpaks
Matthias Clasen [Thu, 6 Feb 2020 04:47:13 +0000 (23:47 -0500)]
Build sassc as a dependency for flatpaks

Downloading the subproject during the GTK build fails
in a flatpak build due to lack of network access.
flatpak-builder insists on having these things explicitly
spelled out as dependencies.

5 years agoMerge branch 'WindowsPrintDriverPreferencesMaster' into 'master'
Matthias Clasen [Thu, 6 Feb 2020 13:07:13 +0000 (13:07 +0000)]
Merge branch 'WindowsPrintDriverPreferencesMaster' into 'master'

Fixed bug that prevented GTK from storing printer driver preferences in the…

See merge request GNOME/gtk!397

5 years agonotebook: Update arrows when text direction changes
Matthias Clasen [Thu, 6 Feb 2020 07:07:22 +0000 (02:07 -0500)]
notebook: Update arrows when text direction changes

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/103

5 years agoMerge branch 'kill-simple-search' into 'master'
Matthias Clasen [Thu, 6 Feb 2020 06:38:17 +0000 (06:38 +0000)]
Merge branch 'kill-simple-search' into 'master'

Remove simple search engine

See merge request GNOME/gtk!1393

5 years agoMerge branch 'better-test-isolation-2' into 'master'
Matthias Clasen [Thu, 6 Feb 2020 04:53:07 +0000 (04:53 +0000)]
Merge branch 'better-test-isolation-2' into 'master'

Better test isolation

See merge request GNOME/gtk!1391

5 years agocss tests: Ignore ".csd" vs ".solid-csd"
Matthias Clasen [Thu, 6 Feb 2020 04:35:39 +0000 (23:35 -0500)]
css tests: Ignore ".csd" vs ".solid-csd"

It it hard to control which of the csd style classes we get,
since it depends on details of the X server or compositor.

Explicitly ignore this difference by replacing .solid-csd
with .csd in the output.

5 years agotestsuite: Make tests run without a11y bus
Matthias Clasen [Thu, 6 Feb 2020 03:24:39 +0000 (22:24 -0500)]
testsuite: Make tests run without a11y bus

Not having an a11y bus around causes warnings from
at-spi, which make tests fail. Explicitly ignore those
warnings.

5 years agotestsuite: Fix bloomfilter style tests
Matthias Clasen [Thu, 6 Feb 2020 03:23:52 +0000 (22:23 -0500)]
testsuite: Fix bloomfilter style tests

The results were expecting solid-csd, which is not what
we usually have.

5 years agoMerge branch 'master.msvc' into 'master'
Matthias Clasen [Wed, 5 Feb 2020 18:26:22 +0000 (18:26 +0000)]
Merge branch 'master.msvc' into 'master'

Fix building recent GTK master on Visual Studio

See merge request GNOME/gtk!1369

5 years agoMerge branch 'public-emojichooser' into 'master'
Matthias Clasen [Wed, 5 Feb 2020 18:04:42 +0000 (18:04 +0000)]
Merge branch 'public-emojichooser' into 'master'

emojichooser: Make public

See merge request GNOME/gtk!1382

5 years agoMerge branch 'wip/otte/css' into 'master'
Benjamin Otte [Wed, 5 Feb 2020 14:04:12 +0000 (14:04 +0000)]
Merge branch 'wip/otte/css' into 'master'

Some CSS cleanup

See merge request GNOME/gtk!1389

5 years agoemojichooser: Add profiler marks for loading
Matthias Clasen [Tue, 4 Feb 2020 23:47:42 +0000 (00:47 +0100)]
emojichooser: Add profiler marks for loading

This is a long-running operation, and worth showing
in traces.

5 years agoicontheme: Fix various memory leaks
Matthias Clasen [Tue, 4 Feb 2020 23:25:15 +0000 (00:25 +0100)]
icontheme: Fix various memory leaks

Tasks need to be unreffed too.

5 years agowidget: Fix a memory leak with class actions
Matthias Clasen [Tue, 4 Feb 2020 23:24:14 +0000 (00:24 +0100)]
widget: Fix a memory leak with class actions

This code was doing the wrong thing even if the parent class
doesn't have actions.

5 years agoAdd a lib64 variant of gtk.supp
Matthias Clasen [Tue, 4 Feb 2020 23:23:36 +0000 (00:23 +0100)]
Add a lib64 variant of gtk.supp

5 years agoicontheme: Remove some dead code
Matthias Clasen [Tue, 4 Feb 2020 22:41:00 +0000 (23:41 +0100)]
icontheme: Remove some dead code

5 years agoframeclock: cosmetics
Matthias Clasen [Tue, 4 Feb 2020 22:07:43 +0000 (23:07 +0100)]
frameclock: cosmetics

Redo the profiler marks for the frame clock signals
to look more uniform.

5 years agogdk: Silence some compiler warnings
Matthias Clasen [Tue, 4 Feb 2020 21:54:19 +0000 (22:54 +0100)]
gdk: Silence some compiler warnings

These cause unused variable warnings in release builds.

5 years agotreestore: Silence compiler warnings
Matthias Clasen [Tue, 4 Feb 2020 21:45:29 +0000 (22:45 +0100)]
treestore: Silence compiler warnings

This was causing compiler warnings in release builds.

5 years agonotebook: Don't trigger criticals in dispose
Matthias Clasen [Tue, 4 Feb 2020 21:42:44 +0000 (22:42 +0100)]
notebook: Don't trigger criticals in dispose

When we dismantle our children in dispose, we
trigger a11y children-changed signals which end
up calling back into the notebook. Handle this
without critical warnings.

5 years agotextview: Don't update action state in dispose
Matthias Clasen [Tue, 4 Feb 2020 21:40:11 +0000 (22:40 +0100)]
textview: Don't update action state in dispose

Only update the action state when we have a text buffer,
there is no need to do it otherwise, since we are going
to get a buffer before we get shown. This avoids triggering
the action state updates from finalize, which is a bad
time to be recreating the action muxer.

5 years agoentry: Avoid criticals in dispose
Matthias Clasen [Tue, 4 Feb 2020 21:15:32 +0000 (22:15 +0100)]
entry: Avoid criticals in dispose

The accessible gets properties of the entry, and
resetting the entry icons triggers accessible change
notification, so do that before we dismantle the entry
too far to respond to a g_object_get () call.

5 years agoDon't export color picker functions
Matthias Clasen [Tue, 4 Feb 2020 19:01:56 +0000 (20:01 +0100)]
Don't export color picker functions

This is not public API, so it shouldn't be exported.

5 years agoRead bookmarks async
Matthias Clasen [Tue, 4 Feb 2020 16:54:30 +0000 (17:54 +0100)]
Read bookmarks async

Do not block the main thread while reading the bookmarks file.
This speeds up initial setup of a GtkPlacesSidebar.

5 years agoplacessidebar: Change some initial property values
Matthias Clasen [Tue, 4 Feb 2020 15:26:40 +0000 (16:26 +0100)]
placessidebar: Change some initial property values

Giving these properties the initial value that the file
chooser wants for them avoids some calls to update_places
in the setup code.

5 years agotestperf: More flexible mark selection
Matthias Clasen [Wed, 5 Feb 2020 05:45:35 +0000 (00:45 -0500)]
testperf: More flexible mark selection

Allow selecting marks not just by their name, but
also by the message detail.

5 years agotestperf: Allow measuring start time
Matthias Clasen [Wed, 5 Feb 2020 05:23:13 +0000 (00:23 -0500)]
testperf: Allow measuring start time

This can be used e.g. to measure how long it takes us
to get the first frame on screen.

5 years agostylecontext: Remove unused typedef
Benjamin Otte [Wed, 5 Feb 2020 03:02:57 +0000 (04:02 +0100)]
stylecontext: Remove unused typedef

5 years agocss: Make some local variables const
Timm Bäder [Tue, 4 Feb 2020 09:17:15 +0000 (10:17 +0100)]
css: Make some local variables const

5 years agocss: Remove unused function
Timm Bäder [Tue, 28 Jan 2020 13:48:10 +0000 (14:48 +0100)]
css: Remove unused function

5 years agostyle context: Remove parent relationship
Timm Bäder [Mon, 3 Feb 2020 09:59:21 +0000 (10:59 +0100)]
style context: Remove parent relationship

We don't have foreign drawing anymore, so we don't need this.

5 years agostylecontext: Remove gtk_style_context_new()
Benjamin Otte [Wed, 5 Feb 2020 02:12:40 +0000 (03:12 +0100)]
stylecontext: Remove gtk_style_context_new()

It's private now, no more foreign drawing of any sort.

To be fair, it was entirely useless without widget paths already.

5 years agotestsuite: Remove the stylecontext test
Benjamin Otte [Wed, 5 Feb 2020 01:59:11 +0000 (02:59 +0100)]
testsuite: Remove the stylecontext test

Stylecontexts are on their way out and I'm removing API that the
testsuite was relying on, so remove the tests.

Put the useful parts of the tests elsewhere.

5 years agostylecontext: Remove the "changed" signal
Benjamin Otte [Wed, 5 Feb 2020 01:54:32 +0000 (02:54 +0100)]
stylecontext: Remove the "changed" signal

Instead, always go directly to the GtkWidget::css_changed() call.

5 years agowidget: Replace style-updated signal with css_changed vfunc
Benjamin Otte [Wed, 5 Feb 2020 01:46:13 +0000 (02:46 +0100)]
widget: Replace style-updated signal with css_changed vfunc

1. Rename the thing
2. Turn it from a signal to a vfunc
3. Pass the GtkCssStyleChange to it

We don't export any public API about the GtkCssStyleChange yet, it's
just a boring opaque struct.

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 agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Tue, 4 Feb 2020 17:48:58 +0000 (17:48 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Wip/otte/for master

See merge request GNOME/gtk!1388

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 agoa11y tests: Ignore "active" flag on toplevel
Alexander Larsson [Tue, 4 Feb 2020 14:01:48 +0000 (15:01 +0100)]
a11y tests: Ignore "active" flag on toplevel

All the a11y tests were failing for me with a window state diff
like this:

-  state: active enabled resizable sensitive showing visible
+  state: enabled resizable sensitive showing visible

I guess the windows in the CI always gets the focus, but not when
I run it here. Generally focus seems asynchronous and hard to rely
on so I just made the test ignore the active state on toplevels.

5 years agotests: Initialize dbus before gtk
Alexander Larsson [Tue, 4 Feb 2020 13:13:33 +0000 (14:13 +0100)]
tests: Initialize dbus before gtk

These days initilizing gtk may create a connection to the sesson bus,
so we have to initialize GTestDBus before initalizing gtk, or we'll
use the address of the "real" session bus (and remember that in the
global).

To further muck things up, g_test_dbus_up() resets important env
vars like DISPLAY and XDG_RUNTIME_DIR, which we have to re-set.

5 years agofilechooser portal: Free portal proxy when bus connection closes
Alexander Larsson [Tue, 4 Feb 2020 13:08:10 +0000 (14:08 +0100)]
filechooser portal: Free portal proxy when bus connection closes

This was blocking the clean exit from the testdbus shutdown in
the defaultvalues test. The proxy was keeping the connection alive
which blocks g_test_dbus_down().

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 agoDon't use xsettings or xft defaults in testsuite
Alexander Larsson [Mon, 3 Feb 2020 14:11:35 +0000 (15:11 +0100)]
Don't use xsettings or xft defaults in testsuite

This adds a GDK_DEBUG=default-settings flag which disables reads
from xsettings and Xft resources, and enables this for the testsuite.

This is one less way to get different testresults depending on the
environment. In particular, it was failing the css tests for me
due to getting the wrong font size because i have a different dpi.

5 years agoemojichooser: Make public
Matthias Clasen [Mon, 3 Feb 2020 11:49:36 +0000 (12:49 +0100)]
emojichooser: Make public

This is a useful widget to have, and it has minimal api.

Not having it public forces apps to recreate a lot of
complicated machinery for not good reason, if they need
an Emoji chooser in a different context.

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 agomeson/MSVC builds: Use -utf-8 where available
Chun-wei Fan [Wed, 15 Jan 2020 07:27:59 +0000 (15:27 +0800)]
meson/MSVC builds: Use -utf-8 where available

This avoids the build from erroring out on C4819 (Unicode handling issue in
Visual Studio compiler), notably when running on Chinese, Japanese and
Korean locales.

Also apply -D_USE_MATH_DEFINES, -FImsvc_recommended_pragmas.h and -utf-8 to
the C++ compiler options as well.

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 agodemos/widget-factory/widget-factory.c: Include stdlib.h
Chun-wei Fan [Thu, 30 Jan 2020 14:35:54 +0000 (22:35 +0800)]
demos/widget-factory/widget-factory.c: Include stdlib.h

Include it for exit().

5 years agotests/testdnd2.c: Don't include unistd.h unconditionally
Chun-wei Fan [Thu, 30 Jan 2020 14:34:53 +0000 (22:34 +0800)]
tests/testdnd2.c: Don't include unistd.h unconditionally

Instead, on Windows when it is not available, include io.h for close()

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.