Commit Graph

77215 Commits

Author SHA1 Message Date
Benjamin Otte
5c601b673e vulkan: intersect rects also for CLIP_NONE
If we don't clip anything, we stil have bounds - either the framebuffer
size or (more likely) the scissor rect. And we don't want to draw
anything that is outside these bounds.

So clip in those cases, too.

Stops gtk4-demo --run=listbox from trying to render the whole listbox
instead of only the visible parts.
2023-07-10 06:32:01 +02:00
Benjamin Otte
465a34e6b0 rendernode: Implement proper GSK_IS_RENDERNODE()
Use G_TYPE_CHECK_INSTANCE_TYPE() instead of just checking for != NULL.
After all, this is a GTypeInstance.

Also fixes some gcc complaints when checking
  node == NULL || GSK_IS_RENDERNODE (node)
which gcc was convinced would be always true.
2023-07-10 06:32:01 +02:00
Benjamin Otte
aa82a400df textbtree: Remove unnecessary check
Since a93614409e we don't allocate the
stack anymore, so this NULL check is unnecessary now - and it's flagged
by compilers.
2023-07-10 06:32:01 +02:00
Daniel Boles
4d673e9c9a theme: Don't dim text in backdropped list/listview
We have largely moved away from changing styles when :backdropped, aside
for some things in HeaderBars and Buttons. So we probably should not be
automatically dimming text in labels in list[view]s anymore either, as
that introduces differences if text happens to be in such widgets vs not
2023-07-09 09:49:25 +01:00
Matthias Clasen
1f3db35271 Merge branch 'dboles/image-notify-storage-type' into 'main'
Image—Notify when :storage-type changes from EMPTY

See merge request GNOME/gtk!6170
2023-07-07 01:15:56 +00:00
Emmanuele Bassi
18cce46ed2 Merge branch 'wip/corey/listitemleak' into 'main'
gtklistitemmanager: Stop leaking item

Closes #5940

See merge request GNOME/gtk!6171
2023-07-06 23:57:16 +00:00
Corey Berla
e78148bae5 gtklistitemmanager: Stop leaking item
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5940
2023-07-06 16:24:29 -07:00
Daniel Boles
41237509ad Image—Notify when :storage-type changes from EMPTY
PROP_STORAGE_TYPE was only notified if it was changing *to* EMPTY, in
gtk_image_clear_internal(). We did not notify when it changes *from*
EMPTY to something non-empty. We should as not doing so is confusing,
e.g. if a user wants to bind :storage-type to :visible if non-empty,
which I just did! So, in functions that apply an ImageType, now notify.

Also do so in gtk_image_set_from_definition, declared in imageprivate.h,
even though none of the function there are currently used anywhere.
(Should they be removed?)
2023-07-06 23:08:20 +01:00
Yosef Or Boczko
576e8a2090 Update Hebrew translation 2023-07-06 09:38:02 +00:00
Matthias Clasen
d0f77c1db4 Merge branch 'wip/carlosg/switch-stylus-buttons' into 'main'
gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click

Closes #5935

See merge request GNOME/gtk!6168
2023-07-05 23:38:38 +00:00
Carlos Garnacho
e28ff79bec gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click
This mapping of stylus evdev input event codes into GDK button numbers
makes gdk/wayland inconsistent with gdk/x11, so depending on the backend
the same button middle-click pastes or right-click pops up menus.

Make the wayland backend consistent with X11, so that a GNOME wayland
session gets these buttons consistently mapped across all kinds of
clients.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5935
2023-07-05 16:54:54 +02:00
Daniel Boles
dccf6b55bd GdkTexture: Don't mention private new_from_surface
The stuff about Cairo Surfaces is in gdktextureprivate.h, & so end users
will not be able to use them; we shouldn't confuse by implying they can.
2023-07-05 12:07:33 +01:00
Daniel Boles
d5ea376e7b docs/list-widget: links, DirList, correct Sections
* Add links to various symbols.
* Mention DirectoryList in the "ready-made choices available" section.
* Don't say that GridView can display headers: it makes no attempt to.
2023-07-05 12:02:08 +01:00
Matthias Clasen
40707a6af0 Merge branch 'ebassi/issue-5934' into 'main'
Lower the Python requirement

Closes #5934

See merge request GNOME/gtk!6167
2023-07-05 10:57:45 +00:00
Emmanuele Bassi
9b71c9dfc6 Do not use bleeding edge Python
The match operator was added in Python 3.10, which is a bit too new for
some downstreams.

While at it, let's fix the flake8 errors and warnings.

Fixes: #5934
2023-07-05 10:19:18 +01:00
Emmanuele Bassi
64308317f8 Add flake8 configuration file
Ignore long lines; most of our Python scripts generate code or other
types of files, which makes long lines a necessity.

We should validate all our Python script in our CI as well.
2023-07-05 10:12:20 +01:00
Daniel Boles
f920723eae AlertDialog: Remove spurious/unmatched backtick 2023-07-04 22:42:50 +01:00
Daniel Boles
c581f4c96f ListBase: Fix a typo 2023-07-04 19:44:56 +01:00
Matthias Clasen
4998c90b10 Merge branch 'update-uac-script-format' into 'main'
tools/generate-uac-manifest.py: Fix formatting (unify with copy in GLib)

See merge request GNOME/gtk!6164
2023-07-03 23:37:36 +00:00
Benjamin Otte
412b23a146 Merge branch 'wip/otte/for-main' into 'main'
gsk: Catch values < 0 before bad things happen

See merge request GNOME/gtk!6165
2023-07-03 20:40:30 +00:00
Benjamin Otte
c179013790 testsuite: Add a test for mask out of bounds effects
Inverted alpha masks have an effect on the source, even if the mask
doesn't cover the source at all - or worse, is completely clipped out.

The GL renderer handles this fine, but Cairo and Vulkan had
optimizations that got this wrong.
2023-07-03 22:02:44 +02:00
Benjamin Otte
c6eb7fd483 gsk: Fix luminance in Cairo and GL renderer
In particular, fix the combination of luminance and alpha. We want to do
  mask = luminance * alpha
and for inverted
  mask = (1.0 - luminance) * alpha
so add a test that makes sure we do that and then fix the code and
existing tests to conform to it.
2023-07-03 22:02:44 +02:00
Benjamin Otte
7c58370673 rendernode: Work around a Cairo bug
When color-matrix modifying a clear surface, the surface would remain
clear according to Cairo.

That's very unfortunate when we prepare a mask for inverted-alpha
masking.
2023-07-03 22:02:44 +02:00
Benjamin Otte
84737a5159 build: Include the right things
If we build our own targets, we need to include those.

This is only relevant when adding new shaders because meson will
complain that the (unused) sources don't exist as it tries to include
those.
And that will make the build.ninja file not be generated which would
have build those shaders and would have allowed to copy them into the
sources.

Note that this makes builds with glslc not care about all the shader
files being included with the sources, but we have CI to check that.
2023-07-03 22:02:44 +02:00
Benjamin Otte
48804c81f3 rendernode: Mask nodes with different modes are different
So treat them as such.

Fixes the node editor not updating when I edit the mask mode.
2023-07-03 22:02:44 +02:00
Benjamin Otte
c79ec355af gsk: Catch values < 0 before bad things happen
In particular, catch radius values being < 0 by return_if_fail()ing in
the rendernode creation code, and by erroring out in the rendernode
parser.

I try too much dumb stuff in the node editor.
2023-07-03 22:02:44 +02:00
Benjamin Otte
ce5d74d7df glcontext: Fix typo in Apple extension name 2023-07-03 22:02:44 +02:00
Matthias Clasen
5bcc943ec3 Post-release version bump 2023-07-03 14:56:49 -04:00
Matthias Clasen
f5d68bb586 4.11.4 2023-07-03 14:12:53 -04:00
Chun-wei Fan
6d1537647c tools/generate-uac-manifest.py: Fix formatting
As this script is now also used in GLib, unify the formatting between
GLib and GTK. Make the formatting of the script conformant to the
Black[1] tool, as GLib requires, and add a copyright header to this
script.

[1]: https://black.readthedocs.io/en/stable/, see also
$(glibsrcroot)/.gitlab-ci/run-bash.sh
2023-07-03 12:50:55 +08:00
Matthias Clasen
ae2c10996a Merge branch 'fix_atcontext_refleaks' into 'main'
a11y: Fix some GtkATContext reference leaks

See merge request GNOME/gtk!6160
2023-07-01 18:06:19 +00:00
Barnabás Pőcze
81e9de3778 a11y: Fix some GtkATContext reference leaks
`gtk_accessible_get_at_context()` is transfer-full, so the returned
reference needs to be dropped. This was missing in a couple places.
2023-07-01 16:40:11 +02:00
Chun-wei Fan
42a704fefb Merge branch 'gdk-win32-input-fixes' into 'main'
GdkWin32 input fixes

