Control: tags 859064 + patch
Control: tags 859064 + pending

On Thu, 30 Mar 2017 at 01:53:21 +0200, Claudio Sacerdoti Coen wrote:
>   File "/usr/share/mypaint/gui/mode.py", line 813, in SingleClickMode
>     cursor = gdk.Cursor(gdk.BOGOSITY)
>   File "/usr/lib/python2.7/dist-packages/gi/overrides/Gdk.py", line 329,
> in __new__
>     return cls.new(*args, **kwds)
> TypeError: constructor returned NULL

This is fixed by upstream commits 48a43f9 and d9eaec0, but there is
another, similar crash tracked as
<https://github.com/mypaint/mypaint/issues/791> which is not yet fixed
on the upstream 1.2.x branch. I've sent pull request
<https://github.com/mypaint/mypaint/pull/792> with a minimal backport
of the fix from upstream master.

I've prepared an NMU for mypaint (versioned as 1.2.0-4.1) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should delay it longer or cancel it, or conversely if I should
reschedule it to land sooner.

I would also be happy to sponsor an similarly minimal upload if you'd
prefer that (I notice the upstream maintainer and one of the Debian
maintainers are the same person).

I suspect that upstream release 1.2.1 might have too much in it for the
release team to accept it during freeze.

Regards,
    S
diffstat for mypaint-1.2.0 mypaint-1.2.0

 changelog                                                      |   10 +
 patches/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch   |   32 ++++
 patches/Remove-references-to-BOGOSITY-cursor.patch             |   59 ++++++++
 patches/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch |   67 ++++++++++
 patches/series                                                 |    3 
 5 files changed, 171 insertions(+)

diff -Nru mypaint-1.2.0/debian/changelog mypaint-1.2.0/debian/changelog
--- mypaint-1.2.0/debian/changelog	2017-02-02 14:39:42.000000000 +0000
+++ mypaint-1.2.0/debian/changelog	2017-04-02 18:26:32.000000000 +0100
@@ -1,3 +1,13 @@
+mypaint (1.2.0-4.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/p/Remove-references-to-BOGOSITY-cursor.patch,
+    d/p/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch,
+    d/p/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch:
+    Fix startup on Wayland systems (Closes: #859064)
+
+ -- Simon McVittie <s...@debian.org>  Sun, 02 Apr 2017 18:26:32 +0100
+
 mypaint (1.2.0-4) unstable; urgency=medium
 
   * Add debian/patches/fix-gtk-3.22.4-canvas-disappearance.patch to fix
diff -Nru mypaint-1.2.0/debian/patches/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch mypaint-1.2.0/debian/patches/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch
--- mypaint-1.2.0/debian/patches/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch	1970-01-01 01:00:00.000000000 +0100
+++ mypaint-1.2.0/debian/patches/Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch	2017-04-02 18:26:32.000000000 +0100
@@ -0,0 +1,32 @@
+From: Andrew Chadwick <a.t.chadw...@gmail.com>
+Date: Sun, 8 Jan 2017 17:14:18 +0000
+Subject: Fix cherry-pick: stable branch has pygtk syntax
+
+Origin: upstream, 1.2.1
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859064
+---
+ gui/mode.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gui/mode.py b/gui/mode.py
+index 2802720..c99eb3d 100644
+--- a/gui/mode.py
++++ b/gui/mode.py
+@@ -811,7 +811,7 @@ class SingleClickMode (InteractionMode):
+ 
+     #: The cursor to use when entering the mode
+     # FIXME: Use Gdk.Cursor.new_for_display; read-only property
+-    cursor = Gdk.Cursor.new(Gdk.CursorType.ARROW)
++    cursor = gdk.Cursor.new(gdk.CursorType.ARROW)
+ 
+     def __init__(self, ignore_modifiers=False, **kwds):
+         super(SingleClickMode, self).__init__(**kwds)
+@@ -860,7 +860,7 @@ class DragMode (InteractionMode):
+     """
+ 
+     # FIXME: Use Gdk.Cursor.new_for_display; read-only property
+-    inactive_cursor = Gdk.Cursor.new(Gdk.CursorType.ARROW)
++    inactive_cursor = gdk.Cursor.new(gdk.CursorType.ARROW)
+     active_cursor = None
+ 
+     #: If true, exit mode when initial modifiers are released
diff -Nru mypaint-1.2.0/debian/patches/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch mypaint-1.2.0/debian/patches/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch
--- mypaint-1.2.0/debian/patches/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch	1970-01-01 01:00:00.000000000 +0100
+++ mypaint-1.2.0/debian/patches/hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch	2017-04-02 18:26:32.000000000 +0100
@@ -0,0 +1,67 @@
+From: Simon McVittie <s...@debian.org>
+Date: Sun, 2 Apr 2017 18:24:33 +0100
+Subject: hcywheel: Avoid deprecated gdk.Cursor constructor
+
+Use Gdk.Cursor.new_for_display on realize instead.
+
+Backported from a larger patch by Daniel Plachotich.
+
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859064
+---
+ gui/colors/hcywheel.py | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/gui/colors/hcywheel.py b/gui/colors/hcywheel.py
+index ed2d113..7d52358 100644
+--- a/gui/colors/hcywheel.py
++++ b/gui/colors/hcywheel.py
+@@ -20,6 +20,7 @@ import os.path
+ import gui.gtk2compat as gtk2compat
+ import gtk
+ from gtk import gdk
++from gi.repository import Gdk
+ import cairo
+ 
+ from bases import CachedBgDrawingArea
+@@ -391,10 +392,10 @@ class HCYMaskEditorWheel (HCYHueChromaWheel):
+ 
+     ## Class-level constants and variables
+     # Specialized cursors for different actions
+-    __add_cursor = gdk.Cursor(gdk.PLUS)
+-    __move_cursor = gdk.Cursor(gdk.FLEUR)
+-    __move_point_cursor = gdk.Cursor(gdk.CROSSHAIR)
+-    __rotate_cursor = gdk.Cursor(gdk.EXCHANGE)
++    __add_cursor = None
++    __move_cursor = None
++    __move_point_cursor = None
++    __rotate_cursor = None
+     # Constrain the range of allowable lumas
+     __MAX_LUMA = 0.75
+     __MIN_LUMA = 0.25
+@@ -417,12 +418,26 @@ class HCYMaskEditorWheel (HCYHueChromaWheel):
+         """Instantiate, and connect the editor events.
+         """
+         HCYHueChromaWheel.__init__(self)
++
++        self.connect("realize", self._realize_cb)
+         self.connect("button-press-event", self.__button_press_cb)
+         self.connect("button-release-event", self.__button_release_cb)
+         self.connect("motion-notify-event", self.__motion_cb)
+         self.connect("leave-notify-event", self.__leave_cb)
+         self.add_events(gdk.POINTER_MOTION_MASK | gdk.LEAVE_NOTIFY_MASK)
+ 
++    def _realize_cb(self, widget):
++        display = self.get_window().get_display()
++
++        self.__add_cursor = Gdk.Cursor.new_for_display(
++            display, Gdk.CursorType.PLUS)
++        self.__move_cursor = Gdk.Cursor.new_for_display(
++            display, Gdk.CursorType.FLEUR)
++        self.__move_point_cursor = Gdk.Cursor.new_for_display(
++            display, Gdk.CursorType.CROSSHAIR)
++        self.__rotate_cursor = Gdk.Cursor.new_for_display(
++            display, Gdk.CursorType.EXCHANGE)
++
+     def __leave_cb(self, widget, event):
+         # Reset the active objects when the pointer leaves.
+         if self.__drag_func is not None:
diff -Nru mypaint-1.2.0/debian/patches/Remove-references-to-BOGOSITY-cursor.patch mypaint-1.2.0/debian/patches/Remove-references-to-BOGOSITY-cursor.patch
--- mypaint-1.2.0/debian/patches/Remove-references-to-BOGOSITY-cursor.patch	1970-01-01 01:00:00.000000000 +0100
+++ mypaint-1.2.0/debian/patches/Remove-references-to-BOGOSITY-cursor.patch	2017-04-02 18:26:32.000000000 +0100
@@ -0,0 +1,59 @@
+From: Andrew Chadwick <a.t.chadw...@gmail.com>
+Date: Wed, 14 Dec 2016 18:20:23 +0000
+Subject: Remove references to BOGOSITY cursor
+
+It may not exist on newer systems/themes, and may cause exceptions to be
+thrown in Wayland. We're only using it as an "obvious" fallback anyway.
+
+Addresses mypaint/mypaint#750.
+
+[Cherry-pick of 2c07a27b00c421979cda17d7827fce85d276c28b from master]
+
+Origin: upstream, 1.2.1
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859064
+---
+ gui/cursor.py | 4 ++--
+ gui/mode.py   | 6 ++++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/gui/cursor.py b/gui/cursor.py
+index df8b33a..5c24d4f 100644
+--- a/gui/cursor.py
++++ b/gui/cursor.py
+@@ -305,10 +305,10 @@ class CustomCursorMaker (object):
+         # Find a small action icon for the overlay
+         action = self.app.find_action(action_name)
+         if action is None:
+-            return Gdk.Cursor.new(Gdk.CursorType.BOGOSITY)
++            return Gdk.Cursor.new(Gdk.CursorType.ARROW)
+         icon_name = action.get_icon_name()
+         if icon_name is None:
+-            return Gdk.Cursor.new(Gdk.CursorType.BOGOSITY)
++            return Gdk.Cursor.new(Gdk.CursorType.ARROW)
+         return self.get_icon_cursor(icon_name, cursor_name)
+ 
+     def get_icon_cursor(self, icon_name, cursor_name=Name.ARROW):
+diff --git a/gui/mode.py b/gui/mode.py
+index 4f9121c..2802720 100644
+--- a/gui/mode.py
++++ b/gui/mode.py
+@@ -810,7 +810,8 @@ class SingleClickMode (InteractionMode):
+     """Base class for non-drag (single click) modes"""
+ 
+     #: The cursor to use when entering the mode
+-    cursor = gdk.Cursor(gdk.BOGOSITY)
++    # FIXME: Use Gdk.Cursor.new_for_display; read-only property
++    cursor = Gdk.Cursor.new(Gdk.CursorType.ARROW)
+ 
+     def __init__(self, ignore_modifiers=False, **kwds):
+         super(SingleClickMode, self).__init__(**kwds)
+@@ -858,7 +859,8 @@ class DragMode (InteractionMode):
+ 
+     """
+ 
+-    inactive_cursor = gdk.Cursor(gdk.BOGOSITY)
++    # FIXME: Use Gdk.Cursor.new_for_display; read-only property
++    inactive_cursor = Gdk.Cursor.new(Gdk.CursorType.ARROW)
+     active_cursor = None
+ 
+     #: If true, exit mode when initial modifiers are released
diff -Nru mypaint-1.2.0/debian/patches/series mypaint-1.2.0/debian/patches/series
--- mypaint-1.2.0/debian/patches/series	2017-02-02 13:06:23.000000000 +0000
+++ mypaint-1.2.0/debian/patches/series	2017-04-02 18:26:32.000000000 +0100
@@ -1,2 +1,5 @@
 fix-glib-2.48-startup-crash.patch
 fix-gtk-3.22.4-canvas-disappearance.patch
+Remove-references-to-BOGOSITY-cursor.patch
+Fix-cherry-pick-stable-branch-has-pygtk-syntax.patch
+hcywheel-Avoid-deprecated-gdk.Cursor-constructor.patch

Reply via email to