XChangeProperty needs long type for 32bit data, especially on 64bit platforms.

Also silence a couple of warnings.
CCMAIL: Thomas Lübking <thomas.luebking@web.de>

svn path=/trunk/kdebase/kwin/; revision=382862
This commit is contained in:
Luboš Luňák 2005-01-27 09:58:34 +00:00
parent 39d880fe1e
commit 6dd5d6b1f7
3 changed files with 13 additions and 11 deletions

View file

@ -477,7 +477,7 @@ QRegion Client::mask() const
void Client::setShapable(bool b) void Client::setShapable(bool b)
{ {
uint tmp = b?1:0; long tmp = b?1:0;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L); XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L);
} }
@ -746,7 +746,7 @@ void Client::setShade( ShadeMode mode )
if ( isShade()) if ( isShade())
{ // shade_mode == ShadeNormal { // shade_mode == ShadeNormal
// we're about to shade, texx xcompmgr to prepare // we're about to shade, texx xcompmgr to prepare
uint _shade = 1; long _shade = 1;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L);
// shade // shade
int h = height(); int h = height();
@ -1776,8 +1776,9 @@ void Client::setOpacity(bool translucent, uint opacity)
if(opacity == opacity_) if(opacity == opacity_)
return; return;
opacity_ = opacity; opacity_ = opacity;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); long data = opacity; // 32bit XChangeProperty needs long
XChangeProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
XChangeProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
} }
} }
@ -1785,7 +1786,8 @@ void Client::setShadowSize(uint shadowSize)
{ {
// ignoring all individual settings - if we control a window, we control it's shadow // ignoring all individual settings - if we control a window, we control it's shadow
// TODO somehow handle individual settings for docks (besides custom sizes) // TODO somehow handle individual settings for docks (besides custom sizes)
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &shadowSize, 1L); long data = shadowSize;
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
} }
void Client::updateOpacity() void Client::updateOpacity()
@ -1992,7 +1994,7 @@ uint Client::opacity()
int Client::opacityPercentage() int Client::opacityPercentage()
{ {
return ((int)100*((double)opacity_/0xffffffff)); return int(100*((double)opacity_/0xffffffff));
} }
bool Client::touches(const Client* c) bool Client::touches(const Client* c)

View file

@ -173,13 +173,13 @@ unsigned long Options::updateSettings()
useTranslucency = config->readBoolEntry("UseTranslucency", false); useTranslucency = config->readBoolEntry("UseTranslucency", false);
config->setGroup( "Translucency"); config->setGroup( "Translucency");
translucentActiveWindows = config->readBoolEntry("TranslucentActiveWindows", false); translucentActiveWindows = config->readBoolEntry("TranslucentActiveWindows", false);
activeWindowOpacity = (config->readNumEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF; activeWindowOpacity = uint((config->readNumEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
translucentInactiveWindows = config->readBoolEntry("TranslucentInactiveWindows", false); translucentInactiveWindows = config->readBoolEntry("TranslucentInactiveWindows", false);
inactiveWindowOpacity = (config->readNumEntry("InactiveWindowOpacity", 100)/100.0)*0xFFFFFFFF; inactiveWindowOpacity = uint((config->readNumEntry("InactiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
translucentMovingWindows = config->readBoolEntry("TranslucentMovingWindows", false); translucentMovingWindows = config->readBoolEntry("TranslucentMovingWindows", false);
movingWindowOpacity = (config->readNumEntry("MovingWindowOpacity", 100)/100.0)*0xFFFFFFFF; movingWindowOpacity = uint((config->readNumEntry("MovingWindowOpacity", 100)/100.0)*0xFFFFFFFF);
translucentDocks = config->readBoolEntry("TranslucentDocks", false); translucentDocks = config->readBoolEntry("TranslucentDocks", false);
dockOpacity = (config->readNumEntry("DockOpacity", 100)/100.0)*0xFFFFFFFF; dockOpacity = uint((config->readNumEntry("DockOpacity", 100)/100.0)*0xFFFFFFFF);
keepAboveAsActive = config->readBoolEntry("TreatKeepAboveAsActive", true); keepAboveAsActive = config->readBoolEntry("TreatKeepAboveAsActive", true);
//TODO: remove this variable //TODO: remove this variable
useTitleMenuSlider = true; useTitleMenuSlider = true;

View file

@ -165,7 +165,7 @@ bool KWinSelectionOwner::genericReply( Atom target_P, Atom property_P, Window re
{ {
if( target_P == xa_version ) if( target_P == xa_version )
{ {
Q_INT32 version[] = { 2, 0 }; long version[] = { 2, 0 };
XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_INTEGER, 32, XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_INTEGER, 32,
PropModeReplace, reinterpret_cast< unsigned char* >( &version ), 2 ); PropModeReplace, reinterpret_cast< unsigned char* >( &version ), 2 );
} }