Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original issue was created by a portion of commit 3e84e9f which I'll refer to as "problematic commit".
My fix185 branch originally undid a portion of the problematic commit, and the outstanding issue relates to other portions of that same commit.
What isn't clear to me is the purpose of the function check_gtk inside Shell.py, which was added in the problematic commit. For some reason, it unconditionally returns mode 'tkthread' if gtk was safely imported and hasattr 'set_interactive', regardless of what mode was passed to it. This "functionality" is not used with the -pylab flag, which is why original one line change did not fix the issue for "ipython -gthread"
I added another commit to the fix185 branch which removes check_gtk() altogether, and see no issues using ipython -gthread, ipython -gthread -pylab, or ipython -pylab. Additionally, the check_gtk() imported gtk regardless of what mode the user selected, and might also be what's been causing the "Why is IPython using X11" threads on the mailing list.
also, I just want to note here that users will see this issue if they use e.g "ipython -gthread" but their matplotlib is set to some other backend by default (say "WX").