mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[client,sdl] simplify suppress output handling
This commit is contained in:
@@ -49,7 +49,7 @@ void sdl_OnChannelConnectedEventHandler(void* context, const ChannelConnectedEve
|
||||
{
|
||||
auto disp = reinterpret_cast<DispClientContext*>(e->pInterface);
|
||||
WINPR_ASSERT(disp);
|
||||
sdl->disp.init(disp);
|
||||
(void)sdl->disp.init(disp);
|
||||
}
|
||||
else
|
||||
freerdp_client_OnChannelConnectedEventHandler(context, e);
|
||||
@@ -76,7 +76,7 @@ void sdl_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnec
|
||||
{
|
||||
auto disp = reinterpret_cast<DispClientContext*>(e->pInterface);
|
||||
WINPR_ASSERT(disp);
|
||||
sdl->disp.uninit(disp);
|
||||
(void)sdl->disp.uninit(disp);
|
||||
}
|
||||
else
|
||||
freerdp_client_OnChannelDisconnectedEventHandler(context, e);
|
||||
|
||||
@@ -36,35 +36,35 @@
|
||||
static constexpr UINT64 RESIZE_MIN_DELAY = 200; /* minimum delay in ms between two resizes */
|
||||
static constexpr unsigned MAX_RETRIES = 5;
|
||||
|
||||
BOOL sdlDispContext::settings_changed()
|
||||
bool sdlDispContext::settings_changed()
|
||||
{
|
||||
auto settings = _sdl->context()->settings;
|
||||
WINPR_ASSERT(settings);
|
||||
|
||||
if (_lastSentWidth != _targetWidth)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (_lastSentHeight != _targetHeight)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (_lastSentDesktopOrientation !=
|
||||
freerdp_settings_get_uint16(settings, FreeRDP_DesktopOrientation))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (_lastSentDesktopScaleFactor != _targetDesktopScaleFactor)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (_lastSentDeviceScaleFactor !=
|
||||
freerdp_settings_get_uint32(settings, FreeRDP_DeviceScaleFactor))
|
||||
return TRUE;
|
||||
return true;
|
||||
/* TODO
|
||||
if (_fullscreen != _sdl->fullscreen)
|
||||
return TRUE;
|
||||
return true;
|
||||
*/
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::update_last_sent()
|
||||
bool sdlDispContext::update_last_sent()
|
||||
{
|
||||
WINPR_ASSERT(_sdl);
|
||||
|
||||
@@ -77,27 +77,27 @@ BOOL sdlDispContext::update_last_sent()
|
||||
_lastSentDesktopScaleFactor = _targetDesktopScaleFactor;
|
||||
_lastSentDeviceScaleFactor = freerdp_settings_get_uint32(settings, FreeRDP_DeviceScaleFactor);
|
||||
// TODO _fullscreen = _sdl->fullscreen;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::sendResize()
|
||||
bool sdlDispContext::sendResize()
|
||||
{
|
||||
DISPLAY_CONTROL_MONITOR_LAYOUT layout = {};
|
||||
auto settings = _sdl->context()->settings;
|
||||
|
||||
if (!settings)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!_activated || !_disp)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (GetTickCount64() - _lastSentDate < RESIZE_MIN_DELAY)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
_lastSentDate = GetTickCount64();
|
||||
|
||||
if (!settings_changed())
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
const UINT32 mcount = freerdp_settings_get_uint32(settings, FreeRDP_MonitorCount);
|
||||
if (_sdl->fullscreen && (mcount > 0))
|
||||
@@ -105,11 +105,11 @@ BOOL sdlDispContext::sendResize()
|
||||
auto monitors = static_cast<const rdpMonitor*>(
|
||||
freerdp_settings_get_pointer(settings, FreeRDP_MonitorDefArray));
|
||||
if (sendLayout(monitors, mcount) != CHANNEL_RC_OK)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_waitingResize = TRUE;
|
||||
_waitingResize = true;
|
||||
layout.Flags = DISPLAY_CONTROL_MONITOR_PRIMARY;
|
||||
layout.Top = layout.Left = 0;
|
||||
layout.Width = WINPR_ASSERTING_INT_CAST(uint32_t, _targetWidth);
|
||||
@@ -122,34 +122,33 @@ BOOL sdlDispContext::sendResize()
|
||||
|
||||
if (IFCALLRESULT(CHANNEL_RC_OK, _disp->SendMonitorLayout, _disp, 1, &layout) !=
|
||||
CHANNEL_RC_OK)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return update_last_sent();
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::set_window_resizable()
|
||||
bool sdlDispContext::set_window_resizable()
|
||||
{
|
||||
_sdl->update_resizeable(TRUE);
|
||||
return TRUE;
|
||||
return _sdl->update_resizeable(true);
|
||||
}
|
||||
|
||||
static BOOL sdl_disp_check_context(void* context, SdlContext** ppsdl, sdlDispContext** ppsdlDisp,
|
||||
static bool sdl_disp_check_context(void* context, SdlContext** ppsdl, sdlDispContext** ppsdlDisp,
|
||||
rdpSettings** ppSettings)
|
||||
{
|
||||
if (!context)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
auto sdl = get_context(context);
|
||||
if (!sdl)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!sdl->context()->settings)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
*ppsdl = sdl;
|
||||
*ppsdlDisp = &sdl->disp;
|
||||
*ppSettings = sdl->context()->settings;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void sdlDispContext::OnActivated(void* context, const ActivatedEventArgs* e)
|
||||
@@ -161,7 +160,7 @@ void sdlDispContext::OnActivated(void* context, const ActivatedEventArgs* e)
|
||||
if (!sdl_disp_check_context(context, &sdl, &sdlDisp, &settings))
|
||||
return;
|
||||
|
||||
sdlDisp->_waitingResize = FALSE;
|
||||
sdlDisp->_waitingResize = false;
|
||||
|
||||
if (sdlDisp->_activated && !freerdp_settings_get_bool(settings, FreeRDP_Fullscreen))
|
||||
{
|
||||
@@ -184,7 +183,7 @@ void sdlDispContext::OnGraphicsReset(void* context, const GraphicsResetEventArgs
|
||||
if (!sdl_disp_check_context(context, &sdl, &sdlDisp, &settings))
|
||||
return;
|
||||
|
||||
sdlDisp->_waitingResize = FALSE;
|
||||
sdlDisp->_waitingResize = false;
|
||||
|
||||
if (sdlDisp->_activated && !freerdp_settings_get_bool(settings, FreeRDP_Fullscreen))
|
||||
{
|
||||
@@ -296,10 +295,10 @@ UINT sdlDispContext::sendLayout(const rdpMonitor* monitors, size_t nmonitors)
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::addTimer()
|
||||
bool sdlDispContext::addTimer()
|
||||
{
|
||||
if (SDL_WasInit(SDL_INIT_EVENTS) == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
SDL_RemoveTimer(_timer);
|
||||
WLog_Print(_sdl->log, WLOG_TRACE, "adding new display check timer");
|
||||
@@ -307,10 +306,10 @@ BOOL sdlDispContext::addTimer()
|
||||
_timer_retries = 0;
|
||||
sendResize();
|
||||
_timer = SDL_AddTimer(1000, sdlDispContext::OnTimer, this);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::handle_display_event(const SDL_DisplayEvent* ev)
|
||||
bool sdlDispContext::handle_display_event(const SDL_DisplayEvent* ev)
|
||||
{
|
||||
WINPR_ASSERT(ev);
|
||||
|
||||
@@ -318,19 +317,19 @@ BOOL sdlDispContext::handle_display_event(const SDL_DisplayEvent* ev)
|
||||
{
|
||||
case SDL_EVENT_DISPLAY_ADDED:
|
||||
SDL_Log("A new display with id %u was connected", ev->displayID);
|
||||
return TRUE;
|
||||
return true;
|
||||
case SDL_EVENT_DISPLAY_REMOVED:
|
||||
SDL_Log("The display with id %u was disconnected", ev->displayID);
|
||||
return TRUE;
|
||||
return true;
|
||||
case SDL_EVENT_DISPLAY_ORIENTATION:
|
||||
SDL_Log("The orientation of display with id %u was changed", ev->displayID);
|
||||
return TRUE;
|
||||
return true;
|
||||
default:
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
bool sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
{
|
||||
WINPR_ASSERT(ev);
|
||||
|
||||
@@ -344,21 +343,12 @@ BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
{
|
||||
case SDL_EVENT_WINDOW_HIDDEN:
|
||||
case SDL_EVENT_WINDOW_MINIMIZED:
|
||||
{
|
||||
auto ctx = _sdl->context();
|
||||
if (ctx && ctx->gdi)
|
||||
gdi_send_suppress_output(ctx->gdi, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
return _sdl->redraw(true);
|
||||
case SDL_EVENT_WINDOW_EXPOSED:
|
||||
case SDL_EVENT_WINDOW_SHOWN:
|
||||
case SDL_EVENT_WINDOW_MAXIMIZED:
|
||||
case SDL_EVENT_WINDOW_RESTORED:
|
||||
{
|
||||
auto ctx = _sdl->context();
|
||||
if (ctx && ctx->gdi)
|
||||
gdi_send_suppress_output(ctx->gdi, FALSE);
|
||||
}
|
||||
(void)_sdl->redraw();
|
||||
/* fallthrough */
|
||||
WINPR_FALLTHROUGH
|
||||
case SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED:
|
||||
@@ -378,7 +368,7 @@ BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
case SDL_EVENT_WINDOW_MOUSE_LEAVE:
|
||||
WINPR_ASSERT(_sdl);
|
||||
_sdl->input.keyboard_grab(ev->windowID, false);
|
||||
return TRUE;
|
||||
return true;
|
||||
case SDL_EVENT_WINDOW_MOUSE_ENTER:
|
||||
WINPR_ASSERT(_sdl);
|
||||
_sdl->input.keyboard_grab(ev->windowID, true);
|
||||
@@ -387,10 +377,15 @@ BOOL sdlDispContext::handle_window_event(const SDL_WindowEvent* ev)
|
||||
return _sdl->input.keyboard_focus_in();
|
||||
|
||||
default:
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 sdlDispContext::scale_factor() const
|
||||
{
|
||||
return _lastSentDesktopScaleFactor;
|
||||
}
|
||||
|
||||
UINT sdlDispContext::DisplayControlCaps(DispClientContext* disp, UINT32 maxNumMonitors,
|
||||
UINT32 maxMonitorAreaFactorA, UINT32 maxMonitorAreaFactorB)
|
||||
{
|
||||
@@ -412,7 +407,7 @@ UINT sdlDispContext::DisplayControlCaps(UINT32 maxNumMonitors, UINT32 maxMonitor
|
||||
"DisplayControlCapsPdu: MaxNumMonitors: %" PRIu32 " MaxMonitorAreaFactorA: %" PRIu32
|
||||
" MaxMonitorAreaFactorB: %" PRIu32 "",
|
||||
maxNumMonitors, maxMonitorAreaFactorA, maxMonitorAreaFactorB);
|
||||
_activated = TRUE;
|
||||
_activated = true;
|
||||
|
||||
if (freerdp_settings_get_bool(settings, FreeRDP_Fullscreen))
|
||||
return CHANNEL_RC_OK;
|
||||
@@ -421,15 +416,15 @@ UINT sdlDispContext::DisplayControlCaps(UINT32 maxNumMonitors, UINT32 maxMonitor
|
||||
return set_window_resizable() ? CHANNEL_RC_OK : CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::init(DispClientContext* disp)
|
||||
bool sdlDispContext::init(DispClientContext* disp)
|
||||
{
|
||||
if (!disp)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
auto settings = _sdl->context()->settings;
|
||||
|
||||
if (!settings)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
_disp = disp;
|
||||
disp->custom = this;
|
||||
@@ -439,18 +434,16 @@ BOOL sdlDispContext::init(DispClientContext* disp)
|
||||
disp->DisplayControlCaps = sdlDispContext::DisplayControlCaps;
|
||||
}
|
||||
|
||||
_sdl->update_resizeable(TRUE);
|
||||
return TRUE;
|
||||
return _sdl->update_resizeable(true);
|
||||
}
|
||||
|
||||
BOOL sdlDispContext::uninit(DispClientContext* disp)
|
||||
bool sdlDispContext::uninit(DispClientContext* disp)
|
||||
{
|
||||
if (!disp)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
_disp = nullptr;
|
||||
_sdl->update_resizeable(FALSE);
|
||||
return TRUE;
|
||||
return _sdl->update_resizeable(false);
|
||||
}
|
||||
|
||||
sdlDispContext::sdlDispContext(SdlContext* sdl) : _sdl(sdl)
|
||||
|
||||
@@ -38,29 +38,26 @@ class sdlDispContext
|
||||
sdlDispContext& operator=(const sdlDispContext& other) = delete;
|
||||
sdlDispContext& operator=(sdlDispContext&& other) = delete;
|
||||
|
||||
BOOL init(DispClientContext* disp);
|
||||
BOOL uninit(DispClientContext* disp);
|
||||
[[nodiscard]] bool init(DispClientContext* disp);
|
||||
[[nodiscard]] bool uninit(DispClientContext* disp);
|
||||
|
||||
BOOL handle_display_event(const SDL_DisplayEvent* ev);
|
||||
[[nodiscard]] bool handle_display_event(const SDL_DisplayEvent* ev);
|
||||
|
||||
BOOL handle_window_event(const SDL_WindowEvent* ev);
|
||||
[[nodiscard]] bool handle_window_event(const SDL_WindowEvent* ev);
|
||||
|
||||
[[nodiscard]] UINT32 scale_factor() const
|
||||
{
|
||||
return _lastSentDesktopScaleFactor;
|
||||
}
|
||||
[[nodiscard]] UINT32 scale_factor() const;
|
||||
|
||||
private:
|
||||
UINT DisplayControlCaps(UINT32 maxNumMonitors, UINT32 maxMonitorAreaFactorA,
|
||||
UINT32 maxMonitorAreaFactorB);
|
||||
BOOL set_window_resizable();
|
||||
bool set_window_resizable();
|
||||
|
||||
BOOL sendResize();
|
||||
BOOL settings_changed();
|
||||
BOOL update_last_sent();
|
||||
bool sendResize();
|
||||
bool settings_changed();
|
||||
bool update_last_sent();
|
||||
UINT sendLayout(const rdpMonitor* monitors, size_t nmonitors);
|
||||
|
||||
BOOL addTimer();
|
||||
bool addTimer();
|
||||
|
||||
static UINT DisplayControlCaps(DispClientContext* disp, UINT32 maxNumMonitors,
|
||||
UINT32 maxMonitorAreaFactorA, UINT32 maxMonitorAreaFactorB);
|
||||
@@ -75,8 +72,8 @@ class sdlDispContext
|
||||
UINT64 _lastSentDate = 0;
|
||||
int _targetWidth = -1;
|
||||
int _targetHeight = -1;
|
||||
BOOL _activated = FALSE;
|
||||
BOOL _waitingResize = FALSE;
|
||||
bool _activated = false;
|
||||
bool _waitingResize = false;
|
||||
UINT16 _lastSentDesktopOrientation = 0;
|
||||
UINT32 _lastSentDesktopScaleFactor = 0;
|
||||
UINT32 _lastSentDeviceScaleFactor = 0;
|
||||
|
||||
@@ -1048,7 +1048,7 @@ static int sdl_run(SdlContext* sdl)
|
||||
(windowEvent.type <= SDL_EVENT_DISPLAY_LAST))
|
||||
{
|
||||
const SDL_DisplayEvent* ev = &windowEvent.display;
|
||||
sdl->disp.handle_display_event(ev);
|
||||
(void)sdl->disp.handle_display_event(ev);
|
||||
}
|
||||
else if ((windowEvent.type >= SDL_EVENT_WINDOW_FIRST) &&
|
||||
(windowEvent.type <= SDL_EVENT_WINDOW_LAST))
|
||||
@@ -1057,7 +1057,7 @@ static int sdl_run(SdlContext* sdl)
|
||||
auto window = sdl->windows.find(ev->windowID);
|
||||
if (window != sdl->windows.end())
|
||||
{
|
||||
sdl->disp.handle_window_event(ev);
|
||||
(void)sdl->disp.handle_window_event(ev);
|
||||
|
||||
switch (ev->type)
|
||||
{
|
||||
@@ -1172,9 +1172,12 @@ static BOOL sdl_post_connect(freerdp* instance)
|
||||
context->update->SetKeyboardIndicators = sdlInput::keyboard_set_indicators;
|
||||
context->update->SetKeyboardImeStatus = sdlInput::keyboard_set_ime_status;
|
||||
|
||||
sdl->update_resizeable(FALSE);
|
||||
sdl->update_fullscreen(freerdp_settings_get_bool(context->settings, FreeRDP_Fullscreen) ||
|
||||
freerdp_settings_get_bool(context->settings, FreeRDP_UseMultimon));
|
||||
if (!sdl->update_resizeable(false))
|
||||
return FALSE;
|
||||
if (!sdl->update_fullscreen(freerdp_settings_get_bool(context->settings, FreeRDP_Fullscreen) ||
|
||||
freerdp_settings_get_bool(context->settings, FreeRDP_UseMultimon)))
|
||||
return FALSE;
|
||||
sdl->setConnected(true);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1189,6 +1192,9 @@ static void sdl_post_disconnect(freerdp* instance)
|
||||
if (!instance->context)
|
||||
return;
|
||||
|
||||
auto sdl = get_context(instance->context);
|
||||
sdl->setConnected(false);
|
||||
|
||||
PubSub_UnsubscribeChannelConnected(instance->context->pubSub,
|
||||
sdl_OnChannelConnectedEventHandler);
|
||||
PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub,
|
||||
@@ -1740,41 +1746,41 @@ int main(int argc, char* argv[])
|
||||
return rc;
|
||||
}
|
||||
|
||||
BOOL SdlContext::update_fullscreen(BOOL enter)
|
||||
bool SdlContext::update_fullscreen(bool enter)
|
||||
{
|
||||
std::lock_guard<CriticalSection> lock(critical);
|
||||
for (const auto& window : windows)
|
||||
{
|
||||
if (!sdl_push_user_event(SDL_EVENT_USER_WINDOW_FULLSCREEN, &window.second, enter))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
fullscreen = enter;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL SdlContext::update_minimize()
|
||||
bool SdlContext::update_minimize()
|
||||
{
|
||||
std::lock_guard<CriticalSection> lock(critical);
|
||||
return sdl_push_user_event(SDL_EVENT_USER_WINDOW_MINIMIZE);
|
||||
}
|
||||
|
||||
BOOL SdlContext::update_resizeable(BOOL enable)
|
||||
bool SdlContext::update_resizeable(bool enable)
|
||||
{
|
||||
std::lock_guard<CriticalSection> lock(critical);
|
||||
|
||||
const auto settings = context()->settings;
|
||||
const BOOL dyn = freerdp_settings_get_bool(settings, FreeRDP_DynamicResolutionUpdate);
|
||||
const BOOL smart = freerdp_settings_get_bool(settings, FreeRDP_SmartSizing);
|
||||
BOOL use = (dyn && enable) || smart;
|
||||
const bool dyn = freerdp_settings_get_bool(settings, FreeRDP_DynamicResolutionUpdate);
|
||||
const bool smart = freerdp_settings_get_bool(settings, FreeRDP_SmartSizing);
|
||||
bool use = (dyn && enable) || smart;
|
||||
|
||||
for (const auto& window : windows)
|
||||
{
|
||||
if (!sdl_push_user_event(SDL_EVENT_USER_WINDOW_RESIZEABLE, &window.second, use))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
resizeable = use;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
SdlContext::SdlContext(rdpContext* context)
|
||||
@@ -1784,12 +1790,33 @@ SdlContext::SdlContext(rdpContext* context)
|
||||
WINPR_ASSERT(context);
|
||||
}
|
||||
|
||||
bool SdlContext::redraw(bool suppress)
|
||||
{
|
||||
if (!connected)
|
||||
return true;
|
||||
|
||||
auto gdi = context()->gdi;
|
||||
WINPR_ASSERT(gdi);
|
||||
return gdi_send_suppress_output(gdi, suppress ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
void SdlContext::setConnected(bool val)
|
||||
{
|
||||
connected = val;
|
||||
}
|
||||
|
||||
bool SdlContext::isConnected() const
|
||||
{
|
||||
return connected;
|
||||
}
|
||||
|
||||
rdpContext* SdlContext::context() const
|
||||
{
|
||||
WINPR_ASSERT(_context);
|
||||
return _context;
|
||||
}
|
||||
|
||||
rdpClientContext* SdlContext::common() const
|
||||
{
|
||||
return reinterpret_cast<rdpClientContext*>(_context);
|
||||
return reinterpret_cast<rdpClientContext*>(context());
|
||||
}
|
||||
|
||||
@@ -54,6 +54,19 @@ class SdlContext
|
||||
SdlContext& operator=(const SdlContext& other) = delete;
|
||||
SdlContext& operator=(SdlContext&& other) = delete;
|
||||
|
||||
public:
|
||||
[[nodiscard]] bool redraw(bool suppress = false);
|
||||
|
||||
void setConnected(bool val);
|
||||
[[nodiscard]] bool isConnected() const;
|
||||
|
||||
[[nodiscard]] bool update_resizeable(bool enable);
|
||||
[[nodiscard]] bool update_fullscreen(bool enter);
|
||||
[[nodiscard]] bool update_minimize();
|
||||
|
||||
[[nodiscard]] rdpContext* context() const;
|
||||
[[nodiscard]] rdpClientContext* common() const;
|
||||
|
||||
private:
|
||||
rdpContext* _context;
|
||||
|
||||
@@ -87,11 +100,5 @@ class SdlContext
|
||||
std::unique_ptr<SDLConnectionDialog> connection_dialog;
|
||||
|
||||
std::atomic<bool> rdp_thread_running;
|
||||
|
||||
BOOL update_resizeable(BOOL enable);
|
||||
BOOL update_fullscreen(BOOL enter);
|
||||
BOOL update_minimize();
|
||||
|
||||
[[nodiscard]] rdpContext* context() const;
|
||||
[[nodiscard]] rdpClientContext* common() const;
|
||||
std::atomic<bool> connected = false;
|
||||
};
|
||||
|
||||
@@ -553,16 +553,14 @@ BOOL sdlInput::keyboard_handle_event(const SDL_KeyboardEvent* ev)
|
||||
WLog_Print(_sdl->log, WLOG_INFO, "%s+<%s> pressed, toggling fullscreen state",
|
||||
masktostr(_hotkeyModmask).c_str(), sdl_scancode_name(_hotkeyFullscreen));
|
||||
keyboard_sync_state();
|
||||
_sdl->update_fullscreen(!_sdl->fullscreen);
|
||||
return TRUE;
|
||||
return _sdl->update_fullscreen(!_sdl->fullscreen);
|
||||
}
|
||||
if (ev->scancode == _hotkeyResizable)
|
||||
{
|
||||
WLog_Print(_sdl->log, WLOG_INFO, "%s+<%s> pressed, toggling resizeable state",
|
||||
masktostr(_hotkeyModmask).c_str(), sdl_scancode_name(_hotkeyResizable));
|
||||
keyboard_sync_state();
|
||||
_sdl->update_resizeable(!_sdl->resizeable);
|
||||
return TRUE;
|
||||
return _sdl->update_resizeable(!_sdl->resizeable);
|
||||
}
|
||||
|
||||
if (ev->scancode == _hotkeyGrab)
|
||||
|
||||
@@ -193,7 +193,7 @@ BOOL sdl_log_error_ex(Sint32 res, wLog* log, const char* what, const char* file,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL sdl_push_user_event(Uint32 type, ...)
|
||||
bool sdl_push_user_event(Uint32 type, ...)
|
||||
{
|
||||
SDL_Event ev = {};
|
||||
SDL_UserEvent* event = &ev.user;
|
||||
@@ -274,7 +274,7 @@ BOOL sdl_push_user_event(Uint32 type, ...)
|
||||
break;
|
||||
default:
|
||||
va_end(ap);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
va_end(ap);
|
||||
return SDL_PushEvent(&ev) == 1;
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct
|
||||
Sint32 result;
|
||||
} SDL_UserAuthArg;
|
||||
|
||||
BOOL sdl_push_user_event(Uint32 type, ...);
|
||||
bool sdl_push_user_event(Uint32 type, ...);
|
||||
|
||||
bool sdl_push_quit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user