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.
This commit is contained in:
mathias 2005-07-13 18:41:38 +00:00
parent 21e525a856
commit 3e16ad8cf8
2 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -3421,17 +3421,21 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
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 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
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 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
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);
}
}
}