The second call of onSizeChanged in surface view is ignored

Hello,

I’ve reproduced the old bug (#743) mentioned in this topic.
So far it occurs only on Kindle Fire (1st Gen) when you launch app from Carousel screen and obviously is caused by their soft buttons (“options bar”, see Kindle Fire User’s Guide) behavior.

After app’s launch onSizeChanged method in Cocos2dxGLSurfaceView.java is called with full size (600*1024 in my case) and then nativeInit is called.
After that options bar appears (its small, “hidden” version) and onSizeChanged is called again (with 600*1004 size in my case) but native code isn’t notified about that.
As the result cocos2d-x view is moved up and cut for 20px.

P.S. Using cocos2d-x v2.2.0.

Thanks in advance,
— Nick

Is there a workaround for this old bug? Currently having the same issue on the 1st gen Kindle Fire.

Add code below to AppDelegate class, Maybe you need to calculate your node’s position again after applicationScreenSizeChanged by add some function like onSizeChanged to your layer.
I tried in cocos2dx 3.3 final, and it works. Hope it works for you.

void AppDelegate::applicationScreenSizeChanged(int newWidth, int newHeight) {

cocos2d::Application::applicationScreenSizeChanged(newWidth, newHeight);

auto director = Director::getInstance();
 auto glview = director->getOpenGLView();
if (glview != nullptr) {
	glview->setFrameSize(newWidth, newHeight);
	// Set the design resolution
	glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::FIXED_WIDTH);
}

}