mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-12-04 15:23:32 +08:00
xfreerdp: handle RAIL window title updates
This commit is contained in:
parent
a312d47599
commit
4a126a55b0
@ -99,6 +99,17 @@ void xf_rail_MoveWindow(rdpRail* rail, rdpWindow* window)
|
||||
window->windowWidth, window->windowHeight);
|
||||
}
|
||||
|
||||
void xf_rail_SetWindowText(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
xfInfo* xfi;
|
||||
xfWindow* xfw;
|
||||
|
||||
xfi = (xfInfo*) rail->extra;
|
||||
xfw = (xfWindow*) window->extra;
|
||||
|
||||
XStoreName(xfi->display, xfw->handle, window->title);
|
||||
}
|
||||
|
||||
void xf_rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
xfWindow* xfw;
|
||||
@ -111,6 +122,7 @@ void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail)
|
||||
rail->extra = (void*) xfi;
|
||||
rail->CreateWindow = xf_rail_CreateWindow;
|
||||
rail->MoveWindow = xf_rail_MoveWindow;
|
||||
rail->SetWindowText = xf_rail_SetWindowText;
|
||||
rail->DestroyWindow = xf_rail_DestroyWindow;
|
||||
}
|
||||
|
||||
@ -142,21 +154,22 @@ void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChanMan* chanman, RDP_E
|
||||
freerdp_chanman_send_event(chanman, new_event);
|
||||
}
|
||||
|
||||
const char* error_code_names[] =
|
||||
{
|
||||
"RAIL_EXEC_S_OK",
|
||||
"RAIL_EXEC_E_HOOK_NOT_LOADED",
|
||||
"RAIL_EXEC_E_DECODE_FAILED",
|
||||
"RAIL_EXEC_E_NOT_IN_ALLOWLIST",
|
||||
"RAIL_EXEC_E_FILE_NOT_FOUND",
|
||||
"RAIL_EXEC_E_FAIL",
|
||||
"RAIL_EXEC_E_SESSION_LOCKED"
|
||||
};
|
||||
|
||||
void xf_process_rail_exec_result_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
|
||||
{
|
||||
RAIL_EXEC_RESULT_ORDER * exec_result;
|
||||
const char* error_code_names[] =
|
||||
{
|
||||
"RAIL_EXEC_S_OK",
|
||||
"RAIL_EXEC_E_HOOK_NOT_LOADED",
|
||||
"RAIL_EXEC_E_DECODE_FAILED",
|
||||
"RAIL_EXEC_E_NOT_IN_ALLOWLIST",
|
||||
"RAIL_EXEC_E_FILE_NOT_FOUND",
|
||||
"RAIL_EXEC_E_FAIL",
|
||||
"RAIL_EXEC_E_SESSION_LOCKED"
|
||||
};
|
||||
RAIL_EXEC_RESULT_ORDER* exec_result;
|
||||
|
||||
exec_result = (RAIL_EXEC_RESULT_ORDER *)event->user_data;
|
||||
exec_result = (RAIL_EXEC_RESULT_ORDER*) event->user_data;
|
||||
|
||||
if (exec_result->execResult != RAIL_EXEC_S_OK)
|
||||
{
|
||||
|
@ -273,6 +273,9 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
|
||||
Pixmap surface;
|
||||
XSizeHints* size_hints;
|
||||
|
||||
if ((width * height) < 1)
|
||||
return;
|
||||
|
||||
size_hints = XAllocSizeHints();
|
||||
|
||||
if (size_hints)
|
||||
|
@ -34,6 +34,7 @@ typedef struct rdp_rail rdpRail;
|
||||
typedef void (*railCreateWindow)(rdpRail* rail, rdpWindow* window);
|
||||
typedef void (*railDestroyWindow)(rdpRail* rail, rdpWindow* window);
|
||||
typedef void (*railMoveWindow)(rdpRail* rail, rdpWindow* window);
|
||||
typedef void (*railSetWindowText)(rdpRail* rail, rdpWindow* window);
|
||||
|
||||
struct rdp_rail
|
||||
{
|
||||
@ -43,6 +44,7 @@ struct rdp_rail
|
||||
railCreateWindow CreateWindow;
|
||||
railDestroyWindow DestroyWindow;
|
||||
railMoveWindow MoveWindow;
|
||||
railSetWindowText SetWindowText;
|
||||
};
|
||||
|
||||
FREERDP_API void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);
|
||||
|
@ -162,7 +162,12 @@ void rail_UpdateWindow(rdpRail* rail, rdpWindow* window)
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
|
||||
{
|
||||
if (window->title != NULL)
|
||||
xfree(window->title);
|
||||
|
||||
window->title = freerdp_uniconv_in(rail->uniconv, window->titleInfo.string, window->titleInfo.length);
|
||||
|
||||
IFCALL(rail->SetWindowText, rail, window);
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
|
||||
|
Loading…
Reference in New Issue
Block a user