all repos — fluxbox @ 3e16ad8cf8be40a1868b6c133649d6549a755761

custom fork of the fluxbox windowmanager

When the screen is filled with windows it can be pretty hard to find a "valid"
area to drop a tab button to detach the client from the group. solution is to
detach the client if the tab button is dropped onto the client area of the
same group.
mathias mathias
commit

3e16ad8cf8be40a1868b6c133649d6549a755761

parent

21e525a856f54d7d62dc21a5d8ba8d74983c9747

2 files changed, 14 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,9 @@

(Format: Year/Month/Day) Changes for 0.9.14: +*05/07/13: + Dragging a tab button from current titlebar onto current client area will + detach that client (Mathias) + Window.cc *05/07/12: Renaming of 'bsetroot' to 'fbsetroot' (Mathias) blackbox's 'bsetroot' and fluxbox's 'bsetroot' have different syntax
M src/Window.ccsrc/Window.cc

@@ -3421,17 +3421,21 @@ Window child = 0;

if (XTranslateCoordinates(display, parent().window(), parent().window(), x, y, &dest_x, &dest_y, &child)) { + + bool inside_titlebar = false; // search for a fluxboxwindow WinClient *client = Fluxbox::instance()->searchWindow(child); FluxboxWindow *attach_to_win = 0; if (client) { + + inside_titlebar = client->fbwindow()->hasTitlebar() && + client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y; + 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(); + else if (area == Fluxbox::ATTACH_AREA_TITLEBAR && inside_titlebar) { + attach_to_win = client->fbwindow(); } }

@@ -3440,7 +3444,7 @@ attach_to_win != 0 && attach_to_win->isTabable()) {

attach_to_win->attachClient(*old_attached,x,y ); // we could be deleted here, DO NOT do anything else that alters this object - } else if (attach_to_win != this) { + } else if (attach_to_win != this || (attach_to_win == this && !inside_titlebar)) { // disconnect client if we didn't drop on a window WinClient &client = *old_attached; detachClient(*old_attached);

@@ -3450,11 +3454,10 @@ if (client.fbwindow() != 0) {

client.fbwindow()->move(frame().x() - m_last_resize_x + x, frame().y() - m_last_resize_y + y); client.fbwindow()->show(); } - } else if(attach_to_win==this && attach_to_win->isTabable()) { + } else if( attach_to_win == this && attach_to_win->isTabable()) { //reording of tabs within a frame moveClientTo(*old_attached, x, y); } - } }