Skip to content

Fix show command for Qt backend to raise window to top #1043

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
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion lib/matplotlib/backends/backend_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ def __init__( self, canvas, num ):

if matplotlib.is_interactive():
self.window.show()
self.window.raise_()

# attach a show method to the figure for pylab ease of use
self.canvas.figure.show = lambda *args: self.window.show()
self.canvas.figure.show = lambda *args: self.window.show() and self.window.raise_()

def notify_axes_change( fig ):
# This will be called whenever the current axes is changed
Expand Down Expand Up @@ -285,6 +286,7 @@ def resize(self, width, height):

def show(self):
self.window.show()
self.window.raise_()

def destroy( self, *args ):
if self.window._destroying: return
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/backends/backend_qt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,10 @@ def __init__( self, canvas, num ):

if matplotlib.is_interactive():
self.window.show()
self.window.raise_()

# attach a show method to the figure for pylab ease of use
self.canvas.figure.show = lambda *args: self.window.show()
self.canvas.figure.show = lambda *args: self.window.show() and self.window.raise_()

def notify_axes_change( fig ):
# This will be called whenever the current axes is changed
Expand Down Expand Up @@ -474,6 +475,7 @@ def resize(self, width, height):

def show(self):
self.window.show()
self.window.raise_()

def destroy( self, *args ):
# check for qApp first, as PySide deletes it in its atexit handler
Expand Down