mypaint / mypaint

MyPaint is a simple drawing and painting program that works well with Wacom-style graphics tablets.
https://mypaint.app
GNU General Public License v2.0
2.7k stars 386 forks source link

Use standard cursor name #1235

Closed jtojnar closed 9 months ago

jtojnar commented 9 months ago

Adwaita, the resident icon theme on GNOME removed the legacy X11 circle cursor: https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/commit/fb133a3989ee155c24201e30bab7dbc1c7c843fd

As a result, MyPaint would break when opening a file on GNOME systems.

Let’s use the equivalent not-allowed cursor from the XDG cursor-spec draft: https://www.freedesktop.org/wiki/Specifications/cursor-spec/

The circle cursor that was removed from Adwaita is in the fourth row, second column here: https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/blob/4d082e44e8361ca32360bb5b865be98a784ef4db/src/cursors/adwaita.svg Here is the list of cursor constants supported by GDK 3 with images – it includes legacy X11 cursors: https://docs.gtk.org/gdk3/enum.CursorType.html Here is the list of cursor names – only contains standard ones: https://docs.gtk.org/gdk3/ctor.Cursor.new_from_name.html

There was also simila issue with the exchange legacy X11 cursor when attempting to mask HCY wheel so Ifixed that as well.

And while at it, I switched to the preferred Gdk.Cursor.new_from_name API.

Fixes: https://github.com/mypaint/mypaint/issues/1209

jtojnar commented 9 months ago

Ideally, we would switch to Gdk.Cursor.new_from_name everywhere but this minor fix at least fixes the crash.

AesaraB commented 9 months ago

Hi, can you give me an .ora file that would break as per #1209 for me to test this fix on my side?

jtojnar commented 9 months ago

It happens with any .ora file for me. Maybe try locking a layer.

AesaraB commented 9 months ago

I can reproduce the bug by locking a layer. Looks like you've removed several calls to a depreciated method, thanks for that.

I can confirm this to be working on my side. Merging it into the codebase.