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
14 changes: 7 additions & 7 deletions IPython/lib/inputhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ def enable_gui(self, gui=None, app=None):
e = "Invalid GUI request {!r}, valid ones are: {}"
raise ValueError(e.format(gui, ', '.join(self.guihooks)))
self._current_gui = gui
return gui_hook.enable(app)

app = gui_hook.enable(app)
if app is not None:
app._in_event_loop = True
self.apps[gui] = app
return app

def disable_gui(self):
"""Disable GUI event loop integration.
Expand Down Expand Up @@ -315,8 +320,7 @@ def enable(self, app=None):
app = wx.GetApp()
if app is None:
app = wx.App(redirect=False, clearSigInt=False)
app._in_event_loop = True
self.manager.apps[GUI_WX] = app

return app

def disable(self):
Expand Down Expand Up @@ -357,8 +361,6 @@ def enable(self, app=None):
self.manager.set_inputhook(inputhook_qt4)
nope()

app._in_event_loop = True
self.manager.apps[GUI_QT4] = app
return app

def disable_qt4(self):
Expand Down Expand Up @@ -483,7 +485,6 @@ def enable(self, app=None):
glut.glutDisplayFunc( glut_display )
glut.glutIdleFunc( glut_idle)
self.manager.set_inputhook( inputhook_glut )
self.manager.apps[GUI_GLUT] = True


def disable(self):
Expand Down Expand Up @@ -544,7 +545,6 @@ def enable(self, app=None):
"""
from IPython.lib.inputhookgtk3 import inputhook_gtk3
self.manager.set_inputhook(inputhook_gtk3)
self.manager._current_gui = GUI_GTK


clear_inputhook = inputhook_manager.clear_inputhook
Expand Down