From b10dc8434b4faa7c4b9be82c00f1c4e141eab0c4 Mon Sep 17 00:00:00 2001
From: rathnor <rathnor>
Date: Sun, 4 May 2003 16:55:40 +0000
Subject: add session.ignoreBorder to ignore border for movement events

---
 ChangeLog      |  2 ++
 RoadMap        |  9 +++++----
 src/Window.cc  | 14 +++++++++++++-
 src/fluxbox.cc |  3 ++-
 src/fluxbox.hh |  6 ++++--
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 698b9bf..cf2449e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 (Format: Year/Month/Day)
 Changes for 0.9.2:
 *03/05/04:
+   * add session.ignoreBorder - ignores window border with movement (Simon)
+     fluxbox.hh/cc Window.cc
    * Fix warping with multiple screens (Simon)
      Window.cc
    * Set many key events/commands to act on the screen the mouse is on,
diff --git a/RoadMap b/RoadMap
index 9b4e2ba..ce3643c 100644
--- a/RoadMap
+++ b/RoadMap
@@ -99,20 +99,20 @@ Bugfixes/lower priority:
 Release:      0.9.2
 Approx Date:  5 May, 2003
 Major Features:
- + Integration of Remember patch        (Simon)
+ * Integration of Remember patch        (Simon)
  * Transparency                         (Henrik)
 Minor Features:
  - more keybinding actions              (Both)
  * directional focus movement           (Simon)
- - fix up focus issues                  (Simon)
+ = fix up focus issues                  (Simon)
  * snap to windows                      (Simon)
  - improved command-line help option    (Henrik)
  = pixmap buttons                       (Henrik)
  + Shaped menu/slit/toolbar             (Henrik)
 Bugfixes/lower priority:
  - Bugs from 0.9.1                      (Both)
- - stop window moving from borders      (Simon)
- - Focus acts sloppy on window close/warp (Simon)
+ * stop window moving from borders      (Simon)
+ = Focus acts sloppy on window close/warp (Simon)
 
 ----------------------------------------------------------
 Release:      0.9.3
@@ -121,6 +121,7 @@ Major Features:
  - Xinerama                             (Simon)
  - XRandr                               (Henrik)
 Minor Features:
+ - Add some sort of program launch function (Simon)
  - more powerful autogroup matching     (?)
  - nls updating (layers, toolbar)       (Both)
 Bugfixes/lower priority:
diff --git a/src/Window.cc b/src/Window.cc
index fb7b169..bd930db 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Window.cc,v 1.157 2003/05/04 13:55:39 rathnor Exp $
+// $Id: Window.cc,v 1.158 2003/05/04 16:55:40 rathnor Exp $
 
 #include "Window.hh"
 
@@ -2253,6 +2253,18 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
     }
     bool inside_titlebar = (m_frame.titlebar() == me.window || m_frame.label() == me.window ||
                             m_frame.handle() == me.window || m_frame.window() == me.window);
+
+    if (Fluxbox::instance()->getIgnoreBorder()
+        && !(me.state & Mod1Mask) // really should check for exact matches
+        && !(isMoving() || isResizing())) {
+        int borderw = screen.rootTheme().borderWidth();
+        if (me.x_root < (m_frame.x() + borderw) ||
+            me.y_root < (m_frame.y() + borderw) ||
+            me.x_root > (m_frame.x() + (int)m_frame.width() + borderw) ||
+            me.y_root > (m_frame.y() + (int)m_frame.height() + borderw))
+            return;
+    }
+
     WinClient *client = 0;
     if (!inside_titlebar) {
         // determine if we're in titlebar
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 6b7d427..d26d8b3 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: fluxbox.cc,v 1.126 2003/05/04 13:07:00 rathnor Exp $
+// $Id: fluxbox.cc,v 1.127 2003/05/04 16:55:40 rathnor Exp $
 
 #include "fluxbox.hh"
 
@@ -365,6 +365,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
       m_fbatoms(new FbAtoms()),
       m_resourcemanager(), m_screen_rm(),
       m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"),
+      m_rc_ignoreborder(m_resourcemanager, false, "session.ignoreBorder", "Session.IgnoreBorder"),
       m_rc_colors_per_channel(m_resourcemanager, 4, 
                               "session.colorsPerChannel", "Session.ColorsPerChannel"),
       m_rc_numlayers(m_resourcemanager, 13, "session.numLayers", "Session.NumLayers"),
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index ee60094..35f7c79 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: fluxbox.hh,v 1.51 2003/04/27 04:28:04 rathnor Exp $
+// $Id: fluxbox.hh,v 1.52 2003/05/04 16:55:40 rathnor Exp $
 
 #ifndef	 FLUXBOX_HH
 #define	 FLUXBOX_HH
@@ -99,6 +99,8 @@ public:
 
     enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
 
+    inline const Bool getIgnoreBorder() const { return *m_rc_ignoreborder; }
+
     inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; }
     inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; }
     inline const std::string &getStyleFilename() const { return *m_rc_stylefile; }
@@ -216,7 +218,7 @@ private:
     ResourceManager m_resourcemanager, m_screen_rm;
 	
     //--- Resources
-    Resource<bool> m_rc_tabs;
+    Resource<bool> m_rc_tabs, m_rc_ignoreborder;
     Resource<int> m_rc_colors_per_channel, m_rc_numlayers;
     Resource<std::string> m_rc_stylefile, 
         m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile,
-- 
cgit v0.11.2