I’ve tested this patch, and it is working. This was very annoying not to be able to correctly use my 2 monitors under Linux, but this patch from bodisiw corrected it
http://www.adbe.org/juceforum/viewtopic.php?t=205
Maybe the linux OpenGL patch could be included too.
http://www.adbe.org/juceforum/viewtopic.php?t=200
As far as I remember, Jules, you said that you’re going to reorganize the OpenGL code so that platform specific code goes in platform specific files.
I would also like to have a DialogWindow::setBackgroundColor (so the dialog editor will not require ugly memory hacks). Maybe this could even be done in Component or refactored. I think the current LookAndFeel behavior is very “strange”, because many component are not using L&F.
For example, the TextEditor is using its own setColours, the ArrowButton is not exporting its color after construction (could this be done too ?).
I think you should add a getOutlineColour / getDefaultBackground on the L&F class and let the TextEditor/ComboBox/etc… rely on the value there so it is really easier to change the whole application look and feel (we will only have to overload the getOutlineColour / getDB methods), instead of having to tweak each component.
Even better, the getDefaultBackground could be a template method taking a Component * argument (as default template argument). So if you want to have a, let’s say “blue” background for your dialog window, you will specialize the template definition of getDefaultBackground for DialogWindow *, but the default template will return a “lavender” background (so TextEditor will still be visually different).
This will only require 2 lines of code (can it be done better ?) like this:
[In LookAndFeel]
template <T = Component *>
const Colour & getDefaultBackground(T) { return Colours::lavender; }
template <>
const Colour & getDefaultBackground(DialogWindow *) { return Colours::blue; }
[In the any component paint class]
g.fillAll(getLookAndFeel().getDefaultBackground(this));
A similar approach could be done for home made drawing by simply adding a “bool isOverridden(T, Graphics & g)” method to L&F that returns false for default template argument (Component *).
Then in each component paint method, you should call the L&F isOverridden(this, g) method, and depending on the results (false means drawing like it is done now, true means don’t draw, it is done in the override), so that each component’s drawing could easily be changed.
That’s the idea.
I hope it helps, feel free to mail me if you want me to give a try to this.