diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/window.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index ef941798..af36bb22 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -1023,8 +1023,12 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
1023 | | | 1023 | | |
1024 | fullheight | 1024 | fullheight |
1025 | */ | 1025 | */ |
1026 | setKeyboardHeight_MainWindow(mw, argLabel_Command(cmd, "top") + | 1026 | const int top = argLabel_Command(cmd, "top"); |
1027 | mw->maxDrawableHeight - argLabel_Command(cmd, "bottom")); | 1027 | const int bottom = argLabel_Command(cmd, "bottom"); |
1028 | if (!SDL_IsScreenKeyboardShown(mw->base.win)) { | ||
1029 | mw->maxDrawableHeight = bottom - top; | ||
1030 | } | ||
1031 | setKeyboardHeight_MainWindow(mw, top + mw->maxDrawableHeight - bottom); | ||
1028 | return iTrue; | 1032 | return iTrue; |
1029 | } | 1033 | } |
1030 | if (processEvent_Touch(&event)) { | 1034 | if (processEvent_Touch(&event)) { |
@@ -1475,6 +1479,7 @@ iBool isOpenGLRenderer_Window(void) { | |||
1475 | } | 1479 | } |
1476 | 1480 | ||
1477 | void setKeyboardHeight_MainWindow(iMainWindow *d, int height) { | 1481 | void setKeyboardHeight_MainWindow(iMainWindow *d, int height) { |
1482 | height = iMax(0, height); | ||
1478 | if (d->keyboardHeight != height) { | 1483 | if (d->keyboardHeight != height) { |
1479 | d->keyboardHeight = height; | 1484 | d->keyboardHeight = height; |
1480 | postCommandf_App("keyboard.changed arg:%d", height); | 1485 | postCommandf_App("keyboard.changed arg:%d", height); |