-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use rcParams to control default "raise window" behavior (Qt,Gtk,Tk,Wx) #15440
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
Merged
jklymak
merged 2 commits into
matplotlib:master
from
immaxchen:add-rcparams-to-control-raise-window-behavior-gh8692
Jan 28, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
:orphan: | ||
|
||
rcParams for controlling default "raise window" behavior | ||
-------------------------------------------------------- | ||
The new config option ``rcParams['figure.raise_window']`` allows to disable | ||
raising the plot window when calling ``plt.show`` or ``plt.pause`` methods. | ||
``MacOSX`` backend is currently not supported. | ||
|
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does GTK3 need a draw now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I am testing with Gtk3 and turn off the "raise window", I encountered a strange behavior, that the GUI window is reluctant to update, and the whole program get stuck, loop is not running, until I move/switch the GUI window or moving my mouse cursor on the canvas, it can continue to run/update.
After debug and tracing, I found the program is stuck inside the
Gtk.main_iteration()
here:By looking into the doc, it says if there is no event queued,
main_iteration
will block until the next event is noticed, but that's very strange since we have already checked withevents_pending
, if there is no event it should not go into the while-loop. Nevertheless, I changed usingGtk.gtk_main_iteration_do(False)
which the doc states that it won't block, however, that's not working, the program still get stuck insidegtk_main_iteration_do
. Finally, I come up with a solution: to callwindow.queue_draw()
right afterwindow.show()
and successfully I don't have to waving my mouse cursor over the canvas any more. And I found that this is exactly whatcanvas.draw()
is doing, and the same approach is also used in thebackend_wx.py
, so I suppose this is the right way to do it? I am not familiar with the GUI stuff so I have no idea what's happening, please feel free to correct me.This is the full report, HaHa!! Thank you so much for your patience reading this mumbo jumbo!! 😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you test with
draw_idle
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, won't update, need stick to
draw