mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 17:17:09 -04:00
Mobile webclient: Try to fix issue where webclient would end up stuck as unfocused, and pressing 'Back to Game' did nothing (e.g. after clicking OK to the 'ran out of memory' dialog in chrome on android)
You can still force focus to be regained by switching to another tab or triggering the on-screen keyboard somehow by e.g. trying to change an option - although that was pretty unintuitive
This commit is contained in:
parent
d3a0ba8808
commit
183acf7b0f
@ -102,6 +102,14 @@ extern void interop_AdjustXY(int* x, int* y);
|
||||
static EM_BOOL OnTouchStart(int type, const EmscriptenTouchEvent* ev, void* data) {
|
||||
const EmscriptenTouchPoint* t;
|
||||
int i, x, y;
|
||||
/* Because we return true to cancel default browser behaviour, sometimes we also */
|
||||
/* end up preventing the default 'focus gained' behaviour from occurring */
|
||||
/* So manually activate focus as a workaround */
|
||||
if (!WindowInfo.Focused) {
|
||||
WindowInfo.Focused = true;
|
||||
Event_RaiseVoid(&WindowEvents.FocusChanged);
|
||||
}
|
||||
|
||||
for (i = 0; i < ev->numTouches; ++i) {
|
||||
t = &ev->touches[i];
|
||||
if (!t->isChanged) continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user