FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Raises the Figures windows when issuing a blocking show() on the macosx backend. by gellule · Pull Request #663 · matplotlib/matplotlib · GitHub

Repository navigation

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

Closed
gellule wants to merge 1 commit into
matplotlib:masterfrom
gellule:master
Closed

gellule wants to merge 1 commit into
matplotlib:masterfrom
gellule:master

Conversation

gellule commented Jan 6, 2012

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
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 commented Jan 6, 2012

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown

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 commented Jan 10, 2012

Copy link
Copy Markdown
Contributor Author

@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?

Copy link
Copy Markdown

@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 commented Jan 10, 2012

Copy link
Copy Markdown
Contributor Author

@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.

Copy link
Copy Markdown

@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 commented Jan 10, 2012

Copy link
Copy Markdown
Contributor Author

@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 commented Jan 25, 2012

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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 commented Mar 5, 2012

Copy link
Copy Markdown
Contributor Author

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

gellule closed this Mar 5, 2012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL