all repos — fluxbox @ 0906477984edbd9f6e62fed3800ea9a441919a58

custom fork of the fluxbox windowmanager

leave fullscreen windows on top, even without the focus, as long as focused window is on another head
Mark Tiefenbruck mark@fluxbox.org
commit

0906477984edbd9f6e62fed3800ea9a441919a58

parent

f6ee704a1d3429c6dedb03d84b4d70103cf8db15

2 files changed, 32 insertions(+), 5 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -1499,11 +1499,11 @@ sendConfigureNotify();

m_last_resize_x = frame().x(); m_last_resize_y = frame().y(); - moveToLayer(::Layer::ABOVE_DOCK); - fullscreen = true; - stateSig().notify(); + setFullscreenLayer(); + if (!isFocused()) + screen().focusedWindowSig().attach(this); } else if (!flag && isFullscreen()) {

@@ -1539,6 +1539,21 @@ setMaximizedState(tmp);

} else stateSig().notify(); } +} + +void FluxboxWindow::setFullscreenLayer() { + + FluxboxWindow *foc = FocusControl::focusedFbWindow(); + // if another window on the same head is focused, make sure we can see it + if (isFocused() || !foc || &foc->screen() != &screen() || + getOnHead() != foc->getOnHead()) { + moveToLayer(::Layer::ABOVE_DOCK); + } else { + moveToLayer(m_old_layernum); + lower(); + } + stateSig().notify(); + } /**

@@ -1899,10 +1914,15 @@ #endif // DEBUG

installColormap(focus); + // if we're fullscreen and another window gains focus on the same head, + // then we need to let the user see it if (fullscreen && !focus) - moveToLayer(m_old_layernum); - if (fullscreen && focus) + screen().focusedWindowSig().attach(this); + + if (fullscreen && focus) { moveToLayer(::Layer::ABOVE_DOCK); + screen().focusedWindowSig().detach(this); + } if (focus != frame().focused()) frame().setFocus(focus);

@@ -2922,6 +2942,11 @@ frame().setFocusTitle(win.title());

titleSig().notify(); } + } else if (subj && typeid(*subj) == typeid(BScreen::ScreenSubject)) { + if (subj == &screen().focusedWindowSig()) { + if (FocusControl::focusedFbWindow()) + setFullscreenLayer(); + } } }
M src/Window.hhsrc/Window.hh

@@ -547,6 +547,8 @@ void saveBlackboxAttribs();

void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1, int gravity = ForgetGravity, unsigned int client_bw = 0); void setState(unsigned long stateval, bool setting_up); + /// set the layer of a fullscreen window + void setFullscreenLayer(); // modifies left and top if snap is necessary void doSnapping(int &left, int &top);