On GTK2 and GTK3 < 3.3.6 there is no GtkAccessibleClass::widget_unset()
method, so we can't destroy our accessible object right away. So, to
avoid accessing a destroyed widget, we need to check whether the widget
still exists in the the ScintillaGTKAccessible destructor.
In other methods it's not necessary because the wrapping GObject class
makes sure not to forward other when the widget has been destroyed, but
we still have to destroy the C++ instance no matter what, so the check
has to be on this side.
Fixes#1410.
This allows plugins to detect the API version of Geany at runtime. This enables
soft dependencies based on Geany's API version, perhaps using a new feature
with a fallback for older API versions. Previously the only alternatives
were hard-depending on a more recent Geany version or ignoring new features.
Since GTK 3.19.12, GtkComboBox has an intermediate GtkBox internal
child wrapping the inner GtkEntry. To get the entry,
`gtk_bin_get_child()` still works as it is part of the API, but the
change breaks the assumption we had that it works the other way around,
that `gtk_widget_get_parent(gtk_bin_get_child(combobox)) == combobox`.
So, while this assumption seemed reasonable, stop relying on it as it
is effectively not correct on GTK 3.20 and newer.
See: https://git.gnome.org/browse/gtk+/commit/?id=222c43fc60362eeb97ce2d5e3a5583a69a2e30ef
Work around incorrect keybinding handling with multiple layouts so
cut/copy/delete keybindings work via menuitem activation if we failed
to trigger the action ourselves.
Closes#1386.
Instead of having a handler on 2 separate objects, use :select and
:deselect on the same one. Those signals are appropriate, as the
documentation mentions that submenus are popped up on :select.
Mark the associated menu items sensitive when the menu is hidden, so
that GTK's accelerator handling can trigger them. This works around
incorrect handling in Geany's code of keybindings coming from multiple
layouts for cut/copy/delete actions.
Partial workaround for #998, #1286 and #1368.
Avoid crash when detaching the widget from the accessible object
without destroying that widget.
In such situations, the widget is still valid but we will have
destroyed the orphaned accessible object. Thus, we must make sure we
disconnected the signal handlers the late accessible had set up on the
widget, as they won't be implicitly disconnected by widget
finalization in this case.
Fixes#1385.
Fix signature of the snippets keybindings callback, properly blocking
further propagation of handled events thus avoiding possibly activating
another action (like a builtin Scintilla keybinding).
Fixes#1354.
Since the Scintilla C++ lexer started to fold on `()` [1], the code
looking up the current scope is confused whenever the function
signature spans multiple lines. Fix this by skipping fold levels that
correspond to parentheses.
Fixes#1279.
[1] https://sourceforge.net/p/scintilla/feature-requests/1138/
imported in 24f91981c057a7e212c09da66fb974c3ccc85bd6
We cannot compute the length in characters after the text has been
deleted, so we need to compute it in BEFOREDELETE. However, we need to
emit the signal once the buffer has actually changed, so we need to
cache the value in-between those events.