aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-07-25 15:47:42 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-07-30 16:22:49 (GMT)
commitbccb185cd9e4efd1db2e5244ba1a1956f750f9cd (patch)
tree69a1756061719eaf0764479942f1139f8694d2e5 /src/fluxbox.cc
parent6defd9391d16fe99422d12c2ab5475929087c11f (diff)
downloadfluxbox-bccb185cd9e4efd1db2e5244ba1a1956f750f9cd.zip
fluxbox-bccb185cd9e4efd1db2e5244ba1a1956f750f9cd.tar.bz2
reconfigTheme's on loading a new style
Also reconfigure menus (recursively) on style load The most critical call is the shape update - the menus often become cut-off, preventing mouse interaction with lower items, but also colors are not applied correctly to menus w/o updating them. BUG 1022 is most likely this and only a misinterpretation (for the mentioned items are those with lacking color updates on style updates) BUG: 1146 BUG: 1017 CCBUG: 1022
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 492b64d..3907d29 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -56,6 +56,7 @@
56#include "FbTk/Compose.hh" 56#include "FbTk/Compose.hh"
57#include "FbTk/KeyUtil.hh" 57#include "FbTk/KeyUtil.hh"
58#include "FbTk/MemFun.hh" 58#include "FbTk/MemFun.hh"
59#include "FbTk/MenuItem.hh"
59 60
60#ifdef USE_EWMH 61#ifdef USE_EWMH
61#include "Ewmh.hh" 62#include "Ewmh.hh"
@@ -1261,6 +1262,35 @@ void Fluxbox::reconfigure() {
1261 m_reconfig_timer.start(); 1262 m_reconfig_timer.start();
1262} 1263}
1263 1264
1265// TODO: once c++11 is required, make this a local var and a closure
1266static std::list<FbTk::Menu*> s_seenMenus;
1267static void rec_reconfigMenu(FbTk::Menu *menu) {
1268 if (!menu || std::find(s_seenMenus.begin(), s_seenMenus.end(), menu) != s_seenMenus.end())
1269 return;
1270 s_seenMenus.push_back(menu);
1271 menu->reconfigure();
1272 for (size_t i = 0; i < menu->numberOfItems(); ++i)
1273 rec_reconfigMenu(menu->find(i)->submenu());
1274}
1275
1276
1277void Fluxbox::reconfigThemes() {
1278 for (ScreenList::iterator it = m_screens.begin(), end = m_screens.end(); it != end; ++it) {
1279 (*it)->focusedWinFrameTheme()->reconfigTheme();
1280 (*it)->unfocusedWinFrameTheme()->reconfigTheme();
1281 (*it)->menuTheme()->reconfigTheme();
1282 (*it)->rootTheme()->reconfigTheme();
1283 (*it)->focusedWinButtonTheme()->reconfigTheme();
1284 (*it)->unfocusedWinButtonTheme()->reconfigTheme();
1285 (*it)->pressedWinButtonTheme()->reconfigTheme();
1286
1287 rec_reconfigMenu(&(*it)->rootMenu());
1288 rec_reconfigMenu(&(*it)->configMenu());
1289 rec_reconfigMenu(&(*it)->windowMenu());
1290 rec_reconfigMenu(&(*it)->workspaceMenu());
1291 s_seenMenus.clear();
1292 }
1293}
1264 1294
1265void Fluxbox::real_reconfigure() { 1295void Fluxbox::real_reconfigure() {
1266 1296