GTK+ 3.24 on Gentoo Linux with adwaita-icon-theme-46.0
GNOME's adwaita-icon-theme-46.0 is only providing icons for cursors named in css-ui-4, i.e. dropping the X-only cursors (but providing symlinks for now for the X names for cursors that exist in CSS).
right_ptr is one of those cursors that no longer exists. This means that when moving the cursor over the line numbers in SciTE 5.5.0, with GTK+ < 3.24.42 a critical error is output:
(scite:19066): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
and for any version of GTK+:
Gdk-Message: Unable to load right_ptr from the cursor theme
gdk_cursor_new_for_display() is no longer recommended (and removed in GTK 4). I've resolved with:
--- a/scintilla/gtk/PlatGTK.cxx
+++ b/scintilla/gtk/PlatGTK.cxx
@@ -1343,7 +1343,7 @@ void Window::SetCursor(Cursor curs) {
gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_HAND2);
break;
case Cursor::reverseArrow:
- gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_RIGHT_PTR);
+ gdkCurs = gdk_cursor_new_from_name(pdisplay, "pointer");
break;
default:
gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
https://docs.gtk.org/gdk3/ctor.Cursor.new_from_name.html
Although not 100% sure pointer is the best choice.
That breaks the feature by showing the wrong cursor. Isn't this GTK's responsibility since it specifies the
GDK_RIGHT_PTRenumeration.It's up to the icon theme to provide the cursor icon.
Why did you install an icon theme without needed cursors? You should install one that includes all the standard cursors. If this is due to your distribution being broken then request that they fix the problem.
Scintilla is the only software I have installed that uses
right_ptr, I choose to patch it.Your patch doesn't fix anything as the cursor appears like a hand (edited) after the patch. It just stops some warnings appearing in the log.
Last edit: Neil Hodgson 2024-05-23
Added a change that avoids the
g_object_unrefwarning [855623] by not unreferencingNULL.Related
Commit: [855623]
Cursors can be installed into the theme by copying their files into a specific directory. On a current Fedora 40 installation which uses Adwaita for icons, this directory is
/usr/share/icons/Adwaita/cursors/. I uploaded aright_ptrcursor from the Yaru theme on current Ubuntu as https://www.scintilla.org/right_ptr .Download this then
sudo cp right_ptr /usr/share/icons/Adwaita/cursors/will make it available. There is probably a more correct way of doing this so the cursor is installed locally or just for one application instead of to a system directory but this worked.Yes that works.
The last sighting of the Adwaita X cursors is at:
https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/tree/9a4eedfc60c04ad0b0fc50100c96646f2f161888/Adwaita/cursors
In the short term sticking with adwaita-icon-theme-45.0 is an option (there's even more going on with icons) to see how things develop.
Potentially an application-level solution in the long term is
gdk_cursor_new_from_pixbuf()(GTK 4gdk_cursor_new_from_texture()). Although I guess that would only be for cases where there wasn't a theme cursor, for consistency. But it remains to be seen how things go.Last edit: Chris Mayo 2024-05-26