summaryrefslogtreecommitdiff
path: root/src/core/hle/applets/swkbd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/applets/swkbd.cpp')
-rw-r--r--src/core/hle/applets/swkbd.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp
index b800e0eb4..7431ebcf8 100644
--- a/src/core/hle/applets/swkbd.cpp
+++ b/src/core/hle/applets/swkbd.cpp
@@ -4,6 +4,7 @@
4 4
5#include "common/assert.h" 5#include "common/assert.h"
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7#include "common/string_util.h"
7 8
8#include "core/hle/applets/swkbd.h" 9#include "core/hle/applets/swkbd.h"
9#include "core/hle/service/hid/hid.h" 10#include "core/hle/service/hid/hid.h"
@@ -33,7 +34,7 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
33 Service::APT::MessageParameter result; 34 Service::APT::MessageParameter result;
34 // The buffer passed in parameter contains the data returned by GSPGPU::ImportDisplayCaptureInfo 35 // The buffer passed in parameter contains the data returned by GSPGPU::ImportDisplayCaptureInfo
35 result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished); 36 result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished);
36 result.data = nullptr; 37 result.data = nullptr;
37 result.buffer_size = 0; 38 result.buffer_size = 0;
38 result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); 39 result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
39 result.sender_id = static_cast<u32>(id); 40 result.sender_id = static_cast<u32>(id);
@@ -43,7 +44,9 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
43 return RESULT_SUCCESS; 44 return RESULT_SUCCESS;
44} 45}
45 46
46ResultCode SoftwareKeyboard::Start(Service::APT::AppletStartupParameter const& parameter) { 47ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) {
48 ASSERT_MSG(parameter.buffer_size == sizeof(config), "The size of the parameter (SoftwareKeyboardConfig) is wrong");
49
47 memcpy(&config, parameter.data, parameter.buffer_size); 50 memcpy(&config, parameter.data, parameter.buffer_size);
48 text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); 51 text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object);
49 52
@@ -52,9 +55,7 @@ ResultCode SoftwareKeyboard::Start(Service::APT::AppletStartupParameter const& p
52 55
53 DrawScreenKeyboard(); 56 DrawScreenKeyboard();
54 57
55 // Update the current applet so we can get update events
56 started = true; 58 started = true;
57 g_current_applet = shared_from_this();
58 return RESULT_SUCCESS; 59 return RESULT_SUCCESS;
59} 60}
60 61
@@ -72,7 +73,7 @@ void SoftwareKeyboard::Update() {
72 config.text_length = 6; 73 config.text_length = 6;
73 config.text_offset = 0; 74 config.text_offset = 0;
74 75
75 // TODO(Subv): We're finalizing the applet immediately after it's started, 76 // TODO(Subv): We're finalizing the applet immediately after it's started,
76 // but we should defer this call until after all the input has been collected. 77 // but we should defer this call until after all the input has been collected.
77 Finalize(); 78 Finalize();
78} 79}
@@ -98,8 +99,6 @@ void SoftwareKeyboard::Finalize() {
98 Service::APT::SendParameter(message); 99 Service::APT::SendParameter(message);
99 100
100 started = false; 101 started = false;
101 // Unset the current applet, we are not running anymore
102 g_current_applet = nullptr;
103} 102}
104 103
105} 104}