CVS commit by lunakl: 64bit fixes for translucency. M +2 -2 client.cpp 1.452 M +14 -14 kompmgr/kompmgr.c 1.25 --- kdebase/kwin/client.cpp #1.451:1.452 @@ -1977,7 +1977,7 @@ bool Client::getWindowOpacity() //query unsigned long n, left; result = XGetWindowProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); - if (result == Success && data != None) + if (result == Success && data != None && format == 32 ) { - memcpy (&opacity_, data, sizeof (unsigned int)); + opacity_ = *reinterpret_cast< long* >( data ); custom_opacity = true; // setOpacity(opacity_ < 0xFFFFFFFF, opacity_); --- kdebase/kwin/kompmgr/kompmgr.c #1.24:1.25 @@ -841,5 +841,5 @@ root_tile (Display *dpy) actual_type == XInternAtom (dpy, "PIXMAP", False) && actual_format == 32 && nitems == 1) { - memcpy (&pixmap, prop, 4); + pixmap = *(long*)prop; XFree (prop); fill = False; @@ -1493,8 +1493,8 @@ get_opacity_prop(Display *dpy, win *w, u XA_CARDINAL, &actual, &format, &n, &left, &data); - if (result == Success && data != NULL) + if (result == Success && data != NULL && format == 32 ) { unsigned int i; - memcpy (&i, data, sizeof (unsigned int)); + i = *(long*)data; XFree( (void *) data); return i; @@ -1514,8 +1514,8 @@ get_shadow_prop(Display *dpy, win *w) XA_CARDINAL, &actual, &format, &n, &left, &data); - if (result == Success && data != NULL) + if (result == Success && data != NULL && format == 32 ) { unsigned int i; - memcpy (&i, data, sizeof (unsigned int)); + i = *(long*)data; XFree( (void *) data); /*i added this for security reaons but limiting a value to 200% is somewhat indiscriminate @@ -1539,8 +1539,8 @@ get_shade_prop(Display *dpy, win *w) XA_CARDINAL, &actual, &format, &n, &left, &data); - if (result == Success && data != NULL) + if (result == Success && data != NULL && format == 32 ) { unsigned int i; - memcpy (&i, data, sizeof (unsigned int)); + i = *(long*)data; XFree( (void *) data); return i; @@ -1560,8 +1560,8 @@ get_shapable_prop(Display *dpy, win *w) XA_CARDINAL, &actual, &format, &n, &left, &data); - if (result == Success && data != NULL) + if (result == Success && data != NULL && format == 32 ) { unsigned int i; - memcpy (&i, data, sizeof (unsigned int)); + i = *(long*)data; XFree( (void *) data); return i==1; @@ -1581,8 +1581,8 @@ get_titleHeight_prop(Display *dpy, win * XA_CARDINAL, &actual, &format, &n, &left, &data); - if (result == Success && data != NULL) + if (result == Success && data != NULL && format == 32 ) { unsigned int i; - memcpy (&i, data, sizeof (unsigned int)); + i = *(long*)data; XFree( (void *) data); return i; @@ -1626,8 +1626,8 @@ get_wintype_prop(Display * dpy, Window w &n, &left, &data); - if (result == Success && data != None) + if (result == Success && data != None && format == 32 ) { Atom a; - memcpy (&a, data, sizeof (Atom)); + a = *(long*)data; XFree ( (void *) data); return a;