# Window scaling with OpenGL context

**URL:** <https://forum.juce.com/t/window-scaling-with-opengl-context/50242>\
**Category:** Development\
**Created:** [February 17, 2022, 8:01pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242 "2022-02-17T20:01:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shg](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@shg](https://forum.juce.com/u/shg)\
**Post date:** [February 17, 2022, 8:01pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242/1 "2022-02-17T20:01:00Z")

</div>

I’m in trouble of scaling window on Mac with attaching OpenGL to TopLevelComponent.  
I’m trying to scale by these,

```auto
juce::Desktop::getInstance().setGlobalScaleFactor(s);
this->setSize(width, height);|

```

These work fine without attaching openGLContext, but doesn’t work properly with attaching to TopLevelComponent.  
 ![Screen Shot 2022-02-17 at 11.38.46 AM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/4/479c48f8cf1198b209f29c38224349cf5057fb3c.jpeg)

I’m attaching the simple test codes, this has one child component having textButton to control scaling.

[Source.zip](https://forum.juce.com/uploads/short-url/tNO976QNaTX4bj9vRfI9LyB5iz2.zip) (8.0 KB)

I’d appreciate if I could have pointers.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 21, 2022, 7:27pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242/2 "2022-02-21T19:27:16Z")

</div>

This looks like a bug in JUCE itself. I’ll get that fixed shortly.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 23, 2022, 4:32pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242/3 "2022-02-23T16:32:08Z")

</div>

Thanks for reporting this issue. It should now be fixed on develop:

> <https://github.com/juce-framework/JUCE/commit/45ae98effdbc7e5f23e2b11299c74d577db85793>

---

<div class="post-metadata">

**Author:** ![shg](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@shg](https://forum.juce.com/u/shg)\
**Post date:** [February 23, 2022, 6:20pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242/4 "2022-02-23T18:20:35Z")

</div>

Thank you reuk. This has been fixed.

---

<div class="post-metadata">

**Author:** ![shg](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@shg](https://forum.juce.com/u/shg)\
**Post date:** [February 25, 2022, 8:46pm UTC](https://forum.juce.com/t/window-scaling-with-opengl-context/50242/5 "2022-02-25T20:46:32Z")

</div>

Hi reuk,  
It seems this hasn’t been fixed completely on vst3.

It get to be like these when I scale on DAW,  
100% to 130%

 ![Screen Shot 2022-02-25 at 12.40.01 PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/3/35865341bdfb9272d295a3d8bc20c6836310bbf8.jpeg)

130% to 100%

 ![Screen Shot 2022-02-25 at 12.40.09 PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/9/97953f12d998c4b4062392b17f3bb459c7b327c4.png)  
It becomes properly scaled once close and open the window. AU, vst2 and standalone app work properly.  
I didn’t notice this because I checked on standalone app only.
