mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[client,sdl] fix single window dynamic screen updates
This commit is contained in:
@@ -475,6 +475,23 @@ bool SdlContext::updateWindowList()
|
||||
list.size());
|
||||
}
|
||||
|
||||
bool SdlContext::updateWindow(SDL_WindowID id)
|
||||
{
|
||||
if (freerdp_settings_get_bool(_context->settings, FreeRDP_Fullscreen) ||
|
||||
freerdp_settings_get_bool(_context->settings, FreeRDP_UseMultimon))
|
||||
return true;
|
||||
|
||||
auto& w = _windows.at(id);
|
||||
auto m = w.monitor(true);
|
||||
auto r = w.rect();
|
||||
m.width = r.w;
|
||||
m.height = r.h;
|
||||
m.attributes.physicalWidth = static_cast<UINT32>(r.w);
|
||||
m.attributes.physicalHeight = static_cast<UINT32>(r.h);
|
||||
w.setMonitor(m);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string SdlContext::windowTitle() const
|
||||
{
|
||||
const char* prefix = "FreeRDP:";
|
||||
|
||||
@@ -108,6 +108,7 @@ class SdlContext
|
||||
|
||||
[[nodiscard]] bool createWindows();
|
||||
[[nodiscard]] bool updateWindowList();
|
||||
[[nodiscard]] bool updateWindow(SDL_WindowID id);
|
||||
|
||||
[[nodiscard]] bool drawToWindows(const std::vector<SDL_Rect>& rects = {});
|
||||
[[nodiscard]] bool drawToWindow(SdlWindow& window, const std::vector<SDL_Rect>& rects = {});
|
||||
|
||||
@@ -281,11 +281,14 @@ bool sdlDispContext::addTimer()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool sdlDispContext::updateMonitor([[maybe_unused]] SDL_WindowID id)
|
||||
bool sdlDispContext::updateMonitor(SDL_WindowID id)
|
||||
{
|
||||
if (!freerdp_settings_get_bool(_sdl->context()->settings, FreeRDP_DynamicResolutionUpdate))
|
||||
return true;
|
||||
|
||||
if (!_sdl->updateWindow(id))
|
||||
return false;
|
||||
|
||||
if (!_sdl->updateWindowList())
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user