Commit Graph

69829 Commits

Author SHA1 Message Date
Matthias Clasen
d0fc3e166d widget-factory: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
e4ce46e75f gtk-demo: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-04-11 15:32:15 -04:00
Matthias Clasen
e2420f62fe menubutton: Propagate focus-on-click
Propagate the focus-on-click setting to the button
inside, so that setting menubuttons as !focus-on-click
works as expected. This helps for menubuttons in
header bars, where dragging on the button will otherwise
steal focus from the content.
2021-04-11 15:32:15 -04:00
Yuri Chornoivan
6712106c25 Update Ukrainian translation 2021-04-11 18:39:40 +00:00
Matthias Clasen
5b55138729 Merge branch 'matthiasc/for-master' into 'master'
some small optimizations

See merge request GNOME/gtk!3423
2021-04-11 18:23:54 +00:00
Matthias Clasen
1d9c581f10 ngl: Allow passing bounds to update_clip
update_clip only uses the bounds of the node that
we are currently passing. This opens the door to
updating the clip while handling a single node.
2021-04-11 12:54:17 -04:00
Matthias Clasen
6bfb57db16 ngl: Small optimization for shadows
When 9-slicing shadows, omit the center tile when it is
entirely contained in the outline (that is not always
the case, depending on corners and offsets).
2021-04-11 12:54:07 -04:00
Matthias Clasen
f8f2f2944f roundedrect: Speed up contains_rect and friends
gsk_rounded_rect_contains_rect was calling
gsk_rounded_rect_contains_point, which potentially
checks all four corners, for a total of up to 16
corner/point checks. But there is no need to do
more than 4 such checks to answer the question.
2021-04-11 12:52:30 -04:00
Matthias Clasen
aaf17fd3d0 ngl: Small optimization
We really want equality here.
2021-04-11 12:50:50 -04:00
Matthias Clasen
678e6fc6d6 nodeeditor: Make the help window wide enough
Make the help window wide enough to show the
tables without wrapping.
2021-04-11 12:50:34 -04:00
Matthias Clasen
fcf39170e1 Merge branch 'media-memory-leak' into 'master'
media: Fix a memory leak

See merge request GNOME/gtk!3420
2021-04-10 13:42:41 +00:00
Matthias Clasen
187072c3fa media: Fix a memory leak
This was introduced in e7dc82fa32.
2021-04-10 09:02:59 -04:00
Matthias Clasen
e6599c6c4f gsk: Don't overshadow
Reduce the cairo shadows to the same size as their GL brethren.
2021-04-09 21:47:55 -04:00
Matthias Clasen
87a8ff90d6 Merge branch 'popover-list-lockup' into 'master'
window: Defer focus setting until after paint

Closes #3725

See merge request GNOME/gtk!3417
2021-04-10 00:34:24 +00:00
Matthias Clasen
4a76abffd4 window: Defer focus setting until after paint
Commit 3dbf5038fa tried to defer focus changes
until after rendering is done. But it failed to do so, since
the toplevel ::render handler is still before rendering of
popups that are attached to that toplevel. To do this
properly, we need to do it in the AFTER_PAINT frame clock
phase.

Fixes: #3725
2021-04-09 19:44:10 -04:00
Matthias Clasen
715449695c Merge branch 'ngl-coloring-underlines' into 'master'
Optimize underlines in text

See merge request GNOME/gtk!3414
2021-04-09 15:36:21 +00:00
Matthias Clasen
d15b0afca9 Merge branch 'no-scroll-cursor' into 'master'
scrolledwindow: Stop using scroll cursors

See merge request GNOME/gtk!3416
2021-04-09 13:30:36 +00:00
Matthias Clasen
0d6bbc035d Merge branch 'ebassi/ci-docs' into 'master'
ci: Drop the split Fedora images

See merge request GNOME/gtk!3415
2021-04-09 12:35:49 +00:00
Matthias Clasen
9313d4b6b4 scrolledwindow: Stop using scroll cursors
We used to override cursor to use all-scroll while the
content is being scrolled. Unfortunately, there is several
problems with this:
- It is really only expected certain devices, and we don't
  have the device information on Wayland
- With the way cursor setting works in GTK4, non-NULL cursors
  of the content (eg the text views ibeam) win, making the
  scroll cursor not show up
- Under X11, we seem to miss scroll end events and then
  the scroll cursor gets stuck
Therefore, just remove this feature.
2021-04-09 08:26:09 -04:00
Emmanuele Bassi
ed412f43d1 ci: Drop the split Fedora images
Now that we don't need the whole of Pandoc to build our documentation,
we can go back to a single Fedora image for our CI.
2021-04-09 12:28:08 +01:00
Matthias Clasen
bfe4aea981 ngl: Add a program change counter
Count how often we change programs during a frame.
2021-04-09 00:52:18 -04:00
Matthias Clasen
0caa28c1de ngl: Optimize underlines in text
Opportunistically use the coloring program for
drawing underlines instead of the color program.
This avoids program changes in the middle of
text.

For the Emoji text scrolling benchmark, this reduces
the program changes per frame from > 1000 to around 100.
2021-04-08 23:37:51 -04:00
Matthias Clasen
d8ba4b4114 ngl: Reserve a pixel in texture atlases
This will be used for coloring from the texture.
2021-04-08 23:34:37 -04:00
Matthias Clasen
e7963945bb ngl: Fix an oversight
All the rest of debug spew goes to stderr here.
2021-04-08 23:34:37 -04:00
Matthias Clasen
e4a6101ae0 gtk-demo: Make one text scroll benchmark harder
Add underlines into the mix with the Emoji heavy
text, to see if we can optimize lines.
2021-04-08 23:34:36 -04:00
Matthias Clasen
5d0a3bd4cb Merge branch 'half-float' into 'master'
ngl: Use fp16 for colors

See merge request GNOME/gtk!3405
2021-04-09 03:34:05 +00:00
Matthias Clasen
1c2238cc2a Merge branch 'font-fallback-fix' into 'master'
wayland: Improve font setting fallback more

Closes #3838

See merge request GNOME/gtk!3412
2021-04-08 11:24:09 +00:00
Matthias Clasen
2d7169fd5f Work around compiler shortcomings on macOS
alias attributes don't work on Darwin, so
do without.
2021-04-07 22:38:47 -04:00
Matthias Clasen
885a6b8ebc gsk: Add runtime checks for F16C
Use an IFUNC resolver to determine whether we can use
intrinsics for FP16 conversion. This requires the functions
to be no longer inline.

Sadly, it turns out that __builtin_cpu_supports ("f16c")
doesn't compile on the systems where we want it to prevent
us from getting a SIGILL at runtime.
2021-04-07 22:21:23 -04:00
Matthias Clasen
9d81c129fc Add an option to disable F16C
And add a compile time check for the presence of this
CPU feature.
2021-04-07 22:21:23 -04:00
Matthias Clasen
38c6fe2ce4 Move color conversion up
Doing the color conversion early lets us reuse
the results whenever we do more than one draw
per node.
2021-04-07 21:30:43 -04:00
Matthias Clasen
7fe7b7ac7d ngl: Use a constant for (fp16)-1
No need to convert that again for every glyph.
2021-04-07 21:30:43 -04:00
Matthias Clasen
ae7f52d301 ngl: Reduce vertex storage
We only have one shader that uses the color2 attribute,
and it doesn't use the uv attribute, so save vertex
memory by putting those in the same space.

This reduce the per vertex space from 32 to 24 bytes.
2021-04-07 21:30:43 -04:00
Matthias Clasen
8b1fcb58e8 ngl: Use fp16 for colors
This reduces the size of our Vertex struct from
48 to 32 bytes. It would be nicer if we could store
the colors in fp16 format in the rendernodes, and
avoid conversion here. But this is still good.
2021-04-07 21:30:43 -04:00
Matthias Clasen
cce36ae701 wayland: Improve font setting fallback more
We may get a response from the portal that contains
no useful settings at all. In that case, we should
fallback as well.

Fixes: #3838
2021-04-07 19:24:09 -04:00
Matthias Clasen
2f0a02eecb Merge branch 'wip/carlosg/stuck-frames' into 'master'
surface: Always set PHASE_PAINT as pending when updates are scheduled

Closes #3750

