Commit | Line | Data |
---|---|---|
c48c6919 TGR |
1 | From: Tobias Geerinckx-Rice <me@tobias.gr> |
2 | Date: Tue, 02 Mar 2021 18:04:33 +0100 | |
3 | Subject: [PATCH] gnu: python-matplotlib: Run under Wayland with GTK3. | |
4 | ||
5 | Adopted from upstream's fix[0] for | |
6 | <https://github.com/matplotlib/matplotlib/issues/19405>. | |
7 | ||
8 | [0]: https://github.com/liuyun88/matplotlib/commit/3d5000463bd23cb046681220f5511f07743f7d82 | |
9 | ||
10 | --- | |
11 | diff -Naur a/lib/matplotlib/backends/backend_gtk3.py b/lib/matplotlib/backends/backend_gtk3.py | |
12 | --- a/lib/matplotlib/backends/backend_gtk3.py 2019-11-21 23:47:05.000000000 +0100 | |
13 | +++ b/lib/matplotlib/backends/backend_gtk3.py 2021-03-02 18:00:57.479929766 +0100 | |
14 | @@ -42,11 +42,12 @@ | |
15 | ||
16 | try: | |
17 | + _display = Gdk.Display.get_default() | |
18 | cursord = { | |
19 | - cursors.MOVE : Gdk.Cursor.new(Gdk.CursorType.FLEUR), | |
20 | - cursors.HAND : Gdk.Cursor.new(Gdk.CursorType.HAND2), | |
21 | - cursors.POINTER : Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR), | |
22 | - cursors.SELECT_REGION : Gdk.Cursor.new(Gdk.CursorType.TCROSS), | |
23 | - cursors.WAIT : Gdk.Cursor.new(Gdk.CursorType.WATCH), | |
24 | + cursors.MOVE : Gdk.Cursor.new_from_name(_display, "move"), | |
25 | + cursors.HAND : Gdk.Cursor.new_from_name(_display, "pointer"), | |
26 | + cursors.POINTER : Gdk.Cursor.new_from_name(_display, "default"), | |
27 | + cursors.SELECT_REGION : Gdk.Cursor.new_from_name(_display, "crosshair"), | |
28 | + cursors.WAIT : Gdk.Cursor.new_from_name(_display, "wait"), | |
29 | } | |
30 | except TypeError as exc: | |
31 | # Happens when running headless. Convert to ImportError to cooperate with |