diff options
| -rw-r--r-- | src/common/logging/backend.cpp | 64 | ||||
| -rw-r--r-- | src/common/logging/backend.h | 2 | ||||
| -rw-r--r-- | src/common/logging/log_entry.h | 1 | ||||
| -rw-r--r-- | src/core/file_sys/program_metadata.cpp | 5 | ||||
| -rw-r--r-- | src/core/frontend/applets/software_keyboard.cpp | 5 | ||||
| -rw-r--r-- | src/core/frontend/applets/software_keyboard.h | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.cpp | 42 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.h | 3 | ||||
| -rw-r--r-- | src/yuzu/applets/qt_software_keyboard.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu/applets/qt_software_keyboard.h | 12 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
12 files changed, 96 insertions, 62 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 0e85a9c1d..c51c05b28 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <chrono> | 6 | #include <chrono> |
| 7 | #include <climits> | 7 | #include <climits> |
| 8 | #include <exception> | 8 | #include <exception> |
| 9 | #include <stop_token> | ||
| 9 | #include <thread> | 10 | #include <thread> |
| 10 | #include <vector> | 11 | #include <vector> |
| 11 | 12 | ||
| @@ -186,6 +187,10 @@ public: | |||
| 186 | initialization_in_progress_suppress_logging = false; | 187 | initialization_in_progress_suppress_logging = false; |
| 187 | } | 188 | } |
| 188 | 189 | ||
| 190 | static void Start() { | ||
| 191 | instance->StartBackendThread(); | ||
| 192 | } | ||
| 193 | |||
| 189 | Impl(const Impl&) = delete; | 194 | Impl(const Impl&) = delete; |
| 190 | Impl& operator=(const Impl&) = delete; | 195 | Impl& operator=(const Impl&) = delete; |
| 191 | 196 | ||
| @@ -201,7 +206,7 @@ public: | |||
| 201 | } | 206 | } |
| 202 | 207 | ||
| 203 | void PushEntry(Class log_class, Level log_level, const char* filename, unsigned int line_num, | 208 | void PushEntry(Class log_class, Level log_level, const char* filename, unsigned int line_num, |
| 204 | const char* function, std::string message) { | 209 | const char* function, std::string&& message) { |
| 205 | if (!filter.CheckMessage(log_class, log_level)) | 210 | if (!filter.CheckMessage(log_class, log_level)) |
| 206 | return; | 211 | return; |
| 207 | const Entry& entry = | 212 | const Entry& entry = |
| @@ -211,40 +216,41 @@ public: | |||
| 211 | 216 | ||
| 212 | private: | 217 | private: |
| 213 | Impl(const std::filesystem::path& file_backend_filename, const Filter& filter_) | 218 | Impl(const std::filesystem::path& file_backend_filename, const Filter& filter_) |
| 214 | : filter{filter_}, file_backend{file_backend_filename}, backend_thread{std::thread([this] { | 219 | : filter{filter_}, file_backend{file_backend_filename} {} |
| 215 | Common::SetCurrentThreadName("yuzu:Log"); | ||
| 216 | Entry entry; | ||
| 217 | const auto write_logs = [this, &entry]() { | ||
| 218 | ForEachBackend([&entry](Backend& backend) { backend.Write(entry); }); | ||
| 219 | }; | ||
| 220 | while (true) { | ||
| 221 | entry = message_queue.PopWait(); | ||
| 222 | if (entry.final_entry) { | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | write_logs(); | ||
| 226 | } | ||
| 227 | // Drain the logging queue. Only writes out up to MAX_LOGS_TO_WRITE to prevent a | ||
| 228 | // case where a system is repeatedly spamming logs even on close. | ||
| 229 | int max_logs_to_write = filter.IsDebug() ? INT_MAX : 100; | ||
| 230 | while (max_logs_to_write-- && message_queue.Pop(entry)) { | ||
| 231 | write_logs(); | ||
| 232 | } | ||
| 233 | })} {} | ||
| 234 | 220 | ||
| 235 | ~Impl() { | 221 | ~Impl() { |
| 236 | StopBackendThread(); | 222 | StopBackendThread(); |
| 237 | } | 223 | } |
| 238 | 224 | ||
| 225 | void StartBackendThread() { | ||
| 226 | backend_thread = std::thread([this] { | ||
| 227 | Common::SetCurrentThreadName("yuzu:Log"); | ||
| 228 | Entry entry; | ||
| 229 | const auto write_logs = [this, &entry]() { | ||
| 230 | ForEachBackend([&entry](Backend& backend) { backend.Write(entry); }); | ||
| 231 | }; | ||
| 232 | while (!stop.stop_requested()) { | ||
| 233 | entry = message_queue.PopWait(stop.get_token()); | ||
| 234 | if (entry.filename != nullptr) { | ||
| 235 | write_logs(); | ||
| 236 | } | ||
| 237 | } | ||
| 238 | // Drain the logging queue. Only writes out up to MAX_LOGS_TO_WRITE to prevent a | ||
| 239 | // case where a system is repeatedly spamming logs even on close. | ||
| 240 | int max_logs_to_write = filter.IsDebug() ? INT_MAX : 100; | ||
| 241 | while (max_logs_to_write-- && message_queue.Pop(entry)) { | ||
| 242 | write_logs(); | ||
| 243 | } | ||
| 244 | }); | ||
| 245 | } | ||
| 246 | |||
| 239 | void StopBackendThread() { | 247 | void StopBackendThread() { |
| 240 | Entry stop_entry{}; | 248 | stop.request_stop(); |
| 241 | stop_entry.final_entry = true; | ||
| 242 | message_queue.Push(stop_entry); | ||
| 243 | backend_thread.join(); | 249 | backend_thread.join(); |
| 244 | } | 250 | } |
| 245 | 251 | ||
| 246 | Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr, | 252 | Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr, |
| 247 | const char* function, std::string message) const { | 253 | const char* function, std::string&& message) const { |
| 248 | using std::chrono::duration_cast; | 254 | using std::chrono::duration_cast; |
| 249 | using std::chrono::microseconds; | 255 | using std::chrono::microseconds; |
| 250 | using std::chrono::steady_clock; | 256 | using std::chrono::steady_clock; |
| @@ -257,7 +263,6 @@ private: | |||
| 257 | .line_num = line_nr, | 263 | .line_num = line_nr, |
| 258 | .function = function, | 264 | .function = function, |
| 259 | .message = std::move(message), | 265 | .message = std::move(message), |
| 260 | .final_entry = false, | ||
| 261 | }; | 266 | }; |
| 262 | } | 267 | } |
| 263 | 268 | ||
| @@ -278,8 +283,9 @@ private: | |||
| 278 | ColorConsoleBackend color_console_backend{}; | 283 | ColorConsoleBackend color_console_backend{}; |
| 279 | FileBackend file_backend; | 284 | FileBackend file_backend; |
| 280 | 285 | ||
| 286 | std::stop_source stop; | ||
| 281 | std::thread backend_thread; | 287 | std::thread backend_thread; |
| 282 | MPSCQueue<Entry> message_queue{}; | 288 | MPSCQueue<Entry, true> message_queue{}; |
| 283 | std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()}; | 289 | std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()}; |
| 284 | }; | 290 | }; |
| 285 | } // namespace | 291 | } // namespace |
| @@ -288,6 +294,10 @@ void Initialize() { | |||
| 288 | Impl::Initialize(); | 294 | Impl::Initialize(); |
| 289 | } | 295 | } |
| 290 | 296 | ||
| 297 | void Start() { | ||
| 298 | Impl::Start(); | ||
| 299 | } | ||
| 300 | |||
| 291 | void DisableLoggingInTests() { | 301 | void DisableLoggingInTests() { |
| 292 | initialization_in_progress_suppress_logging = true; | 302 | initialization_in_progress_suppress_logging = true; |
| 293 | } | 303 | } |
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index cb7839ee9..bf785f402 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h | |||
| @@ -14,6 +14,8 @@ class Filter; | |||
| 14 | /// Initializes the logging system. This should be the first thing called in main. | 14 | /// Initializes the logging system. This should be the first thing called in main. |
| 15 | void Initialize(); | 15 | void Initialize(); |
| 16 | 16 | ||
| 17 | void Start(); | ||
| 18 | |||
| 17 | void DisableLoggingInTests(); | 19 | void DisableLoggingInTests(); |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
diff --git a/src/common/logging/log_entry.h b/src/common/logging/log_entry.h index dd6f44841..b28570071 100644 --- a/src/common/logging/log_entry.h +++ b/src/common/logging/log_entry.h | |||
| @@ -22,7 +22,6 @@ struct Entry { | |||
| 22 | unsigned int line_num = 0; | 22 | unsigned int line_num = 0; |
| 23 | std::string function; | 23 | std::string function; |
| 24 | std::string message; | 24 | std::string message; |
| 25 | bool final_entry = false; | ||
| 26 | }; | 25 | }; |
| 27 | 26 | ||
| 28 | } // namespace Common::Log | 27 | } // namespace Common::Log |
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 35a53d36c..4e46c24cf 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp | |||
| @@ -53,13 +53,16 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | /*static*/ ProgramMetadata ProgramMetadata::GetDefault() { | 55 | /*static*/ ProgramMetadata ProgramMetadata::GetDefault() { |
| 56 | // Allow use of cores 0~3 and thread priorities 1~63. | ||
| 57 | constexpr u32 default_thread_info_capability = 0x30007F7; | ||
| 58 | |||
| 56 | ProgramMetadata result; | 59 | ProgramMetadata result; |
| 57 | 60 | ||
| 58 | result.LoadManual( | 61 | result.LoadManual( |
| 59 | true /*is_64_bit*/, FileSys::ProgramAddressSpaceType::Is39Bit /*address_space*/, | 62 | true /*is_64_bit*/, FileSys::ProgramAddressSpaceType::Is39Bit /*address_space*/, |
| 60 | 0x2c /*main_thread_prio*/, 0 /*main_thread_core*/, 0x00100000 /*main_thread_stack_size*/, | 63 | 0x2c /*main_thread_prio*/, 0 /*main_thread_core*/, 0x00100000 /*main_thread_stack_size*/, |
| 61 | 0 /*title_id*/, 0xFFFFFFFFFFFFFFFF /*filesystem_permissions*/, | 64 | 0 /*title_id*/, 0xFFFFFFFFFFFFFFFF /*filesystem_permissions*/, |
| 62 | 0x1FE00000 /*system_resource_size*/, {} /*capabilities*/); | 65 | 0x1FE00000 /*system_resource_size*/, {default_thread_info_capability} /*capabilities*/); |
| 63 | 66 | ||
| 64 | return result; | 67 | return result; |
| 65 | } | 68 | } |
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp index 12c76c9ee..c4863ee73 100644 --- a/src/core/frontend/applets/software_keyboard.cpp +++ b/src/core/frontend/applets/software_keyboard.cpp | |||
| @@ -16,7 +16,8 @@ DefaultSoftwareKeyboardApplet::~DefaultSoftwareKeyboardApplet() = default; | |||
| 16 | 16 | ||
| 17 | void DefaultSoftwareKeyboardApplet::InitializeKeyboard( | 17 | void DefaultSoftwareKeyboardApplet::InitializeKeyboard( |
| 18 | bool is_inline, KeyboardInitializeParameters initialize_parameters, | 18 | bool is_inline, KeyboardInitializeParameters initialize_parameters, |
| 19 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> submit_normal_callback_, | 19 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 20 | submit_normal_callback_, | ||
| 20 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 21 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 21 | submit_inline_callback_) { | 22 | submit_inline_callback_) { |
| 22 | if (is_inline) { | 23 | if (is_inline) { |
| @@ -128,7 +129,7 @@ void DefaultSoftwareKeyboardApplet::ExitKeyboard() const { | |||
| 128 | } | 129 | } |
| 129 | 130 | ||
| 130 | void DefaultSoftwareKeyboardApplet::SubmitNormalText(std::u16string text) const { | 131 | void DefaultSoftwareKeyboardApplet::SubmitNormalText(std::u16string text) const { |
| 131 | submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text); | 132 | submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text, true); |
| 132 | } | 133 | } |
| 133 | 134 | ||
| 134 | void DefaultSoftwareKeyboardApplet::SubmitInlineText(std::u16string_view text) const { | 135 | void DefaultSoftwareKeyboardApplet::SubmitInlineText(std::u16string_view text) const { |
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 29109306b..490c55cc2 100644 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h | |||
| @@ -57,7 +57,7 @@ public: | |||
| 57 | 57 | ||
| 58 | virtual void InitializeKeyboard( | 58 | virtual void InitializeKeyboard( |
| 59 | bool is_inline, KeyboardInitializeParameters initialize_parameters, | 59 | bool is_inline, KeyboardInitializeParameters initialize_parameters, |
| 60 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> | 60 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 61 | submit_normal_callback_, | 61 | submit_normal_callback_, |
| 62 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 62 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 63 | submit_inline_callback_) = 0; | 63 | submit_inline_callback_) = 0; |
| @@ -82,7 +82,7 @@ public: | |||
| 82 | 82 | ||
| 83 | void InitializeKeyboard( | 83 | void InitializeKeyboard( |
| 84 | bool is_inline, KeyboardInitializeParameters initialize_parameters, | 84 | bool is_inline, KeyboardInitializeParameters initialize_parameters, |
| 85 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> | 85 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 86 | submit_normal_callback_, | 86 | submit_normal_callback_, |
| 87 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 87 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 88 | submit_inline_callback_) override; | 88 | submit_inline_callback_) override; |
| @@ -106,7 +106,7 @@ private: | |||
| 106 | 106 | ||
| 107 | KeyboardInitializeParameters parameters; | 107 | KeyboardInitializeParameters parameters; |
| 108 | 108 | ||
| 109 | mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> | 109 | mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 110 | submit_normal_callback; | 110 | submit_normal_callback; |
| 111 | mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 111 | mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 112 | submit_inline_callback; | 112 | submit_inline_callback; |
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index c89aa1bbf..f38f53f69 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp | |||
| @@ -109,13 +109,18 @@ void SoftwareKeyboard::Execute() { | |||
| 109 | ShowNormalKeyboard(); | 109 | ShowNormalKeyboard(); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text) { | 112 | void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text, |
| 113 | bool confirmed) { | ||
| 113 | if (complete) { | 114 | if (complete) { |
| 114 | return; | 115 | return; |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | if (swkbd_config_common.use_text_check && result == SwkbdResult::Ok) { | 118 | if (swkbd_config_common.use_text_check && result == SwkbdResult::Ok) { |
| 118 | SubmitForTextCheck(submitted_text); | 119 | if (confirmed) { |
| 120 | SubmitNormalOutputAndExit(result, submitted_text); | ||
| 121 | } else { | ||
| 122 | SubmitForTextCheck(submitted_text); | ||
| 123 | } | ||
| 119 | } else { | 124 | } else { |
| 120 | SubmitNormalOutputAndExit(result, submitted_text); | 125 | SubmitNormalOutputAndExit(result, submitted_text); |
| 121 | } | 126 | } |
| @@ -273,13 +278,21 @@ void SoftwareKeyboard::ProcessTextCheck() { | |||
| 273 | 278 | ||
| 274 | std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); | 279 | std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); |
| 275 | 280 | ||
| 276 | std::u16string text_check_message = | 281 | std::u16string text_check_message = [this, &swkbd_text_check]() -> std::u16string { |
| 277 | swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure || | 282 | if (swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure || |
| 278 | swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm | 283 | swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm) { |
| 279 | ? Common::UTF16StringFromFixedZeroTerminatedBuffer( | 284 | return swkbd_config_common.use_utf8 |
| 280 | swkbd_text_check.text_check_message.data(), | 285 | ? Common::UTF8ToUTF16(Common::StringFromFixedZeroTerminatedBuffer( |
| 281 | swkbd_text_check.text_check_message.size()) | 286 | reinterpret_cast<const char*>( |
| 282 | : u""; | 287 | swkbd_text_check.text_check_message.data()), |
| 288 | swkbd_text_check.text_check_message.size() * sizeof(char16_t))) | ||
| 289 | : Common::UTF16StringFromFixedZeroTerminatedBuffer( | ||
| 290 | swkbd_text_check.text_check_message.data(), | ||
| 291 | swkbd_text_check.text_check_message.size()); | ||
| 292 | } else { | ||
| 293 | return u""; | ||
| 294 | } | ||
| 295 | }(); | ||
| 283 | 296 | ||
| 284 | LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", | 297 | LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", |
| 285 | GetTextCheckResultName(swkbd_text_check.text_check_result), | 298 | GetTextCheckResultName(swkbd_text_check.text_check_result), |
| @@ -583,11 +596,12 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() { | |||
| 583 | .disable_cancel_button{disable_cancel_button}, | 596 | .disable_cancel_button{disable_cancel_button}, |
| 584 | }; | 597 | }; |
| 585 | 598 | ||
| 586 | frontend.InitializeKeyboard(false, std::move(initialize_parameters), | 599 | frontend.InitializeKeyboard( |
| 587 | [this](SwkbdResult result, std::u16string submitted_text) { | 600 | false, std::move(initialize_parameters), |
| 588 | SubmitTextNormal(result, submitted_text); | 601 | [this](SwkbdResult result, std::u16string submitted_text, bool confirmed) { |
| 589 | }, | 602 | SubmitTextNormal(result, submitted_text, confirmed); |
| 590 | {}); | 603 | }, |
| 604 | {}); | ||
| 591 | } | 605 | } |
| 592 | } | 606 | } |
| 593 | 607 | ||
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.h b/src/core/hle/service/am/applets/applet_software_keyboard.h index 6009c10c7..a0fddd965 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.h +++ b/src/core/hle/service/am/applets/applet_software_keyboard.h | |||
| @@ -36,8 +36,9 @@ public: | |||
| 36 | * | 36 | * |
| 37 | * @param result SwkbdResult enum | 37 | * @param result SwkbdResult enum |
| 38 | * @param submitted_text UTF-16 encoded string | 38 | * @param submitted_text UTF-16 encoded string |
| 39 | * @param confirmed Whether the text has been confirmed after TextCheckResult::Confirm | ||
| 39 | */ | 40 | */ |
| 40 | void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text); | 41 | void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text, bool confirmed); |
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 43 | * Submits the input text to the application. | 44 | * Submits the input text to the application. |
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp index 8fc0c5a36..a83a11a95 100644 --- a/src/yuzu/applets/qt_software_keyboard.cpp +++ b/src/yuzu/applets/qt_software_keyboard.cpp | |||
| @@ -413,7 +413,7 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog( | |||
| 413 | ? ui->text_edit_osk->toPlainText().toStdU16String() | 413 | ? ui->text_edit_osk->toPlainText().toStdU16String() |
| 414 | : ui->line_edit_osk->text().toStdU16String(); | 414 | : ui->line_edit_osk->text().toStdU16String(); |
| 415 | 415 | ||
| 416 | emit SubmitNormalText(SwkbdResult::Ok, std::move(text)); | 416 | emit SubmitNormalText(SwkbdResult::Ok, std::move(text), true); |
| 417 | break; | 417 | break; |
| 418 | } | 418 | } |
| 419 | } | 419 | } |
| @@ -1510,7 +1510,8 @@ QtSoftwareKeyboard::~QtSoftwareKeyboard() = default; | |||
| 1510 | 1510 | ||
| 1511 | void QtSoftwareKeyboard::InitializeKeyboard( | 1511 | void QtSoftwareKeyboard::InitializeKeyboard( |
| 1512 | bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, | 1512 | bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, |
| 1513 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> submit_normal_callback_, | 1513 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 1514 | submit_normal_callback_, | ||
| 1514 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 1515 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 1515 | submit_inline_callback_) { | 1516 | submit_inline_callback_) { |
| 1516 | if (is_inline) { | 1517 | if (is_inline) { |
| @@ -1609,8 +1610,8 @@ void QtSoftwareKeyboard::ExitKeyboard() const { | |||
| 1609 | } | 1610 | } |
| 1610 | 1611 | ||
| 1611 | void QtSoftwareKeyboard::SubmitNormalText(Service::AM::Applets::SwkbdResult result, | 1612 | void QtSoftwareKeyboard::SubmitNormalText(Service::AM::Applets::SwkbdResult result, |
| 1612 | std::u16string submitted_text) const { | 1613 | std::u16string submitted_text, bool confirmed) const { |
| 1613 | submit_normal_callback(result, submitted_text); | 1614 | submit_normal_callback(result, submitted_text, confirmed); |
| 1614 | } | 1615 | } |
| 1615 | 1616 | ||
| 1616 | void QtSoftwareKeyboard::SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, | 1617 | void QtSoftwareKeyboard::SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, |
diff --git a/src/yuzu/applets/qt_software_keyboard.h b/src/yuzu/applets/qt_software_keyboard.h index 1a03c098c..592d9c085 100644 --- a/src/yuzu/applets/qt_software_keyboard.h +++ b/src/yuzu/applets/qt_software_keyboard.h | |||
| @@ -51,8 +51,8 @@ public: | |||
| 51 | void ExitKeyboard(); | 51 | void ExitKeyboard(); |
| 52 | 52 | ||
| 53 | signals: | 53 | signals: |
| 54 | void SubmitNormalText(Service::AM::Applets::SwkbdResult result, | 54 | void SubmitNormalText(Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, |
| 55 | std::u16string submitted_text) const; | 55 | bool confirmed = false) const; |
| 56 | 56 | ||
| 57 | void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, | 57 | void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, |
| 58 | std::u16string submitted_text, s32 cursor_position) const; | 58 | std::u16string submitted_text, s32 cursor_position) const; |
| @@ -234,7 +234,7 @@ public: | |||
| 234 | 234 | ||
| 235 | void InitializeKeyboard( | 235 | void InitializeKeyboard( |
| 236 | bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, | 236 | bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, |
| 237 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> | 237 | std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 238 | submit_normal_callback_, | 238 | submit_normal_callback_, |
| 239 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 239 | std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 240 | submit_inline_callback_) override; | 240 | submit_inline_callback_) override; |
| @@ -272,13 +272,13 @@ signals: | |||
| 272 | void MainWindowExitKeyboard() const; | 272 | void MainWindowExitKeyboard() const; |
| 273 | 273 | ||
| 274 | private: | 274 | private: |
| 275 | void SubmitNormalText(Service::AM::Applets::SwkbdResult result, | 275 | void SubmitNormalText(Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, |
| 276 | std::u16string submitted_text) const; | 276 | bool confirmed) const; |
| 277 | 277 | ||
| 278 | void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, | 278 | void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, |
| 279 | std::u16string submitted_text, s32 cursor_position) const; | 279 | std::u16string submitted_text, s32 cursor_position) const; |
| 280 | 280 | ||
| 281 | mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> | 281 | mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)> |
| 282 | submit_normal_callback; | 282 | submit_normal_callback; |
| 283 | mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> | 283 | mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> |
| 284 | submit_inline_callback; | 284 | submit_inline_callback; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f6fb23085..4e5552d2a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -299,6 +299,8 @@ GMainWindow::GMainWindow() | |||
| 299 | SDL_EnableScreenSaver(); | 299 | SDL_EnableScreenSaver(); |
| 300 | #endif | 300 | #endif |
| 301 | 301 | ||
| 302 | Common::Log::Start(); | ||
| 303 | |||
| 302 | QStringList args = QApplication::arguments(); | 304 | QStringList args = QApplication::arguments(); |
| 303 | 305 | ||
| 304 | if (args.size() < 2) { | 306 | if (args.size() < 2) { |
| @@ -483,8 +485,9 @@ void GMainWindow::SoftwareKeyboardInitialize( | |||
| 483 | } else { | 485 | } else { |
| 484 | connect( | 486 | connect( |
| 485 | software_keyboard, &QtSoftwareKeyboardDialog::SubmitNormalText, this, | 487 | software_keyboard, &QtSoftwareKeyboardDialog::SubmitNormalText, this, |
| 486 | [this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text) { | 488 | [this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, |
| 487 | emit SoftwareKeyboardSubmitNormalText(result, submitted_text); | 489 | bool confirmed) { |
| 490 | emit SoftwareKeyboardSubmitNormalText(result, submitted_text, confirmed); | ||
| 488 | }, | 491 | }, |
| 489 | Qt::QueuedConnection); | 492 | Qt::QueuedConnection); |
| 490 | } | 493 | } |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index aed15a0a0..981102daa 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -150,7 +150,7 @@ signals: | |||
| 150 | void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid); | 150 | void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid); |
| 151 | 151 | ||
| 152 | void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, | 152 | void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, |
| 153 | std::u16string submitted_text); | 153 | std::u16string submitted_text, bool confirmed); |
| 154 | void SoftwareKeyboardSubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, | 154 | void SoftwareKeyboardSubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, |
| 155 | std::u16string submitted_text, s32 cursor_position); | 155 | std::u16string submitted_text, s32 cursor_position); |
| 156 | 156 | ||