Skip to content

[Bug] wxGUI/nviz: an error message is printed during docking undocked 3D view window #7668

Description

@tmszi

Describe the bug

An error message is printed during docking undocked 3D view window.

To reproduce

  1. Launch wxGUI
  2. Display some raster elevation map d.rast elevation
  3. Switch 2D view to the 3D view
  4. Hit (Un)dock (undocking) button from the map display toolbar
  5. Hit (Un)dock (docking) button from the map display toolbar window
  6. See error message
Traceback (most recent call last):
  File "/usr/lib64/grass86/gui/wxpython/nviz/mapwindow.py",
line 441, in OnSize
    self.SetCurrent(self.context)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
wx._core.wxAssertionError: C++ assertion ""xid"" failed at /
var/tmp/portage/x11-libs/wxGTK-3.2.8.1-r2/work/wxWidgets-
3.2.8.1/src/unix/glx11.cpp(584) in SetCurrent(): window must
be shown

Expected behavior

No error message should be printed during docking undocked 3D view window.

System description

  • Operating System: all
  • GRASS version: 8.6.0dev, 8.5.0

Additional context

According my debug info, during docking undocked 3D view window is called

self.AddPage(page, frame.GetTitle())
which trigger wx.EVT_SIZE event with OnSize() method handler (problematic is code line no. 428)
def OnSize(self, event):
size = self.GetClientSize()
context = self.context if CheckWxVersion(version=[2, 9]) else self.GetContext()
if self.size != size and context:
Debug.msg(
3, "GLCanvas.OnSize(): w = %d, h = %d" % (size.width, size.height)
)
if CheckWxVersion(version=[2, 9]):
self.SetCurrent(self.context)
before the window is displayed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIwxGUI relatedPythonRelated code is in Pythonbackport to 8.5PR needs to be backported to release branch 8.5bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions