aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/xdmcphostselect.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-03 14:55:25 +0000
committermarha <marha@users.sourceforge.net>2011-02-03 14:55:25 +0000
commit81d327e65a2081a5bb48f974d9101ed9f85767a6 (patch)
treec310d5b5bd07d8c2a66ff99f8be503a9e85a2e19 /xorg-server/hw/xwin/xdmcphostselect.c
parent46fbac6f1b19416ee1dbca883f0d09d9fd75d1eb (diff)
downloadvcxsrv-81d327e65a2081a5bb48f974d9101ed9f85767a6.tar.gz
vcxsrv-81d327e65a2081a5bb48f974d9101ed9f85767a6.tar.bz2
vcxsrv-81d327e65a2081a5bb48f974d9101ed9f85767a6.zip
xdmcp: add host connected to in the title of the main window
Diffstat (limited to 'xorg-server/hw/xwin/xdmcphostselect.c')
-rw-r--r--xorg-server/hw/xwin/xdmcphostselect.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/xorg-server/hw/xwin/xdmcphostselect.c b/xorg-server/hw/xwin/xdmcphostselect.c
index a447f9495..3196da4af 100644
--- a/xorg-server/hw/xwin/xdmcphostselect.c
+++ b/xorg-server/hw/xwin/xdmcphostselect.c
@@ -6,6 +6,39 @@
void XdmcpHostSelected(int HostIndex);
static HWND g_hDlgHosts;
+static char HostToConnect[128];
+
+static void SelectHost(int Index)
+{
+ int i;
+ char HostName[128];
+ int HostIndex=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETITEMDATA, (WPARAM)Index, 0);
+
+ HostToConnect[0]=0;
+ SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETTEXT, (WPARAM)Index, (LPARAM)HostToConnect);
+ g_pszQueryHost=HostToConnect;
+
+ gethostname(HostName,128);
+
+ XdmcpHostSelected(HostIndex);
+
+ for (i = 0; i < g_iNumScreens; ++i)
+ {
+ /* Change the window title to reflect the host we are connecting to */
+ if (g_ScreenInfo[i].pScreen)
+ {
+ char szTitle[256];
+
+ winScreenPriv(g_ScreenInfo[i].pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ snprintf (szTitle, sizeof (szTitle), WINDOW_TITLE_XDMCP, HostToConnect, HostName, display, (int) pScreenInfo->dwScreen);
+ SetWindowText(pScreenPriv->hwndScreen,szTitle);
+ }
+ }
+
+ DestroyWindow (g_hDlgHosts);
+ g_hDlgHosts = NULL;
+}
/*
* Process messages for the about dialog.
@@ -64,11 +97,7 @@ static wBOOL CALLBACK DisplayXdmcpHostsDlgProc (HWND hwndDialog, UINT message, W
}
else
{
- int HostIndex=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETITEMDATA, (WPARAM)Index, 0);
- XdmcpHostSelected(HostIndex);
-
- DestroyWindow (g_hDlgHosts);
- g_hDlgHosts = NULL;
+ SelectHost(Index);
}
return TRUE;
@@ -87,11 +116,7 @@ static wBOOL CALLBACK DisplayXdmcpHostsDlgProc (HWND hwndDialog, UINT message, W
if (HIWORD(wParam)==LBN_DBLCLK)
{
int Index=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETCURSEL, 0, 0);
- int HostIndex=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETITEMDATA, (WPARAM)Index, 0);
- XdmcpHostSelected(HostIndex);
-
- DestroyWindow (g_hDlgHosts);
- g_hDlgHosts = NULL;
+ SelectHost(Index);
return TRUE;
}
break;