all repos — fluxbox @ 909b3c5665213ef2a05ef26e33506d02829bdd93

custom fork of the fluxbox windowmanager

raise on focus [at end of cycle], also a temporary raise while cycling
(Simon)
rathnor rathnor
commit

909b3c5665213ef2a05ef26e33506d02829bdd93

parent

4ca88642fad0b89209aea9272b835b1e724975ad

M src/FbTk/XLayer.ccsrc/FbTk/XLayer.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XLayer.cc,v 1.6 2003/02/18 15:08:12 rathnor Exp $ +// $Id: XLayer.cc,v 1.7 2003/04/15 23:09:24 rathnor Exp $ #include "XLayer.hh" #include "XLayerItem.hh"

@@ -260,6 +260,27 @@ }

#endif // DEBUG itemList().push_front(&item); + stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); + +} + +void XLayer::tempRaise(XLayerItem &item) { + // assume it is already in this layer + + if (&item == itemList().front()) + return; // nothing to do + + iterator it = std::find(itemList().begin(), itemList().end(), &item); + if (it != itemList().end()) + // don't remove it +#ifdef DEBUG + else { + cerr<<__FILE__<<"("<<__LINE__<<"): WARNING: raise on item not in layer["<<m_layernum<<"]"<<endl; + return; + } +#endif // DEBUG + + // don't add it back to the top stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); }
M src/FbTk/XLayer.hhsrc/FbTk/XLayer.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XLayer.hh,v 1.3 2003/02/09 14:11:14 rathnor Exp $ +// $Id: XLayer.hh,v 1.4 2003/04/15 23:09:25 rathnor Exp $ #ifndef FBTK_XLAYER_HH

@@ -71,6 +71,9 @@

// bring to top of layer void raise(XLayerItem &item); void lower(XLayerItem &item); + + // raise it, but don't make it permanent (i.e. restack will revert) + void tempRaise(XLayerItem &item); // send to next layer up void raiseLayer(XLayerItem &item);
M src/FbTk/XLayerItem.ccsrc/FbTk/XLayerItem.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XLayerItem.cc,v 1.6 2003/02/18 15:08:12 rathnor Exp $ +// $Id: XLayerItem.cc,v 1.7 2003/04/15 23:09:25 rathnor Exp $ #include "XLayerItem.hh" #include "XLayer.hh"

@@ -54,6 +54,10 @@ }

void XLayerItem::lower() { m_layer->lower(*this); +} + +void XLayerItem::tempRaise() { + m_layer->tempRaise(*this); } void XLayerItem::stepUp() {
M src/FbTk/XLayerItem.hhsrc/FbTk/XLayerItem.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XLayerItem.hh,v 1.6 2003/02/18 15:08:12 rathnor Exp $ +// $Id: XLayerItem.hh,v 1.7 2003/04/15 23:09:26 rathnor Exp $ #ifndef FBTK_XLAYERITEM_HH #define FBTK_XLAYERITEM_HH

@@ -46,6 +46,8 @@ void setLayer(XLayer &layer);

void raise(); void lower(); + void tempRaise(); // this raise gets reverted by a restack() + // go above the next item visible in this layer void stepUp(); void stepDown();
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.122 2003/04/15 14:42:03 fluxgen Exp $ +// $Id: Screen.cc,v 1.123 2003/04/15 23:09:12 rathnor Exp $ #include "Screen.hh"

@@ -1371,6 +1371,9 @@ if (!(opts & CYCLELINEAR)) {

if (!cycling_focus) { cycling_focus = True; cycling_window = focused_list.begin(); + } else { + // already cycling, so restack to put windows back in their proper order + m_layermanager.restack(); } // if it is stacked, we want the highest window in the focused list // that is on the same workspace

@@ -1392,8 +1395,10 @@ if (fbwin && !fbwin->isIconic() &&

(fbwin->isStuck() || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { // either on this workspace, or stuck - if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) + if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { + fbwin->tempRaise(); break; + } } } cycling_window = it;

@@ -1444,6 +1449,9 @@ if (!(opts & CYCLELINEAR)) {

if (!cycling_focus) { cycling_focus = True; cycling_window = focused_list.end(); + } else { + // already cycling, so restack to put windows back in their proper order + m_layermanager.restack(); } // if it is stacked, we want the highest window in the focused list // that is on the same workspace

@@ -1466,8 +1474,10 @@ if (fbwin && !fbwin->isIconic() &&

(fbwin->isStuck() || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { // either on this workspace, or stuck - if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) + if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { + fbwin->tempRaise(); break; + } } } cycling_window = it;

@@ -2167,6 +2177,7 @@ // put currently focused window to top

WinClient *client = *cycling_window; focused_list.erase(cycling_window); focused_list.push_front(client); + client->fbwindow()->raise(); } }
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.137 2003/04/15 21:38:23 fluxgen Exp $ +// $Id: Window.cc,v 1.138 2003/04/15 23:09:13 rathnor Exp $ #include "Window.hh"

@@ -150,6 +150,23 @@ std::list<FluxboxWindow *>::const_iterator it_end = win.getTransients().end();

for (; it != it_end; ++it) { if (!(*it)->isIconic()) lowerFluxboxWindow(*(*it)); + } +} + +/// raise window and do the same for each transient it holds +void tempRaiseFluxboxWindow(FluxboxWindow &win) { + + if (!win.isIconic()) { + // don't update netizen, as it is only temporary + win.getLayerItem().tempRaise(); + } + + // for each transient do raise + std::list<FluxboxWindow *>::const_iterator it = win.getTransients().begin(); + std::list<FluxboxWindow *>::const_iterator it_end = win.getTransients().end(); + for (; it != it_end; ++it) { + if (!(*it)->isIconic()) + tempRaiseFluxboxWindow(*(*it)); } }

@@ -1409,6 +1426,25 @@ bottom = this;

lowerFluxboxWindow(*bottom); } + +void FluxboxWindow::tempRaise() { + if (isIconic()) + deiconify(); + + // get root window + FluxboxWindow *win = this; + while (win->getTransientFor()) { + win = win->getTransientFor(); + assert(win != win->getTransientFor()); + } + // if we don't have any root window use this as root + if (win == 0) + win = this; + + // raise this window and every transient in it + tempRaiseFluxboxWindow(*win); +} + void FluxboxWindow::raiseLayer() { // don't let it up to menu layer
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.56 2003/04/15 18:56:42 fluxgen Exp $ +// $Id: Window.hh,v 1.57 2003/04/15 23:09:15 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -155,6 +155,7 @@ /// toggles sticky

void stick(); void raise(); void lower(); + void tempRaise(); void raiseLayer(); void lowerLayer(); void moveToLayer(int layernum);