Commit Graph

54488 Commits

Author SHA1 Message Date
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Benjamin Otte
fc6de135fe widget: Don't keep track of clip anymore.
It's not used anywhere, so why would we need it?
2018-04-05 14:56:38 +02:00
Benjamin Otte
f1f27ce0c2 broadway: Improve error message
This error message is printed into the journal if a GTK app can't
connect to eithre Wayland or X11. Make it at least mention who is not
capable of connecting to a server.

Unrelated, we might want to improve our error reporting when a GTK app
can't start, so that debugging issues with system startup / login get
easier to resolve.
2018-04-05 14:56:38 +02:00
Benjamin Otte
a36b0f8bae widget: Don't clip widgets anymore when snapshotting
This is the first step in removing clips.

It's seperate to allow bisecting to this commit when analyzing
performance problems.
2018-04-05 14:56:38 +02:00
Benjamin Otte
4bf90633ea widget: Cache clip from creating render node
When the clip changes that is passed to a snapshot function, we need to
create eventual cached render nodes because they might not have drawn
their whole area before.

Fixes issues with redrawing when scrolling.
2018-04-05 14:56:38 +02:00
Benjamin Otte
278ab3c4de snapshot: Track clip as a rect only 2018-04-05 14:56:38 +02:00
Benjamin Otte
200bbe8fda diff: Allow aborting a diff
When the max cost for finding a path gets to high, the diff can now be
aborted.

Because render nodes have a fallback method (by just marking the whole
bounds of the nodes as different), we use this to improve performance
of diffs.

This brings fishbowl (which is basically a container node with N images
that change every frame) back to close to previous performance.
2018-04-05 14:56:38 +02:00
Benjamin Otte
144637bff1 build: Switch order of subdirectories
After fixing this once already in 5970dac167 the order was messed up
again in d50708b024.
2018-04-05 14:56:38 +02:00
Benjamin Otte
4b72ea33ac diff: Introduce GskDiffSettings
We can put lots of settings there to allow tuning the diff algorithm
used.
2018-04-05 14:56:38 +02:00
Benjamin Otte
0f184d3270 vulkan: Always render clip extents
Now that we have the full render nodes available, there is not much
benefit in fine-grained control over multiple rectangles.
In particular, it's causing pain with complex regions.

There might be a benefit in clipping to the region's rectangles in cases
like widget-factory where the whole diff is made up of the 2 rectangles
of spinner and the pulsing progress bar, but it needs a good heuristic
for where this is useful.
2018-04-05 14:56:38 +02:00
Benjamin Otte
e3a717363b snapshot: Remove clip argument from gtk_snapshot_new()
It's not used anymore. And anybody who wants to have a clip on a
newly created snapshot can achieve that using gtk_snapshot_push_clip().
2018-04-05 14:56:38 +02:00
Benjamin Otte
73650c6da2 gtk: Remove gtk_widget_queue_draw_region()
... and gtk_widget_queue_draw_area().

They don't doi anything anymore.
2018-04-05 14:56:38 +02:00
Benjamin Otte
a468714849 widget: Stop tracking invalidations
Instead of calling gdk_surface_invalidate_region(), just
gdk_surface_queue_expose() and rely on the renderer computing the diff
from the previous rendering.
2018-04-05 14:56:38 +02:00
Benjamin Otte
7e078cd940 gtk: Remove debug updates
With the soon-to-arrive automatic updates (aka computing invalid region
from render nodes), this will no longer be necessary.
2018-04-05 14:56:38 +02:00
Benjamin Otte
925cbeaadf renderer: Track the previous node
... and diff the previous node with the current one to determine the
clip region.

This doubles the work necessary to track clip regions, but the following
commits will clean that up.
2018-04-05 14:56:38 +02:00
Benjamin Otte
7c313c7b25 gsk: move begin/end_frame vfuncs into the renderers 2018-04-05 14:56:38 +02:00
Benjamin Otte
d0873c7dec gsk: Fold gsk_renderer_begin_draw_frame() into renderer
It doesn't need to be exported anymore.

