[yocto] [matchbox-wm][PATCH] ewmh: Fix data type of a few XChangeProperty calls
Jussi Kukkonen
jussi.kukkonen at intel.com
Fri Mar 18 08:11:42 PDT 2016
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 <jussi.kukkonen at intel.com>
---
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 *)&w->n_modals_present, 1);
+ (unsigned char *)&modals, 1);
XChangeProperty(w->dpy, w->root,
w->atoms[_MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT],
XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *)&w->n_modal_blocker_wins, 1);
+ (unsigned char *)&modal_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
More information about the yocto
mailing list