From 3e16ad8cf8be40a1868b6c133649d6549a755761 Mon Sep 17 00:00:00 2001 From: mathias Date: Wed, 13 Jul 2005 18:41:38 +0000 Subject: 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. --- ChangeLog | 4 ++++ src/Window.cc | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7fbc1f3..001c233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 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) { 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); } - } } -- cgit v0.11.2