all repos — fluxbox @ b405d36151d3a6d3074eb6bafb541a1d6228d85e

custom fork of the fluxbox windowmanager

Move windows out of inactive heads upon layout change.

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Tomas Janousek tomi@nomi.cz
commit

b405d36151d3a6d3074eb6bafb541a1d6228d85e

parent

8c3f2a8e0378ff5d649ce831b995669874fd1056

2 files changed, 20 insertions(+), 0 deletions(-)

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

@@ -1909,6 +1909,9 @@

// send resize notify m_resize_sig.notify(); m_workspace_area_sig.notify(); + + // move windows out of inactive heads + clearHeads(); }

@@ -2018,6 +2021,22 @@ m_xinerama_avail = false;

m_xinerama_num_heads = 0; #endif // XINERAMA +} + +/* Move windows out of inactive heads */ +void BScreen::clearHeads() { + if (!hasXinerama()) return; + + for (Workspaces::iterator i = m_workspaces_list.begin(); + i != m_workspaces_list.end(); i++) { + for (Workspace::Windows::iterator win = (*i)->windowList().begin(); + win != (*i)->windowList().end(); win++) { + if (getHead((*win)->fbWindow()) == 0) { + // first head is a safe bet here + (*win)->placeWindow(1); + } + } + } } int BScreen::getHead(int x, int y) const {
M src/Screen.hhsrc/Screen.hh

@@ -406,6 +406,7 @@ /// @return umber of xinerama heads

int numHeads() const { return m_xinerama_num_heads; } void initXinerama(); + void clearHeads(); /** * Determines head number for a position * @param x position in pixels on the screen