Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyPaint crashing with group layer creation #1206

Open
americogobbo opened this issue Nov 10, 2023 · 0 comments
Open

MyPaint crashing with group layer creation #1206

americogobbo opened this issue Nov 10, 2023 · 0 comments
Labels
cat.UI Issue relates to operation of the user interface cat.Widget Issue relates to a widget platform.Linux Issue is reported on Linux type.Crasher Something crashes MyPaint

Comments

@americogobbo
Copy link

Description of the problem

MyPaint is crashing when you try to create a Group Layer. The issue happens always before or after you create a single layer. For instance, the Mypaint opens directly with a layer by default, if you create a group layer after the program crash.

Basic system details

MyPaint version: 2.0.1+gitexport.478280f

Operating system: [Fedora 39]
Desktop environment: [GNOME 45]

Steps to reproduce

  1. Start MyPaint
  2. Create a Group layer
  3. Crash

Backtraces or error messages

Mypaint version: 2.0.1+gitexport.478280f
System information: Linux-6.5.10-300.fc39.x86_64-x86_64-with-glibc2.38
Using: Python 3.12.0, GTK 3.24.38, GdkPixbuf 2.42.10, Cairo 1.18.0, GLib 2.78.0
Traceback (most recent call last):
  File "/usr/lib64/mypaint/gui/document.py", line 1404, new_layer_cb(self=<gui.document.Document object>, action=<Gtk.Action object at 0x7f356e29aa00 (GtkAction at 0x5610150d13c0)>)
            self.model.add_layer(path, layer_class=layer_class, **layer_kwds)
            self.blink_layer(action)
  variables: {'self.model.add_layer': ('local', <bound method Document.add_layer of <Document nlayers=2 bbox=Rect(0, 0, 0, 0) paintonly=False>>), 'path': ('local', (0,)), 'layer_class': ('local', <class 'lib.layer.group.LayerStack'>), 'layer_kwds': ('local', {})}
  File "/usr/lib64/mypaint/lib/document.py", line 1286, add_layer(self=<Document nlayers=2 bbox=Rect(0, 0, 0, 0) paintonly=False>, path=(0,), layer_class=<class 'lib.layer.group.LayerStack'>, **kwds={})
            )
            self.do(cmd)
  variables: {'self.do': ('local', <bound method Document.do of <Document nlayers=2 bbox=Rect(0, 0, 0, 0) paintonly=False>>), 'cmd': ('local', <Add Group>)}
  File "/usr/lib64/mypaint/lib/document.py", line 1161, do(self=<Document nlayers=2 bbox=Rect(0, 0, 0, 0) paintonly=False>, cmd=<Add Group>)
            self.sync_pending_changes()
            self.command_stack.do(cmd)
  variables: {'self.command_stack.do': ('local', <bound method CommandStack.do of <CommandStack undo_len=0 redo_len=0>>), 'cmd': ('local', <Add Group>)}
  File "/usr/lib64/mypaint/lib/command.py", line 75, do(self=<CommandStack undo_len=0 redo_len=0>, command=<Add Group>)
            self._discard_redo()
            completed = command.redo()
            # NOTE: The below is not equivalent to checking truthiness,
  variables: {'completed': (None, []), 'command.redo': ('local', <bound method AddLayer.redo of <Add Group>>)}
  File "/usr/lib64/mypaint/lib/command.py", line 951, redo(self=<Add Group>)
            self._prev_currentlayer_path = layers.get_current_path()
            layers.deepinsert(self._insert_path, self._layer)
            assert self._layer.name is not None
  variables: {'layers.deepinsert': ('local', <bound method RootLayerStack.deepinsert of <RootLayerStack len=2>>), 'self._insert_path': ('local', (0,)), 'self._layer': ('local', <LayerStack len=0 'Group'>)}
  File "/usr/lib64/mypaint/lib/layer/tree.py", line 1718, deepinsert(self=<RootLayerStack len=2>, path=(0,), layer=<LayerStack len=0 'Group'>)
                    stack.insert(idx, layer)
                    layer.name = self.get_unique_name(layer)
                    self._propagate_symmetry_state(layer)
  variables: {'layer.name': ('local', 'Group'), 'self.get_unique_name': ('local', <bound method RootLayerStack.get_unique_name of <RootLayerStack len=2>>), 'layer': ('local', <LayerStack len=0 'Group'>)}
  File "/usr/lib64/mypaint/lib/layer/core.py", line 335, name(self=<LayerStack len=0 'Group'>, name='Group')
            if self._name != oldname:
                self._properties_changed(["name"])
  variables: {'self._properties_changed': ('local', <bound method LayerBase._properties_changed of <LayerStack len=0 'Group'>>)}
  File "/usr/lib64/mypaint/lib/layer/core.py", line 528, _properties_changed(self=<LayerStack len=0 'Group'>, properties=['name'])
            if root is not None:
                root._notify_layer_properties_changed(self, set(properties))
  variables: {'root._notify_layer_properties_changed': ('local', <bound method RootLayerStack._notify_layer_properties_changed of <RootLayerStack len=2>>), 'self': ('local', <LayerStack len=0 'Group'>), 'set': ('builtin', <class 'set'>), 'properties': ('local', ['name'])}
  File "/usr/lib64/mypaint/lib/layer/tree.py", line 2590, _notify_layer_properties_changed(self=<RootLayerStack len=2>, layer=<LayerStack len=0 'Group'>, changed={'name'})
            assert path is not None, "Unable to find layer which was changed"
            self.layer_properties_changed(path, layer, changed)
  variables: {'self.layer_properties_changed': ('local', <_MethodWithObservers lib.layer.tree.RootLayerStack.layer_properties_changed>), 'path': ('local', (0,)), 'layer': ('local', <LayerStack len=0 'Group'>), 'changed': ('local', {'name'})}
  File "/usr/lib64/mypaint/lib/observable.py", line 289, __call__(self=<_MethodWithObservers lib.layer.tree.RootLayerStack.layer_properties_changed>, *args=((0,), <LayerStack len=0 'Group'>, {'name'}), **kwargs={})
                    try:
                        observer(observed, *args, **kwargs)
                    except _BoundObserverMethod._ReferenceError:
  variables: {'observer': ('local', <_BoundObserverMethod gui.tileddrawwidget.CanvasRenderer.layer_props_changed_cb>), 'observed': (None, []), 'args': ('local', ((0,), <LayerStack len=0 'Group'>, {'name'})), 'kwargs': ('local', {})}
  File "/usr/lib64/mypaint/lib/observable.py", line 474, __call__(self=<_BoundObserverMethod gui.tileddrawwidget.CanvasRenderer.layer_props_changed_cb>, observed=<RootLayerStack len=2>, *args=((0,), <LayerStack len=0 'Group'>, {'name'}), **kwargs={})
                raise self._ReferenceError
            self._observer_func(observer, observed, *args, **kwargs)
            del observer
  variables: {'self._observer_func': ('local', <function CanvasRenderer.layer_props_changed_cb at 0x7f356e3ff420>), 'observer': ('local', <tileddrawwidget.CanvasRenderer object at 0x7f356e27acc0 (gui+tileddrawwidget+CanvasRenderer at 0x5610151d4c10)>), 'observed': ('local', <RootLayerStack len=2>), 'args': ('local', ((0,), <LayerStack len=0 'Group'>, {'name'})), 'kwargs': ('local', {})}
  File "/usr/lib64/mypaint/gui/tileddrawwidget.py", line 933, layer_props_changed_cb(self=<tileddrawwidget.CanvasRenderer object at 0x7f35...ileddrawwidget+CanvasRenderer at 0x5610151d4c10)>, rootstack=<RootLayerStack len=2>, path=(0,), layer=<LayerStack len=0 'Group'>, changed={'name'})
        def layer_props_changed_cb(self, rootstack, path, layer, changed):
            self.update_cursor()
  variables: {'self.update_cursor': ('local', <bound method DrawCursorMixin.update_cursor of <tileddrawwidget.CanvasRenderer object at 0x7f356e27acc0 (gui+tileddrawwidget+CanvasRenderer at 0x5610151d4c10)>>)}
  File "/usr/lib64/mypaint/gui/tileddrawwidget.py", line 590, update_cursor(self=<tileddrawwidget.CanvasRenderer object at 0x7f35...ileddrawwidget+CanvasRenderer at 0x5610151d4c10)>)
                # Often a red circle with a diagonal bar through it.
                c = Gdk.Cursor.new_for_display(
                    window.get_display(), Gdk.CursorType.CIRCLE)
  variables: {'c': (None, []), 'Gdk.Cursor.new_for_display': ('global', gi.FunctionInfo(new_for_display, bound=<class 'gi.overrides.Gdk.Cursor'>)), 'window.get_display': ('local', gi.FunctionInfo(get_display, bound=<__gi__.GdkWaylandWindow object at 0x7f356c771100 (GdkWaylandWindow at 0x561015de4020)>)), 'Gdk.CursorType.CIRCLE': ('global', <enum GDK_CIRCLE of type Gdk.CursorType>)}
TypeError: constructor returned NULL
```

```
@AesaraB AesaraB added type.Crasher Something crashes MyPaint platform.Linux Issue is reported on Linux cat.Widget Issue relates to a widget cat.UI Issue relates to operation of the user interface labels Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat.UI Issue relates to operation of the user interface cat.Widget Issue relates to a widget platform.Linux Issue is reported on Linux type.Crasher Something crashes MyPaint
Development

No branches or pull requests

2 participants