aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-06-08 19:39:12 (GMT)
committermarkt <markt>2007-06-08 19:39:12 (GMT)
commit222d8cd7e9c0f28b3dd0b9b253a0b096d856195f (patch)
treebf6e2e9c61bb43e7c5441e31b28a7c096dbb99e5 /src
parentdff2aa33561b00e97b3561892fb690ba9f2968c6 (diff)
downloadfluxbox_pavel-222d8cd7e9c0f28b3dd0b9b253a0b096d856195f.zip
fluxbox_pavel-222d8cd7e9c0f28b3dd0b9b253a0b096d856195f.tar.bz2
don't tab transient windows from apps file, and change their layers when the main window does
Diffstat (limited to 'src')
-rw-r--r--src/Remember.cc6
-rw-r--r--src/WinClient.cc17
-rw-r--r--src/Window.cc42
3 files changed, 42 insertions, 23 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index e0a7b0f..55816c4 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -1132,8 +1132,10 @@ void Remember::setupFrame(FluxboxWindow &win) {
1132 1132
1133void Remember::setupClient(WinClient &winclient) { 1133void Remember::setupClient(WinClient &winclient) {
1134 1134
1135 if (winclient.screen().isRestart()) 1135 // leave windows alone on restart
1136 return; // don't mess up windows on restart 1136 // don't apply settings to transient windows
1137 if (winclient.screen().isRestart() || winclient.transientFor())
1138 return;
1137 1139
1138 Application *app = find(winclient); 1140 Application *app = find(winclient);
1139 if (app == 0) 1141 if (app == 0)
diff --git a/src/WinClient.cc b/src/WinClient.cc
index b7e14e9..bb6bf10 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -107,6 +107,11 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb
107 // clear transient waiting list for this window 107 // clear transient waiting list for this window
108 s_transient_wait.erase(win); 108 s_transient_wait.erase(win);
109 } 109 }
110
111 // also check if this window is a transient
112 // this needs to be done before creating an fbwindow, so this doesn't get
113 // tabbed using the apps file
114 updateTransientInfo();
110} 115}
111 116
112WinClient::~WinClient() { 117WinClient::~WinClient() {
@@ -263,13 +268,6 @@ void WinClient::updateWMClassHint() {
263} 268}
264 269
265void WinClient::updateTransientInfo() { 270void WinClient::updateTransientInfo() {
266#ifdef DEBUG
267 cerr<<__FUNCTION__<<": m_win = "<<m_win<<endl;
268#endif // DEBUG
269 if (m_win == 0)
270 return;
271
272
273 // remove this from parent 271 // remove this from parent
274 if (transientFor() != 0) { 272 if (transientFor() != 0) {
275 transientFor()->transientList().remove(this); 273 transientFor()->transientList().remove(this);
@@ -293,7 +291,7 @@ void WinClient::updateTransientInfo() {
293 return; 291 return;
294 } 292 }
295 293
296 if (win != None && m_win->screen().rootWindow() == win) { 294 if (win != None && screen().rootWindow() == win) {
297 // transient for root window... = transient for group 295 // transient for root window... = transient for group
298 // I don't think we are group-aware yet 296 // I don't think we are group-aware yet
299 return; 297 return;
@@ -334,9 +332,6 @@ void WinClient::updateTransientInfo() {
334 // we need to add ourself to the right client in 332 // we need to add ourself to the right client in
335 // the transientFor() window so we search client 333 // the transientFor() window so we search client
336 transient_for->transientList().push_back(this); 334 transient_for->transientList().push_back(this);
337
338 if (transientFor()->fbwindow() && transientFor()->fbwindow()->isStuck())
339 m_win->stick();
340 } 335 }
341 336
342} 337}
diff --git a/src/Window.cc b/src/Window.cc
index 46530b7..23e11bf 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -424,8 +424,9 @@ void FluxboxWindow::init() {
424 /* Read state above here, apply state below here. */ 424 /* Read state above here, apply state below here. */
425 /**************************************************/ 425 /**************************************************/
426 426
427 // update transient infomation 427 if (m_client->transientFor() && m_client->transientFor()->fbwindow() &&
428 m_client->updateTransientInfo(); 428 m_client->transientFor()->fbwindow()->isStuck())
429 stick();
429 430
430 // adjust the window decorations based on transience and window sizes 431 // adjust the window decorations based on transience and window sizes
431 if (m_client->isTransient() && !screen().decorateTransient()) { 432 if (m_client->isTransient() && !screen().decorateTransient()) {
@@ -1831,6 +1832,19 @@ void FluxboxWindow::stick() {
1831 m_workspacesig.notify(); 1832 m_workspacesig.notify();
1832 } 1833 }
1833 1834
1835 ClientList::iterator client_it = clientList().begin();
1836 ClientList::iterator client_it_end = clientList().end();
1837 for (; client_it != client_it_end; ++client_it) {
1838
1839 WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin();
1840 WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end();
1841 for (; it != it_end; ++it) {
1842 if ((*it)->fbwindow() && (*it)->fbwindow()->isStuck() != stuck)
1843 (*it)->fbwindow()->stick();
1844 }
1845
1846 }
1847
1834} 1848}
1835 1849
1836 1850
@@ -1939,16 +1953,24 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1939 layernum = win->layerItem().getLayerNum(); 1953 layernum = win->layerItem().getLayerNum();
1940 win->setLayerNum(layernum); 1954 win->setLayerNum(layernum);
1941 1955
1942 WinClient::TransientList::const_iterator it = client->transientList().begin(); 1956 // move all the transients, too
1943 WinClient::TransientList::const_iterator it_end = client->transientList().end(); 1957 ClientList::iterator client_it = win->clientList().begin();
1944 for (; it != it_end; ++it) { 1958 ClientList::iterator client_it_end = win->clientList().end();
1945 win = (*it)->fbwindow(); 1959 for (; client_it != client_it_end; ++client_it) {
1946 if (win && !win->isIconic()) { 1960
1947 screen().updateNetizenWindowRaise((*it)->window()); 1961 WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin();
1948 win->layerItem().moveToLayer(layernum); 1962 WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end();
1949 win->setLayerNum(layernum); 1963 for (; it != it_end; ++it) {
1964 FluxboxWindow *fbwin = (*it)->fbwindow();
1965 if (fbwin && !fbwin->isIconic()) {
1966 screen().updateNetizenWindowRaise((*it)->window());
1967 fbwin->layerItem().moveToLayer(layernum);
1968 fbwin->setLayerNum(layernum);
1969 }
1950 } 1970 }
1971
1951 } 1972 }
1973
1952} 1974}
1953 1975
1954void FluxboxWindow::setFocusHidden(bool value) { 1976void FluxboxWindow::setFocusHidden(bool value) {