raise on focus [at end of cycle], also a temporary raise while cycling
(Simon)
This commit is contained in:
parent
4ca88642fa
commit
909b3c5665
7 changed files with 87 additions and 9 deletions
|
@ -20,7 +20,7 @@
|
|||
// 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"
|
||||
|
@ -264,6 +264,27 @@ void XLayer::raise(XLayerItem &item) {
|
|||
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
void XLayer::lower(XLayerItem &item) {
|
||||
// assume already in this layer
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// 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
|
||||
|
@ -72,6 +72,9 @@ public:
|
|||
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);
|
||||
void lowerLayer(XLayerItem &item);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// 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"
|
||||
|
@ -56,6 +56,10 @@ void XLayerItem::lower() {
|
|||
m_layer->lower(*this);
|
||||
}
|
||||
|
||||
void XLayerItem::tempRaise() {
|
||||
m_layer->tempRaise(*this);
|
||||
}
|
||||
|
||||
void XLayerItem::stepUp() {
|
||||
m_layer->stepUp(*this);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// 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 @@ public:
|
|||
|
||||
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();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// 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 @@ void BScreen::nextFocus(int opts) {
|
|||
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 @@ void BScreen::nextFocus(int opts) {
|
|||
(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 @@ void BScreen::prevFocus(int opts) {
|
|||
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 @@ void BScreen::prevFocus(int opts) {
|
|||
(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 @@ void BScreen::notifyReleasedKeys(XKeyEvent &ke) {
|
|||
WinClient *client = *cycling_window;
|
||||
focused_list.erase(cycling_window);
|
||||
focused_list.push_front(client);
|
||||
client->fbwindow()->raise();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// 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"
|
||||
|
||||
|
@ -153,6 +153,23 @@ void lowerFluxboxWindow(FluxboxWindow &win) {
|
|||
}
|
||||
}
|
||||
|
||||
/// 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));
|
||||
}
|
||||
}
|
||||
|
||||
class SetClientCmd:public FbTk::Command {
|
||||
public:
|
||||
explicit SetClientCmd(WinClient &client):m_client(client) {
|
||||
|
@ -1410,6 +1427,25 @@ void FluxboxWindow::lower() {
|
|||
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
|
||||
if (getLayerNum() == (Fluxbox::instance()->getMenuLayer()+1))
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// 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 @@ public:
|
|||
void stick();
|
||||
void raise();
|
||||
void lower();
|
||||
void tempRaise();
|
||||
void raiseLayer();
|
||||
void lowerLayer();
|
||||
void moveToLayer(int layernum);
|
||||
|
|
Loading…
Reference in a new issue