all repos — fluxbox @ ffae659b3ecc080fdd98c8825d8e643cc66ccf27

custom fork of the fluxbox windowmanager

external tab fixes, plus aligning items properly
simonb simonb
commit

ffae659b3ecc080fdd98c8825d8e643cc66ccf27

parent

15f53b5556403a8301fc7be4512b6f8ce52ffa5d

5 files changed, 31 insertions(+), 21 deletions(-)

jump to
M ChangeLogChangeLog

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

(Format: Year/Month/Day) Changes for 0.9.16: +*06/03/23: + * Fix some tab stacking alignment and rendering on tab resize (Simon) + (and very minor tidying) + FbWinFrame.cc FbTk/XLayer.cc FbTk/XLayerItem.hh/cc *06/03/22: * More external tabs work (Simon) - Can now be placed TopLeft/TopRight/BottomLeft/BottomRight
M src/FbTk/XLayer.ccsrc/FbTk/XLayer.cc

@@ -131,24 +131,33 @@ delete [] winlist;

} +// We can't just use Restack here, because it won't do anything if they're +// already in the same relative order excluding other windows void XLayer::alignItem(XLayerItem &item) { + if (itemList().front() == &item) { + stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); + return; + } + // Note: some other things effectively assume that the window list is // sorted from highest to lowest - size_t winnum = 0, - num = item.numWindows(); - Window *winlist = new Window[num]; + // get our item + iterator myit = std::find(itemList().begin(), itemList().end(), &item); + iterator it = myit; + + // go to the one above it in our layer (top is front, so we decrement) + --it; + + // keep going until we find one that is currently visible to the user + while (it != itemList().begin() && !(*it)->visible()) + --it; - // fill the rest of the array - XLayerItem::Windows::iterator it = item.getWindows().begin(); - XLayerItem::Windows::iterator it_end = item.getWindows().end(); - for (; it != it_end; ++it) { - if ((*it)->window()) { - winlist[winnum++] = (*it)->window(); - } - } + if (it == itemList().begin() && !(*it)->visible()) + // reached front item, but it wasn't visible, therefore it was already raised + stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); + else + stackBelowItem(&item, *it); - XRestackWindows(FbTk::App::instance()->display(), winlist, winnum); - delete [] winlist; } XLayer::iterator XLayer::insert(XLayerItem &item, unsigned int pos) {
M src/FbTk/XLayerItem.ccsrc/FbTk/XLayerItem.cc

@@ -28,7 +28,7 @@

using namespace FbTk; XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) : - m_layer(&layer), m_layeriterator(0) { + m_layer(&layer) { m_windows.push_front(&win); m_layer->insert(*this); }
M src/FbTk/XLayerItem.hhsrc/FbTk/XLayerItem.hh

@@ -79,7 +79,6 @@ size_t numWindows() const { return m_windows.size(); }

private: XLayer *m_layer; - XLayer::iterator m_layeriterator; Windows m_windows; };
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -207,10 +207,12 @@ renderTabContainer();

applyTabContainer(); m_tab_container.clear(); + m_tab_container.raise(); + m_tab_container.show(); + if (!m_use_tabs) - m_tab_container.show(); - else ret = false; + m_label.hide(); // reconfigure(); }

@@ -1296,10 +1298,6 @@

m_label.setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask); - m_label.show(); - - m_tab_container.show(); - m_tab_container.raise(); showHandle(); showTitlebar();