Package: fluxbox
Version: 1.1.1+git20100908.df2f51b-2
Severity: wishlist
Tags: upstream patch

This patch adds the OnTab keyword for the keys file, also adding the
following lines to the keys file restore the old behaviour to use Mouse2
on tabs to start tabbing that was the default before the :StartTabbing
command was introduced, and keep OnTitlebar Mouse2 to lower the window.
Of course this only works with external tabs.

OnTab Mouse2 :StartTabbing
OnTab Move1 :StartMoving


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages fluxbox depends on:
ii  libc6                   2.11.2-7         Embedded GNU C Library: Shared lib
ii  libfontconfig1          2.8.0-2.1        generic font configuration library
ii  libfreetype6            2.4.2-2          FreeType 2 font engine, shared lib
ii  libfribidi0             0.19.2-1         Free Implementation of the Unicode
ii  libgcc1                 1:4.4.5-8        GCC support library
ii  libice6                 2:1.0.6-2        X11 Inter-Client Exchange library
ii  libimlib2               1.4.2-8+b2       powerful image loading and renderi
ii  libsm6                  2:1.2.0-1        X11 Session Management library
ii  libstdc++6              4.4.5-8          The GNU Standard C++ Library v3
ii  libx11-6                2:1.3.3-3        X11 client-side library
ii  libxext6                2:1.1.2-1        X11 miscellaneous extension librar
ii  libxft2                 2.1.14-2         FreeType-based font drawing librar
ii  libxinerama1            2:1.1.1-1        X11 Xinerama extension library
ii  libxpm4                 1:3.5.8-1        X11 pixmap library
ii  libxrandr2              2:1.3.0-3        X11 RandR extension library
ii  libxrender1             1:0.9.6-1        X Rendering Extension client libra
ii  menu                    2.1.44           generates programs menu for all me
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages fluxbox recommends:
ii  xfonts-terminus               4.30-2     Fixed-width fonts for fast reading

Versions of packages fluxbox suggests:
ii  fbdesk    1.4.1-5                        desktop icons for window managers
ii  fbpager   0.1.5~git20090221.1.8e0927e6-1 a pager application for the Fluxbo

-- no debconf information
Author: Julien Viard de Galbert <jul...@vdg.blogsite.org>
Description: Adding OnTab key context

This patch adds the OnTab keyword for the keys file, also adding the
following lines to the keys file restore the old behaviour to use Mouse2
on tabs to start tabbing that was the default before the :StartTabbing
command was introduced, and keep OnTitlebar Mouse2 to lower the window.
Of course this only works with external tabs.

OnTab Mouse2 :StartTabbing
OnTab Move1 :StartMoving

--- fluxbox-1.1.1+git20100908.df2f51b.orig/src/Keys.cc
+++ fluxbox-1.1.1+git20100908.df2f51b/src/Keys.cc
@@ -414,6 +414,8 @@ bool Keys::addBinding(const string &line
                 context |= ON_WINDOWBORDER;
             else if (arg == "onleftgrip")
                 context |= ON_LEFTGRIP;
+            else if (arg == "ontab")
+                context |= ON_TAB;
             else if (arg == "onrightgrip")
                 context |= ON_RIGHTGRIP;
             else if (arg == "double")
--- fluxbox-1.1.1+git20100908.df2f51b.orig/src/Window.cc
+++ fluxbox-1.1.1+git20100908.df2f51b/src/Window.cc
@@ -2347,9 +2347,16 @@ void FluxboxWindow::buttonPressEvent(XBu
     bool onTitlebar =
         frame().insideTitlebar( be.window ) &&
         frame().handle().window() != be.window;
-
+    bool onTab = false;
+    {
+        using RectangleUtil::insideBorder;
+        int borderw = frame().window().borderWidth();
+       onTab = ( frame().externalTabMode() 
+                         && insideBorder(frame().tabcontainer(), be.x_root, 
be.y_root, borderw) );
+    }
     Keys *k = Fluxbox::instance()->keys();
-    if ((onTitlebar && k->doAction(be.type, be.state, be.button, 
Keys::ON_TITLEBAR, &winClient(), be.time)) ||
+    if ((onTab && k->doAction(be.type, be.state, be.button, Keys::ON_TAB, 
&winClient(), be.time)) ||
+        (onTitlebar && k->doAction(be.type, be.state, be.button, 
Keys::ON_TITLEBAR, &winClient(), be.time)) ||
         k->doAction(be.type, be.state, be.button, Keys::ON_WINDOW, 
&winClient(), be.time)) {
 
         return;
@@ -2405,6 +2412,7 @@ void FluxboxWindow::motionNotifyEvent(XM
     bool inside_titlebar = frame().insideTitlebar( me.window );
     bool inside_grips = (me.window == frame().gripRight() || me.window == 
frame().gripLeft());
     bool inside_border = false;
+    bool inside_tab = false;
 
     if (!inside_grips)
     {
@@ -2413,6 +2421,8 @@ void FluxboxWindow::motionNotifyEvent(XM
 
 
         //!! TODO(tabs): the below test ought to be in FbWinFrame
+       inside_tab = ( frame().externalTabMode() 
+                         && insideBorder(frame().tabcontainer(), me.x_root, 
me.y_root, borderw) );
 
         inside_border =
 
@@ -2445,7 +2455,9 @@ void FluxboxWindow::motionNotifyEvent(XM
 
 
     int context = Keys::ON_WINDOW;
-    if (inside_titlebar) {
+    if (inside_tab) {
+        context = Keys::ON_TAB;
+    } else if (inside_titlebar) {
         context = Keys::ON_TITLEBAR;
     } else if (inside_border) {
         context = Keys::ON_WINDOWBORDER;

Reply via email to