Skip to content

Conversation

@hydrocat
Copy link

This fixes a bug in which some plots are not redrawn under wayland.

PR summary

  • Why is this change necessary?

  • What problem does it solve?
    Under wayland and wxwidgets, the canvas was only being redraw after user interaction. Programmatic updates from code, such as a background task, would somehow, not trigger a plot redraw.

  • What is the reasoning for this implementation?
    Sorry, not much reasoning. I followed the code path and sprinkled what I thought could work. The best I can think of is that wxwidgets is not being notified of the need to repaint the canvas.

I tried to find a way to force redraw of the plot canvas in wxWidgets backend. This place seems to fix it.

Running a demo script with GDK_BACKEND=x11 python demo.py fixes it too, but then it is not using wayland.

PR checklist

This fixes a bug in which some widgets are not redrawn under wayland.
@newville
Copy link
Contributor

@hydrocat Thanks for looking into this.
If this is needed only for Wayland (see Note at https://docs.wxpython.org/wx.Window.html#wx.Window.Update), is it possible to add a test for "on Wayland" and run this self.Refresh() only then? Perhaps one of the methods from wx.PlatformInformation clearly identifies Wayland?

Also: should this self.Refresh() be in _FigureCanvasWxBase.gui_repaint()? That is, why wouldn't every repaint need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wxPython 4.0: backends not yet working w. Wayland / Ubuntu 17

2 participants