Closes #5877

See merge request GNOME/gtk!6131
2023-06-30 04:33:08 +00:00
Matthias Clasen
e57eaf16b4 Merge branch 'wip/chergert/map-as-sectionmodel' into 'main'
maplistmodel: implement GtkSectionModel

See merge request GNOME/gtk!6154
2023-06-30 01:50:07 +00:00
Matthias Clasen
9aabb0e98d Add section model tests for GtkMapListModel 2023-06-29 21:30:11 -04:00
Matthias Clasen
9590a5f45e maplistmodel: Handle the ::sections-changed signal
Wrapper section models need to listen to and pass
on the ::sections-changed signal from the underlying
model.
2023-06-29 21:29:11 -04:00
Daniel Boles
7bee50c4f6 Image: Fix missing closing backtick 2023-06-29 14:33:29 +01:00
Matthias Clasen
bad2324318 Merge branch 'dboles/gtk-demo_dnd_dark' into 'main'
gtk-demo/dnd: Fix, generalise detecting dark theme

See merge request GNOME/gtk!6157
2023-06-29 10:26:41 +00:00
Matthias Clasen
dd15accb79 Merge branch 'matthiasc/for-main' into 'main'
build: Try harder to work with nongnu ld

See merge request GNOME/gtk!6159
2023-06-28 23:31:41 +00:00
Matthias Clasen
1d1f35576a build: Try harder to work with nongnu ld
Only try to be fast with gnu ld.
2023-06-28 16:54:34 -04:00
Daniel Boles
15458b5af3 gtk-demo/dnd: Fix, generalise detecting dark theme
Our default theme is now Default, not Adwaita, & HighContrastInverse was
renamed to Default-hc. So these checks did not work anymore. Rather than
hard-coding the new names, & possibly running into the same issue again,
we can just look for the convention of appending -dark to the theme name
and/or the Settings:prefer-dark-theme prop. The latter, we can & likely
SHOULD also apply to all themes - not just ours as before. We also check
for the :dark suffix as that means the theme variant - & before checking
GtkSettings check the GTK_THEME env var, just as GtkSettings itself does
2023-06-28 14:40:06 +01:00
Matthias Clasen
5ffe9a68ed Merge branch 'matthiasc/for-main' into 'main'
build: Move objcopy checks to one place

Closes #5672

See merge request GNOME/gtk!6156
2023-06-28 12:06:49 +00:00
Matthias Clasen
f341bd563b build: Look for ld.bfd
The objcopy+ld approach to fast resource building
relies on behavior that is specific to the binutils
linker, and does not work with the llvm one.

Therefore, check for ld.bfd. We still fall back
to trying with just ld, since I'm not 100% sure
if binutils unconditionally installs ld.bfd.

Fixes: #5672
2023-06-28 07:12:07 -04:00
Matthias Clasen
70edacc68d build: Move objcopy checks to one place
We were doing the same thing in three places.
Move it to the toplevel meson.build, so we
can change it in one place.
2023-06-28 07:11:51 -04:00
Matthias Clasen
091176ae48 Updates 2023-06-28 06:47:32 -04:00
Matthias Clasen
d9cfb94a80 Merge branch 'fix_dropdown_set_expression' into 'main'
GtkDropDown: Force redisplay of the drop-down items after expression change

See merge request GNOME/gtk!6145
2023-06-28 09:57:04 +00:00
Lukáš Tyrychtr
3c7ca28f1f dropdown: Handle expression changes
The expression is used by the default factory, so we
need to track whether we are using the default factory
and recreate it if the expression changes.
2023-06-28 08:18:01 +02:00
Matthias Clasen
25e518326c Merge branch 'matthiasc/for-main' into 'main'
Plug a memory leak in gsk_render_node_serialize

See merge request GNOME/gtk!6155
2023-06-28 02:42:47 +00:00
Matthias Clasen
a853307fb7 ci: Ignore more leaks in dependencies
libxkbcommon shows up quite a bit in leak sanitizer
reports. Ignore it.
2023-06-27 22:08:22 -04:00
Matthias Clasen
0ae541671d gsk: Plug a memory leak in mask node fallback
We were forgetting to free the mask pattern.
Found by asan.
2023-06-27 21:54:15 -04:00