From 6dd5d6b1f72d5af13910544a27cb7245b069ca68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 27 Jan 2005 09:58:34 +0000 Subject: [PATCH] =?UTF-8?q?XChangeProperty=20needs=20long=20type=20for=203?= =?UTF-8?q?2bit=20data,=20especially=20on=2064bit=20platforms.=20Also=20si?= =?UTF-8?q?lence=20a=20couple=20of=20warnings.=20CCMAIL:=20Thomas=20L?= =?UTF-8?q?=C3=83=C2=BCbking=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/kdebase/kwin/; revision=382862 --- client.cpp | 14 ++++++++------ options.cpp | 8 ++++---- utils.cpp | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/client.cpp b/client.cpp index 0849c21554..9f5e0bc669 100644 --- a/client.cpp +++ b/client.cpp @@ -477,7 +477,7 @@ QRegion Client::mask() const 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); } @@ -746,7 +746,7 @@ void Client::setShade( ShadeMode mode ) if ( isShade()) { // shade_mode == ShadeNormal // 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); // shade int h = height(); @@ -1776,8 +1776,9 @@ void Client::setOpacity(bool translucent, uint opacity) if(opacity == opacity_) return; opacity_ = opacity; - XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); - XChangeProperty(qt_xdisplay(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); + long data = opacity; // 32bit XChangeProperty needs long + 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 // 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() @@ -1992,7 +1994,7 @@ uint Client::opacity() int Client::opacityPercentage() { - return ((int)100*((double)opacity_/0xffffffff)); + return int(100*((double)opacity_/0xffffffff)); } bool Client::touches(const Client* c) diff --git a/options.cpp b/options.cpp index 082af2fa98..aa9b69836a 100644 --- a/options.cpp +++ b/options.cpp @@ -173,13 +173,13 @@ unsigned long Options::updateSettings() useTranslucency = config->readBoolEntry("UseTranslucency", false); config->setGroup( "Translucency"); 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); - inactiveWindowOpacity = (config->readNumEntry("InactiveWindowOpacity", 100)/100.0)*0xFFFFFFFF; + inactiveWindowOpacity = uint((config->readNumEntry("InactiveWindowOpacity", 100)/100.0)*0xFFFFFFFF); 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); - dockOpacity = (config->readNumEntry("DockOpacity", 100)/100.0)*0xFFFFFFFF; + dockOpacity = uint((config->readNumEntry("DockOpacity", 100)/100.0)*0xFFFFFFFF); keepAboveAsActive = config->readBoolEntry("TreatKeepAboveAsActive", true); //TODO: remove this variable useTitleMenuSlider = true; diff --git a/utils.cpp b/utils.cpp index e58b1efb11..19d147b9d8 100644 --- a/utils.cpp +++ b/utils.cpp @@ -165,7 +165,7 @@ bool KWinSelectionOwner::genericReply( Atom target_P, Atom property_P, Window re { if( target_P == xa_version ) { - Q_INT32 version[] = { 2, 0 }; + long version[] = { 2, 0 }; XChangeProperty( qt_xdisplay(), requestor_P, property_P, XA_INTEGER, 32, PropModeReplace, reinterpret_cast< unsigned char* >( &version ), 2 ); }