#! /bin/sh -e
## cvs_fixes.dpatch by Eduard Bloch <blade@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: CVS updates or rollbacks to fix current bugs.

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
--- /tmp/icewm-1.2.35/src/wmcontainer.cc	2008-01-05 08:34:24.000000000 +0100
+++ icewm-1.2_maint_branch/src/wmcontainer.cc	2008-02-02 13:11:58.000000000 +0100
@@ -40,10 +40,11 @@
         (!useMouseWheel || (button.button != 4 && button.button != 5)))
     {
         if (focusOnClickClient) {
-            if (getFrame()->canFocus() && !getFrame()->focused())
-                firstClick = true;
-            if (!getFrame()->isTypeDock())
+            if (!getFrame()->isTypeDock()) {
                 doActivate = true;
+                if (getFrame()->canFocusByMouse() && !getFrame()->focused())
+                    firstClick = true;
+            }
         }
         if (raiseOnClickClient) {
             doRaise = true;
