# "SerializeEditorState" doesn't save UI size in DAW project?

**URL:** <https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524>\
**Category:** Uncategorized\
**Created:** [14 December 2021 17:11 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524 "2021-12-14T17:11:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [14 December 2021 17:11 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524/1 "2021-12-14T17:11:45Z")

</div>

I’ve had some users complain that my plugin UI does not save it’s size when a DAW project is closed and re-opened. It appears that “SerializeEditorState” should be doing that - but it’s not.

How can I make this happen - i.e., save current UI size in the DAW project the same way it saves all the current parameter settings?

---

<div class="post-metadata">

**Author:** ![stw](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@stw](https://iplug2.discourse.group/u/stw)\
**Post date:** [14 December 2021 20:00 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524/2 "2021-12-14T20:00:57Z")

</div>

You can add the screen scale to your arbitrary serialized data in SerializeState.  
Get the scale factor with GetUI()-\>GetDrawScale().  
When unserializing you can call GetUI()–\>Resize(GetUI()–\>Width(), GetUI()–\>Height(), scale);  
There may be other solutions…

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [14 December 2021 22:26 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524/3 "2021-12-14T22:26:42Z")

</div>

Thank you - will look into it.

Curious why IPlug doesn’t do this (save the current UI size) by default as part of the UI state?

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [17 December 2021 13:20 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524/4 "2021-12-17T13:20:26Z")

</div>

> <https://github.com/iPlug2/iPlug2/issues/117#issuecomment-886043446>
>
> Currently the plugin editor state is valid only during the lifetime of the plug-…in and is not reloaded. VST3 has a infrastructure to support recall, but other APIs are less obvious. This needs discussion.

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [17 December 2021 18:41 UTC](https://iplug2.discourse.group/t/serializeeditorstate-doesnt-save-ui-size-in-daw-project/524/5 "2021-12-17T18:41:15Z")

</div>

Wow - I don’t remember asking this on GitHub - must be time for a break.

Thank you for the link/reminder.
