all repos — fluxbox @ 09eade65d558dfc032ac415607fc2c6eb99aea19

custom fork of the fluxbox windowmanager

attach area, patch from Mathias Gumz
fluxgen fluxgen
commit

09eade65d558dfc032ac415607fc2c6eb99aea19

parent

027741fbb409e945a2c3a632027c28981314b89a

3 files changed, 34 insertions(+), 5 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.281 2004/04/18 21:17:36 fluxgen Exp $ +// $Id: Window.cc,v 1.282 2004/04/22 21:07:57 fluxgen Exp $ #include "Window.hh"

@@ -3095,9 +3095,16 @@ x, y, &dest_x, &dest_y, &child)) {

// search for a fluxboxwindow WinClient *client = Fluxbox::instance()->searchWindow(child); FluxboxWindow *attach_to_win = 0; - if (client) + if (client) { + Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea(); + if (area == Fluxbox::ATTACH_AREA_WINDOW) attach_to_win = client->fbwindow(); - + else if (area == Fluxbox::ATTACH_AREA_TITLEBAR) { + if(client->fbwindow()->hasTitlebar() && + client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y) + attach_to_win = client->fbwindow(); + } + } if (attach_to_win != this && attach_to_win != 0) {
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.239 2004/04/19 22:45:44 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.240 2004/04/22 21:07:57 fluxgen Exp $ #include "fluxbox.hh"

@@ -190,6 +190,15 @@ m_value.push_back(Fluxbox::MENU);

else if (strcasecmp(val[i].c_str(), "Close")==0) m_value.push_back(Fluxbox::CLOSE); } +} + +template<> +void FbTk::Resource<Fluxbox::TabsAttachArea>:: +setFromString(char const *strval) { + if (strcasecmp(strval, "Titlebar")==0) + m_value= Fluxbox::ATTACH_AREA_TITLEBAR; + else + m_value= Fluxbox::ATTACH_AREA_WINDOW; } template<>

@@ -256,6 +265,15 @@ return retval;

} template<> +std::string FbTk::Resource<Fluxbox::TabsAttachArea>:: +getString() { + if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR) + return "Titlebar"; + else + return "Window"; +} + +template<> string FbTk::Resource<unsigned int>:: getString() { char tmpstr[128];

@@ -394,6 +412,7 @@ "session.titlebar.left", "Session.Titlebar.Left"),

m_rc_titlebar_right(m_resourcemanager, TitlebarList(&s_titlebar_right[0], &s_titlebar_right[3]), "session.titlebar.right", "Session.Titlebar.Right"), + m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"), m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"),
M src/fluxbox.hhsrc/fluxbox.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.86 2004/04/19 22:45:44 fluxgen Exp $ +// $Id: fluxbox.hh,v 1.87 2004/04/22 21:07:57 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH

@@ -107,6 +107,7 @@ void removeAtomHandler(AtomHandler *atomh);

/// obsolete enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; + enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR};

@@ -114,6 +115,7 @@ inline 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 Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; } inline const std::string &getStyleFilename() const { return *m_rc_stylefile; } inline const std::string &getMenuFilename() const { return *m_rc_menufile; }

@@ -252,6 +254,7 @@ m_rc_groupfile;

FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; + FbTk::Resource<TabsAttachArea> m_rc_tabs_attach_area; FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; FbTk::Resource<time_t> m_rc_auto_raise_delay; FbTk::Resource<bool> m_rc_use_mod1; /// temporary!, to disable mod1 for resize/move