See merge request GNOME/gtk!3411
2021-04-07 23:18:25 +00:00
Carlos Garnacho
07167fdf22 surface: Always set PHASE_PAINT as pending when updates are scheduled
At times (most often when closing subsurfaces that are scheduling
relayouts) the PHASE_PAINT handling gets broken with the following
sequence:

1. Surface receives wl_callback.done for the previous frame.
   Surface is thawed.
2. A new update on the surface is scheduled. PHASE_PAINT is
   requested directly on the frame clock. priv->pending_phase is
   left unset in the surface.
3. Surface gets frozen
4. Frame clock processes the update scheduled at 2. The surface
   is frozen, so paint is prevented. PHASE_PAINT is considered
   handled.
5. Compositor emits wl_callback.done again. Surface is thawed.
6. At this point the machinery is off
   - The surface didn't paint but has pending update regions
   - priv->draw_needed is set in the toplevel and other portions
     of the widget tree
   - So queueing redraws is ineffective at eventually calling
     gdk_surface_schedule_update() again on the toplevel surface.
   - We don't paint anymore, so this broken state is not flushed
     until other subsurface changes manage to schedule the missing
     update.

To fix this, always set PHASE_PAINT in priv->pending_phase when
doing gdk_surface_schedule_update(). If the frame clock turns
around before the surface is thawed, it will still be waiting to
be processed the next iteration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3750
2021-04-07 23:06:06 +02:00
Emmanuele Bassi
99c7ba7840 Install documentation in the appropriate place
We're already installing each reference into its own namespaced
directory, so we don't need to add further path elements.

Additionally, with the changes in:

  https://gitlab.gnome.org/GNOME/devhelp/-/merge_requests/20
  https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/54

we can browse the GTK API references in DevHelp.
2021-04-07 14:57:31 +01:00
Matthias Clasen
5710df685b Merge branch 'font-settings-fallback-4' into 'master'
wayland: Improve font setting fallback

See merge request GNOME/gtk!3407
2021-04-07 13:21:38 +00:00
Matthias Clasen
62f10b1b8f wayland: Improve font setting fallback
When we don't get stettings from the portal, the current
fallback is 'awful fonts'. There is no need for that. Instead,
set the fallback values to grayscale antialiasing with slight
hinting.
2021-04-07 08:50:14 -04:00
Matthias Clasen
d50d55228b Merge branch 'textview-last-line' into 'master'
textview: Fix a problem with the last line

Closes #3835

See merge request GNOME/gtk!3403
2021-04-06 16:15:55 +00:00
Matthias Clasen
288a5d4151 textview: Fix a problem with the last line
Sometimes, we missed the last line for display.

Fixes: #3835
2021-04-06 11:09:05 -04:00
Matthias Clasen
748b8497c9 Merge branch 'matthiasc/for-master' into 'master'
window: Actually enable the inspector by default

Closes #3831

See merge request GNOME/gtk!3401
2021-04-05 19:05:15 +00:00
Matthias Clasen
303ff60d5e modelbutton: Avoid a crash
We may not have a popover menu ancestor. The check for
this was forgotten in one of the branches here.

Fixes: #3831
2021-04-05 14:06:42 -04:00
Matthias Clasen
b79eb55b34 window: Actually enable the inspector by default
427d216081 changed the default in the schema,
but didn't handle cases where the schema isn't found.
2021-04-05 11:54:37 -04:00
Matthias Clasen
0ca573142a Merge branch 'matthiasc/for-master' into 'master'
textlayout: Remove some unnecessary code

See merge request GNOME/gtk!3400
2021-04-05 13:19:29 +00:00
Matthias Clasen
a1ece16143 ngl: Fix an oversight
We were special-casing 2D affine transforms,
but overlooked even simpler transforms.
2021-04-05 08:47:53 -04:00
Matthias Clasen
2e18f1b6e3 textlayout: Remove an unused function 2021-04-05 08:47:53 -04:00
Matthias Clasen
6cf712591f textlayout: Avoid allocations for line iteration
No need to collect the lines firs, and allocate memory
for that. We can just iterate over them right away.
2021-04-04 23:42:58 -04:00
Matthias Clasen
b32cd5d328 textlayout: Introduce some locals
No need to call _gtk_text_buffer_get_btree over and over.
2021-04-04 22:44:09 -04:00