From d3cd9cb7e9650ee357f6322d5c2bfee8db21ab86 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 12 Oct 2014 21:55:04 -0700 Subject: Xorg: remove uds file on exit --- xorg/server/module/rdpInput.c | 13 ++++++++++++- xorg/server/xrdpdev/xrdpdev.c | 13 ++++++++++++- xorg/server/xrdpkeyb/rdpKeyboard.c | 1 + xorg/server/xrdpmouse/rdpMouse.c | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) (limited to 'xorg/server') diff --git a/xorg/server/module/rdpInput.c b/xorg/server/module/rdpInput.c index f19b2947..2344f4a1 100644 --- a/xorg/server/module/rdpInput.c +++ b/xorg/server/module/rdpInput.c @@ -53,6 +53,7 @@ static struct input_proc_list g_input_proc[MAX_INPUT_PROC]; int rdpRegisterInputCallback(int type, rdpInputEventProcPtr proc) { + LLOGLN(0, ("rdpRegisterInputCallback: type %d proc %p", type, proc)); if (type == 0) { g_input_proc[0].proc = proc; @@ -73,12 +74,22 @@ int rdpUnregisterInputCallback(rdpInputEventProcPtr proc) { int index; + char text[256]; + LLOGLN(0, ("rdpUnregisterInputCallback: proc %p", proc)); for (index = 0; index < MAX_INPUT_PROC; index++) { if (g_input_proc[index].proc == proc) { - g_input_proc[index].proc = 0; + if (index == 0) + { + /* hack to cleanup + remove when xrdpdevTearDown is working */ + g_sprintf(text, "/tmp/.xrdp/xrdp_display_%s", display); + LLOGLN(0, ("rdpUnregisterInputCallback: deleting file %s", text)); + unlink(text); + } + g_input_proc[index].proc = 0; return 0; } } diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index 5a863f00..9aa4ca2a 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -619,6 +619,17 @@ rdpValidMode(ScrnInfoPtr a, DisplayModePtr b, Bool c, int d) return 0; } +/*****************************************************************************/ +static void +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) +rdpFreeScreen(int a, int b) +#else +rdpFreeScreen(ScrnInfoPtr a) +#endif +{ + LLOGLN(0, ("rdpFreeScreen:")); +} + /*****************************************************************************/ static Bool rdpProbe(DriverPtr drv, int flags) @@ -670,7 +681,7 @@ rdpProbe(DriverPtr drv, int flags) pscrn->EnterVT = rdpEnterVT; pscrn->LeaveVT = rdpLeaveVT; pscrn->ValidMode = rdpValidMode; - + pscrn->FreeScreen = rdpFreeScreen; xf86DrvMsg(pscrn->scrnIndex, X_INFO, "%s", "using default device\n"); } } diff --git a/xorg/server/xrdpkeyb/rdpKeyboard.c b/xorg/server/xrdpkeyb/rdpKeyboard.c index 0157de21..20e8a469 100644 --- a/xorg/server/xrdpkeyb/rdpKeyboard.c +++ b/xorg/server/xrdpkeyb/rdpKeyboard.c @@ -674,6 +674,7 @@ rdpkeybUnInit(InputDriverPtr drv, InputInfoPtr info, int flags) { LLOGLN(0, ("rdpkeybUnInit: drv %p info %p, flags 0x%x", drv, info, flags)); + rdpUnregisterInputCallback(rdpInputKeyboard); } /******************************************************************************/ diff --git a/xorg/server/xrdpmouse/rdpMouse.c b/xorg/server/xrdpmouse/rdpMouse.c index d64e9233..60b97945 100644 --- a/xorg/server/xrdpmouse/rdpMouse.c +++ b/xorg/server/xrdpmouse/rdpMouse.c @@ -309,6 +309,7 @@ rdpmouseUnInit(InputDriverPtr drv, InputInfoPtr info, int flags) { LLOGLN(0, ("rdpmouseUnInit: drv %p info %p, flags 0x%x", drv, info, flags)); + rdpUnregisterInputCallback(rdpInputMouse); } /******************************************************************************/ -- cgit v1.2.1