Skip to content

tkagg: raise each new window; partially addresses #596 #5951

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

Merged
merged 1 commit into from
Feb 3, 2016
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