From bfee1681752451aef3dafd74ff94bb013d78cc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 17 Apr 2021 22:33:44 +0200 Subject: [PATCH] Don't even bother checking touch.id == 0 for closing popup windows. It's fine to close with any touch. Fixes issue with touch on Windows mentioned in #14387 Also includes a warning fix. --- Common/UI/UIScreen.cpp | 2 +- UI/ChatScreen.cpp | 2 +- Windows/TouchInputHandler.h | 1 - android/src/org/ppsspp/ppsspp/NativeActivity.java | 4 +++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index 98518c703e..3a852dc2ee 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -222,7 +222,7 @@ PopupScreen::PopupScreen(std::string title, std::string button1, std::string but } bool PopupScreen::touch(const TouchInput &touch) { - if (!box_ || (touch.flags & TOUCH_DOWN) == 0 || touch.id != 0) { + if (!box_ || (touch.flags & TOUCH_DOWN) == 0) { return UIDialogScreen::touch(touch); } diff --git a/UI/ChatScreen.cpp b/UI/ChatScreen.cpp index b21d64d27e..c93d755e42 100644 --- a/UI/ChatScreen.cpp +++ b/UI/ChatScreen.cpp @@ -196,7 +196,7 @@ void ChatMenu::UpdateChat() { } bool ChatMenu::touch(const TouchInput &touch) { - if (!box_ || (touch.flags & TOUCH_DOWN) == 0 || touch.id != 0) { + if (!box_ || (touch.flags & TOUCH_DOWN) == 0) { return UIDialogScreen::touch(touch); } diff --git a/Windows/TouchInputHandler.h b/Windows/TouchInputHandler.h index 7d2761ecb7..457850298d 100644 --- a/Windows/TouchInputHandler.h +++ b/Windows/TouchInputHandler.h @@ -20,7 +20,6 @@ class TouchInputHandler { public: TouchInputHandler(); - ~TouchInputHandler(); void handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); void registerTouchWindow(HWND wnd); bool hasTouch(); diff --git a/android/src/org/ppsspp/ppsspp/NativeActivity.java b/android/src/org/ppsspp/ppsspp/NativeActivity.java index c859faf7c8..e0286d6102 100644 --- a/android/src/org/ppsspp/ppsspp/NativeActivity.java +++ b/android/src/org/ppsspp/ppsspp/NativeActivity.java @@ -1145,7 +1145,9 @@ public abstract class NativeActivity extends Activity { Uri selectedFile = data.getData(); if (selectedFile != null) { // Grab permanent permission so we can show it in recents list etc. - getContentResolver().takePersistableUriPermission(selectedFile, Intent.FLAG_GRANT_READ_URI_PERMISSION); + if (Build.VERSION.SDK_INT >= 19) { + getContentResolver().takePersistableUriPermission(selectedFile, Intent.FLAG_GRANT_READ_URI_PERMISSION); + } Log.i(TAG, "Browse file finished:" + selectedFile.toString()); NativeApp.sendMessage("browse_fileSelect", selectedFile.toString()); }