aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathias <mathias>2005-07-13 18:41:38 (GMT)
committermathias <mathias>2005-07-13 18:41:38 (GMT)
commit3e16ad8cf8be40a1868b6c133649d6549a755761 (patch)
tree92cab56ca5ee4f8d4e707ec7fa8156f630054b80 /src
parent21e525a856f54d7d62dc21a5d8ba8d74983c9747 (diff)
downloadfluxbox_paul-3e16ad8cf8be40a1868b6c133649d6549a755761.zip
fluxbox_paul-3e16ad8cf8be40a1868b6c133649d6549a755761.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Window.cc b/src/Window.cc
index b7f78cf..71f597e 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3421,17 +3421,21 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3421 if (XTranslateCoordinates(display, parent().window(), 3421 if (XTranslateCoordinates(display, parent().window(),
3422 parent().window(), 3422 parent().window(),
3423 x, y, &dest_x, &dest_y, &child)) { 3423 x, y, &dest_x, &dest_y, &child)) {
3424
3425 bool inside_titlebar = false;
3424 // search for a fluxboxwindow 3426 // search for a fluxboxwindow
3425 WinClient *client = Fluxbox::instance()->searchWindow(child); 3427 WinClient *client = Fluxbox::instance()->searchWindow(child);
3426 FluxboxWindow *attach_to_win = 0; 3428 FluxboxWindow *attach_to_win = 0;
3427 if (client) { 3429 if (client) {
3430
3431 inside_titlebar = client->fbwindow()->hasTitlebar() &&
3432 client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y;
3433
3428 Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea(); 3434 Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea();
3429 if (area == Fluxbox::ATTACH_AREA_WINDOW) 3435 if (area == Fluxbox::ATTACH_AREA_WINDOW)
3430 attach_to_win = client->fbwindow(); 3436 attach_to_win = client->fbwindow();
3431 else if (area == Fluxbox::ATTACH_AREA_TITLEBAR) { 3437 else if (area == Fluxbox::ATTACH_AREA_TITLEBAR && inside_titlebar) {
3432 if(client->fbwindow()->hasTitlebar() && 3438 attach_to_win = client->fbwindow();
3433 client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y)
3434 attach_to_win = client->fbwindow();
3435 } 3439 }
3436 } 3440 }
3437 3441
@@ -3440,7 +3444,7 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3440 3444
3441 attach_to_win->attachClient(*old_attached,x,y ); 3445 attach_to_win->attachClient(*old_attached,x,y );
3442 // we could be deleted here, DO NOT do anything else that alters this object 3446 // we could be deleted here, DO NOT do anything else that alters this object
3443 } else if (attach_to_win != this) { 3447 } else if (attach_to_win != this || (attach_to_win == this && !inside_titlebar)) {
3444 // disconnect client if we didn't drop on a window 3448 // disconnect client if we didn't drop on a window
3445 WinClient &client = *old_attached; 3449 WinClient &client = *old_attached;
3446 detachClient(*old_attached); 3450 detachClient(*old_attached);
@@ -3450,11 +3454,10 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3450 client.fbwindow()->move(frame().x() - m_last_resize_x + x, frame().y() - m_last_resize_y + y); 3454 client.fbwindow()->move(frame().x() - m_last_resize_x + x, frame().y() - m_last_resize_y + y);
3451 client.fbwindow()->show(); 3455 client.fbwindow()->show();
3452 } 3456 }
3453 } else if(attach_to_win==this && attach_to_win->isTabable()) { 3457 } else if( attach_to_win == this && attach_to_win->isTabable()) {
3454 //reording of tabs within a frame 3458 //reording of tabs within a frame
3455 moveClientTo(*old_attached, x, y); 3459 moveClientTo(*old_attached, x, y);
3456 } 3460 }
3457
3458 } 3461 }
3459} 3462}
3460 3463