As a side effect, the inspector no longer has any information about the
render region, so remove the code that was taking care of that.
2018-04-05 14:56:38 +02:00
Benjamin Otte
b19d7630ae widget: Reorder gtk_widget_render()
Now that we don't clip the created render nodes anymore, we don't have
to compute the clip region beforehand.

So snapshot the render nodes before initializing the renderer.
2018-04-05 14:56:38 +02:00
Benjamin Otte
a6079b9b7b gsk: Implement gsk_render_node_diff()
This includes a copy of the diff(1) algorithm used by git diff by Davide
Libenzi.

It's used for the common case ofcontainer nodes having only very few
changes for the few nodes of child widgets that changed (like a button
lighting up when hilighted or a spinning spinner).
2018-04-05 14:56:38 +02:00
Benjamin Otte
c0db4091cf magnifier: Redo with GtkWidgetPaintable 2018-04-05 14:56:38 +02:00
Benjamin Otte
2d10c2568c gtk: Add GtkWidgetPaintable
A GtkWidgetPaintable is a paintable that observes a given GtkWidget and
renders that widget into a paintable.
2018-04-05 14:56:38 +02:00
Benjamin Otte
29111a16d4 widget: Cache the render node
This requires a bunch of refactorings:

1. Don't pass the current clip region to gtk_widget_snapshot()
   so we don't create full widget contents
3. Have a widget->priv->draw_needed that we invalidate on every
   queue_draw() call and set on every snapshot()
2. In queue_draw(), walk the widget chain to invalidate the
   render nodes of all parents
2018-04-05 14:56:38 +02:00
Benjamin Otte
271820b677 rendernode: Add gsk_render_node_diff()
... and gsk_render_node_can_diff(). Those are vfuncs to compute a region
containing all the pixels that differ between the two nodes.

This is just the plumbing that chains into node classes. No node
implements it yet.
2018-04-05 14:56:38 +02:00
Matthias Clasen
dcdd95bbc8 font button: fix compiler warnings
A PangoLanguage is not a string.
2018-04-05 06:23:14 -04:00
Benjamin Otte
7c60f939ee Merge branch 'text-changed-delete-4' into 'master'
gtkentryaccessible: Fix text-changed::delete length

See merge request GNOME/gtk!100
2018-04-04 18:19:08 +00:00
Benjamin Otte
572a23b136 Merge branch 'textview-delete-4' into 'master'
gtktextviewaccessible: update cursor position after text suppression

See merge request GNOME/gtk!102
2018-04-04 18:18:49 +00:00
Samuel Thibault
a1f206b802 gtktextviewaccessible: update cursor position after text suppression
delete_range_cb is set to be called before the text suppression done by
the gtktextlayout (otherwise it does not work properly). But at that
point the cursor position is not yet up to date.  We thus need to move
the accessibility cursor notification to after the actual text
suppression, by using another callback.

This fixes cursor position in brltty screen reading.

(cherry picked from commit fa6994d033)
2018-04-04 18:26:55 +02:00
Samuel Thibault
8c8cb2bb12 gtkentryaccessible: Fix text-changed::delete length
The second parameter of the text-changed::delete event is to be the length,
not the end position.  This fixes spurious text removals in brltty
screen reading.

(cherry picked from commit 209f908a03)
2018-04-04 17:59:31 +02:00
Daniel Boles
67360c9d00 GLArea: Remove wrong transfer annotation on new()
Like other widgets, this returns a floating reference, so
(transfer full) is wrong. Just omit the annotation as others do,
thus implying (transfer none).

