Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gtk3 rubberband is invisible #17773

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

Closed
anntzer opened this issue Jun 26, 2020 · 3 comments · Fixed by #17877
Closed

gtk3 rubberband is invisible #17773

anntzer opened this issue Jun 26, 2020 · 3 comments · Fixed by #17877
Labels
GUI: gtk Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Jun 26, 2020

Bug report

Bug summary

All's in the title.
Note that #17772 is necessary to avoid throwing an exception due to a logic error, but even with it, the rubberband is invisible.

Expected outcome

Matplotlib version

  • Operating system: archlinux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): gtk3agg/gtk3cairo
  • Python version: 38
  • Jupyter version (if applicable):
  • Other libraries: pygobject 3.36.1, may be worth trying earlier ones... (if it's a regression there this may not be release critical)
@anntzer anntzer added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. GUI: gtk labels Jun 26, 2020
@anntzer anntzer added this to the v3.3.0 milestone Jun 26, 2020
@QuLogic
Copy link
Member

QuLogic commented Jun 26, 2020

With #17772, the rubberband works for me, but it is not perfect, as it flashes and disappears if you stop moving the cursor.

@anntzer
Copy link
Contributor Author

anntzer commented Jun 27, 2020

A bisect suggest this has been broken ever since #10209 and that the correct fix is along the lines of restoring

diff --git i/lib/matplotlib/backends/backend_gtk3.py w/lib/matplotlib/backends/backend_gtk3.py
index 31d20f3e6..62d85fe39 100644
--- i/lib/matplotlib/backends/backend_gtk3.py
+++ w/lib/matplotlib/backends/backend_gtk3.py
@@ -294,6 +294,9 @@ class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase):
         # docstring inherited
         if self.is_drawable():
             self.queue_draw()
+            # do a synchronous draw (its less efficient than an async draw,
+            # but is required if/when animation is used)
+            self.get_property("window").process_updates(False)
 
     def draw_idle(self):
         # docstring inherited

but I guess it seems costly to always do this, may be nicer to only do this on draw_rubberband but this doesn't seem to work there...

@tacaswell
Copy link
Member

I merged #17772 to bank the crash fix.

QuLogic added a commit to QuLogic/matplotlib that referenced this issue Jul 10, 2020
Just like Qt, the drawing should only be done in the draw (paint) event,
so move the rubberband draw there. Also, make it black-and-white like
the Qt one.

Fixes matplotlib#17773.
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Jul 10, 2020
Just like Qt, the drawing should only be done in the draw (paint) event,
so move the rubberband draw there. Also, make it black-and-white like
the Qt one.

Fixes matplotlib#17773.
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Jul 15, 2020
Just like Qt, the drawing should only be done in the draw (paint) event,
so move the rubberband draw there. Also, make it black-and-white like
the Qt one.

Fixes matplotlib#17773.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: gtk Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants