Resizing window didn't account for toolbar and status bar heights.
This PR duplicates #748, but is based off of v1.1.x instead of master.
Fix bug when resizing qt4 figure window.
Sorry to be dense but what do I need to do to see the before and after behavior. I tries launching the simple_plot.py example before and after w/ the qt4agg backend and resizing the window, but didn't notice any difference.
Sorry, I wasn't clear in the pull request: this is for resizing in code. I sent the following to the mailing list, but forgot to add it to the PR.
import matplotlib as mpl
import matplotlib.pyplot as plt
fig = plt.figure()
fig.set_size_inches(2, 2, forward=True)
In theory, the two figures should be the same size, but since the code path for set_size_inches doesn't account for the bar heights, the figures are different sizes.
BTW, in the email, I mentioned that I couldn't test whether this change affected figure.set_figwidth or figure.set_figheight because I couldn't get the figure to update with these settings (i.e. the set the figure's bbox_inches attribute but this doesn't get called when drawn). The forward parameter here accesses a block of code that doesn't seem to be available elsewhere, which is a bit confusing (I would expect set_figwidth and set_figheight to have access to the same code).
This anomaly is not confined to the qt4agg backend; I see it in the gtkagg backend also. TkAgg gives wildly different sizes. WxAgg gives two windows the same size, but without the unit aspect ratio that the canvas area should have.
It's a real mess.
Yeah, I noticed the TkAgg issue as well (I don't have GTK or Wx installed). I tried to dig into the TkAgg backend, but for some reason, I came to the conclusion that I would not be able to figure out a fix without considerable effort.
And macosx has issues too: resizing causes a dark gray region to shrink to the specified size, but the window itself remains unchanged.
Ah, this is a mess. It would be great to get to the bottom of this. And while, of course, it's ideal to fix this in all backends, since this is really a bugfix and not a new feature, I think it's find to merge this and file a new issue that resizing doesn't work correctly in the gtk, wx, tk backends. Better that than to hold up this PR waiting for all the other backends to be fixed.