diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c index c55347fe2..fd7a1ca04 100644 --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -20,6 +20,8 @@ #include #include +#include "xf_rail.h" + #include "xf_event.h" uint8 X11_EVENT_STRINGS[][20] = @@ -420,7 +422,6 @@ boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app) boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app) { - xfWindow* xfw; rdpWindow* window; if (app != True) @@ -430,11 +431,8 @@ boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app) if (window != NULL) { - xfw = (xfWindow*) window->extra; - - /* local maximize event */ - - XFlush(xfi->display); + /* local restore event */ + xf_rail_send_client_system_command(xfi, window->windowId, SC_RESTORE); } return True; diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index 5e3daa9bc..3f8d5eecb 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -154,6 +154,24 @@ void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail) rail->DestroyWindow = xf_rail_DestroyWindow; } +void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command) +{ + RDP_EVENT* event; + rdpChanMan* chanman; + RAIL_SYSCOMMAND_ORDER* syscommand; + + chanman = GET_CHANMAN(xfi->instance); + syscommand = (RAIL_SYSCOMMAND_ORDER*) xmalloc(sizeof(RAIL_SYSCOMMAND_ORDER)); + + syscommand->windowId = windowId; + syscommand->command = command; + + event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, + RDP_EVENT_TYPE_RAIL_CLIENT_SYSCOMMAND, NULL, syscommand); + + freerdp_chanman_send_event(chanman, event); +} + void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event) { RDP_EVENT* new_event; diff --git a/client/X11/xf_rail.h b/client/X11/xf_rail.h index 5e4a6b083..b00088c0a 100644 --- a/client/X11/xf_rail.h +++ b/client/X11/xf_rail.h @@ -26,6 +26,8 @@ void xf_rail_paint(xfInfo* xfi, rdpRail* rail, uint32 ileft, uint32 itop, uint32 void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail); +void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command); + void xf_process_rail_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event); #endif /* __XF_RAIL_H */