KLWP Screen Resolution Change

As it's already known, changing phone screen resolution causes KLWP wallpaper to not fit the screen anymore, solutions to this would be to restart the phone or go in to the app and change the main scale.

I change my S8+ screen resolution from WQHD to HD+, I noticed that:

si(rwidth) is always 720 when KLWP fits the screen and changes to 360 when phone screen resolution changes (revers back to 720 after phone restart)

si(sdpi) is always 640 on WQHD and 320 on HD+

I put all my items inside an Overlay and made this formula for the Overlay scale:

$if((si(rwidth) = 360) & (si(sdpi) = 320),50,if((si(rwidth) = 1440) & (si(sdpi) = 640),200,100))$

it should results to 50 when KLWP is not fitting the screen and 100 when it does (1440 is after restarting the phone and changing the resolution from HD+ to WQHD)

- When i turn the screen off and on, KLWP toggles between fit and not fit each time and it takes almost a second after screen on to do it, so one time it fits, the second it does not fit

- When I open the app and hit save it always automatically reverts to the right scale to fit the screen (50 or 100), no matter how many times I do it, it always fits correctly, without toggling

- When I restart rwidth is back to 720 and scale is always 100 and everything works fine

Why does it toggle and do not take the right scale ?

Other solutions were:

2- Send tasker screen resolution automatically when the screen turns on to KLWP, and this forces KLWP to change the formula, this worked, but it does not change if the sent variable was same as previous, I had to send another variable, wait 1 second, then send the correct one.

3- Manually change the scale from inside the app

4- Manually make tasker change the new scale after changing the resolution

5- Something is happening while restarting the phone that makes KLWP adopt the correct scale, and make the 100 the correct to fit the screen resolution whatever it was. How can we simulate this without restarting?