Benjamin Otte [Tue, 17 Apr 2018 21:05:41 +0000 (23:05 +0200)]
wayland: Rewrite Cairo rendering
Also, split it into its own file - which was the original reason for
looking at this code, the rewrite was an unintentional side effect.
This changes the context to create surfaces on demand.
So whenever the compositor holds onto a surface while GDK wants to
render, it just creates a new surface. If the compositor releases
surfaces, we will retain one for the next frame to be rendered, but free
all extra ones.
This way, we should get to a stage where we have exactly as many
surfaces as needed and never allocate/free any.
Benjamin Otte [Sat, 14 Apr 2018 00:29:23 +0000 (02:29 +0200)]
x11: Move implementation of Cairo context backends
Also, don't implement SurfaceClass.ref_cairo_surface() anymore. This
means calls to it will crash now. But as they only happen in the generic
GdkCairoContext implementation, we shouldn't be affected by that.
Plus, once all backends have been ported, that call is going away
anyway.
Benjamin Otte [Sun, 15 Apr 2018 16:42:23 +0000 (18:42 +0200)]
surface: Merge function into only caller
Benjamin Otte [Sat, 14 Apr 2018 20:45:33 +0000 (22:45 +0200)]
gdk: Remove GDK_DEBUG=cairo-image
This is the default now - at least until cairo rendering gets split
into backends.
Benjamin Otte [Sat, 14 Apr 2018 20:35:46 +0000 (22:35 +0200)]
surface: Fold function into only user
Benjamin Otte [Sat, 14 Apr 2018 00:17:47 +0000 (02:17 +0200)]
cairocontext: Turn cairo_create() function into a vfunc
Benjamin Otte [Sat, 14 Apr 2018 00:10:36 +0000 (02:10 +0200)]
gdk: Remove unused GL setting
Benjamin Otte [Thu, 12 Apr 2018 14:48:31 +0000 (16:48 +0200)]
gdk: Add Cairo context implementations for all backends
And make the GdkCairoContext as abstract.
The idea of this and thje following commits is to get rid of all
Cairo code in gdksurface.c (and $backend/gdksurface-$backend.c)
by moving that code into the Cairo context files.
In particular, the GdkSurfaceClass.begin_frame/end_frame()
functions (which are currently exclusively used by the Cairo code
should end up being moved to GdkDrawContextClass.begin/end_frame().
This has multiple benefits:
1. It unifies code between the different drawing contexts.
GL lives in GLContext, Vulkan in VulkanContext and Cairo in
CairoContext. In turn, this makes it way easier to reason about
what's going on in surface-specific code. Currently pretty much
all backends do things wrong when they want to sync to drawing
or to the frame clock.
2. It makes the API of GdkSurface smaller. No drawing code (apart
from creating the contexts) needs to remain.
3. It confines Cairo to the Drawcontext, thereby making it way
more obvious when backends are still using it in situations
where it may now conflict with OpenGL (like when doing the dnd
failed animation or in the APIs that I'm removing in this
branch).
4. We have 2 very different types of Cairo contexts: The X/win32
model, where we have a natively supported Cairo backend but do
double buffering ourselves and use similar surfaces and the
Wayland/Broadway model where we use image surfaces without any
Cairo backend support and have to submit the buffers manually.
By not sharing code between those 2 versions, we can make the
actual code way smaller. We also get around the need to create
1x1 image surfaces in the Wayland backend where we pretend
there's a native Cairo surface.
Benjamin Otte [Thu, 12 Apr 2018 00:10:22 +0000 (02:10 +0200)]
cairocontext: Move a function
A function of GdkDrawingContext is only used when drawing with Cairo, so
move it to GdkCairoContext.
Benjamin Otte [Wed, 11 Apr 2018 22:32:53 +0000 (00:32 +0200)]
gdk: Move Cairo code from surface to CairoContext
This just moves code, no actual changes to functionality are happening.
Benjamin Otte [Wed, 11 Apr 2018 22:16:43 +0000 (00:16 +0200)]
gdk: Add GdkCairoContext
This does nothing but disallow passing NULL to gdk_surface_begin_paint()
and instead require this context.
The ultimate goal is to split out Cairo drawing into its own source file
so it doesn't clutter up the generic rendering path.
Benjamin Otte [Tue, 24 Apr 2018 19:32:36 +0000 (21:32 +0200)]
gtk-demo: Merge widgetbowl into fishbowl
Benjamin Otte [Tue, 24 Apr 2018 18:32:57 +0000 (20:32 +0200)]
demo: Clean up GtkFishbowl widget
1. Remove set_icons property
2. Make it a GtkWidget subclass
3. Add gtk_fishbowl_set_creation_func()
4. Make the widgetbowl use the new benchmarking infrastructure of the
fishbowl
Benjamin Otte [Tue, 24 Apr 2018 17:04:44 +0000 (19:04 +0200)]
demo: Move benchmarking implementation to fishbowl widget
Kristjan SCHMIDT [Tue, 24 Apr 2018 19:17:30 +0000 (19:17 +0000)]
Update Esperanto translation
Daniel Boles [Tue, 24 Apr 2018 12:40:02 +0000 (13:40 +0100)]
testentrycompletion: Use the model we already got
cherry-pick of gtk-3-22 commit
af350b20b1c396ec55ca6a71eab23fdca6ffb784
Stas Solovey [Tue, 24 Apr 2018 10:32:36 +0000 (10:32 +0000)]
Update Russian translation
Benjamin Otte [Tue, 24 Apr 2018 02:02:55 +0000 (04:02 +0200)]
snapshot: Get rid of record_nodes flag
Instead, use GTK_DEBUG=snapshot for it.
Benjamin Otte [Tue, 24 Apr 2018 01:46:44 +0000 (03:46 +0200)]
rendernode: Remove gsk_render_node_set_name()
And of course, gsk_render_node_get_name() is gone, too.
The replacement is of course debug nodes.
As a side effect, GskRenderNode is now *really* immutable.
Benjamin Otte [Tue, 24 Apr 2018 01:17:23 +0000 (03:17 +0200)]
snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
Benjamin Otte [Mon, 23 Apr 2018 22:41:48 +0000 (00:41 +0200)]
gsk: Add GskDebugNode
Matthias Clasen [Tue, 24 Apr 2018 00:38:20 +0000 (00:38 +0000)]
Merge branch 'wip/matthiasc/emoji-picker' into 'master'
Wip/matthiasc/emoji picker
See merge request GNOME/gtk!115
Matthias Clasen [Mon, 23 Apr 2018 04:29:21 +0000 (00:29 -0400)]
Drop Ctrl-Shift-e support
Now that we have Emoji completion, drop the rather limited
Ctrl-Shift-e support in GtkIMContextSimple, and leave this
sequence to input methods.
Matthias Clasen [Tue, 15 Aug 2017 21:35:03 +0000 (17:35 -0400)]
widget-factory: add emoji completion to an entry
Matthias Clasen [Sat, 19 Aug 2017 18:08:15 +0000 (14:08 -0400)]
entry: Add emoji completion
Pop up completions when the text in the entry matches :word:
This functionality has to be enabled using the enable-emoji-completion
property.
Matthias Clasen [Sat, 19 Aug 2017 18:06:47 +0000 (14:06 -0400)]
Add an emoji completion popup
This widget provides entry completion-like functionality
for Emoji codes like :grin: or :kiss:.
Matthias Clasen [Sat, 19 Aug 2017 18:07:59 +0000 (14:07 -0400)]
Export some entry functions privately
This will be used in the following commits.
Emmanuele Bassi [Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)]
wayland: Allow a NULL inhibitors hash table
The shortcuts inhibitors hash table is created when we create a
GdkWaylandWindow implementation for a GdkWindow, and it's destroyed once
we finalize the instance. The fake "root" window we create for the
Wayland display does not have a backing native window, so the shortcuts
inhibitors hash table is set to NULL; this causes a critical error
message when calling g_hash_table_destroy() on it. The finalization of
the root window happens when we close a display connection.
We should use g_clear_pointer(), instead, as it's NULL safe.
Without this change, the displayclose test fails, as all warnings are
considered fatal.
Ting-Wei Lan [Sun, 22 Apr 2018 13:51:36 +0000 (21:51 +0800)]
gtk-demo, testgtk: Don't pass an integer to fabs
It looks like a mistake which compilers are likely to warn.
Ting-Wei Lan [Sun, 22 Apr 2018 13:48:35 +0000 (21:48 +0800)]
imcontextxim: Don't assign a variable to itself
This causes clang to show warnings.
Ting-Wei Lan [Sun, 22 Apr 2018 13:45:19 +0000 (21:45 +0800)]
Fix header guards
They were found by clang.
Ting-Wei Lan [Sun, 22 Apr 2018 13:42:03 +0000 (21:42 +0800)]
build: Use cc.links to check linker arguments
Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.
Ting-Wei Lan [Sun, 22 Apr 2018 12:47:32 +0000 (20:47 +0800)]
build: Make the default setting work on non-Linux Unix-like systems
All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.
However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.
This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.
Daniel Mustieles [Mon, 23 Apr 2018 14:18:20 +0000 (14:18 +0000)]
Update Spanish translation
Emmanuele Bassi [Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)]
wayland: Allow a NULL inhibitors hash table
The shortcuts inhibitors hash table is created when we create a
GdkWaylandWindow implementation for a GdkWindow, and it's destroyed once
we finalize the instance. The fake "root" window we create for the
Wayland display does not have a backing native window, so the shortcuts
inhibitors hash table is set to NULL; this causes a critical error
message when calling g_hash_table_destroy() on it. The finalization of
the root window happens when we close a display connection.
We should use g_clear_pointer(), instead, as it's NULL safe.
Without this change, the displayclose test fails, as all warnings are
considered fatal.
Matthias Clasen [Mon, 23 Apr 2018 02:40:00 +0000 (02:40 +0000)]
Merge branch 'wip/lantw/improve-freebsd-build-and-fix-warnings' into 'master'
Improve meson.build for FreeBSD and reduce the number of warnings during compilation
See merge request GNOME/gtk!123
Daniel Boles [Sun, 22 Apr 2018 22:12:18 +0000 (23:12 +0100)]
Widget: Add missing space in new warning
Daniel Boles [Sun, 22 Apr 2018 21:20:57 +0000 (22:20 +0100)]
themes: Fix a new comment
bah.
Daniel Boles [Sun, 22 Apr 2018 20:45:18 +0000 (21:45 +0100)]
themes: Fix swapped borders on RTL PathBar buttons
.linked assumes the container is a GtkBox, which is documented as never
flipping children in RTL, so :first-child is always the left child, etc.
GtkBox does that by reordering its CSS nodes when the direction changes.
But most widgets don’t do that, so :first|last-child are 1st/last ADDED
and swap sides in RTL. GtkPathBar is so, and ignoring that in our themes
meant that in RTL, its left/right buttons got each other’s borders. Yuk!
This patch adds the groundwork for supporting widgets like that, via the
%linked_flippable placeholder, and applies that to override buttons in
filechooser .path-bar.linked > button
so that the correct borders get applied to those buttons when using RTL.
Note that I select only PathBars within a FileChooser because we also
have NautilusPathBar, which also uses widget.path-bar – but *does* flip
its nodes for RTL already, so letting that get affected broke it again!
https://bugzilla.gnome.org/show_bug.cgi?id=772817
Daniel Boles [Sun, 22 Apr 2018 20:22:45 +0000 (21:22 +0100)]
CheckMenuItem: Fix insert_after|before() here too
See the previous commit.
There may be other cases of these being swapped by Gadget conversions,
but hopefully someone else will find and fix those before I have to…
Close https://gitlab.gnome.org/GNOME/gtk/issues/200
Daniel Boles [Sun, 22 Apr 2018 20:17:29 +0000 (21:17 +0100)]
MenuItem: Fix broken args to insert_before|after()
The widget & its parent were swapped to each other’s place in the calls.
https://gitlab.gnome.org/GNOME/gtk/issues/200
Daniel Boles [Sun, 22 Apr 2018 20:17:24 +0000 (21:17 +0100)]
Widget: Show widget name/addrs if fail to reparent
so we can more easily get an idea of where the problematic code is
https://gitlab.gnome.org/GNOME/gtk/issues/200
Daniel Boles [Sun, 22 Apr 2018 20:07:50 +0000 (21:07 +0100)]
Widget: Trivially fix arg name in non-doc comment
Daniel Boles [Sun, 22 Apr 2018 15:25:54 +0000 (16:25 +0100)]
MenuButton: popover connects to menu_deactivate_cb
This was missed (even before my recent patches).
https://gitlab.gnome.org/GNOME/gtk/issues/199
Daniel Boles [Sun, 22 Apr 2018 15:25:07 +0000 (16:25 +0100)]
MenuButton: Disconnect newly added signal handler
Otherwise, we do stuff we shouldn't, as the failing pipeline showed:
https://gitlab.gnome.org/GNOME/gtk/pipelines/9431
https://gitlab.gnome.org/GNOME/gtk/issues/199
Daniel Boles [Sun, 22 Apr 2018 15:02:55 +0000 (16:02 +0100)]
MenuButton: Clarify NULL popup/over/menu/model doc
Daniel Boles [Sun, 22 Apr 2018 13:52:27 +0000 (14:52 +0100)]
MenuButton: Drop ref to Popover on its ::destroy
Otherwise, if the Popover is destroyed before the MenuButton, the latter
still had a non-NULL but invalid instance and tried to use it in dispose
Close https://gitlab.gnome.org/GNOME/gtk/issues/199
Daniel Boles [Wed, 18 Apr 2018 23:50:50 +0000 (00:50 +0100)]
Entry: Show optional style classes in node diagram
Juan Pablo Ugarte [Thu, 19 Oct 2017 18:16:43 +0000 (15:16 -0300)]
a11y/ScrolledWin|IconView: Connect signals safely
Use g_signal_connect_data() instead of g_signal_connect_object()
to make sure the callback gets disconnected when the data object
is destroyed. This avoids problems in garbage-collected bindings.
https://bugzilla.gnome.org/show_bug.cgi?id=789215
Piotr Drąg [Sun, 22 Apr 2018 14:13:56 +0000 (16:13 +0200)]
Update Polish translation
Ting-Wei Lan [Sun, 22 Apr 2018 13:51:36 +0000 (21:51 +0800)]
gtk-demo, testgtk: Don't pass an integer to fabs
It looks like a mistake which compilers are likely to warn.
Ting-Wei Lan [Sun, 22 Apr 2018 13:48:35 +0000 (21:48 +0800)]
imcontextxim: Don't assign a variable to itself
This causes clang to show warnings.
Ting-Wei Lan [Sun, 22 Apr 2018 13:45:19 +0000 (21:45 +0800)]
Fix header guards
They were found by clang.
Ting-Wei Lan [Sun, 22 Apr 2018 13:42:03 +0000 (21:42 +0800)]
build: Use cc.links to check linker arguments
Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.
Ting-Wei Lan [Sun, 22 Apr 2018 12:47:32 +0000 (20:47 +0800)]
build: Make the default setting work on non-Linux Unix-like systems
All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.
However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.
This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.
Benjamin Otte [Sun, 22 Apr 2018 00:46:00 +0000 (02:46 +0200)]
widget: Position changes don't require a redraw
Well, they don't require a redraw of the widget, because the widget
itself didn't change.
They require a redraw of the parent, because that now displays the
widget in a different position.
And this means we can keep the cache of the widget's render node.
My fishbowl numbers are through the roof^W water surface. Vulkan gets
4000 now.
Benjamin Otte [Sun, 22 Apr 2018 00:45:11 +0000 (02:45 +0200)]
demo: Don't add more icons all the time
If adding new icons takes longer than a second, the frame clock should
run before we add even more icons...
Timm Bäder [Sat, 21 Apr 2018 17:30:12 +0000 (19:30 +0200)]
build: Remove 'name' kwarg from has_function calls
They cause warnings with later meson versions.
Timm Bäder [Sat, 21 Apr 2018 17:24:25 +0000 (19:24 +0200)]
build: Fix copy/paste error
Timm Bäder [Sat, 21 Apr 2018 17:18:20 +0000 (19:18 +0200)]
Always use #ifdef for G_ENABLE_DEBUG
Release builds don't define it to 0, they just don't define it. Avoid
the compilation warning we get otherwise.
Timm Bäder [Sat, 21 Apr 2018 17:01:06 +0000 (19:01 +0200)]
sizerequestcache: Directly initialize some locals
Declaring them and initializing them in the same block of code without
an empty line in between is really just confusing.
Timm Bäder [Sat, 21 Apr 2018 15:04:41 +0000 (17:04 +0200)]
Use inlined gtk_widget_get_display version in a few places
We can safely do this whenever we already made sure that the given
pointer is a valid GtkWidget.
Timm Bäder [Sat, 21 Apr 2018 15:03:31 +0000 (17:03 +0200)]
widget: Add static inline version of gtk_widget_display()
Due to the few type checks in gtk_widget_get_display(), it was the
slowest part of a call to gtk_widget_query_size_for_orientation if the
in case of a cache hit.
Timm Bäder [Sat, 21 Apr 2018 13:45:47 +0000 (15:45 +0200)]
textview: Remove handling_key_event flag
It's not used anymore.
Timm Bäder [Sat, 21 Apr 2018 09:20:15 +0000 (11:20 +0200)]
gsk: Make gsk_text_node_new_with_bounds private
We pulled out the bounds calculation for performance reasons, but the
caller can't know how to properly compute them. Inside gtk+, we can do
that but it's not good enough for public API.
Timm Bäder [Sat, 21 Apr 2018 08:13:16 +0000 (10:13 +0200)]
gl renderer: Rename texture_id parameter to fbo_id
So this makes sense again.
Timm Bäder [Sat, 21 Apr 2018 08:05:39 +0000 (10:05 +0200)]
widget: Use get_instance_private more often
To be more consistent with newer code. We can also save a few lines here
and there by pulling the priv initialization before the precondition
checks.
Timm Bäder [Sat, 21 Apr 2018 07:33:48 +0000 (09:33 +0200)]
sizerequestcache: Constify some locals
Make it clear that we only use them for lookups here.
Timm Bäder [Sat, 21 Apr 2018 07:22:59 +0000 (09:22 +0200)]
sizerequestcache: Use int instead of gint
Timm Bäder [Sat, 21 Apr 2018 07:14:48 +0000 (09:14 +0200)]
sizerequest: Pull locals in closest scope
Timm Bäder [Fri, 20 Apr 2018 18:35:00 +0000 (20:35 +0200)]
snapshot: Fix some documentation problems
Timm Bäder [Sun, 15 Apr 2018 19:16:12 +0000 (21:16 +0200)]
viewport: Remove useless import
Just a debugging remnant
Timm Bäder [Sun, 15 Apr 2018 18:57:58 +0000 (20:57 +0200)]
viewport: Remove outdated comment
Timm Bäder [Sun, 15 Apr 2018 16:20:52 +0000 (18:20 +0200)]
gl renderer: Fix fallback node scaling
Matthias Clasen [Fri, 20 Apr 2018 21:37:13 +0000 (21:37 +0000)]
Merge branch 'print-deserialize' into 'master'
printing: Be more careful when deserializing
See merge request GNOME/gtk!121
Matthias Clasen [Fri, 20 Apr 2018 20:56:28 +0000 (16:56 -0400)]
printing: Be more careful when deserializing
The GVariant we are getting here might not be coming
from GTK+, but rather from some other source. Best to
be forgiving and deal with missing data without crashing.
This was causing the GTK+ portal backends to crash on
print requests from Qt.
Daniel Mustieles [Fri, 20 Apr 2018 09:42:22 +0000 (11:42 +0200)]
Updated Spanish translation
Daniel Mustieles [Thu, 19 Apr 2018 14:13:15 +0000 (16:13 +0200)]
Revert "Update Spanish translation"
This reverts commit
8570d33e08a72abf9004a92784663a3aeba86c00.
Marco Trevisan (Treviño) [Thu, 19 Apr 2018 01:58:57 +0000 (20:58 -0500)]
stack: protect set_visible_child_name from NULL stack
Return with error if gtk_stack_set_visible_child_name is called
with NULL parameter
(cherry picked from commit
2ee5aee4a9f01cce3dda7dff877070b62c3e2880)
Emmanuele Bassi [Thu, 19 Apr 2018 08:24:49 +0000 (08:24 +0000)]
Merge branch 'gtkplacesview-finalization-fixes-master' into 'master'
Gtkplacesview finalization fixes
See merge request GNOME/gtk!119
Marco Trevisan (Treviño) [Thu, 19 Apr 2018 07:47:30 +0000 (02:47 -0500)]
gtkplacesview: disconnect from server list monitor changes on destroy
It might happen otherwise that a change is recorded in between the
widget dispose and finalization, causing a crash when setting
the visible name for the GtkStack (as that will be NULL at that point)
Marco Trevisan (Treviño) [Thu, 19 Apr 2018 07:46:40 +0000 (02:46 -0500)]
gtkplacesview: unset entry_pulse_timeout_id before removing it
Fixes a warning on widget finalize, when trying to remove an invalid
source.
Daniel Boles [Wed, 18 Apr 2018 21:57:02 +0000 (22:57 +0100)]
Scale: Document new optional classes on value node
Daniel Boles [Mon, 1 Jan 2018 14:31:56 +0000 (14:31 +0000)]
Range: Make down/up keys act like down/up scrolls
Before now, down/up keys on H Ranges would increase/decrease value resp,
which is unintuitive & worse, contradicts what we already do for scrolls
Fix simply by moving to the new should_invert_move() as scrolls just did
– which also gets us the other benefits explained in the last 2 commits.
https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
Daniel Boles [Mon, 1 Jan 2018 14:28:16 +0000 (14:28 +0000)]
Range: Use should_invert_move() to scroll value
This fixes RTL and/or :inverted Ranges responding to a horizontal scroll
by moving the value/slider button in the opposite direction... See prev.
https://bugzilla.gnome.org/show_bug.cgi?id=791802
Daniel Boles [Tue, 17 Apr 2018 20:44:16 +0000 (21:44 +0100)]
Range: Add should_invert_move() for scrolls & keys
This will be used in subsequent commits to fix the sign by which the
value is changed in response to directional scroll or keypress events.
The idea is: you have a movement to make – in the form of a delta that
follows widget directions, i.e. −1 means left or up, +1 means right or
down – and you want to know whether that delta needs to be inverted in
order to produce the intuitively expected directional change of :value.
The existing should_invert() is not sufficient: it just determines
whether to invert visually, but we need more nuance than that for input.
To answer that – while not doubling up the work for scrolls and keys – I
add a helper should_invert_move(), which considers other relevant state:
• A parallel movement on priv->orientation should just use the existing
should_invert(), which already worked OK for this case (not others).
• Movements on the other orientation now depend on priv->orientation:
◦ For a horizontal Range, always invert, so up (i.e. −ve in terms of
widget coords) always means increase value & vice-versa. This was
done in get_wheel_delta(), but move it here for use with keys too.
◦ For a vertical Range, ignore :invert as it’s only relevant to the
parallel orientation. Do not care about text direction here either
as RTL locales do not invert number lines, Cartesian plots, etc.
This returns TRUE if the delta should be inverted before applying to the
value, and we can now use this function in both scroll and key handlers.
https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
Benjamin Otte [Sun, 15 Apr 2018 12:07:25 +0000 (14:07 +0200)]
snapshot: Don't handle clip anymore
If widgets want to clip things, they now need to do it themselves.
By not taking care of clip, we avoid the need to track clip. And by not
tracking clip, we can avoid all unnecessary cache invalidations that we
were doing for render nodes whenever the clip changed.
And when you are scrolling, the clip changes *a lot*.
Daniel Boles [Tue, 17 Apr 2018 19:50:04 +0000 (20:50 +0100)]
MenuShell: Avoid compiler warning re un/signed cmp
priv->button is a guint, but we assigned it to a local gint.
gtk/gtkmenushell.c:734:37: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (button && (new_button != button) && priv->parent_menu_shell)
^
Daniel Boles [Tue, 17 Apr 2018 19:03:07 +0000 (20:03 +0100)]
Menu|Item: Fix FIXME re non-const interned strings
These are members of the private struct, so it hurts no one to fix this.
Daniel Boles [Tue, 17 Apr 2018 18:56:13 +0000 (19:56 +0100)]
Menu: Remove redundant typecheck in private func
Everything that calls this already ensured we are a valid GtkMenu.
Daniel Boles [Tue, 17 Apr 2018 19:19:45 +0000 (20:19 +0100)]
Menu: Update @accel_path annotation/description
Daniel Boles [Tue, 17 Apr 2018 19:19:38 +0000 (20:19 +0100)]
Menu: Typecheck AccelGroup passed via public API
Daniel Boles [Tue, 17 Apr 2018 18:51:53 +0000 (19:51 +0100)]
Menu: Typecheck before dereferencing to get ->priv
Daniel Boles [Tue, 17 Apr 2018 18:48:43 +0000 (19:48 +0100)]
MenuShell: Sanitise take_focus bool via public API
We store in priv then compare it later, so better make sure it’s 0 or 1.
Daniel Boles [Tue, 17 Apr 2018 18:49:24 +0000 (19:49 +0100)]
MenuShell: Typecheck the instance @ select_first()
since this is public API and therefore might get junk passed to it.
Daniel Boles [Tue, 3 Apr 2018 19:01:54 +0000 (20:01 +0100)]
CellRenderer: Link to CellEditable.start_editing()
...from CellRenderer::start-editing, to point people in the direction of
info about the lifecycle of the Editable and how to do generic setup.
https://gitlab.gnome.org/GNOME/gtk/issues/154
Daniel Boles [Mon, 2 Apr 2018 12:18:18 +0000 (13:18 +0100)]
CellRenderer: Clarify doc of .start_editing()
Drop the line copied from .activate(), replace it with a description of
what this method actually does, and explain what a NULL result means.
https://gitlab.gnome.org/GNOME/gtk/issues/154
Daniel Boles [Mon, 2 Apr 2018 12:01:02 +0000 (13:01 +0100)]
CellRenderer: Entry is not the only CellEditable
so link to GtkCellEditable and note that GtkEntry is just one example.
Daniel Boles [Mon, 2 Apr 2018 11:59:16 +0000 (12:59 +0100)]
CellRenderer|Editable: Don't @See_also subclasses
The documentation knows that from the inheritance hierarchy, without us
having to manually duplicate that info here. Link to each other instead.
Daniel Boles [Tue, 17 Apr 2018 17:27:23 +0000 (18:27 +0100)]
CellEditable: Clarify doc on lifecycle of editable
* Note in the intro that we're really thinking about temporary widgets
* Mention a gotcha regarding GtkEntry and how ::focus-out stops editing
* Give some examples of what you'd want to do in ::editing-done
* Be a bit more precise about what ::remove-widget represents
* Summarise the lifecycle between Renderer/Editable in .start_editing()
* Emphasise again there that this should be viewed as a temporary widget
https://gitlab.gnome.org/GNOME/gtk/issues/154