summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 953d5ea4..ef941798 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -606,6 +606,7 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
606#endif 606#endif
607 setCurrent_Text(d->base.text); 607 setCurrent_Text(d->base.text);
608 SDL_GetRendererOutputSize(d->base.render, &d->base.size.x, &d->base.size.y); 608 SDL_GetRendererOutputSize(d->base.render, &d->base.size.x, &d->base.size.y);
609 d->maxDrawableHeight = d->base.size.y;
609 setupUserInterface_MainWindow(d); 610 setupUserInterface_MainWindow(d);
610 postCommand_App("~bindings.changed"); /* update from bindings */ 611 postCommand_App("~bindings.changed"); /* update from bindings */
611 /* Load the border shadow texture. */ { 612 /* Load the border shadow texture. */ {
@@ -1011,8 +1012,19 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
1011 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.sysframe") && mw) { 1012 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.sysframe") && mw) {
1012 /* This command is sent on Android to update the keyboard height. */ 1013 /* This command is sent on Android to update the keyboard height. */
1013 const char *cmd = command_UserEvent(ev); 1014 const char *cmd = command_UserEvent(ev);
1014 setKeyboardHeight_MainWindow(mw, argLabel_Command(cmd, "fullheight") - 1015 /*
1015 argLabel_Command(cmd, "bottom")); 1016 0
1017 |
1018 top
1019 | |
1020 | bottom (top of keyboard) :
1021 | | : keyboardHeight
1022 maxDrawableHeight :
1023 |
1024 fullheight
1025 */
1026 setKeyboardHeight_MainWindow(mw, argLabel_Command(cmd, "top") +
1027 mw->maxDrawableHeight - argLabel_Command(cmd, "bottom"));
1016 return iTrue; 1028 return iTrue;
1017 } 1029 }
1018 if (processEvent_Touch(&event)) { 1030 if (processEvent_Touch(&event)) {
@@ -1245,11 +1257,15 @@ void draw_MainWindow(iMainWindow *d) {
1245 isDrawing_ = iTrue; 1257 isDrawing_ = iTrue;
1246 setCurrent_Text(d->base.text); 1258 setCurrent_Text(d->base.text);
1247 /* Check if root needs resizing. */ { 1259 /* Check if root needs resizing. */ {
1260 const iBool wasPortrait = isPortrait_App();
1248 iInt2 renderSize; 1261 iInt2 renderSize;
1249 SDL_GetRendererOutputSize(w->render, &renderSize.x, &renderSize.y); 1262 SDL_GetRendererOutputSize(w->render, &renderSize.x, &renderSize.y);
1250 if (!isEqual_I2(renderSize, w->size)) { 1263 if (!isEqual_I2(renderSize, w->size)) {
1251 updateSize_MainWindow_(d, iTrue); 1264 updateSize_MainWindow_(d, iTrue);
1252 processEvents_App(postedEventsOnly_AppEventMode); 1265 processEvents_App(postedEventsOnly_AppEventMode);
1266 if (isPortrait_App() != wasPortrait) {
1267 d->maxDrawableHeight = renderSize.y;
1268 }
1253 } 1269 }
1254 } 1270 }
1255 const int winFlags = SDL_GetWindowFlags(d->base.win); 1271 const int winFlags = SDL_GetWindowFlags(d->base.win);