Branch: master

84d7db01 2014-11-21 14:11:16 Timothy Pearson
Call setActive if new focus window is found and set when rotating focus to next available window
This resolves Bug 2189
M libkonq/konq_pixmapprovider.cc
M twin/activation.cpp
M twin/bridge.cpp
M twin/bridge.h
M twin/client.cpp
M twin/events.cpp
diff --git a/libkonq/konq_pixmapprovider.cc b/libkonq/konq_pixmapprovider.cc
index d5ff0ca..28d5a99 100644
--- a/libkonq/konq_pixmapprovider.cc
+++ b/libkonq/konq_pixmapprovider.cc
@@ -58,8 +58,9 @@
     TQString icon;
     if ( it != iconMap.end() ) {
         icon = it.data();
-        if ( !icon.isEmpty() )
+        if ( !icon.isEmpty() ) {
 	    return icon;
+	}
     }
 
     if ( url.isEmpty() ) {
diff --git a/twin/activation.cpp b/twin/activation.cpp
index 6f79c47..d00efc3 100644
--- a/twin/activation.cpp
+++ b/twin/activation.cpp
@@ -408,7 +408,9 @@
     if( c != NULL )
         {
         if( c == active_client )
+            {
             setActiveClient( NULL, Allowed );
+            }
         should_get_focus.remove( c );
         }
     if( focusChangeEnabled())
@@ -442,7 +444,10 @@
             if( get_focus == NULL )
                 get_focus = findDesktop( true, currentDesktop());
             if( get_focus != NULL )
+                {
                 requestFocus( get_focus );
+                get_focus->setActive( true, true );
+                }
             else
                 focusToNull();
             }
@@ -855,7 +860,7 @@
         return;
     active = act;
     workspace()->setActiveClient( act ? this : NULL, Allowed );
-    
+
     if (updateOpacity_) updateOpacity();
     if (isModal() && transientFor())
     {
@@ -863,7 +868,7 @@
         else if (!transientFor()->custom_opacity) transientFor()->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity);
     }
     updateShadowSize();
-    
+
     if ( active )
     {
         Notify::raise( Notify::Activate );
@@ -891,6 +896,7 @@
         removeShadow();
 
         if (options->shadowEnabled(false))
+            {
             if (this == workspace()->topClientOnDesktop(desktop()))
                 {
                 /* If the newly deactivated window is the top client on the
@@ -899,10 +905,15 @@
                  * activated window's shadow.
                  */
                 if ((shadowAfterClient = workspace()->activeClient()))
+                    {
                     drawShadowAfter(shadowAfterClient);
+                    }
                 }
             else
+                {
                 drawDelayedShadow();
+                }
+            }
         }
 
     if( !active )
diff --git a/twin/bridge.cpp b/twin/bridge.cpp
index 49840e2..f793824 100644
--- a/twin/bridge.cpp
+++ b/twin/bridge.cpp
@@ -21,6 +21,10 @@
     {
     }
 
+Bridge::~Bridge()
+    {
+    }
+
 #define BRIDGE_HELPER( rettype, prototype, args1, args2, cst ) \
 rettype Bridge::prototype ( args1 ) cst \
     { \
diff --git a/twin/bridge.h b/twin/bridge.h
index 0989a64..3208b31 100644
--- a/twin/bridge.h
+++ b/twin/bridge.h
@@ -22,6 +22,8 @@
     {
     public:
         Bridge( Client* cl );
+        virtual ~Bridge();
+
         virtual bool isActive() const;
         virtual bool isCloseable() const;
         virtual bool isMaximizable() const;
diff --git a/twin/client.cpp b/twin/client.cpp
index a5b5e80..f32c506 100644
--- a/twin/client.cpp
+++ b/twin/client.cpp
@@ -1429,7 +1429,7 @@
     QRgb pixel;
     double opacity;
     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;
     TQMemArray<TQRect>::Iterator it, itEnd;
     TQMemArray<TQRect> rectangles;
@@ -1446,7 +1446,6 @@
     yOffset = options->shadowYOffset(isActive());
     options->shadowColour(isActive()).rgb(&red, &green, &blue);
     w = pixmap.width();
-    h = pixmap.height();
 
     itEnd = rectangles.end();
     for (it = rectangles.begin(); it != itEnd; ++it) {
@@ -1487,7 +1486,7 @@
     QRgb pixel;
     double decay, factor, opacity;
     int red, green, blue, pixelRed, pixelGreen, pixelBlue;
-    int halfMaxIntersects, lineIntersects, maxIntersects, maxY;
+    int lineIntersects, maxIntersects, maxY;
     int irBottom, irLeft, irRight, irTop, yIncrement;
     int subW, subH, w, h, zeroX, zeroY;
     TQImage image;
@@ -1505,7 +1504,6 @@
     yOffset = options->shadowYOffset(isActive());
     options->shadowColour(isActive()).rgb(&red, &green, &blue);
     maxIntersects = thickness * thickness * 4 + (thickness * 4) + 1;
-    halfMaxIntersects = maxIntersects / 2;
     lineIntersects = thickness * 2 + 1;
     factor = maxIntersects / maxOpacity;
     decay = (lineIntersects / 0.0125 - factor) / pow((double)maxIntersects, 3.0);
diff --git a/twin/events.cpp b/twin/events.cpp
index c7472cd..68c4be5 100644
--- a/twin/events.cpp
+++ b/twin/events.cpp
@@ -1584,7 +1584,7 @@
         handleMoveResize( x, y, x_root, y_root );
     return true;
     }
-    
+
 void Client::focusInEvent( XFocusInEvent* e )
     {
     if( e->window != window())