Remove kompmgr-related code except for the generic parts like

the slider in Alt+F3.


svn path=/branches/work/kwin_composite/; revision=558258
icc-effect-5.14.5
Luboš Luňák 2006-07-04 23:30:05 +00:00
parent d4cf5af1c4
commit f4f07d4fd3
14 changed files with 127 additions and 986 deletions

View File

@ -221,7 +221,7 @@ void Workspace::setActiveClient( Client* c, allowed_t )
++set_active_client_recursion;
if( active_client != NULL )
{ // note that this may call setActiveClient( NULL ), therefore the recursion counter
active_client->setActive( false, !c || !c->isModal() || c != active_client->transientFor() );
active_client->setActive( false );
}
active_client = c;
Q_ASSERT( c == NULL || c->isActive());
@ -804,21 +804,13 @@ Time Client::userTime() const
its own.
*/
void Client::setActive( bool act, bool updateOpacity_)
void Client::setActive( bool act )
{
if ( active == act )
return;
active = act;
workspace()->setActiveClient( act ? this : NULL, Allowed );
if (updateOpacity_) updateOpacity();
if (isModal() && transientFor())
{
if (!act) transientFor()->updateOpacity();
else if (!transientFor()->custom_opacity) transientFor()->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
}
updateShadowSize();
if ( active )
Notify::raise( Notify::Activate );

View File

@ -144,9 +144,6 @@ Client::Client( Workspace *ws )
geom = QRect( 0, 0, 100, 100 ); // so that decorations don't start with size being (0,0)
client_size = QSize( 100, 100 );
custom_opacity = false;
rule_opacity_active = 0;; //translucency rules
rule_opacity_inactive = 0; //dito.
// SELI initialize xsizehints??
}
@ -183,7 +180,6 @@ void Client::releaseWindow( bool on_shutdown )
finishCompositing();
workspace()->discardUsedWindowRules( this, true ); // remove ForceTemporarily rules
StackingUpdatesBlocker blocker( workspace());
if (!custom_opacity) setOpacity(false);
if (moveResizeMode)
leaveMoveResize();
finishWindowRules();
@ -277,9 +273,6 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
XReparentWindow( display(), decoration->widget()->winId(), frameId(), 0, 0 );
decoration->widget()->lower();
decoration->borders( border_left, border_right, border_top, border_bottom );
options->onlyDecoTranslucent ?
setDecoHashProperty(border_top, border_right, border_bottom, border_left):
unsetDecoHashProperty();
int save_workarea_diff_x = workarea_diff_x;
int save_workarea_diff_y = workarea_diff_y;
move( calculateGravitation( false ));
@ -335,9 +328,6 @@ void Client::checkBorderSizes()
border_right != new_right ||
border_top != new_top ||
border_bottom != new_bottom)
options->onlyDecoTranslucent ?
setDecoHashProperty(new_top, new_right, new_bottom, new_left):
unsetDecoHashProperty();
move( calculateGravitation( false ));
plainResize( sizeForClientSize( clientSize()), ForceGeometrySet );
checkWorkspacePosition();
@ -376,30 +366,6 @@ void Client::detectNoBorder()
noborder = true;
}
void Client::detectShapable()
{
if( hasShape( window()))
return;
switch( windowType())
{
case NET::Desktop :
case NET::Dock :
case NET::TopMenu :
case NET::Splash :
break;
case NET::Unknown :
case NET::Normal :
case NET::Toolbar :
case NET::Menu :
case NET::Dialog :
case NET::Utility :
setShapable(false);
break;
default:
assert( false );
}
}
void Client::updateFrameExtents()
{
NETStrut strut;
@ -457,7 +423,6 @@ void Client::setUserNoBorder( bool set )
void Client::updateShape()
{
setShapable(true);
if ( shape() )
{
XShapeCombineShape(display(), frameId(), ShapeBounding,
@ -512,12 +477,6 @@ QRegion Client::mask() const
return _mask;
}
void Client::setShapable(bool b)
{
long tmp = b?1:0;
XChangeProperty(display(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L);
}
void Client::hideClient( bool hide )
{
if( hidden == hide )
@ -1830,272 +1789,6 @@ bool Client::hasShape( Window w )
return boundingShaped != 0;
}
void Client::setOpacity(bool translucent, uint opacity)
{
if (isDesktop())
return; // xcompmgr does not like non solid desktops and the user could set it accidently by mouse scrolling
// qWarning("setting opacity for %d",display());
//rule out activated translulcency with 100% opacity
if (!translucent || opacity == 0xFFFFFFFF)
{
opacity_ = 0xFFFFFFFF;
XDeleteProperty (display(), frameId(), atoms->net_wm_window_opacity);
XDeleteProperty (display(), window(), atoms->net_wm_window_opacity); // ??? frameId() is necessary for visible changes, window() is the winId() that would be set by apps - we set both to be sure the app knows what's currently displayd
}
else{
if(opacity == opacity_)
return;
opacity_ = opacity;
long data = opacity; // 32bit XChangeProperty needs long
XChangeProperty(display(), frameId(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
XChangeProperty(display(), window(), atoms->net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
}
}
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)
long data = shadowSize;
XChangeProperty(display(), frameId(), atoms->net_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
}
void Client::updateOpacity()
// extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows)
{
if (!(isNormalWindow() || isDialog() || isUtility() )|| custom_opacity)
return;
if (isActive())
{
if( ruleOpacityActive() )
setOpacity(rule_opacity_active < 0xFFFFFFFF, rule_opacity_active);
else
setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
if (isBMP())
// beep-media-player, only undecorated windows (gtk2 xmms, xmms doesn't work with compmgr at all - s.e.p. :P )
{
ClientList tmpGroupMembers = group()->members();
ClientList activeGroupMembers;
activeGroupMembers.append(this);
tmpGroupMembers.removeAll(this);
ClientList::Iterator it = tmpGroupMembers.begin();
while (it != tmpGroupMembers.end())
// search for next attached and not activated client and repeat if found
{
if ((*it) != this && (*it)->isBMP())
// potential "to activate" client found
{
// qWarning("client found");
if ((*it)->touches(this)) // first test, if the new client touches the just activated one
{
// qWarning("found client touches me");
if( ruleOpacityActive() )
(*it)->setOpacity(rule_opacity_active < 0xFFFFFFFF, rule_opacity_active);
else
(*it)->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
// qWarning("activated, search restarted (1)");
(*it)->setShadowSize(options->activeWindowShadowSize);
activeGroupMembers.append(*it);
tmpGroupMembers.erase(it);
it = tmpGroupMembers.begin(); // restart, search next client
continue;
}
else
{ // pot. client does not touch c, so we have to search if it touches some other activated client
bool found = false;
for( ClientList::ConstIterator it2 = activeGroupMembers.begin(); it2 != activeGroupMembers.end(); it2++ )
{
if ((*it2) != this && (*it2) != (*it) && (*it)->touches(*it2))
{
// qWarning("found client touches other active client");
if( ruleOpacityActive() )
(*it)->setOpacity(rule_opacity_active < 0xFFFFFFFF, rule_opacity_active);
else
(*it)->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
(*it)->setShadowSize(options->activeWindowShadowSize);
activeGroupMembers.append(*it);
tmpGroupMembers.erase(it);
it = tmpGroupMembers.begin(); // reset potential client search
found = true;
// qWarning("activated, search restarted (2)");
break; // skip this loop
}
}
if (found) continue;
}
}
it++;
}
}
else if (isNormalWindow())
// activate dependent minor windows as well
{
for( ClientList::ConstIterator it = group()->members().begin(); it != group()->members().end(); it++ )
if ((*it)->isDialog() || (*it)->isUtility())
if( (*it)->ruleOpacityActive() )
(*it)->setOpacity((*it)->ruleOpacityActive() < 0xFFFFFFFF, (*it)->ruleOpacityActive());
else
(*it)->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
}
}
else
{
if( ruleOpacityInactive() )
setOpacity(rule_opacity_inactive < 0xFFFFFFFF, rule_opacity_inactive);
else
setOpacity(options->translucentInactiveWindows && !(keepAbove() && options->keepAboveAsActive),
options->inactiveWindowOpacity);
// deactivate dependent minor windows as well
if (isBMP())
// beep-media-player, only undecorated windows (gtk2 xmms, xmms doesn't work with compmgr at all - s.e.p. :P )
{
ClientList tmpGroupMembers = group()->members();
ClientList inactiveGroupMembers;
inactiveGroupMembers.append(this);
tmpGroupMembers.removeAll(this);
ClientList::Iterator it = tmpGroupMembers.begin();
while ( it != tmpGroupMembers.end() )
// search for next attached and not activated client and repeat if found
{
if ((*it) != this && (*it)->isBMP())
// potential "to activate" client found
{
// qWarning("client found");
if ((*it)->touches(this)) // first test, if the new client touches the just activated one
{
// qWarning("found client touches me");
if( (*it)->ruleOpacityInactive() )
(*it)->setOpacity((*it)->ruleOpacityInactive() < 0xFFFFFFFF, (*it)->ruleOpacityInactive());
else
(*it)->setOpacity(options->translucentInactiveWindows && !((*it)->keepAbove() && options->keepAboveAsActive), options->inactiveWindowOpacity);
(*it)->setShadowSize(options->inactiveWindowShadowSize);
// qWarning("deactivated, search restarted (1)");
inactiveGroupMembers.append(*it);
tmpGroupMembers.erase(it);
it = tmpGroupMembers.begin(); // restart, search next client
continue;
}
else // pot. client does not touch c, so we have to search if it touches some other activated client
{
bool found = false;
for( ClientList::ConstIterator it2 = inactiveGroupMembers.begin(); it2 != inactiveGroupMembers.end(); it2++ )
{
if ((*it2) != this && (*it2) != (*it) && (*it)->touches(*it2))
{
// qWarning("found client touches other inactive client");
if( (*it)->ruleOpacityInactive() )
(*it)->setOpacity((*it)->ruleOpacityInactive() < 0xFFFFFFFF, (*it)->ruleOpacityInactive());
else
(*it)->setOpacity(options->translucentInactiveWindows && !((*it)->keepAbove() && options->keepAboveAsActive), options->inactiveWindowOpacity);
(*it)->setShadowSize(options->inactiveWindowShadowSize);
// qWarning("deactivated, search restarted (2)");
inactiveGroupMembers.append(*it);
tmpGroupMembers.erase(it);
it = tmpGroupMembers.begin(); // reset potential client search
found = true;
break; // skip this loop
}
}
if (found) continue;
}
}
it++;
}
}
else if (isNormalWindow())
{
for( ClientList::ConstIterator it = group()->members().begin(); it != group()->members().end(); it++ )
if ((*it)->isUtility()) //don't deactivate dialogs...
if( (*it)->ruleOpacityInactive() )
(*it)->setOpacity((*it)->ruleOpacityInactive() < 0xFFFFFFFF, (*it)->ruleOpacityInactive());
else
(*it)->setOpacity(options->translucentInactiveWindows && !((*it)->keepAbove() && options->keepAboveAsActive), options->inactiveWindowOpacity);
}
}
}
void Client::updateShadowSize()
// extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows)
{
if (!(isNormalWindow() || isDialog() || isUtility() ))
return;
if (isActive())
setShadowSize(options->activeWindowShadowSize);
else
setShadowSize(options->inactiveWindowShadowSize);
}
uint Client::ruleOpacityInactive()
{
return rule_opacity_inactive;// != 0 ;
}
uint Client::ruleOpacityActive()
{
return rule_opacity_active;// != 0;
}
bool Client::getWindowOpacity() //query translucency settings from X, returns true if window opacity is set
{
unsigned char *data = 0;
Atom actual;
int format, result;
unsigned long n, left;
result = XGetWindowProperty(display(), window(), atoms->net_wm_window_opacity, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 )
{
opacity_ = *reinterpret_cast< long* >( data );
custom_opacity = true;
// setOpacity(opacity_ < 0xFFFFFFFF, opacity_);
XFree ((char*)data);
return true;
}
return false;
}
void Client::setCustomOpacityFlag(bool custom)
{
custom_opacity = custom;
}
uint Client::opacity()
{
return opacity_;
}
int Client::opacityPercentage()
{
return int(100*((double)opacity_/0xffffffff));
}
bool Client::touches(const Client* c)
// checks if this client borders c, needed to test beep media player window state
{
if (y() == c->y() + c->height()) // this bottom to c
return true;
if (y() + height() == c->y()) // this top to c
return true;
if (x() == c->x() + c->width()) // this right to c
return true;
if (x() + width() == c->x()) // this left to c
return true;
return false;
}
void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth)
{
long data = (topHeight < 255 ? topHeight : 255) << 24 |
(rightWidth < 255 ? rightWidth : 255) << 16 |
(bottomHeight < 255 ? bottomHeight : 255) << 8 |
(leftWidth < 255 ? leftWidth : 255);
XChangeProperty(display(), frameId(), atoms->net_wm_window_decohash, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
}
void Client::unsetDecoHashProperty()
{
XDeleteProperty( display(), frameId(), atoms->net_wm_window_decohash);
}
void Client::debug( kdbgstream& stream ) const
{
stream << "\'ID:" << window() << ";WMCLASS:" << resourceClass() << ":" << resourceName() << ";Caption:" << caption() << "\'";

View File

@ -100,7 +100,7 @@ class Client
QPixmap miniIcon() const;
bool isActive() const;
void setActive( bool, bool updateOpacity = true );
void setActive( bool );
int desktop() const;
void setDesktop( int );
@ -278,22 +278,6 @@ class Client
void cancelAutoRaise();
void destroyClient();
void checkActiveModal();
void setOpacity(bool translucent, uint opacity = 0);
void setShadowSize(uint shadowSize);
void updateOpacity();
void updateShadowSize();
bool hasCustomOpacity(){return custom_opacity;}
void setCustomOpacityFlag(bool custom = true);
bool getWindowOpacity();
int opacityPercentage();
void checkAndSetInitialRuledOpacity();
uint ruleOpacityInactive();
uint ruleOpacityActive();
unsigned int opacity();
bool isBMP();
void setBMP(bool b);
bool touches(const Client* c);
void setShapable(bool b);
bool hasStrut() const;
private slots:
@ -393,8 +377,6 @@ class Client
void ungrabButton( int mod );
void resetMaximize();
void resizeDecoration( const QSize& s );
void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
void unsetDecoHashProperty();
void pingWindow();
void killProcess( bool ask, Time timestamp = CurrentTime );
@ -404,7 +386,6 @@ class Client
void embedClient( Window w, const XWindowAttributes &attr );
void detectNoBorder();
void detectShapable();
void destroyDecoration();
void updateFrameExtents();
@ -534,13 +515,6 @@ class Client
friend class GeometryUpdatesPostponer;
void show() { assert( false ); } // SELI remove after Client is no longer QWidget
void hide() { assert( false ); }
uint opacity_;
uint savedOpacity_;
bool custom_opacity;
uint rule_opacity_active; //translucency rules
uint rule_opacity_inactive; //dto.
//int shadeOriginalHeight;
bool isBMP_;
QTimer* demandAttentionKNotifyTimer;
Damage damage;
};
@ -865,16 +839,6 @@ inline KShortcut Client::shortcut() const
return _shortcut;
}
inline bool Client::isBMP()
{
return isBMP_;
}
inline void Client::setBMP(bool b)
{
isBMP_ = b;
}
inline void Client::removeRule( Rules* rule )
{
client_rules.remove( rule );

View File

@ -2248,13 +2248,6 @@ bool Client::startMoveResize()
workspace()->setClientIsMoving(this);
initialMoveResizeGeom = moveResizeGeom = geometry();
checkUnrestrictedMoveResize();
// rule out non opaque windows from useless translucency settings, maybe resizes?
if ((isResize() && options->removeShadowsOnResize) || (isMove() && options->removeShadowsOnMove))
setShadowSize(0);
if (rules()->checkMoveResizeMode( options->moveMode ) == Options::Opaque){
savedOpacity_ = opacity_;
setOpacity(options->translucentMovingWindows, options->movingWindowOpacity);
}
if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque )
|| ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) )
{
@ -2286,11 +2279,6 @@ void Client::finishMoveResize( bool cancel )
void Client::leaveMoveResize()
{
// rule out non opaque windows from useless translucency settings, maybe resizes?
if (rules()->checkMoveResizeMode( options->moveMode ) == Options::Opaque)
setOpacity(true, savedOpacity_);
if ((isResize() && options->removeShadowsOnResize) || (isMove() && options->removeShadowsOnMove))
updateShadowSize();
clearbound();
if (geometryTip)
{

View File

@ -1,212 +1,27 @@
/*
* This file was generated by dbusidl2cpp version 0.5
* when processing input file org.kde.KWin.xml
* This file was generated by dbusxml2cpp version 0.6
* Command line was: dbusxml2cpp -c KWinAdaptor -m -p kwinadaptor -- org.kde.KWin.xml
*
* dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
* dbusxml2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
* before re-generating it.
*/
#include "kwinadaptor.h"
#include <QtCore/QMetaObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
/*
* Implementation of adaptor class KWinAdaptor
* Implementation of interface class KWinAdaptor
*/
KWinAdaptor::KWinAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
KWinAdaptor::KWinAdaptor(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
{
// constructor
setAutoRelaySignals(true);
}
KWinAdaptor::~KWinAdaptor()
{
// destructor
}
void KWinAdaptor::cascadeDesktop()
{
// handle method call org.kde.KWin.cascadeDesktop
QMetaObject::invokeMethod(parent(), "cascadeDesktop");
// Alternative:
//static_cast<YourObjectType *>(parent())->cascadeDesktop();
}
void KWinAdaptor::circulateDesktopApplications()
{
// handle method call org.kde.KWin.circulateDesktopApplications
QMetaObject::invokeMethod(parent(), "circulateDesktopApplications");
// Alternative:
//static_cast<YourObjectType *>(parent())->circulateDesktopApplications();
}
int KWinAdaptor::currentDesktop()
{
// handle method call org.kde.KWin.currentDesktop
int out0;
QMetaObject::invokeMethod(parent(), "currentDesktop", Q_RETURN_ARG(int, out0));
// Alternative:
//out0 = static_cast<YourObjectType *>(parent())->currentDesktop();
return out0;
}
void KWinAdaptor::doNotManage(const QString &name)
{
// handle method call org.kde.KWin.doNotManage
QMetaObject::invokeMethod(parent(), "doNotManage", Q_ARG(QString, name));
// Alternative:
//static_cast<YourObjectType *>(parent())->doNotManage(name);
}
void KWinAdaptor::killWindow()
{
// handle method call org.kde.KWin.killWindow
QMetaObject::invokeMethod(parent(), "killWindow");
// Alternative:
//static_cast<YourObjectType *>(parent())->killWindow();
}
bool KWinAdaptor::kompmgrIsRunning()
{
// handle method call org.kde.KWin.kompmgrIsRunning
bool out0;
QMetaObject::invokeMethod(parent(), "kompmgrIsRunning", Q_RETURN_ARG(bool, out0));
// Alternative:
//out0 = static_cast<YourObjectType *>(parent())->kompmgrIsRunning();
return out0;
}
void KWinAdaptor::nextDesktop()
{
// handle method call org.kde.KWin.nextDesktop
QMetaObject::invokeMethod(parent(), "nextDesktop");
// Alternative:
//static_cast<YourObjectType *>(parent())->nextDesktop();
}
void KWinAdaptor::previousDesktop()
{
// handle method call org.kde.KWin.previousDesktop
QMetaObject::invokeMethod(parent(), "previousDesktop");
// Alternative:
//static_cast<YourObjectType *>(parent())->previousDesktop();
}
void KWinAdaptor::reconfigure()
{
// handle method call org.kde.KWin.reconfigure
QMetaObject::invokeMethod(parent(), "reconfigure");
// Alternative:
//static_cast<YourObjectType *>(parent())->reconfigure();
}
void KWinAdaptor::refresh()
{
// handle method call org.kde.KWin.refresh
QMetaObject::invokeMethod(parent(), "refresh");
// Alternative:
//static_cast<YourObjectType *>(parent())->refresh();
}
bool KWinAdaptor::setCurrentDesktop(int desktop)
{
// handle method call org.kde.KWin.setCurrentDesktop
bool out0;
QMetaObject::invokeMethod(parent(), "setCurrentDesktop", Q_RETURN_ARG(bool, out0), Q_ARG(int, desktop));
// Alternative:
//out0 = static_cast<YourObjectType *>(parent())->setCurrentDesktop(desktop);
return out0;
}
void KWinAdaptor::setDesktopLayout(int orientation, int x, int y)
{
// handle method call org.kde.KWin.setDesktopLayout
QMetaObject::invokeMethod(parent(), "setDesktopLayout", Q_ARG(int, orientation), Q_ARG(int, x), Q_ARG(int, y));
// Alternative:
//static_cast<YourObjectType *>(parent())->setDesktopLayout(orientation, x, y);
}
void KWinAdaptor::setOpacity(qlonglong winId, uint opacityPercent)
{
// handle method call org.kde.KWin.setOpacity
QMetaObject::invokeMethod(parent(), "setOpacity", Q_ARG(qlonglong, winId), Q_ARG(uint, opacityPercent));
// Alternative:
//static_cast<YourObjectType *>(parent())->setOpacity(winId, opacityPercent);
}
void KWinAdaptor::setShadowSize(qlonglong winId, uint shadowSizePercent)
{
// handle method call org.kde.KWin.setShadowSize
QMetaObject::invokeMethod(parent(), "setShadowSize", Q_ARG(qlonglong, winId), Q_ARG(uint, shadowSizePercent));
// Alternative:
//static_cast<YourObjectType *>(parent())->setShadowSize(winId, shadowSizePercent);
}
void KWinAdaptor::setUnshadowed(qlonglong winId)
{
// handle method call org.kde.KWin.setUnshadowed
QMetaObject::invokeMethod(parent(), "setUnshadowed", Q_ARG(qlonglong, winId));
// Alternative:
//static_cast<YourObjectType *>(parent())->setUnshadowed(winId);
}
void KWinAdaptor::showWindowMenuAt(qlonglong winId, int x, int y)
{
// handle method call org.kde.KWin.showWindowMenuAt
QMetaObject::invokeMethod(parent(), "showWindowMenuAt", Q_ARG(qlonglong, winId), Q_ARG(int, x), Q_ARG(int, y));
// Alternative:
//static_cast<YourObjectType *>(parent())->showWindowMenuAt(winId, x, y);
}
void KWinAdaptor::startKompmgr()
{
// handle method call org.kde.KWin.startKompmgr
QMetaObject::invokeMethod(parent(), "startKompmgr");
// Alternative:
//static_cast<YourObjectType *>(parent())->startKompmgr();
}
void KWinAdaptor::stopKompmgr()
{
// handle method call org.kde.KWin.stopKompmgr
QMetaObject::invokeMethod(parent(), "stopKompmgr");
// Alternative:
//static_cast<YourObjectType *>(parent())->stopKompmgr();
}
void KWinAdaptor::unclutterDesktop()
{
// handle method call org.kde.KWin.unclutterDesktop
QMetaObject::invokeMethod(parent(), "unclutterDesktop");
// Alternative:
//static_cast<YourObjectType *>(parent())->unclutterDesktop();
}

View File

@ -1,119 +1,129 @@
/*
* This file was generated by dbusidl2cpp version 0.5
* when processing input file org.kde.KWin.xml
* This file was generated by dbusxml2cpp version 0.6
* Command line was: dbusxml2cpp -c KWinAdaptor -m -p kwinadaptor -- org.kde.KWin.xml
*
* dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
* dbusxml2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
#ifndef KWINADAPTOR_H_187881149684785
#define KWINADAPTOR_H_187881149684785
#ifndef KWINADAPTOR_H_276481152054086
#define KWINADAPTOR_H_276481152054086
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
class QByteArray;
template<class T> class QList;
template<class Key, class Value> class QMap;
class QString;
class QStringList;
class QVariant;
/*
* Adaptor class for interface org.kde.KWin
* Proxy class for interface org.kde.KWin
*/
class KWinAdaptor: public QDBusAbstractAdaptor
class KWinAdaptor: public QDBusAbstractInterface
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin")
Q_CLASSINFO("D-Bus Introspection", ""
" <interface name=\"org.kde.KWin\" >\n"
" <method name=\"cascadeDesktop\" >\n"
" <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\" />\n"
" </method>\n"
" <method name=\"unclutterDesktop\" >\n"
" <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\" />\n"
" </method>\n"
" <method name=\"reconfigure\" >\n"
" <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\" />\n"
" </method>\n"
" <method name=\"killWindow\" >\n"
" <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\" />\n"
" </method>\n"
" <method name=\"refresh\" />\n"
" <method name=\"doNotManage\" >\n"
" <arg direction=\"in\" type=\"s\" name=\"name\" />\n"
" </method>\n"
" <method name=\"showWindowMenuAt\" >\n"
" <arg direction=\"in\" type=\"x\" name=\"winId\" />\n"
" <arg direction=\"in\" type=\"i\" name=\"x\" />\n"
" <arg direction=\"in\" type=\"i\" name=\"y\" />\n"
" </method>\n"
" <method name=\"setDesktopLayout\" >\n"
" <arg direction=\"in\" type=\"i\" name=\"orientation\" />\n"
" <arg direction=\"in\" type=\"i\" name=\"x\" />\n"
" <arg direction=\"in\" type=\"i\" name=\"y\" />\n"
" </method>\n"
" <method name=\"setCurrentDesktop\" >\n"
" <arg direction=\"in\" type=\"i\" name=\"desktop\" />\n"
" <arg direction=\"out\" type=\"b\" />\n"
" </method>\n"
" <method name=\"currentDesktop\" >\n"
" <arg direction=\"out\" type=\"i\" />\n"
" </method>\n"
" <method name=\"nextDesktop\" />\n"
" <method name=\"previousDesktop\" />\n"
" <method name=\"circulateDesktopApplications\" />\n"
" <method name=\"startKompmgr\" />\n"
" <method name=\"stopKompmgr\" />\n"
" <method name=\"kompmgrIsRunning\" >\n"
" <arg direction=\"out\" type=\"b\" />\n"
" </method>\n"
" <method name=\"setOpacity\" >\n"
" <arg direction=\"in\" type=\"x\" name=\"winId\" />\n"
" <arg direction=\"in\" type=\"u\" name=\"opacityPercent\" />\n"
" </method>\n"
" <method name=\"setShadowSize\" >\n"
" <arg direction=\"in\" type=\"x\" name=\"winId\" />\n"
" <arg direction=\"in\" type=\"u\" name=\"shadowSizePercent\" />\n"
" </method>\n"
" <method name=\"setUnshadowed\" >\n"
" <arg direction=\"in\" type=\"x\" name=\"winId\" />\n"
" </method>\n"
" <signal name=\"kompmgrStarted\" />\n"
" <signal name=\"kompmgrStopped\" />\n"
" <signal name=\"dcopResetAllClients\" />\n"
" </interface>\n"
"")
public:
KWinAdaptor(QObject *parent);
virtual ~KWinAdaptor();
static inline const char *staticInterfaceName()
{ return "org.kde.KWin"; }
public:
KWinAdaptor(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
~KWinAdaptor();
public: // PROPERTIES
public Q_SLOTS: // METHODS
Q_NOREPLY void cascadeDesktop();
void circulateDesktopApplications();
int currentDesktop();
void doNotManage(const QString &name);
Q_NOREPLY void killWindow();
bool kompmgrIsRunning();
void nextDesktop();
void previousDesktop();
Q_NOREPLY void reconfigure();
void refresh();
bool setCurrentDesktop(int desktop);
void setDesktopLayout(int orientation, int x, int y);
void setOpacity(qlonglong winId, uint opacityPercent);
void setShadowSize(qlonglong winId, uint shadowSizePercent);
void setUnshadowed(qlonglong winId);
void showWindowMenuAt(qlonglong winId, int x, int y);
void startKompmgr();
void stopKompmgr();
Q_NOREPLY void unclutterDesktop();
inline Q_NOREPLY void cascadeDesktop()
{
QList<QVariant> argumentList;
callWithArgumentList(QDBus::NoBlock, QLatin1String("cascadeDesktop"), argumentList);
}
inline QDBusReply<void> circulateDesktopApplications()
{
QList<QVariant> argumentList;
return callWithArgumentList(QDBus::Block, QLatin1String("circulateDesktopApplications"), argumentList);
}
inline QDBusReply<int> currentDesktop()
{
QList<QVariant> argumentList;
return callWithArgumentList(QDBus::Block, QLatin1String("currentDesktop"), argumentList);
}
inline QDBusReply<void> doNotManage(const QString &name)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(name);
return callWithArgumentList(QDBus::Block, QLatin1String("doNotManage"), argumentList);
}
inline Q_NOREPLY void killWindow()
{
QList<QVariant> argumentList;
callWithArgumentList(QDBus::NoBlock, QLatin1String("killWindow"), argumentList);
}
inline QDBusReply<void> nextDesktop()
{
QList<QVariant> argumentList;
return callWithArgumentList(QDBus::Block, QLatin1String("nextDesktop"), argumentList);
}
inline QDBusReply<void> previousDesktop()
{
QList<QVariant> argumentList;
return callWithArgumentList(QDBus::Block, QLatin1String("previousDesktop"), argumentList);
}
inline Q_NOREPLY void reconfigure()
{
QList<QVariant> argumentList;
callWithArgumentList(QDBus::NoBlock, QLatin1String("reconfigure"), argumentList);
}
inline QDBusReply<void> refresh()
{
QList<QVariant> argumentList;
return callWithArgumentList(QDBus::Block, QLatin1String("refresh"), argumentList);
}
inline QDBusReply<bool> setCurrentDesktop(int desktop)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(desktop);
return callWithArgumentList(QDBus::Block, QLatin1String("setCurrentDesktop"), argumentList);
}
inline QDBusReply<void> setDesktopLayout(int orientation, int x, int y)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(orientation) << qVariantFromValue(x) << qVariantFromValue(y);
return callWithArgumentList(QDBus::Block, QLatin1String("setDesktopLayout"), argumentList);
}
inline QDBusReply<void> showWindowMenuAt(qlonglong winId, int x, int y)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(winId) << qVariantFromValue(x) << qVariantFromValue(y);
return callWithArgumentList(QDBus::Block, QLatin1String("showWindowMenuAt"), argumentList);
}
inline Q_NOREPLY void unclutterDesktop()
{
QList<QVariant> argumentList;
callWithArgumentList(QDBus::NoBlock, QLatin1String("unclutterDesktop"), argumentList);
}
Q_SIGNALS: // SIGNALS
void dcopResetAllClients();
void kompmgrStarted();
void kompmgrStopped();
};
namespace org {
namespace kde {
typedef ::KWinAdaptor KWin;
}
}
#endif

View File

@ -111,7 +111,6 @@ bool Client::manage( Window w, bool isMapped )
setCaption( cap_normal, true );
detectNoBorder();
detectShapable();
fetchIconicName();
getWMHints(); // needs to be done before readTransient() because of reading the group
modal = ( info->state() & NET::Modal ) != 0; // needs to be valid before handling groups
@ -148,8 +147,6 @@ bool Client::manage( Window w, bool isMapped )
if( rules()->checkNoBorder( false, !isMapped ))
setUserNoBorder( true );
checkAndSetInitialRuledOpacity();
// initial desktop placement
if ( session )
{

View File

@ -173,7 +173,7 @@ unsigned long Options::updateSettings()
CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize"), false );
CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel","Nothing"));
//translucency settings
//translucency settings - TODO
config->setGroup( "Notification Messages" );
useTranslucency = config->readEntry("UseTranslucency", QVariant(false)).toBool();
config->setGroup( "Translucency");
@ -194,10 +194,6 @@ unsigned long Options::updateSettings()
removeShadowsOnMove = config->readEntry("RemoveShadowsOnMove", QVariant(true)).toBool();
removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", QVariant(true)).toBool();
onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool();
if (resetKompmgr = config->readEntry("ResetKompmgr", QVariant(false)).toBool())
config->writeEntry("ResetKompmgr",false);
// Read button tooltip animation effect from kdeglobals
// Since we want to allow users to enable window decoration tooltips

View File

@ -299,7 +299,6 @@ class Options : public KDecorationOptions
uint inactiveWindowShadowSize;
uint dockShadowSize;
bool onlyDecoTranslucent;
bool resetKompmgr;
private:
WindowOperation OpTitlebarDblClick;

View File

@ -38,24 +38,6 @@
<method name="nextDesktop"/>
<method name="previousDesktop"/>
<method name="circulateDesktopApplications"/>
<method name="startKompmgr"/>
<method name="stopKompmgr"/>
<method name="kompmgrIsRunning">
<arg type="b" direction="out"/>
</method>
<method name="setOpacity">
<arg name="winId" type="x" direction="in"/>
<arg name="opacityPercent" type="u" direction="in"/>
</method>
<method name="setShadowSize">
<arg name="winId" type="x" direction="in"/>
<arg name="shadowSizePercent" type="u" direction="in"/>
</method>
<method name="setUnshadowed">
<arg name="winId" type="x" direction="in"/>
</method>
<signal name="kompmgrStarted"/>
<signal name="kompmgrStopped"/>
<signal name="dcopResetAllClients"/>
</interface>
</node>

View File

@ -491,13 +491,11 @@ bool Rules::update( Client* c )
}
if (opacityactiverule == ( ForceRule )Force)
{
updated = updated || (uint) (opacityactive/100.0*0xffffffff) != c->ruleOpacityActive();
opacityactive = (uint)(((double)c->ruleOpacityActive())/0xffffffff*100);
// TODO
}
if (opacityinactiverule == ( ForceRule )Force)
{
updated = updated || (uint) (opacityinactive/100.0*0xffffffff) != c->ruleOpacityInactive();
opacityinactive = (uint)(((double)c->ruleOpacityInactive())/0xffffffff*100);
// TODO
}
return updated;
}
@ -810,7 +808,6 @@ void Client::setupWindowRules( bool ignore_temporary )
// Used e.g. after the rules have been modified using the kcm.
void Client::applyWindowRules()
{
checkAndSetInitialRuledOpacity();
// apply force rules
// Placement - does need explicit update, just like some others below
// Geometry : setGeometry() doesn't check rules
@ -865,43 +862,6 @@ void Client::finishWindowRules()
client_rules = WindowRules();
}
void Client::checkAndSetInitialRuledOpacity()
//apply kwin-rules for window-translucency upon hitting apply or starting to manage client
{
int tmp;
//active translucency
tmp = -1;
tmp = rules()->checkOpacityActive(tmp);
if( tmp != -1 ) //rule did apply and returns valid value
{
rule_opacity_active = (uint)((tmp/100.0)*0xffffffff);
}
else
rule_opacity_active = 0;
//inactive translucency
tmp = -1;
tmp = rules()->checkOpacityInactive(tmp);
if( tmp != -1 ) //rule did apply and returns valid value
{
rule_opacity_inactive = (uint)((tmp/100.0)*0xffffffff);
}
else
rule_opacity_inactive = 0;
return;
if( isDock() )
//workaround for docks, as they don't have active/inactive settings and don't aut, therefore we take only the active one...
{
uint tmp = rule_opacity_active ? rule_opacity_active : options->dockOpacity;
setOpacity(tmp < 0xFFFFFFFF && (rule_opacity_active || options->translucentDocks), tmp);
}
else
updateOpacity();
}
// Workspace
WindowRules Workspace::findWindowRules( const Client* c, bool ignore_temporary )

View File

@ -118,7 +118,6 @@ QMenu* Workspace::clientPopup()
connect(transButton, SIGNAL(clicked()), trans_popup, SLOT(hide()));
connect(transSlider, SIGNAL(valueChanged(int)), SLOT(setTransButtonText(int)));
connect(transSlider, SIGNAL(valueChanged(int)), this, SLOT(setPopupClientOpacity(int)));
// connect(transSlider, SIGNAL(sliderReleased()), trans_popup, SLOT(hide()));
action = popup->addMenu( trans_popup );
action->setText( i18n("&Opacity") );
}
@ -168,9 +167,7 @@ QMenu* Workspace::clientPopup()
//sets the transparency of the client to given value(given by slider)
void Workspace::setPopupClientOpacity(int value)
{
active_popup_client->setCustomOpacityFlag(true);
value = 100 - value;
value<100?active_popup_client->setOpacity(true, (uint)((value/100.0)*0xffffffff)):active_popup_client->setOpacity(false,0xffffffff);
// TODO
}
void Workspace::setTransButtonText(int value)
@ -188,10 +185,7 @@ void Workspace::setTransButtonText(int value)
void Workspace::resetClientOpacity()
{
active_popup_client->setCustomOpacityFlag(false);
active_popup_client->updateOpacity();
transSlider->setValue(100-active_popup_client->opacityPercentage());
setTransButtonText(100-active_popup_client->opacityPercentage());
// TODO
}
@ -229,12 +223,6 @@ void Workspace::clientPopupAboutToShow()
mNoBorderOpAction->setChecked( active_popup_client->noBorder() );
mMinimizeOpAction->setEnabled( active_popup_client->isMinimizable() );
mCloseOpAction->setEnabled( active_popup_client->isCloseable() );
if (options->useTranslucency)
{
transSlider->setValue(100-active_popup_client->opacityPercentage());
setTransButtonText(100-active_popup_client->opacityPercentage());
}
}
@ -653,26 +641,10 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
workspace()->windowToNextDesktop( this );
break;
case Options::MouseOpacityMore:
if (opacity_ < 0xFFFFFFFF)
{
if (opacity_ < 0xF3333333)
{
setOpacity(true, opacity_ + 0xCCCCCCC);
custom_opacity = true;
}
else
{
setOpacity(false, 0xFFFFFFFF);
custom_opacity = false;
}
}
// TODO
break;
case Options::MouseOpacityLess:
if (opacity_ > 0)
{
setOpacity(true, (opacity_ > 0xCCCCCCC) ? opacity_ - 0xCCCCCCC : 0);
custom_opacity = true;
}
// TODO
break;
case Options::MouseNothing:
replay = true;

