diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2020-05-25 19:54:15 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-10-17 22:38:05 +0200 |
commit | ce649c02747e45208dedfed1ee7a329a24652ecd (patch) | |
tree | 3004be261b3a2c1d61ac5d88fcb1b38f5c816c25 /nx-X11/programs/Xserver/hw/nxagent/Screen.c | |
parent | 210db316300c9a24f74963fc90d0eb59db9555a5 (diff) | |
download | nx-libs-ce649c02747e45208dedfed1ee7a329a24652ecd.tar.gz nx-libs-ce649c02747e45208dedfed1ee7a329a24652ecd.tar.bz2 nx-libs-ce649c02747e45208dedfed1ee7a329a24652ecd.zip |
nxagent: add names to some windows in DEBUG mode
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 52ecea854..e2ceede23 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -466,9 +466,23 @@ Window nxagentCreateIconWindow(void) } } + char *winname = NULL; + #ifdef DEBUG + if (-1 == asprintf(&winname, "%s Icon", nxagentWindowName)) + { + /* If memory allocation wasn't possible, or some other error + occurs, these functions will return -1, and the contents of + winname are undefined. */ + winname = NULL; + } + #endif + Xutf8SetWMProperties(nxagentDisplay, w, - nxagentWindowName, nxagentWindowName, - NULL , 0 , sizeHints, wmHints, NULL); + winname ? winname : nxagentWindowName, + winname ? winname : nxagentWindowName, + NULL , 0 , sizeHints, wmHints, NULL); + + SAFE_free(winname); SAFE_XFree(sizeHints); SAFE_XFree(wmHints); @@ -1768,6 +1782,18 @@ N/A fprintf(stderr, "NXAGENT_WINDOW_ID: INPUT_WINDOW:[%d],WID:[0x%x]\n", pScreen->myNum, nxagentInputWindows[pScreen->myNum]); } + #ifdef DEBUG + { + char *winname = NULL; + if (-1 != asprintf(&winname, "%s Input", nxagentWindowName)) + { + Xutf8SetWMProperties(nxagentDisplay, nxagentInputWindows[pScreen->myNum], + winname, winname, NULL , 0 , NULL, NULL, NULL); + SAFE_free(winname); + } + } + #endif + #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Created new input window for screen [%d] with id [0x%x].\n", pScreen->myNum, nxagentInputWindows[pScreen->myNum]); @@ -1873,11 +1899,24 @@ N/A } } + char *winname = NULL; + #ifdef DEBUG + if (-1 == asprintf(&winname, "%s Default[%d]", nxagentWindowName, pScreen->myNum)) + { + /* If memory allocation wasn't possible, or some other error + occurs, these functions will return -1, and the contents of + winname are undefined. */ + winname = NULL; + } + #endif + Xutf8SetWMProperties(nxagentDisplay, - nxagentDefaultWindows[pScreen->myNum], - nxagentWindowName, - nxagentWindowName, - argv , argc , sizeHints, wmHints, NULL); + nxagentDefaultWindows[pScreen->myNum], + winname ? winname : nxagentWindowName, + winname ? winname : nxagentWindowName, + argv , argc , sizeHints, wmHints, NULL); + + SAFE_free(winname); SAFE_XFree(sizeHints); SAFE_XFree(wmHints); |