mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-12-12 03:06:34 +08:00
xfreerdp: add ability to move RAIL windows
This commit is contained in:
parent
ac61e43cc3
commit
eb02b578a5
@ -57,6 +57,16 @@ void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
|
||||
window->extraId = (void*) xfw->handle;
|
||||
}
|
||||
|
||||
void xf_rail_MoveWindow(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
xfWindow* xfw;
|
||||
xfw = (xfWindow*) window->extra;
|
||||
|
||||
xf_MoveWindow((xfInfo*) rail->extra, xfw,
|
||||
window->windowOffsetX, window->windowOffsetY,
|
||||
window->windowWidth, window->windowHeight);
|
||||
}
|
||||
|
||||
void xf_rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
xfWindow* xfw;
|
||||
@ -68,6 +78,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->DestroyWindow = xf_rail_DestroyWindow;
|
||||
}
|
||||
|
||||
|
@ -121,18 +121,6 @@ boolean window_GetWorkArea(xfInfo* xfi)
|
||||
return True;
|
||||
}
|
||||
|
||||
void window_move(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height)
|
||||
{
|
||||
XWindowChanges changes;
|
||||
|
||||
changes.x = x;
|
||||
changes.y = y;
|
||||
changes.width = width;
|
||||
changes.height = height;
|
||||
|
||||
XConfigureWindow(xfi->display, window->handle, CWX | CWY | CWWidth | CWHeight, &changes);
|
||||
}
|
||||
|
||||
void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show)
|
||||
{
|
||||
Atom atom;
|
||||
@ -276,12 +264,24 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char
|
||||
|
||||
XStoreName(xfi->display, window->handle, name);
|
||||
|
||||
window_move(xfi, window, x, y, width, height);
|
||||
xf_MoveWindow(xfi, window, x, y, width, height);
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height)
|
||||
{
|
||||
XWindowChanges changes;
|
||||
|
||||
changes.x = x;
|
||||
changes.y = y;
|
||||
changes.width = width;
|
||||
changes.height = height;
|
||||
|
||||
XConfigureWindow(xfi->display, window->handle, CWX | CWY | CWWidth | CWHeight, &changes);
|
||||
}
|
||||
|
||||
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
|
||||
{
|
||||
XFreeGC(xfi->display, window->gc);
|
||||
|
@ -43,13 +43,12 @@ boolean window_GetCurrentDesktop(xfInfo* xfi);
|
||||
boolean window_GetWorkArea(xfInfo* xfi);
|
||||
|
||||
void window_fullscreen(xfInfo* xfi, xfWindow* window, boolean fullscreen);
|
||||
void window_move(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
|
||||
void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show);
|
||||
|
||||
xfWindow* window_create(xfInfo* xfi, char* name);
|
||||
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
|
||||
|
||||
xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char* name);
|
||||
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
|
||||
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
|
||||
|
||||
#endif /* __XF_WINDOW_H */
|
||||
|
@ -33,6 +33,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);
|
||||
|
||||
struct rdp_rail
|
||||
{
|
||||
@ -41,6 +42,7 @@ struct rdp_rail
|
||||
rdpWindowList* list;
|
||||
railCreateWindow CreateWindow;
|
||||
railDestroyWindow DestroyWindow;
|
||||
railMoveWindow MoveWindow;
|
||||
};
|
||||
|
||||
FREERDP_API void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);
|
||||
|
@ -35,6 +35,7 @@ struct rdp_window
|
||||
void* extra;
|
||||
void* extraId;
|
||||
char* title;
|
||||
uint32 fieldFlags;
|
||||
rdpWindow* prev;
|
||||
rdpWindow* next;
|
||||
uint32 windowId;
|
||||
@ -66,6 +67,7 @@ struct rdp_window
|
||||
FREERDP_API void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
|
||||
FREERDP_API void rail_CreateWindow(rdpRail* rail, rdpWindow* window);
|
||||
FREERDP_API void rail_UpdateWindow(rdpRail* rail, rdpWindow* window);
|
||||
FREERDP_API void rail_DestroyWindow(rdpRail* rail, rdpWindow* window);
|
||||
|
||||
#endif /* __WINDOW_H */
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
|
||||
{
|
||||
window->fieldFlags = orderInfo->fieldFlags;
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_OWNER)
|
||||
{
|
||||
window->ownerWindowId = window_state->ownerWindowId;
|
||||
@ -141,10 +143,77 @@ void rail_CreateWindow(rdpRail* rail, rdpWindow* window)
|
||||
IFCALL(rail->CreateWindow, rail, window);
|
||||
}
|
||||
|
||||
void rail_UpdateWindow(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_OWNER)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_STYLE)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_SHOW)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
|
||||
{
|
||||
window->title = freerdp_uniconv_in(rail->uniconv, window->titleInfo.string, window->titleInfo.length);
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if ((window->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) ||
|
||||
(window->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE))
|
||||
{
|
||||
IFCALL(rail->MoveWindow, rail, window);
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (window->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
|
||||
{
|
||||
printf("rail_DestroyWindow\n");
|
||||
|
||||
IFCALL(rail->DestroyWindow, rail, window);
|
||||
|
||||
if (window != NULL)
|
||||
|
@ -133,6 +133,8 @@ void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDO
|
||||
return;
|
||||
|
||||
window_state_update(window, orderInfo, window_state);
|
||||
|
||||
rail_UpdateWindow(list->rail, window);
|
||||
}
|
||||
|
||||
void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo)
|
||||
|
Loading…
Reference in New Issue
Block a user