mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fix issue where windows with titlebars reported the wrong transparency kind
This commit is contained in:
parent
9a93fb03a4
commit
0ed2ae64fa
1 changed files with 9 additions and 14 deletions
|
|
@ -1693,16 +1693,6 @@ public:
|
||||||
|
|
||||||
TransparencyKind getTransparencyKind() const
|
TransparencyKind getTransparencyKind() const
|
||||||
{
|
{
|
||||||
if (hasTitleBar())
|
|
||||||
{
|
|
||||||
// If you hit this assertion, you're trying to create a window with a native titlebar
|
|
||||||
// and per-pixel transparency. If you want a semi-transparent window, then remove the
|
|
||||||
// native title bar. Otherwise, ensure that the window's component is opaque.
|
|
||||||
jassert (transparencyKind != TransparencyKind::perPixel);
|
|
||||||
return transparencyKind == TransparencyKind::perPixel ? TransparencyKind::opaque
|
|
||||||
: TransparencyKind::constant;
|
|
||||||
}
|
|
||||||
|
|
||||||
return transparencyKind;
|
return transparencyKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2622,12 +2612,17 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static TransparencyKind computeTransparencyKind (const Component& comp)
|
TransparencyKind computeTransparencyKind() const
|
||||||
{
|
{
|
||||||
if (! comp.isOpaque())
|
if (! hasTitleBar() && ! component.isOpaque())
|
||||||
return TransparencyKind::perPixel;
|
return TransparencyKind::perPixel;
|
||||||
|
|
||||||
if (comp.getAlpha() < 1.0f)
|
// If you hit this assertion, you're trying to create a window with a native titlebar
|
||||||
|
// and per-pixel transparency. If you want a semi-transparent window, then remove the
|
||||||
|
// native title bar. Otherwise, ensure that the window's component is opaque.
|
||||||
|
jassert (! hasTitleBar() || component.isOpaque());
|
||||||
|
|
||||||
|
if (component.getAlpha() < 1.0f)
|
||||||
return TransparencyKind::constant;
|
return TransparencyKind::constant;
|
||||||
|
|
||||||
return TransparencyKind::opaque;
|
return TransparencyKind::opaque;
|
||||||
|
|
@ -2635,7 +2630,7 @@ private:
|
||||||
|
|
||||||
void setLayeredWindow()
|
void setLayeredWindow()
|
||||||
{
|
{
|
||||||
const auto old = std::exchange (transparencyKind, computeTransparencyKind (component));
|
const auto old = std::exchange (transparencyKind, computeTransparencyKind());
|
||||||
|
|
||||||
if (old == getTransparencyKind())
|
if (old == getTransparencyKind())
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue