Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/matplotlib/backends/backend_tkagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ def destroy(*args):
self.window.update()
else:
self.canvas.draw_idle()
# Raise the new window.
self.canvas.manager.window.attributes('-topmost', 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make this a method on the FigureManager[TkAgg] - that way we can re-use in code too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long-term, it might make sense to have a standard API for requests to the window manager. (We can't do more than make requests; each particular window manager has the final say.) I'm reluctant to try to design this now, though, so I'm not sure it would be a good idea to add to our public API by putting this (and the raise() in qt) into methods. It's debatable, and I have been on the fence about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.canvas.manager.window.attributes('-topmost', 0)
self._shown = True

def destroy(self, *args):
Expand Down