Commit Graph

64678 Commits

Author SHA1 Message Date
Matthias Clasen
5eec736b07 multifilter: Use GdkArray for the filters 2020-07-16 18:44:25 -04:00
Matthias Clasen
cf4a8e2152 multisorter: Use GdkArray for the sorters 2020-07-16 18:44:25 -04:00
Benjamin Otte
60a09e59e8 stringlist: Convert to array
Stringlists are usually built and then never modified, and accessing
items through an array is faster.
2020-07-16 18:09:58 +02:00
Benjamin Otte
6f8e9bf3a9 snapshot: Use GdkArray for the state stack 2020-07-16 18:09:58 +02:00
Benjamin Otte
90b7b84337 array: Add a bunch of new features
* GDK_ARRAY_BY_VALUE
  #define this to get GArray-like behavior
* gdk_array_splice (v, 0, 0, NULL, 25)
  Adding items but passing NULL as the items will zero() them.
* gdk_array_set_size()
  A nicer way to call gdk_array_splice()
* constify getters
2020-07-16 18:09:58 +02:00
Benjamin Otte
088b5fc57f icontheme: Use GdkArray 2020-07-16 18:09:58 +02:00
Benjamin Otte
a4cd974912 array: Add null-termination 2020-07-16 18:09:57 +02:00
Benjamin Otte
65359dcc59 snapshot: Port node list to GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
ac8b398c50 snapshot: Move structs into .c file
They aren't used anywhere else.
2020-07-16 18:09:57 +02:00
Benjamin Otte
aac2417893 Remove preallocated array code
Now with GdkArray, we can use that one instead.
2020-07-16 18:09:57 +02:00
Benjamin Otte
ad8892df10 main: Use a GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
edc7977c4e cssselector: Use GdkArray 2020-07-16 18:09:57 +02:00
Benjamin Otte
8bf8ac5076 Add GdkArray
This is a scary idea where you #define a bunch of preprocessor values
and then #include "gdkarrayimpl.c" and end up with a dynamic array for
that data type.

See https://en.wikipedia.org/wiki/X_Macro for what's going on.

What are the advantages over using GArray or GPtrArray?

 * It's typesafe
   Because it works like C++ templates, we can use the actual type of
   the object instead of having to use gpointer.

 * It's one less indirection
   instead of 2 indirections via self->array->data, this array is
   embedded, so self->array is the actual data, and just one indirection
   away. This is pretty irrelevant in general, but can be very noticable
   in tight loops.

 * It's all inline
   Because the whole API is defined as static inline functions, the
   compiler has full access to everything and can (and does) optimize
   out unnecessary calls, thereby speeding up some operations quite
   significantly, when full optimizations are enabled.

 * It has more features
   In particular preallocation allows for avoiding malloc() calls, which
   can again speed up tight loops a lot.
   But there's also splice(), which is very useful when used with
   listmodels.
2020-07-16 18:09:57 +02:00
Matthias Clasen
b7efd896b6 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2249
2020-07-16 12:52:46 +00:00
Matthias Clasen
46eb51bc30 inspector: Avoid losing a reference
This was copying the example in the treelistrowsorter
docs that the previous commit fixed, so we apply
the same fix here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
500dbaabc3 treelistrowsorter: Fix a faulty example
gtk_tree_list_row_sorter_new() consumes the
sorter, so we can't pass gtk_column_view_get_sorter(),
since that is transfer none.
2020-07-16 07:14:01 -04:00
Matthias Clasen
594ec3d822 inspector: Don't derive from GtkBox
We don't do that anymore. A bin layout
is sufficient here.
2020-07-16 07:14:01 -04:00
Matthias Clasen
f280508209 inspector: Drop a Private struct
These are really not needed in the inspector.
2020-07-16 07:14:01 -04:00
Matthias Clasen
480b88c776 inspector: Drop an unused field 2020-07-16 07:14:01 -04:00
Efstathios Iosifidis
a4e63905b1 Update Greek translation 2020-07-15 18:12:26 +00:00
Matthias Clasen
5666127dbc Merge branch 'matthiasc/for-master' into 'master'
inspector: Use substring matching in the property list

See merge request GNOME/gtk!2247
2020-07-15 16:52:05 +00:00
Matthias Clasen
c1c110ba65 inspector: Use substring matching in the property list
This is convenient for things like "set both hexpand and
vexpand", since you can then search for "expand"
2020-07-15 11:29:06 -04:00
Florentina Mușat
eb2a839892 Update Romanian translation 2020-07-15 08:58:58 +00:00
Matthias Clasen
1c537a6d2e Merge branch 'wip/jimmac/file-dialog-sidebar-color' into 'master'
Adwaita: sidebar color for file picker

See merge request GNOME/gtk!2242
2020-07-15 01:41:35 +00:00
Matthias Clasen
c12261a6ec Merge branch 'wip/fix-picom-crasher' into 'master'
x11: Don't set up frame sync fence on unsupported compositors

Closes #2927

See merge request GNOME/gtk!2245
2020-07-15 01:40:49 +00:00
Matthias Clasen
5af7d6bff3 Merge branch 'idle-inhibit' into 'master'
Add support for idle inhibition on Wayland

Closes #2202

See merge request GNOME/gtk!2226
2020-07-15 01:38:55 +00:00
Matthias Clasen
de0f4b0f5b Merge branch 'shortcuts-section-reflow-fix' into 'master'
Fix shortcuts section reflow

Closes #2928

