Move windows out of inactive heads upon layout change.

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
This commit is contained in:
Tomas Janousek 2007-03-01 23:18:18 +01:00
parent 8c3f2a8e03
commit b405d36151
2 changed files with 20 additions and 0 deletions

View file

@ -1909,6 +1909,9 @@ void BScreen::updateSize() {
// send resize notify
m_resize_sig.notify();
m_workspace_area_sig.notify();
// move windows out of inactive heads
clearHeads();
}
@ -2020,6 +2023,22 @@ notactive:
}
/* 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 {
if (!hasXinerama()) return 0;
#ifdef XINERAMA

View file

@ -406,6 +406,7 @@ public:
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