Move windows out of inactive heads upon layout change.
Signed-off-by: Tomas Janousek <tomi@nomi.cz>
This commit is contained in:
parent
8c3f2a8e03
commit
b405d36151
2 changed files with 20 additions and 0 deletions
|
@ -1909,6 +1909,9 @@ void BScreen::updateSize() {
|
||||||
// send resize notify
|
// send resize notify
|
||||||
m_resize_sig.notify();
|
m_resize_sig.notify();
|
||||||
m_workspace_area_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 {
|
int BScreen::getHead(int x, int y) const {
|
||||||
if (!hasXinerama()) return 0;
|
if (!hasXinerama()) return 0;
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
|
|
|
@ -406,6 +406,7 @@ public:
|
||||||
int numHeads() const { return m_xinerama_num_heads; }
|
int numHeads() const { return m_xinerama_num_heads; }
|
||||||
|
|
||||||
void initXinerama();
|
void initXinerama();
|
||||||
|
void clearHeads();
|
||||||
/**
|
/**
|
||||||
* Determines head number for a position
|
* Determines head number for a position
|
||||||
* @param x position in pixels on the screen
|
* @param x position in pixels on the screen
|
||||||
|
|
Loading…
Reference in a new issue