See merge request GNOME/gtk!2246
2020-07-15 01:38:38 +00:00
Emmanuel Gil Peyrot
966ab1152d gtk/wayland: Add support for idle inhibition in GtkApplication
This feature was previously only supported on DBus compositors, such as
Mutter, this adds support for other compositors such as all of those
based on wlroots.

This implementation prefers the idle-inhibit Wayland protocol to the
DBus version if it is available, since the inhibitor is per-surface
instead of global it allows a finer control over which displays get
dimmed for instance.  For every case not supported by this protocol, a
fallback to the DBus version is used.

It can’t do anything if the GtkWindow isn’t passed, which might warrant
some documentation change to encourage users to not use NULL for this
argument.

This has been tested on Sway.

Fixes #2202.
2020-07-14 21:47:22 +02:00
Emmanuel Gil Peyrot
74a4432688 gdk/wayland: Add an API to inhibit and uninhibit idle
This uses the idle-inhibit protocol from wayland-protocols, to attach an
inhibitor to the GdkSurface.  The inhibit function can be called as many
times as the user wants, but the uninhibit function MUST be called as
many times to unset the idle inhibition.

This has been tested on Sway.
2020-07-14 21:47:22 +02:00
Matthias Clasen
115d0cdc07 Fix shortcuts section reflow
When this code was ported from gtk_container_get_children
to the dom api, we inadvertendly inverted the order of the
list in one place. With the dom api, we can just avoid
reversing lists altogether, so do that.

Fixes: #2928
2020-07-14 14:48:32 -04:00
Ray Strode
d0ec616fba x11: Don't set up frame sync fence on unsupported compositors
Not all compositors support _NET_WM_FRAME_DRAWN.  In cases
where the compositor doesn't support _NET_WM_FRAME_DRAWN we don't
need to do all the fancy damage tracking and fence watching.

Furthermore, if the compositor doesn't support _NET_WM_FRAME_DRAWN,
it's possible that one frame will start before the previous frame has
made it through the pipeline, leading to a blown assertion.

This commit side-steps the unnecessary code and associated assertion
when _NET_WM_FRAME_DRAWN isn't supported.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2927
2020-07-14 14:33:12 -04:00
Florentina Mușat
38cce2bb18 Update Romanian translation 2020-07-14 14:52:19 +00:00
Matthias Clasen
9cb7002b98 Merge branch 'wip/jimmac/large-title-letterspacing' into 'master'
Adwaita: revert letter-spacing for large-title

Closes #2932

See merge request GNOME/gtk!2243
2020-07-14 11:47:36 +00:00
Yuri Chornoivan
eb9c91c0a9 Update Ukrainian translation 2020-07-14 10:33:34 +00:00
Jakub Steiner
be07153efa Adwaita: revert letter-spacing for large-title
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2932
2020-07-14 12:24:25 +02:00
Jakub Steiner
627ec82e60 Adwaita: sidebar color for file picker
- use menu like hovers and desaturated selected_bg_color

Partially addresses https://gitlab.gnome.org/GNOME/gtk/-/issues/1586
2020-07-14 11:37:29 +02:00
Matthias Clasen
ccc34ca06c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2241
2020-07-14 02:43:25 +00:00
Matthias Clasen
2b5dd0082d inspector: Show some information about expressions
This is not too useful, but better than nothing.
2020-07-13 20:49:56 -04:00
Matthias Clasen
7b36b339aa expression: Add some introspection
Add a few apis to peek inside expressions, mainly
for the benefit of GtkInspector and similar uses.
2020-07-13 20:19:07 -04:00
Matthias Clasen
b7eb663b82 gtk-demo: Make the words demo expand
We want to fill the window here.
2020-07-13 17:54:27 -04:00
Matthias Clasen
1b28353be5 inspector: Ellipsize in the object tree
We don't want a long label to blow up the width
of the inspector window.
2020-07-13 17:32:52 -04:00
Matthias Clasen
a07c030d02 inspector: Fix up input enum names
We've recently added and removed a few values in these
enumerations. Keep the names in sync, so we don't show
nonsense.
2020-07-13 17:13:43 -04:00
Matthias Clasen
339cccdf53 NEWS: Updates and fixes 2020-07-13 17:10:22 -04:00
Matthias Clasen
577126e99c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2240
2020-07-13 20:48:08 +00:00
Matthias Clasen
125ea5ee4a treeexpander: Be focusable
We need to be focusable so that we can take focus
if the child doesn't.
2020-07-13 15:06:35 -04:00
Matthias Clasen
3c5afc06d1 searchbar: Set a focus vfunc
We don't want to take focus ourselves here.
2020-07-13 15:06:08 -04:00
Matthias Clasen
f87c15f4f9 Merge branch 'wip/jimmac/file-dialog-sidebar-color' into 'master'
Adwaita: sidebar color for file picker

Closes #1586

See merge request GNOME/gtk!2238
2020-07-13 16:31:07 +00:00
Jakub Steiner
fe5c0e2fe3 Adwaita: sidebar color for file picker
- avoid using the selected blue for the sidebar

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1586
2020-07-13 17:03:55 +02:00
Matthias Clasen
c8421cfd82 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2236
2020-07-13 14:38:03 +00:00
Matthias Clasen
fbf99b8d65 Merge branch 'wip/carlosg/windowhandle-gesture-state' into 'master'
gtkwindowhandle: Only claim gesture on action

See merge request GNOME/gtk!2237
2020-07-13 14:32:06 +00:00