From 4eb87522a0c7954d9bd6cc0aac38cc64ac204412 Mon Sep 17 00:00:00 2001
From: markt <markt>
Date: Sat, 10 Feb 2007 18:18:36 +0000
Subject: it was still possible to move a window by grabbing the border with
 session.ignoreBorder: true

---
 ChangeLog     |  2 ++
 src/Window.cc | 17 ++++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4b51ce9..6f31e5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
  (Format: Year/Month/Day)
 Changes for 1.0rc3:
 *07/02/10:
+   * Fixed a bug with `session.ignoreBorder: true' (Mark)
+     Window.cc
    * Fixed a bug with resizing windows for clients when only the width is
      specified (Mark)
      Window.cc
diff --git a/src/Window.cc b/src/Window.cc
index 4c6c681..c83acd7 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2689,7 +2689,8 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
                             || frame().label() == me.window
                             || frame().tabcontainer() == me.window
                             || frame().handle() == me.window
-                            || frame().window() == me.window);
+                            || frame().window() == me.window
+                               && !Fluxbox::instance()->getIgnoreBorder());
 
     if (Fluxbox::instance()->getIgnoreBorder()
         && !(me.state & Fluxbox::instance()->getModKey()) // really should check for exact matches
@@ -2800,10 +2801,16 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
 
             screen().showPosition(dx, dy);
         } // end if moving
-    } else if (functions.resize &&
-               (((me.state & Button1Mask) && (me.window == frame().gripRight() ||
-                                              me.window == frame().gripLeft())) ||
-                me.window == frame().window())) {
+    } else if (isResizing() // if we're already resizing the window
+               || functions.resize
+                  // or if we're dragging one of the grips
+                  && ((me.state & Button1Mask)
+                      && (me.window == frame().gripRight()
+                          || me.window == frame().gripLeft())
+                      // or if we're right-click dragging the border
+                      || (me.state & Button3Mask)
+                         && me.window == frame().window()
+                         && !Fluxbox::instance()->getIgnoreBorder())) {
 
         if (! resizing) {
 
-- 
cgit v0.11.2