+void fgPlatformHandleKeyboardHeight(SFG_Window* window, int height)
+{
+ int size[2];
+ int screenHeight;
+ int nScreenHeight = -1;
+
+ screenHeight = glutGet(GLUT_WINDOW_HEIGHT); //Using this takes rotation into account
+ if(height == 0) {
+ nScreenHeight = screenHeight;
+ }
+ else if(!screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_POSITION, size)) {
+ /* Calculate the new screen size */ //XXX Make sure to use display size instead of screen size
+ nScreenHeight = ((size[1] + screenHeight) - height) - size[1];
+ }
+
+ if(nScreenHeight != -1) {
+ /* If nScreenHeight is less then zero then window is covered. If nScreenHeight == height, then no change in size. Else, change in size */
+
+ int screenWidth = glutGet(GLUT_WINDOW_WIDTH);
+ if(nScreenHeight < 0) {
+ LOGI("fgPlatformHandleKeyboardHeight: Covered window state");
+ window->State.Visible = GL_FALSE;
+ window->State.pWState.windowCovered = GL_TRUE;
+ INVOKE_WCB(*window, WindowStatus, (GLUT_FULLY_COVERED));
+ fghOnReshapeNotify(window, screenWidth, 0, GL_FALSE);
+ } else {
+ if(window->State.pWState.windowCovered == GL_TRUE) {
+ LOGI("fgPlatformHandleKeyboardHeight: Resetting window state");
+
+ /* Reset window status if it was previously covered */
+ switch(window->State.pWState.windowState) {
+ case NAVIGATOR_WINDOW_FULLSCREEN:
+ window->State.Visible = GL_TRUE;
+ INVOKE_WCB(*window, WindowStatus, (GLUT_FULLY_RETAINED));
+ break;
+ case NAVIGATOR_WINDOW_THUMBNAIL:
+ window->State.Visible = GL_TRUE;
+ INVOKE_WCB(*window, WindowStatus, (GLUT_PARTIALLY_RETAINED));
+ break;
+ case NAVIGATOR_WINDOW_INVISIBLE:
+ window->State.Visible = GL_FALSE;
+ INVOKE_WCB(*window, WindowStatus, (GLUT_HIDDEN));
+ break;
+ }
+ window->State.pWState.windowCovered = GL_FALSE;
+ }
+ fghOnReshapeNotify(window, screenWidth, nScreenHeight, GL_FALSE);
+ }
+ }
+}
+