summaryrefslogtreecommitdiffstats
path: root/client/SDL/dialogs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
commit941f9937e0744d18de4cc0afa71e0caa925d82ac (patch)
tree67872b86dbf72d73e91188bf8de12594668fe4aa /client/SDL/dialogs
parentAdding upstream version 3.3.0+dfsg1. (diff)
downloadfreerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz
freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'client/SDL/dialogs')
-rw-r--r--client/SDL/dialogs/res/convert_res_to_c.cpp6
-rw-r--r--client/SDL/dialogs/res/sdl_resource_manager.cpp2
-rw-r--r--client/SDL/dialogs/sdl_connection_dialog.cpp13
3 files changed, 14 insertions, 7 deletions
diff --git a/client/SDL/dialogs/res/convert_res_to_c.cpp b/client/SDL/dialogs/res/convert_res_to_c.cpp
index 07309d5..8ef828a 100644
--- a/client/SDL/dialogs/res/convert_res_to_c.cpp
+++ b/client/SDL/dialogs/res/convert_res_to_c.cpp
@@ -79,6 +79,10 @@ static int readwrite(std::ofstream& out, std::ifstream& ifs)
{
size_t pos = 0;
char c = 0;
+
+ std::ios backup(nullptr);
+ backup.copyfmt(out);
+
while (ifs.read(&c, 1) && ifs.good())
{
unsigned val = c & 0xff;
@@ -89,6 +93,8 @@ static int readwrite(std::ofstream& out, std::ifstream& ifs)
out << std::endl;
}
+ out.copyfmt(backup);
+
return 0;
}
diff --git a/client/SDL/dialogs/res/sdl_resource_manager.cpp b/client/SDL/dialogs/res/sdl_resource_manager.cpp
index 90ccf31..0f0682a 100644
--- a/client/SDL/dialogs/res/sdl_resource_manager.cpp
+++ b/client/SDL/dialogs/res/sdl_resource_manager.cpp
@@ -49,7 +49,7 @@ SDL_RWops* SDLResourceManager::get(const std::string& type, const std::string& i
<< fs::absolute(path) << std::endl;
std::cerr << "file not found, application will fail" << std::endl;
}
- return SDL_RWFromFile(path.native().c_str(), "rb");
+ return SDL_RWFromFile(path.u8string().c_str(), "rb");
#endif
}
diff --git a/client/SDL/dialogs/sdl_connection_dialog.cpp b/client/SDL/dialogs/sdl_connection_dialog.cpp
index cbb6349..56c3853 100644
--- a/client/SDL/dialogs/sdl_connection_dialog.cpp
+++ b/client/SDL/dialogs/sdl_connection_dialog.cpp
@@ -164,6 +164,7 @@ bool SDLConnectionDialog::clearWindow(SDL_Renderer* renderer)
bool SDLConnectionDialog::update(SDL_Renderer* renderer)
{
+ std::lock_guard lock(_mux);
if (!renderer)
return false;
@@ -217,7 +218,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
case SDL_KEYUP:
if (visible())
{
- auto ev = reinterpret_cast<const SDL_KeyboardEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_KeyboardEvent&>(event);
update(_renderer);
switch (event.key.keysym.sym)
{
@@ -244,7 +245,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
case SDL_MOUSEMOTION:
if (visible())
{
- auto ev = reinterpret_cast<const SDL_MouseMotionEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_MouseMotionEvent&>(event);
_buttons.set_mouseover(event.button.x, event.button.y);
update(_renderer);
@@ -255,7 +256,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
case SDL_MOUSEBUTTONUP:
if (visible())
{
- auto ev = reinterpret_cast<const SDL_MouseButtonEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_MouseButtonEvent&>(event);
update(_renderer);
auto button = _buttons.get_selected(event.button);
@@ -274,7 +275,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
case SDL_MOUSEWHEEL:
if (visible())
{
- auto ev = reinterpret_cast<const SDL_MouseWheelEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_MouseWheelEvent&>(event);
update(_renderer);
return windowID == ev.windowID;
}
@@ -283,7 +284,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
case SDL_FINGERDOWN:
if (visible())
{
- auto ev = reinterpret_cast<const SDL_TouchFingerEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_TouchFingerEvent&>(event);
update(_renderer);
#if SDL_VERSION_ATLEAST(2, 0, 18)
return windowID == ev.windowID;
@@ -294,7 +295,7 @@ bool SDLConnectionDialog::handle(const SDL_Event& event)
return false;
case SDL_WINDOWEVENT:
{
- auto ev = reinterpret_cast<const SDL_WindowEvent&>(event);
+ auto& ev = reinterpret_cast<const SDL_WindowEvent&>(event);
switch (ev.event)
{
case SDL_WINDOWEVENT_CLOSE: