aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwm.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-24 21:12:32 +0100
committermarha <marha@users.sourceforge.net>2014-03-24 21:12:32 +0100
commite0927d908a12c9c140458c355b29b884a7705f2d (patch)
tree360dbbd5a318ff84a951e4ca96df38393bc9783f /xorg-server/hw/xwin/winmultiwindowwm.c
parent41fea4472dec859ddec76bdfa7108ebec71de1e3 (diff)
downloadvcxsrv-e0927d908a12c9c140458c355b29b884a7705f2d.tar.gz
vcxsrv-e0927d908a12c9c140458c355b29b884a7705f2d.tar.bz2
vcxsrv-e0927d908a12c9c140458c355b29b884a7705f2d.zip
fontconfig libxcb mesa xserver git update 24 Mar 2014
xserver commit bf087659f0fb747c471e26c5b287c35877818040 libxcb commit e2813e1cde893f384fa620ff3c13493beebabe0c fontconfig commit 9260b7ec39c34ce68d74e16d47917290a8c3f35a mesa commit 0d99aef6c8a940e52afcbffa7091ff9c854ba120
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwm.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 9f12521bc..618e38121 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -60,6 +60,7 @@
#include "window.h"
#include "pixmapstr.h"
#include "windowstr.h"
+#include "winglobals.h"
#ifdef XWIN_MULTIWINDOWEXTWM
#include <X11/extensions/windowswmstr.h>
@@ -69,6 +70,10 @@
#define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND"
#endif
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
extern void winDebug(const char *format, ...);
extern void winReshapeMultiWindow(WindowPtr pWin);
extern void winUpdateRgnMultiWindow(WindowPtr pWin);
@@ -430,7 +435,10 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName)
{
int nResult;
XTextProperty xtpWindowName;
+ XTextProperty xtpClientMachine;
char *pszWindowName;
+ char *pszClientMachine;
+ char hostname[HOST_NAME_MAX + 1];
#if CYGMULTIWINDOW_DEBUG
ErrorF("GetWindowName\n");
@@ -450,6 +458,41 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName)
pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName);
XFree(xtpWindowName.value);
+
+ if (g_fHostInTitle) {
+ /* Try to get client machine name */
+ nResult = XGetWMClientMachine(pDisplay, iWin, &xtpClientMachine);
+ if (nResult && xtpClientMachine.value && xtpClientMachine.nitems) {
+ pszClientMachine =
+ Xutf8TextPropertyToString(pDisplay, &xtpClientMachine);
+ XFree(xtpClientMachine.value);
+
+ /*
+ If we have a client machine name
+ and it's not the local host name
+ and it's not already in the window title...
+ */
+ if (strlen(pszClientMachine) &&
+ !gethostname(hostname, HOST_NAME_MAX + 1) &&
+ strcmp(hostname, pszClientMachine) &&
+ (strstr(pszWindowName, pszClientMachine) == 0)) {
+ /* ... add '@<clientmachine>' to end of window name */
+ *ppWindowName =
+ malloc(strlen(pszWindowName) +
+ strlen(pszClientMachine) + 2);
+ strcpy(*ppWindowName, pszWindowName);
+ strcat(*ppWindowName, "@");
+ strcat(*ppWindowName, pszClientMachine);
+
+ free(pszWindowName);
+ free(pszClientMachine);
+
+ return;
+ }
+ }
+ }
+
+ /* otherwise just return the window name */
*ppWindowName = pszWindowName;
}
@@ -1618,10 +1661,10 @@ winDeinitMultiWindowWM(void)
}
/* Windows window styles */
-#define HINT_NOFRAME (1l<<0)
+#define HINT_NOFRAME (1L<<0)
#define HINT_BORDER (1L<<1)
-#define HINT_SIZEBOX (1l<<2)
-#define HINT_CAPTION (1l<<3)
+#define HINT_SIZEBOX (1L<<2)
+#define HINT_CAPTION (1L<<3)
#define HINT_NOMAXIMIZE (1L<<4)
#define HINT_NOMINIMIZE (1L<<5)
#define HINT_NOSYSMENU (1L<<6)