diff options
author | Peter Harris <pharris@opentext.com> | 2013-05-31 16:07:41 -0400 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2013-05-31 16:12:04 -0400 |
commit | 001281cfbf7e0f9bce202e628baffa23714e273c (patch) | |
tree | c6173d8c920dd70991aa4a48fb6e2388e88f42ff | |
parent | 17a8c9f981b6142a96bb3ad7c6dd40bd0da721c7 (diff) |
Fix XSetWMSizeHints et al.
Xlib, since release 1.1.2, only transmits fields for which the
corresponding flags bit is set (to avoid a potential information leak).
Set the flags field to include all the fields to be tested.
Signed-off-by: Peter Harris <pharris@opentext.com>
-rw-r--r-- | xts5/Xlib15/XGetWMNormalHints.m | 7 | ||||
-rw-r--r-- | xts5/Xlib15/XGetWMSizeHints.m | 7 | ||||
-rw-r--r-- | xts5/Xlib15/XSetWMNormalHints.m | 8 | ||||
-rw-r--r-- | xts5/Xlib15/XSetWMProperties/XSetWMProperties.m | 8 | ||||
-rw-r--r-- | xts5/Xlib15/XSetWMSizeHints.m | 9 |
5 files changed, 21 insertions, 18 deletions
diff --git a/xts5/Xlib15/XGetWMNormalHints.m b/xts5/Xlib15/XGetWMNormalHints.m index 5a754d0a..28dd70af 100644 --- a/xts5/Xlib15/XGetWMNormalHints.m +++ b/xts5/Xlib15/XGetWMNormalHints.m @@ -111,7 +111,8 @@ long *supplied_return = &supret; #include "X11/Xatom.h" #define NumPropSizeElements 18 #define OldNumPropSizeElements 15 -static XSizeHints sizehints = { 0 ,1,2,3,4,5,6,7,8,9,10, {11,12} , {13,14}, 15, 16, 17}; +#define AllFlags (USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect|PBaseSize|PWinGravity) +static XSizeHints sizehints = { AllFlags ,1,2,3,4,5,6,7,8,9,10, {11,12} , {13,14}, 15, 16, 17}; static XSizeHints rhints = { 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, {111, 112}, {113, 114}, 115, 116, 117 }; static long supret; @@ -161,8 +162,8 @@ XVisualInfo *vp; } else CHECK; - if(rhints.flags != 0) { - report("The flags component of the XSizeHints structure was %lu instead of 0.", rhints.flags); + if(rhints.flags != AllFlags) { + report("The flags component of the XSizeHints structure was %lX instead of %X.", rhints.flags, AllFlags); FAIL; } else CHECK; diff --git a/xts5/Xlib15/XGetWMSizeHints.m b/xts5/Xlib15/XGetWMSizeHints.m index 21cccda1..0e0370b9 100644 --- a/xts5/Xlib15/XGetWMSizeHints.m +++ b/xts5/Xlib15/XGetWMSizeHints.m @@ -112,7 +112,8 @@ Atom property = XA_WM_NORMAL_HINTS; #include "X11/Xatom.h" #define NumPropSizeElements 18 #define OldNumPropSizeElements 15 -static XSizeHints sizehints = {0,1,2,3,4,5,6,7,8,9,10, {11,12} , {13,14}, 15, 16, 17}; +#define AllFlags (USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect|PBaseSize|PWinGravity) +static XSizeHints sizehints = {AllFlags,1,2,3,4,5,6,7,8,9,10, {11,12} , {13,14}, 15, 16, 17}; static XSizeHints rhints = {100,101,102,103,104,105,106,107,108,109,110, {111,112} , {113,114}, 115, 116, 117}; static long supret; >>ASSERTION Good A @@ -161,8 +162,8 @@ XVisualInfo *vp; } else CHECK; - if(rhints.flags != 0) { - report("The flags component of the XSizeHints structure was %lu instead of 0.", rhints.flags); + if(rhints.flags != AllFlags) { + report("The flags component of the XSizeHints structure was %lX instead of %X.", rhints.flags, AllFlags); FAIL; } else CHECK; diff --git a/xts5/Xlib15/XSetWMNormalHints.m b/xts5/Xlib15/XSetWMNormalHints.m index 44325a6a..5216314e 100644 --- a/xts5/Xlib15/XSetWMNormalHints.m +++ b/xts5/Xlib15/XSetWMNormalHints.m @@ -109,8 +109,8 @@ XSizeHints *hints = &sizehints_0; >>EXTERN #include "X11/Xatom.h" #define NewNumPropSizeElements 18 /* ICCCM v. 1 */ -static XSizeHints sizehints_0 = { PAllHints,0,0,0,0,0,0,0,0,0,0, {0,0}, {0,0}, 0,0,0}; -static XSizeHints sizehints_1 = { PAllHints,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; +static XSizeHints sizehints_0 = { PAllHints|PBaseSize|PWinGravity,0,0,0,0,0,0,0,0,0,0, {0,0}, {0,0}, 0,0,0}; +static XSizeHints sizehints_1 = { PAllHints|PBaseSize|PWinGravity,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; >>ASSERTION Good A A call to xname sets the .S WM_NORMAL_HINTS @@ -188,8 +188,8 @@ int i; pp.base_height = (int)uls[++i]; /* added by ICCCM version 1 */ pp.win_gravity = (int)uls[++i]; /* added by ICCCM version 1 */ - if(pp.flags != PAllHints) { - report("The flags component of the XSizeHints structure was %lu instead of PAllHints (%ld).", pp.flags, PAllHints); + if(pp.flags != (PAllHints|PBaseSize|PWinGravity)) { + report("The flags component of the XSizeHints structure was %lu instead of PAllHints|PBaseSize|PWinGravity (%ld).", pp.flags, PAllHints|PBaseSize|PWinGravity); FAIL; } else CHECK; diff --git a/xts5/Xlib15/XSetWMProperties/XSetWMProperties.m b/xts5/Xlib15/XSetWMProperties/XSetWMProperties.m index 9ef85f7c..80589152 100644 --- a/xts5/Xlib15/XSetWMProperties/XSetWMProperties.m +++ b/xts5/Xlib15/XSetWMProperties/XSetWMProperties.m @@ -147,8 +147,8 @@ Test2 : Test2.o $(LIBS) $(top_builddir)/src/tet3/tcm/libtcmchild.la #define NewNumPropSizeElements 18 /* ICCCM v. 1 */ #define NumPropWMHintsElements 9 #include "X11/Xatom.h" -static XSizeHints sizehints = { PAllHints,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; -static XSizeHints sizehints_1 = { PAllHints,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; +static XSizeHints sizehints = { PAllHints|PBaseSize|PWinGravity,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; +static XSizeHints sizehints_1 = { PAllHints|PBaseSize|PWinGravity,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; >>ASSERTION Good A When the .A window_name @@ -534,8 +534,8 @@ int i; pp.base_height = (int)uls[++i]; /* added by ICCCM version 1 */ pp.win_gravity = (int)uls[++i]; /* added by ICCCM version 1 */ - if(pp.flags != PAllHints) { - report("The flags component of the XSizeHints structure was %lu instead of PAllHints (%ld).", pp.flags, PAllHints); + if(pp.flags != (PAllHints|PBaseSize|PWinGravity)) { + report("The flags component of the XSizeHints structure was %lu instead of PAllHints|PBaseSize|PWinGravity (%ld).", pp.flags, PAllHints|PBaseSize|PWinGravity); FAIL; } else CHECK; diff --git a/xts5/Xlib15/XSetWMSizeHints.m b/xts5/Xlib15/XSetWMSizeHints.m index f4cfee71..68e0696e 100644 --- a/xts5/Xlib15/XSetWMSizeHints.m +++ b/xts5/Xlib15/XSetWMSizeHints.m @@ -110,8 +110,9 @@ Atom property = XA_WM_NORMAL_HINTS; >>EXTERN #define NumPropSizeElements 18 /* ICCCM v. 1 */ #include "X11/Xatom.h" -static XSizeHints sizehints_0 = { 0,0,0,0,0,0,0,0,0,0,0, {0,0}, {0,0}, 0,0,0}; -static XSizeHints sizehints_1 = { 0,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; +#define AllFlags (USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect|PBaseSize|PWinGravity) +static XSizeHints sizehints_0 = { AllFlags,0,0,0,0,0,0,0,0,0,0, {0,0}, {0,0}, 0,0,0}; +static XSizeHints sizehints_1 = { AllFlags,1,2,3,4,5,6,7,8,9,10, {11,12}, {13,14}, 15, 16, 17}; >>ASSERTION Good A A call to xname sets the property, specified by the @@ -190,8 +191,8 @@ int i; pp.base_height = (int)uls[++i]; /* added by ICCCM version 1 */ pp.win_gravity = (int)uls[++i]; /* added by ICCCM version 1 */ - if(pp.flags != 0) { - report("The flags component of the XSizeHints structure was %lu instead of 0.", pp.flags); + if(pp.flags != AllFlags) { + report("The flags component of the XSizeHints structure was %lX instead of %X.", pp.flags, AllFlags); FAIL; } else CHECK; |