Close https://gitlab.gnome.org/GNOME/gtk/issues/156
2018-04-04 12:02:21 +01:00
Lionel Landwerlin
faceaec20a imwayland: destroy objects only if it matches our manager object
Should fix one of the crash from #129.
2018-04-03 19:11:09 +02:00
Matthias Clasen
bd9debe048 font chooser: Remove some dead code
This is leftover code from already removed debug spew.
2018-04-02 17:46:41 -04:00
Matthias Clasen
ec66c32def font button: Fix a crash
Since we are now storing the language as a PangoLanguage,
we must not free it anymore.
2018-04-02 17:45:48 -04:00
Matthias Clasen
5a68ac27cf font chooser: Make the language property writable
This is meant as an input to the font chooser.
We don't want the user to select a language, but
rather have fonts presented as they would work for
the current language. Therefore, do away with the
lang/script combo on the tweak page.
2018-04-02 13:37:53 -04:00
Chun-wei Fan
464943e5a6 gtk, demos: Fix builds without HarfBuzz and PangoFT
Really exclude the portions in the gtkfontchooserwidget.c that are built
when HarfBuzz and PangoFT2 are built, and update the Meson files to
exclude such sources as well from the main GTK SO/DLL and from the
gtk4-demo program.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:15:18 +08:00
Chun-wei Fan
bca4a78f07 testsuite/gsk/test-render-nodes.c: Avoid VLA usage
Just #define N as 5, instead of using a const int, which is not enough
to justify that as non-VLA usage.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:14:55 +08:00
Chun-wei Fan
a4c0395343 [gtk|demos/gtk-demo]/language-names.c: Fix build on non-GCC/CLang
Remove g_auto*() usage from these sources and use the traditional
g_free(), as g_auto*() are GCCisms (or CLangisms).

Also, don't include unistd.h unconditionally and stop including
langinfo.h and dirent.h, since they seem to be unused.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:13:27 +08:00
Chun-wei Fan
19ce520c2d build: Fix linking demos on Visual Studio
The demos are now built as GUI programs, which will require the presence
of WinMain() on Visual Studio builds, unless we specify the entry point.

Pass the /entry:mainCRTStartup linker flag on Visual Studio builds for
the demo programs so that they can link properly.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:11:50 +08:00
Matthias Clasen
d0e46d257c font chooser: Add examples for font features
For some font features, we can figure out affected
glyphs, and show before/after. For some others, we
hardcode typical sequences.

Still to do: figure out how to find ligatures and
show them.
2018-04-01 19:36:54 -04:00
Matthias Clasen
63a7d99d25 widget-factory: Enable all details in the font chooser
We want to see this here.
2018-04-01 19:36:54 -04:00
Piotr Drąg
1764673cff Update POTFILES.in 2018-04-01 15:00:07 +02:00
Руслан Ижбулатов
9e76a6055a W32: Link GTK to pangowin32
Needed for pango_win32_font_logfont() from gtkimcontextime.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-01 10:35:02 +00:00
LRN
eec0bd2fa9 Merge branch 'lrn/issue-147' into 'master'
Fix cursor handling in GTK4 on W32

Closes #147

See merge request GNOME/gtk!92
2018-04-01 10:33:43 +00:00
Rico Tzschichholz
f2937f8c45 Fix some g-i annotation warnings 2018-04-01 09:15:08 +02:00
Matthias Clasen
6b3091856b Enable variations and features for font explorer 2018-03-31 21:31:11 -04:00
Matthias Clasen
ad814509a4 font chooser: Align level value names
In the backport, I used the plural for variations, and that
is a better name, so use it here too.
2018-03-31 21:02:51 -04:00
Matthias Clasen
17693a2820 font chooser: Align property defaults
Set the default font chooser level to the same value we use
in the backports, to preserve font chooser behavior.
2018-03-31 21:02:51 -04:00
Matthias Clasen
8fb30a6a7b Font chooser: Hide tweak button sometimes
When there is no chance of tweaking anything, don't
show a tweak button.
2018-03-31 21:02:51 -04:00
Matthias Clasen
d15a29c876 Defeat compiler optimization
We always want to call both update functions here, and
the compiler unhelpfully optimizes out the second call
if the first one returns TRUE.
2018-03-31 21:02:51 -04:00
Timm Bäder
0f28f0ee39 GskRenderer: Remove outdated documentation comment
All render node trees are immutable
2018-03-31 14:45:03 +02:00
Timm Bäder
d9136fb944 snapshot: Plug memory leak when collecting rounded clip nodes 2018-03-31 14:45:03 +02:00