56 bool init(RailClientContext* rail);
57 bool uninit(RailClientContext* rail);
59 [[nodiscard]]
bool enabled()
const
66 bool paint(SDL_Surface* primary, SDL_PixelFormat fallbackFormat,
67 const std::vector<SDL_Rect>& damage);
70 UINT updateWindowFromSurface(gdiGfxSurface* surface);
73 static UINT UpdateWindowFromSurface(RdpgfxClientContext* context, gdiGfxSurface* surface);
76 [[nodiscard]]
bool ownsWindow(SDL_WindowID
id);
78 void invalidateWindow(SDL_WindowID
id);
80 void handleMaximized(SDL_WindowID
id);
81 void handleMinimized(SDL_WindowID
id);
82 void handleRestored(SDL_WindowID
id);
83 void handleClose(SDL_WindowID
id);
85 void handleFocus(SDL_WindowID
id,
bool gained);
87 void ensureActive(SDL_WindowID
id);
89 bool translateToServer(SDL_WindowID
id,
float& x,
float& y);
91 void noteLeftPress(
float x,
float y)
93 _lastPressServer = {
static_cast<int>(x),
static_cast<int>(y) };
94 _lastPointerServer = _lastPressServer;
97 void noteServerPointer(
float x,
float y)
99 _lastPointerServer = {
static_cast<int>(x),
static_cast<int>(y) };
102 bool suppressServerInput(SDL_WindowID
id);
104 bool suppressServerMotion(SDL_WindowID
id);
107 void handleLocalMoveRequested(uint32_t windowId, uint16_t moveType);
109 void noteDragResize(SDL_WindowID
id,
int w,
int h);
111 void syncGeometry(SDL_WindowID
id);
113 void completeLocalMoveIfPending();
116 void completeWaylandResize(
bool definitive =
false);
118 void noteResizeGrab(SDL_WindowID
id);
120 void handleWaylandResize(SDL_WindowID
id);
125 [[nodiscard]]
SdlRailWindow* getWindowBySdlId(SDL_WindowID
id);
127 void sendClientActivate(uint32_t wid,
bool enabled);
131 [[nodiscard]]
SdlRailWindow* resolveParent(uint64_t ownerId);
133 [[nodiscard]]
bool isShadowFrame(
const SdlRailWindow& popup);
135 void enableRemoteAppMode(
bool enable);
138 void sendWorkArea(
const SDL_Rect& area);
142 void clampIntoDesktop(
int& x,
int& y,
int w,
int h)
const;
144 void sendSystemCommand(
SdlRailWindow* appWindow, uint16_t command);
149 SDL_Rect _sessionMargins = { 0, 0, 0, 0 };
150 SDL_Point _lastPressServer = { 0, 0 };
151 SDL_Point _lastPointerServer = { 0, 0 };
154 static UINT server_execute_result(RailClientContext* context,
156 static UINT server_local_move_size(RailClientContext* context,
158 static UINT server_min_max_info(RailClientContext* context,
162 void registerUpdateCallbacks(rdpUpdate* update);
163 static BOOL window_common(rdpContext* context,
const WINDOW_ORDER_INFO* orderInfo,
174 static BOOL window_cached_icon(rdpContext* context,
const WINDOW_ORDER_INFO* orderInfo,
176 static BOOL window_delete(rdpContext* context,
const WINDOW_ORDER_INFO* orderInfo);
177 static BOOL monitored_desktop(rdpContext* context,
const WINDOW_ORDER_INFO* orderInfo,
179 static BOOL non_monitored_desktop(rdpContext* context,
const WINDOW_ORDER_INFO* orderInfo);
181 static SdlRail* get(rdpContext* context);
185 void reportAndAdopt(
SdlRailWindow* appWindow,
int x,
int y,
int w,
int h);
187 void sendClientWindowMove(
SdlRailWindow* appWindow,
const SDL_Rect& serverRect);
191 [[nodiscard]]
SdlRailIcon* iconCacheLookup(uint32_t cacheId, uint32_t cacheEntry);
195 RailClientContext* _rail =
nullptr;
197 std::atomic<bool> _enabled =
false;
198 bool _refreshSent =
false;
200 SDL_Rect _sentWorkArea = { 0, 0, 0, 0 };
203 mutable std::mutex _windowsLock;
204 std::map<uint64_t, SdlRailWindow> _windows;
206 std::multimap<uint64_t, SdlRailWindow> _deadWindows;
211 bool wayland =
false;
213 SDL_Point anchor = { 0, 0 };
214 SDL_Point pointer = { 0, 0 };
217 bool sawResize =
false;
220 bool serverEnded =
false;
222 bool wmSized =
false;
223 SDL_Point wmSize = { 0, 0 };
225 LocalMove _localMove;
227 uint64_t _focusedAppId = 0;
229 std::vector<uint32_t> _zOrder;
230 std::vector<uint32_t> _appliedZOrder;
231 uint32_t _clientActiveId = 0;
232 bool _zOrderDirty =
false;
234 std::vector<SdlRailIcon> _iconCache;
236 uint32_t _iconCacheEntries = 0;