View File

@ -61,10 +61,6 @@ extern int screen_number;
Workspace *Workspace::_self = 0;
KProcess* kompmgr = 0;
bool allowKompmgrRestart = true;
// Rikkus: This class is too complex. It needs splitting further.
// It's a nightmare to understand, especially with so few comments :(
@ -131,9 +127,7 @@ Workspace::Workspace( bool restore )
composite_pixmap( None ),
damaged( false )
{
new KWinAdaptor(this);
QDBus::sessionBus().registerObject("/KWin", this);
setObjectName( "workspace" );
new KWinAdaptor( "org.kde.kwin", "/KWin", QDBus::sessionBus(), this );
_self = this;
mgr = new PluginMgr;
@ -203,15 +197,6 @@ Workspace::Workspace( bool restore )
init();
connect( kapp->desktop(), SIGNAL( resized( int )), SLOT( desktopResized()));
// start kompmgr - i wanted to put this into main.cpp, but that would prevent dcop support, as long as Application was no dcop_object
if (options->useTranslucency)
{
kompmgr = new KProcess;
connect(kompmgr, SIGNAL(receivedStderr(KProcess*, char*, int)), SLOT(handleKompmgrOutput(KProcess*, char*, int)));
*kompmgr << "kompmgr";
startKompmgr();
}
}
void Workspace::init()
@ -441,8 +426,6 @@ void Workspace::init()
Workspace::~Workspace()
{
if (kompmgr)
delete kompmgr;
finishCompositing();
blockStackingUpdates( true );
// TODO grabXServer();
@ -519,21 +502,6 @@ Unmanaged* Workspace::createUnmanaged( Window w )
void Workspace::addClient( Client* c, allowed_t )
{
// waited with trans settings until window figured out if active or not ;)
// qWarning("%s", (const char*)(c->resourceClass()));
c->setBMP(c->resourceName() == "beep-media-player" || c->decorationId() == None);
// first check if the window has it's own opinion of it's translucency ;)
c->getWindowOpacity();
if (c->isDock())
{
// if (c->x() == 0 && c->y() == 0 && c->width() > c->height()) topDock = c;
if (!c->hasCustomOpacity()) // this xould be done slightly more efficient, but we want to support the topDock in future
{
c->setShadowSize(options->dockShadowSize);
c->setOpacity(options->translucentDocks, options->dockOpacity);
}
}
//------------------------------------------------
Group* grp = findGroup( c->window());
if( grp != NULL )
grp->gotLeader( c );
@ -999,14 +967,6 @@ void Workspace::slotReconfigure()
(*it)->applyWindowRules();
discardUsedWindowRules( *it, false );
}
if (options->resetKompmgr) // need restart
{
bool tmp = options->useTranslucency;
stopKompmgr();
if (tmp)
QTimer::singleShot( 200, this, SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart
}
}
void Workspace::loadDesktopSettings()
@ -2451,172 +2411,6 @@ void Workspace::helperDialog( const QString& message, const Client* c )
proc.start( KProcess::DontCare );
}
// kompmgr stuff
void Workspace::startKompmgr()
{
if (!kompmgr || kompmgr->isRunning())
return;
if (!kompmgr->start(KProcess::OwnGroup, KProcess::Stderr))
{
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
<< "--title" << "Composite Manager Failure";
proc.start(KProcess::DontCare);
}
else
{
connect(kompmgr, SIGNAL(processExited(KProcess*)), SLOT(restartKompmgr()));
options->useTranslucency = true;
allowKompmgrRestart = false;
QTimer::singleShot( 60000, this, SLOT(unblockKompmgrRestart()) );
QByteArray ba;
QDataStream arg(&ba, QIODevice::WriteOnly);
arg << "";
#ifdef __GNUC__
#warning D-BUS TODO
// kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStarted()", ba);
#endif
}
if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider
}
void Workspace::stopKompmgr()
{
if (!kompmgr || !kompmgr->isRunning())
return;
kompmgr->disconnect(this, SLOT(restartKompmgr()));
options->useTranslucency = false;
if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider
kompmgr->kill();
QByteArray ba;
QDataStream arg(&ba, QIODevice::WriteOnly);
arg << "";
#ifdef __GNUC__
#warning D-BUS TODO
// kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStopped()", ba);
#endif
}
bool Workspace::kompmgrIsRunning()
{
return kompmgr && kompmgr->isRunning();
}
void Workspace::unblockKompmgrRestart()
{
allowKompmgrRestart = true;
}
void Workspace::restartKompmgr()
// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); QTimer::singleShot(200, workspace, SLOT(startKompmgr()));
{
if (!allowKompmgrRestart) // uh-ohh
{
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n( "The Composite Manager crashed twice within a minute and is therefore disabled for this session.")
<< "--title" << i18n("Composite Manager Failure");
proc.start(KProcess::DontCare);
return;
}
if (!kompmgr)
return;
// this should be useless, i keep it for maybe future need
// if (!kcompmgr)
// {
// kompmgr = new KProcess;
// kompmgr->clearArguments();
// *kompmgr << "kompmgr";
// }
// -------------------
if (!kompmgr->start(KProcess::NotifyOnExit, KProcess::Stderr))
{
options->useTranslucency = false;
KProcess proc;
proc << "kdialog" << "--error"
<< i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
<< "--title" << i18n("Composite Manager Failure");
proc.start(KProcess::DontCare);
}
else
{
allowKompmgrRestart = false;
QTimer::singleShot( 60000, this, SLOT(unblockKompmgrRestart()) );
}
}
void Workspace::handleKompmgrOutput( KProcess* , char *buffer, int buflen)
{
QString message;
QString output = QString::fromLocal8Bit( buffer, buflen );
if (output.contains("Started",Qt::CaseInsensitive))
; // don't do anything, just pass to the connection release
else if (output.contains("Can't open display",Qt::CaseInsensitive))
message = i18n("<qt><b>kompmgr failed to open the display</b><br>There is probably an invalid display entry in your ~/.xcompmgrrc.</qt>");
else if (output.contains("No render extension",Qt::CaseInsensitive))
message = i18n("<qt><b>kompmgr cannot find the Xrender extension</b><br>You are using either an outdated or a crippled version of XOrg.<br>Get XOrg &ge; 6.8 from www.freedesktop.org.<br></qt>");
else if (output.contains("No composite extension",Qt::CaseInsensitive))
message = i18n("<qt><b>Composite extension not found</b><br>You <i>must</i> use XOrg &ge; 6.8 for translucency and shadows to work.<br>Additionally, you need to add a new section to your X config file:<br>"
"<i>Section \"Extensions\"<br>"
"Option \"Composite\" \"Enable\"<br>"
"EndSection</i></qt>");
else if (output.contains("No damage extension",Qt::CaseInsensitive))
message = i18n("<qt><b>Damage extension not found</b><br>You <i>must</i> use XOrg &ge; 6.8 for translucency and shadows to work.</qt>");
else if (output.contains("No XFixes extension",Qt::CaseInsensitive))
message = i18n("<qt><b>XFixes extension not found</b><br>You <i>must</i> use XOrg &ge; 6.8 for translucency and shadows to work.</qt>");
else return; //skip others
// kompmgr startup failed or succeeded, release connection
kompmgr->closeStderr();
disconnect(kompmgr, SIGNAL(receivedStderr(KProcess*, char*, int)), this, SLOT(handleKompmgrOutput(KProcess*, char*, int)));
if( !message.isEmpty())
{
KProcess proc;
proc << "kdialog" << "--error"
<< message
<< "--title" << i18n("Composite Manager Failure");
proc.start(KProcess::DontCare);
}
}
void Workspace::setOpacity(unsigned long winId, unsigned int opacityPercent)
{
if (opacityPercent > 100) opacityPercent = 100;
for( ClientList::ConstIterator it = stackingOrder().begin(); it != stackingOrder().end(); it++ )
if (winId == (*it)->window())
{
(*it)->setOpacity(opacityPercent < 100, (unsigned int)((opacityPercent/100.0)*0xFFFFFFFF));
return;
}
}
void Workspace::setShadowSize(unsigned long winId, unsigned int shadowSizePercent)
{
//this is open to the user by dcop - to avoid stupid trials, we limit the max shadow size to 400%
if (shadowSizePercent > 400) shadowSizePercent = 400;
for( ClientList::ConstIterator it = stackingOrder().begin(); it != stackingOrder().end(); it++ )
if (winId == (*it)->window())
{
(*it)->setShadowSize(shadowSizePercent);
return;
}
}
void Workspace::setUnshadowed(unsigned long winId)
{
for( ClientList::ConstIterator it = stackingOrder().begin(); it != stackingOrder().end(); it++ )
if (winId == (*it)->window())
{
(*it)->setShadowSize(0);
return;
}
}
void Workspace::setShowingDesktop( bool showing )
{
rootInfo->setShowingDesktop( showing );

View File

@ -239,12 +239,6 @@ class Workspace : public QObject, public KDecorationDefines
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
void stopKompmgr();
bool kompmgrIsRunning();
void setOpacity(unsigned long winId, unsigned int opacityPercent);
void setShadowSize(unsigned long winId, unsigned int shadowSizePercent);
void setUnshadowed(unsigned long winId); // redundant, equals setShadowSize(inId, 0)
// only called from Client::destroyClient() or Client::releaseWindow()
void removeClient( Client*, allowed_t );
void setActiveClient( Client*, allowed_t );
@ -367,9 +361,6 @@ class Workspace : public QObject, public KDecorationDefines
void updateClientArea();
// kompmgr, also dcop
void startKompmgr();
private slots:
void desktopPopupAboutToShow();
void clientPopupAboutToShow();
@ -389,9 +380,6 @@ class Workspace : public QObject, public KDecorationDefines
void setPopupClientOpacity(int v);
void resetClientOpacity();
void setTransButtonText(int value);
void unblockKompmgrRestart();
void restartKompmgr();
void handleKompmgrOutput( KProcess *proc, char *buffer, int buflen);
// end
void compositeTimeout();
@ -651,15 +639,6 @@ class Workspace : public QObject, public KDecorationDefines
//kompmgr
QSlider *transSlider;
QPushButton *transButton;
// not used yet
/*Client* topDock;
int maximizedWindowCounter;
int topDockShadowSize;*/
//end
signals:
void kompmgrStarted();
void kompmgrStopped();
};
// helper for Workspace::blockStackingUpdates() being called in pairs (true/false)