aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-14 23:22:01 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-14 23:22:01 (GMT)
commit2b62cf973318978bc222db7719552148275887db (patch)
tree71722be7f293a2433bfbc1de8b32d2ca338d8aa8 /src/Window.cc
parentc6047e9ebab5a0551c866078ed29fdda1e6b8174 (diff)
downloadfluxbox-2b62cf973318978bc222db7719552148275887db.zip
fluxbox-2b62cf973318978bc222db7719552148275887db.tar.bz2
cleanup and code deduplication
* ClientPattern.cc: make compiler happy (complaints about XPROP not handled in switch) * FbTk/FbPixmap.cc FbTk/StringUtil.cc: signed vs unsigned * FbTk/FbString.cc: missing return * WinClient.cc: create atoms only once; use helper function * Window.cc: use a helper function
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 1837cee..79e9b43 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -133,6 +133,16 @@ WinClient *getRootTransientFor(WinClient *client) {
133} 133}
134 134
135 135
136void callForAllTransient(FluxboxWindow& win, void (*callFunc)(FluxboxWindow&)) {
137 WinClient::TransientList::const_iterator it = win.winClient().transientList().begin();
138 WinClient::TransientList::const_iterator it_end = win.winClient().transientList().end();
139 for (; it != it_end; ++it) {
140 if ((*it)->fbwindow() && !(*it)->fbwindow()->isIconic())
141 // TODO: should we also check if it is the active client?
142 callFunc(*(*it)->fbwindow());
143 }
144}
145
136/// raise window and do the same for each transient of the current window 146/// raise window and do the same for each transient of the current window
137void raiseFluxboxWindow(FluxboxWindow &win) { 147void raiseFluxboxWindow(FluxboxWindow &win) {
138 if (win.oplock) 148 if (win.oplock)
@@ -150,19 +160,10 @@ void raiseFluxboxWindow(FluxboxWindow &win) {
150 160
151 win.layerItem().raise(); 161 win.layerItem().raise();
152 162
153 // for each transient do raise 163 callForAllTransient(win, raiseFluxboxWindow);
154
155 WinClient::TransientList::const_iterator it = win.winClient().transientList().begin();
156 WinClient::TransientList::const_iterator it_end = win.winClient().transientList().end();
157 for (; it != it_end; ++it) {
158 if ((*it)->fbwindow() && !(*it)->fbwindow()->isIconic())
159 // TODO: should we also check if it is the active client?
160 raiseFluxboxWindow(*(*it)->fbwindow());
161 }
162 164
163 win.oplock = false; 165 win.oplock = false;
164 166
165
166 if (!win.winClient().transientList().empty()) 167 if (!win.winClient().transientList().empty())
167 win.screen().layerManager().unlock(); 168 win.screen().layerManager().unlock();
168 169
@@ -210,16 +211,9 @@ void tempRaiseFluxboxWindow(FluxboxWindow &win) {
210 win.layerItem().tempRaise(); 211 win.layerItem().tempRaise();
211 } 212 }
212 213
213 // for each transient do raise 214 callForAllTransient(win, tempRaiseFluxboxWindow);
214 WinClient::TransientList::const_iterator it = win.winClient().transientList().begin();
215 WinClient::TransientList::const_iterator it_end = win.winClient().transientList().end();
216 for (; it != it_end; ++it) {
217 if ((*it)->fbwindow() && !(*it)->fbwindow()->isIconic())
218 // TODO: should we also check if it is the active client?
219 tempRaiseFluxboxWindow(*(*it)->fbwindow());
220 }
221 win.oplock = false;
222 215
216 win.oplock = false;
223} 217}
224 218
225class SetClientCmd:public FbTk::Command<void> { 219class SetClientCmd:public FbTk::Command<void> {
@@ -1063,8 +1057,8 @@ void FluxboxWindow::reconfigure() {
1063 m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); 1057 m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay());
1064 1058
1065 updateButtons(); 1059 updateButtons();
1066 frame().reconfigure();
1067 1060
1061 frame().reconfigure();
1068 menu().reconfigure(); 1062 menu().reconfigure();
1069 1063
1070 Client2ButtonMap::iterator it = m_labelbuttons.begin(), 1064 Client2ButtonMap::iterator it = m_labelbuttons.begin(),