[yocto] [matchbox-wm][PATCH] ewmh: Fix data type of a few XChangeProperty calls

2016-03-20 Thread Jussi Kukkonen
XChangeProperty documentation: "If the specified format is 32, the
property data must be a long array."

Using int can lead to bogus data being used on platforms where long
actually is different from int.

Signed-off-by: Jussi Kukkonen 
---

Yocto-specific reference: Sato does not really use the other cases
but _NET_SHOW_DESKTOP corruption lead to problems like [YOCTO #9284]
and [YOCTO #9026].

 src/ewmh.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/ewmh.c b/src/ewmh.c
index 31ac969..a736037 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -136,7 +136,7 @@ ewmh_init(Wm *w)
 void
 ewmh_init_props(Wm *w)
 {
-  int num_desktops = 1;
+  long num_desktops = 1;
   
   set_compliant(w);
   set_supported(w);
@@ -455,15 +455,18 @@ ewmh_update_lists(Wm *w)
   */
   if (w->config->super_modal)
 {
+  long modals = w->n_modals_present;
+  long modal_blockers = w->n_modal_blocker_wins;
+
   XChangeProperty(w->dpy, w->root, 
  w->atoms[_MB_NUM_MODAL_WINDOWS_PRESENT],
  XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *)>n_modals_present, 1);
+ (unsigned char *), 1);
 
   XChangeProperty(w->dpy, w->root, 
  w->atoms[_MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT],
  XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *)>n_modal_blocker_wins, 1);
+ (unsigned char *)_blockers, 1);
 }
 }
 
@@ -472,7 +475,7 @@ ewmh_update_desktop_hint(Wm *w)
 {
/* Desktop showing hint */
 
-   int val = (w->flags & DESKTOP_RAISED_FLAG) ? 1 : 0;
+   long val = (w->flags & DESKTOP_RAISED_FLAG) ? 1 : 0;
 
XChangeProperty(w->dpy, w->root, w->atoms[_NET_SHOW_DESKTOP],
   XA_CARDINAL, 32, PropModeReplace, 
-- 
2.7.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [matchbox-wm][PATCH] ewmh: Fix data type of a few XChangeProperty calls

2016-03-19 Thread Burton, Ross
On 18 March 2016 at 15:11, Jussi Kukkonen  wrote:

> XChangeProperty documentation: "If the specified format is 32, the
> property data must be a long array."
>
> Using int can lead to bogus data being used on platforms where long
> actually is different from int.
>
> Signed-off-by: Jussi Kukkonen 
>

Pushed, thanks Jussi!

Ross
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto