aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2007-03-01 22:18:18 (GMT)
committerTomas Janousek <tomi@nomi.cz>2008-01-27 14:01:14 (GMT)
commitb405d36151d3a6d3074eb6bafb541a1d6228d85e (patch)
treeac67fd02067fb473348972a3a4d40272d99666e0 /src
parent8c3f2a8e0378ff5d649ce831b995669874fd1056 (diff)
downloadfluxbox-b405d36151d3a6d3074eb6bafb541a1d6228d85e.zip
fluxbox-b405d36151d3a6d3074eb6bafb541a1d6228d85e.tar.bz2
Move windows out of inactive heads upon layout change.
Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc19
-rw-r--r--src/Screen.hh1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index c6379a0..36b1918 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1909,6 +1909,9 @@ void BScreen::updateSize() {
1909 // send resize notify 1909 // send resize notify
1910 m_resize_sig.notify(); 1910 m_resize_sig.notify();
1911 m_workspace_area_sig.notify(); 1911 m_workspace_area_sig.notify();
1912
1913 // move windows out of inactive heads
1914 clearHeads();
1912} 1915}
1913 1916
1914 1917
@@ -2020,6 +2023,22 @@ notactive:
2020 2023
2021} 2024}
2022 2025
2026/* Move windows out of inactive heads */
2027void BScreen::clearHeads() {
2028 if (!hasXinerama()) return;
2029
2030 for (Workspaces::iterator i = m_workspaces_list.begin();
2031 i != m_workspaces_list.end(); i++) {
2032 for (Workspace::Windows::iterator win = (*i)->windowList().begin();
2033 win != (*i)->windowList().end(); win++) {
2034 if (getHead((*win)->fbWindow()) == 0) {
2035 // first head is a safe bet here
2036 (*win)->placeWindow(1);
2037 }
2038 }
2039 }
2040}
2041
2023int BScreen::getHead(int x, int y) const { 2042int BScreen::getHead(int x, int y) const {
2024 if (!hasXinerama()) return 0; 2043 if (!hasXinerama()) return 0;
2025#ifdef XINERAMA 2044#ifdef XINERAMA
diff --git a/src/Screen.hh b/src/Screen.hh
index c95e573..f0dbcc6 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -406,6 +406,7 @@ public:
406 int numHeads() const { return m_xinerama_num_heads; } 406 int numHeads() const { return m_xinerama_num_heads; }
407 407
408 void initXinerama(); 408 void initXinerama();
409 void clearHeads();
409 /** 410 /**
410 * Determines head number for a position 411 * Determines head number for a position
411 * @param x position in pixels on the screen 412 * @param x position in pixels on the screen