Skip to content
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

Raises the Figures windows when issuing a blocking show() on the macosx backend. #663

Closed
wants to merge 1 commit into from

Conversation

gellule
Copy link
Contributor

@gellule gellule commented Jan 6, 2012

Currently when issuing a blocking show() on the macosx backend, the figures appear in the background, and the shell (or application) that holds the python interpreter stays active. The user has to make the figures active by clicking on them, interact with them, and then close them to keep going. Why not directly make the figure active, since the only way to keep going is to close the windows?

This is done by issuing an activateIgnoringOtherApps:YES on NSApp, in
the show() method of the macosx backend.
@WeatherGod
Copy link
Member

This has been a known issue, and I think the only reason why it hasn't been done is that none of us knew how to do it properly.

@gellule
Copy link
Contributor Author

gellule commented Jan 6, 2012

I will let other confirm this is not too unproper. :)
So far I was working around it by using pyobjc:

from AppKit import NSApplication

and issuing just before show():

NSApplication.sharedApplication().activateIgnoringOtherApps_(True)
pylab.show()

It worked, but the pull request should achieve the same thing within the macosx backend show() method.

@jiffyclub
Copy link

I just tried a checkout from @gellule's master fork to see if it fixed #665. There was no change in the behavior I see in #665, but also the plot window was not raised to the foreground.

@gellule
Copy link
Contributor Author

gellule commented Jan 10, 2012

@jiffyclub: If I read #665 correctly, you are in interactive mode. My pull request only raises the plot window if in non-interactive mode. Are you expecting from the show() command that it also yields the focus to the plot window in interactive mode?

@jiffyclub
Copy link

@gellule, I am not in interactive mode. I'm using plt.show() and I don't see any difference using your pull request and using the matplotlib main code.

@gellule
Copy link
Contributor Author

gellule commented Jan 10, 2012

@jiffyclub Thanks for the answer. #665 does not seem related to the current pull request. But because of #665 (comment), and because you are the only person (that I know of) who tried my branch, could you please check that you are using the version of matplotlib you pulled from my branch? Maybe with a:

import pylab
print(pylab.__file__)

Thanks.

@jiffyclub
Copy link

@gellule the command I used to install was pip install git+git://github.com/gellule/matplotlib.git.

Out of curiosity, are you using Lion? I suspect the problems I'm having with #665 are Lion related and not seeing the expected behavior here is probably also a Lion effect. But if you're using Lion it's back to the drawing board on that idea.

@gellule
Copy link
Contributor Author

gellule commented Jan 10, 2012

@jiffyclub I just wanted to make sure that either you had one copy of matplotlib installed, or were using the correct one.

I am also on Lion. However, I'm getting python and others (including matplotlib) from macports. Except for my matplotlib checkout that I use locally.

@gellule
Copy link
Contributor Author

gellule commented Jan 25, 2012

Looks like this pull request could be... pulled? :)
At least one person tested the change successfully, as reported on the matplotlib-devel mailing list.

@WeatherGod
Copy link
Member

I guess we could pull it and see what others think. I guess a partial solution is better than none at all? Any objections Mike?

@gellule
Copy link
Contributor Author

gellule commented Mar 5, 2012

Thank you!
This pull request is now replaced by #741: closing.

@gellule gellule closed this Mar 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants