Commit Graph

68525 Commits

Author SHA1 Message Date
Christian Hergert
6fab195643 gsk: move transform structure to private.h
This allows using the category without having to call a function from the
hot paths of the renderer.
2021-02-10 16:14:59 -08:00
Matthias Clasen
6c85a4b2f5 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3177
2021-02-10 13:55:50 +00:00
Matthias Clasen
befc2c3ed6 iconbrowser: Use the right icon
We have an app icon, lets use it.
2021-02-10 08:04:11 -05:00
Matthias Clasen
62788d5b0d print-editor: Use the non-devel icon
We are no longer a nightly print editor.
2021-02-10 07:52:29 -05:00
Matthias Clasen
3c91a2b0a8 node-editor: Use the non-devel icon
We're now a respectable, stable node editor.
2021-02-10 07:44:59 -05:00
Matthias Clasen
d3096f079f Merge branch 'fix-clipped-texture' into 'master'
gl: Fixed clipped offscreen rendering

Closes #3651

See merge request GNOME/gtk!3175
2021-02-10 05:15:14 +00:00
Matthias Clasen
dff2aa20ff gl: Fixed clipped offscreen rendering
When we are rendering a texture node to an offscreen,
and we have a clip, we must force the offscreen rendering.
Otherwise, the code will notice: Hey, it already is a texture
node, so no need to render it to a texture again. But when
clipping is involved, that is exactly what we want to do.

Testcase included.

Fixes: #3651
2021-02-09 22:43:15 -05:00
Matthias Clasen
dae42c8f55 Merge branch 'wip/chergert/fix-maximized-shadows' into 'master'
adwaita: disable shadows when window is maximized or fullscreen

See merge request GNOME/gtk!3173
2021-02-09 23:16:49 +00:00
Jakub Steiner
da64856f37 Adwaita: don't cast shadows for halt-tiled windows
- while the case of a single half tiled window casting shadow is valid,
  the main use case for half tiled windows is when they have a neighbor.
  The :backdrop should be enough of a focus indicator and we avoid shadow
  casting on neighbors that are on the same Z level.
2021-02-09 18:57:31 +01:00
Christian Hergert
461fe36707 adwaita: disable shadows when window is maximized or fullscreen
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-09 09:27:22 -08:00
Matthias Clasen
4ce071721f Merge branch 'win32-drop-formats-leak' into 'master'
win32: Fix some leaks

See merge request GNOME/gtk!3167
2021-02-09 12:27:35 +00:00
Matthias Clasen
3cdfb779c7 Merge branch 'wip/chergert/fix-bgr8-uploads' into 'master'
gl: handle B8G8R8 texture data when uploading

See merge request GNOME/gtk!3171
2021-02-09 12:11:49 +00:00
Christian Hergert
3a43663630 gl: handle B8G8R8 texture data when uploading
We do not need to translate this on the CPU when we can instead push it
to the GPU in the same format and allow it to swizzle.

This fixes a huge number of memory allocations found while uploading the
GTK animation in widget-factory.
2021-02-08 15:32:12 -08:00
Matthias Clasen
360a66e945 Merge branch 'wip/chergert/macos-perf-fixes' into 'master'
macos: various OpenGL performance fixes

See merge request GNOME/gtk!3170
2021-02-08 20:30:27 +00:00
Christian Hergert
13e162c404 macos: improve use of swap rectangles with OpenGL 2021-02-08 11:30:11 -08:00
Christian Hergert
65296228d7 macos: only flush when not attached
This makes it so we only flush the context for the NSView, not the context
that is the center of our center of the GL context spokes.
2021-02-08 11:30:05 -08:00
Christian Hergert
443d199868 macos: mark region as unlikely 2021-02-08 11:29:56 -08:00
Christian Hergert
86c5f2df6e gsk: make gsk_render_node_get_node_type() use const
There isn't any state to modify in the type so we can use const here.
Doing so allows some of the renderer code to use const across a
number of functions so that repeated calls are elided if inlined.
2021-02-08 11:29:43 -08:00
Christian Hergert
09b447a9e1 gsk: make render node getters pure
These do not do modify anything so they can be marked as pure to
potentially ellide calls. Since they do dereference, I do not believe
we can make them const although that is unclear since we could technically
just return a pointer + offset. Therefore it *might* be possible to also
make these G_GNUC_CONST.
2021-02-08 11:29:39 -08:00
Christian Hergert
161ddcfa92 gsk: make render node getters const
This also removes the return if fail macros from these as a good portion
of them didn't have them anyway. I think it's fair to say that access to
these incorrectly is a programmer error.

It significantly reduces the amount of code generated into generally a
movss,ret.
2021-02-08 11:29:36 -08:00
Christian Hergert
226dc49602 profiler: allow using gdk profiler functions without braces
Just compiling these out means you have to write code slightly differently
so that you don't end up with "if ();" afterwards.

This adds a "do {} while (0)" so that we're still semantically a statement
but will also compile out.
2021-02-08 11:29:32 -08:00
Matthias Clasen
207569c4ed Merge branch 'wip/exalm/headerbar' into 'master'
headerbar: Don't use gtk_widget_unparent() with GtkBox

See merge request GNOME/gtk!3169
2021-02-08 15:38:48 +00:00
Alexander Mikhaylenko
cf61d96188 headerbar: Null-check boxes when removing window controls
Prevent a crash when show-title-buttons value changes to FALSE during
destruction.
2021-02-08 18:46:35 +05:00
Alexander Mikhaylenko
319755662f headerbar: Don't use gtk_widget_unparent() with GtkBox
gtk_widget_unparent() is for widget implementations, it's not supposed to
be used from outside.
2021-02-08 18:46:27 +05:00
Matthias Clasen
055cd9aaad Merge branch 'printing-temporary-queues-gtk4' into 'master'
printing: Create temporary queues for Avahi printers

See merge request GNOME/gtk!3160
2021-02-07 16:13:46 +00:00
Matthias Clasen
15697d5c0c Merge branch 'focus' into 'master'
listbox: Fix handling of non-focusable rows

Closes #3633

See merge request GNOME/gtk!3152
2021-02-07 15:57:11 +00:00
Matthias Clasen
0cd2d01f3f Merge branch 'fix-x11-drop' into 'master'
x11: More dnd fixes

Closes #3654

See merge request GNOME/gtk!3166
2021-02-07 14:52:24 +00:00
Matthias Clasen
67877e403f win32: Fix some leaks
My reading of the code is that gdk_drop_new() is not
consuming the content formats it is given, so the caller
must not pass a new reference.

Needs testing on Windows.
2021-02-07 09:41:34 -05:00
Matthias Clasen
0bce63e3ab x11: More dnd fixes
Whenever we communicate targets, we need to the union, otherwise
we don't tell the other side about our serialization. This makes
drops of images from gtk4-icon-browser to gimp and libreoffice
succeed in transferring data.

Fixes: #3654
2021-02-07 09:03:22 -05:00
Matthias Clasen
6396bf6d89 Merge branch 'fix-x11-drop' into 'master'
Fix x11 drop

Closes #3652

See merge request GNOME/gtk!3165
2021-02-07 06:52:45 +00:00
Matthias Clasen
5b45f267d6 x11: Pass mimetypes when creating output stream
When creating the output stream for a drop, we must
pass the mimetypes we support, otherwise the picking
of the right handler does not work.

Fixes: #3652
2021-02-07 01:32:39 -05:00
Matthias Clasen
f26f15fced x11: Fix a memory leak
We ref the content formats here, so we better unref it
when done.
2021-02-07 01:31:40 -05:00
Matthias Clasen
a37044f36c x11: Some code cleanups
Fix some glaring misindentation.
2021-02-07 01:30:50 -05:00
Matthias Clasen
e8c8be8e37 Merge branch 'matthiasc/for-master' into 'master'
Implement drop-shadow css filter

See merge request GNOME/gtk!3163
2021-02-06 22:35:23 +00:00
Matthias Clasen
bfc80c32ea Add tests for the css filter property
Test that we can parse filters and that we
don't accept invalid filters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
5f48764ac8 cssfiltervalue: Reject invalid filters
The Filter Effects Spec doesn't allow negative values
for most of the filter parameters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
cc6fcbfc09 cssfiltervalue: Fix blur filter interpretation
According to https://www.w3.org/TR/filter-effects-1/,
the length passed to blur() is the standard deviation,
and according to https://www.w3.org/TR/css-backgrounds-3/#shadow-blur
the blur radius is twice the standard deviation.
2021-02-06 16:16:44 -05:00
Matthias Clasen
ea7185bdb1 cssfiltervalue: Implement drop-shadows
We have all the pieces, so this is surprisingly easy.
2021-02-06 16:16:43 -05:00
Matthias Clasen
429dfcf483 cssshadowvalue: Add a 'filter mode'
Shadow values created by gtk_css_shadow_value_new_filter or
gtk_css_shadow_value_parse_filter interpret their radius value
as standard deviation. Add a flag for this mode, and use it
where necessary.
2021-02-06 16:10:34 -05:00
Matthias Clasen
be3f352b59 cssshadowvalue: Add a parsing function
Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
2021-02-06 16:10:32 -05:00
Matthias Clasen
5b8896f1db cssshadowvalue: Add gtk_css_shadow_value_pop_snapshot
This is the counterpart ot gtk_css_shadow_value_push_snapshot.

To make this easy, move the determination whether we need a
shadow out of the push function and save it.
2021-02-06 16:09:21 -05:00
Matthias Clasen
4e27de7df9 cssshadowvalue: Drop the underscore
Rename _gtk_css_shadow_value_parse to drop the underscore.
It was the only underscore-prefixed function in this file.
2021-02-06 16:08:19 -05:00
Marek Černocký
2712f536c2 Updated Czech translation 2021-02-06 09:44:09 +01:00
Matthias Clasen
a1f7073ff5 Add tests for the css filter property
Test that we can parse filters.
2021-02-05 21:37:47 -05:00
Matthias Clasen
9770872d12 css: Implement the drop-shadow filter
We have all the pieces, so this is surprisingly easy.
2021-02-05 21:37:14 -05:00
Matthias Clasen
de24b4f91b cssshadowvalue: Add a parsing function
Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
2021-02-05 21:36:22 -05:00
Matthias Clasen
650fd9c291 Merge branch 'module-ext' into 'master'
meson: use correct module file extension on macOS

Closes #3645

See merge request GNOME/gtk!3162
2021-02-06 01:15:09 +00:00
David Lechner
b509809f34 meson: use correct module file extension on macOS
GModule requires the .so file extension on macOS for historic reasons.
However Meson defaults to .dylib for modules, so we need to override
it to get the correct extension.

Fixes #3645.
2021-02-05 16:54:28 -06:00
Marek Kasik
a93ab37ea9 printing: Show all Avahi advertised printers
This commit unsubscribes CUPS backend from a DBus
signal in idle when listening for new items on Avahi.

Since GDBus emits gathered signals in idle while
checking whether the signal has been unsubscribed
it could happen that a signal was not processed
because it was removed from hash table of
subscribed signals.
This caused the situation where printers advertised
on Avahi were not listed in CUPS backend sometimes.

We need those signals since this happens when switching
from a general subscription which listens to signals
for all Avahi services to a specific one which listens
to just _ipp._tcp and _ipps._tcp (chicken and egg problem).
2021-02-05 18:35:56 +01:00
Marek Kasik
5d7364960a printing: Create temporary queues for Avahi printers
This change extends set of Avahi advertised printers which
works with Gtk's CUPS print backend.

It creates a temporary queue (local printer) for each
Avahi printer in CUPS instead of accessing them directly
(via CUPS library).

This makes some printers work which did not work before and
also gives users more options to change in the print dialog.

This also changes naming of printers to be in accordance with CUPS.
It uses '_' instead of '-' and has hostname appended for CUPS remote
printers.
2021-02-05 18:35:56 +01:00