Call setActive if new focus window is found and set when rotating focus to next available window

This resolves Bug 2189
pull/2/head
Timothy Pearson 10 years ago
parent f685dc8a29
commit 84d7db0195

@ -58,9 +58,10 @@ TQString KonqPixmapProvider::iconNameFor( const TQString& url )
TQString icon; TQString icon;
if ( it != iconMap.end() ) { if ( it != iconMap.end() ) {
icon = it.data(); icon = it.data();
if ( !icon.isEmpty() ) if ( !icon.isEmpty() ) {
return icon; return icon;
} }
}
if ( url.isEmpty() ) { if ( url.isEmpty() ) {
// Use the folder icon for the empty URL // Use the folder icon for the empty URL

@ -408,7 +408,9 @@ bool Workspace::activateNextClient( Client* c )
if( c != NULL ) if( c != NULL )
{ {
if( c == active_client ) if( c == active_client )
{
setActiveClient( NULL, Allowed ); setActiveClient( NULL, Allowed );
}
should_get_focus.remove( c ); should_get_focus.remove( c );
} }
if( focusChangeEnabled()) if( focusChangeEnabled())
@ -442,7 +444,10 @@ bool Workspace::activateNextClient( Client* c )
if( get_focus == NULL ) if( get_focus == NULL )
get_focus = findDesktop( true, currentDesktop()); get_focus = findDesktop( true, currentDesktop());
if( get_focus != NULL ) if( get_focus != NULL )
{
requestFocus( get_focus ); requestFocus( get_focus );
get_focus->setActive( true, true );
}
else else
focusToNull(); focusToNull();
} }
@ -891,6 +896,7 @@ void Client::setActive( bool act, bool updateOpacity_)
removeShadow(); removeShadow();
if (options->shadowEnabled(false)) if (options->shadowEnabled(false))
{
if (this == workspace()->topClientOnDesktop(desktop())) if (this == workspace()->topClientOnDesktop(desktop()))
{ {
/* If the newly deactivated window is the top client on the /* If the newly deactivated window is the top client on the
@ -899,11 +905,16 @@ void Client::setActive( bool act, bool updateOpacity_)
* activated window's shadow. * activated window's shadow.
*/ */
if ((shadowAfterClient = workspace()->activeClient())) if ((shadowAfterClient = workspace()->activeClient()))
{
drawShadowAfter(shadowAfterClient); drawShadowAfter(shadowAfterClient);
} }
}
else else
{
drawDelayedShadow(); drawDelayedShadow();
} }
}
}
if( !active ) if( !active )
cancelAutoRaise(); cancelAutoRaise();

@ -21,6 +21,10 @@ Bridge::Bridge( Client* cl )
{ {
} }
Bridge::~Bridge()
{
}
#define BRIDGE_HELPER( rettype, prototype, args1, args2, cst ) \ #define BRIDGE_HELPER( rettype, prototype, args1, args2, cst ) \
rettype Bridge::prototype ( args1 ) cst \ rettype Bridge::prototype ( args1 ) cst \
{ \ { \

@ -22,6 +22,8 @@ class Bridge : public KDecorationBridge
{ {
public: public:
Bridge( Client* cl ); Bridge( Client* cl );
virtual ~Bridge();
virtual bool isActive() const; virtual bool isActive() const;
virtual bool isCloseable() const; virtual bool isCloseable() const;
virtual bool isMaximizable() const; virtual bool isMaximizable() const;

@ -1429,7 +1429,7 @@ void Client::imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed)
QRgb pixel; QRgb pixel;
double opacity; double opacity;
int red, green, blue, pixelRed, pixelGreen, pixelBlue; int red, green, blue, pixelRed, pixelGreen, pixelBlue;
int subW, subH, w, h, x, y, zeroX, zeroY; int subW, subH, w, x, y, zeroX, zeroY;
TQImage image; TQImage image;
TQMemArray<TQRect>::Iterator it, itEnd; TQMemArray<TQRect>::Iterator it, itEnd;
TQMemArray<TQRect> rectangles; TQMemArray<TQRect> rectangles;
@ -1446,7 +1446,6 @@ void Client::imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed)
yOffset = options->shadowYOffset(isActive()); yOffset = options->shadowYOffset(isActive());
options->shadowColour(isActive()).rgb(&red, &green, &blue); options->shadowColour(isActive()).rgb(&red, &green, &blue);
w = pixmap.width(); w = pixmap.width();
h = pixmap.height();
itEnd = rectangles.end(); itEnd = rectangles.end();
for (it = rectangles.begin(); it != itEnd; ++it) { for (it = rectangles.begin(); it != itEnd; ++it) {
@ -1487,7 +1486,7 @@ void Client::imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
QRgb pixel; QRgb pixel;
double decay, factor, opacity; double decay, factor, opacity;
int red, green, blue, pixelRed, pixelGreen, pixelBlue; int red, green, blue, pixelRed, pixelGreen, pixelBlue;
int halfMaxIntersects, lineIntersects, maxIntersects, maxY; int lineIntersects, maxIntersects, maxY;
int irBottom, irLeft, irRight, irTop, yIncrement; int irBottom, irLeft, irRight, irTop, yIncrement;
int subW, subH, w, h, zeroX, zeroY; int subW, subH, w, h, zeroX, zeroY;
TQImage image; TQImage image;
@ -1505,7 +1504,6 @@ void Client::imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
yOffset = options->shadowYOffset(isActive()); yOffset = options->shadowYOffset(isActive());
options->shadowColour(isActive()).rgb(&red, &green, &blue); options->shadowColour(isActive()).rgb(&red, &green, &blue);
maxIntersects = thickness * thickness * 4 + (thickness * 4) + 1; maxIntersects = thickness * thickness * 4 + (thickness * 4) + 1;
halfMaxIntersects = maxIntersects / 2;
lineIntersects = thickness * 2 + 1; lineIntersects = thickness * 2 + 1;
factor = maxIntersects / maxOpacity; factor = maxIntersects / maxOpacity;
decay = (lineIntersects / 0.0125 - factor) / pow((double)maxIntersects, 3.0); decay = (lineIntersects / 0.0125 - factor) / pow((double)maxIntersects, 3.0);

Loading…
Cancel
Save