aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/Menu.cc2
-rw-r--r--src/FbTk/MenuItem.cc7
-rw-r--r--src/FbTk/Subject.cc2
-rw-r--r--src/MenuCreator.cc2
-rw-r--r--src/Remember.cc2
-rw-r--r--src/Toolbar.cc2
-rw-r--r--src/Window.cc6
7 files changed, 15 insertions, 8 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index f10f1b7..23efcfe 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -502,7 +502,7 @@ void Menu::updateMenu(int active_index) {
502 502
503void Menu::show() { 503void Menu::show() {
504 504
505 if (isVisible() || !menuitems.size()) 505 if (isVisible() || menuitems.empty())
506 return; 506 return;
507 507
508 m_visible = true; 508 m_visible = true;
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc
index b598c47..2576d2b 100644
--- a/src/FbTk/MenuItem.cc
+++ b/src/FbTk/MenuItem.cc
@@ -34,8 +34,11 @@
34namespace FbTk { 34namespace FbTk {
35 35
36void MenuItem::click(int button, int time) { 36void MenuItem::click(int button, int time) {
37 if (m_command.get() != 0) 37 if (m_command.get() != 0) {
38 m_command->execute(); 38 // we need a local variable, since the command may destroy this object
39 RefCount<Command> tmp(m_command);
40 tmp->execute();
41 }
39} 42}
40 43
41void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size, 44void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size,
diff --git a/src/FbTk/Subject.cc b/src/FbTk/Subject.cc
index 2b30fd8..08a211c 100644
--- a/src/FbTk/Subject.cc
+++ b/src/FbTk/Subject.cc
@@ -64,7 +64,7 @@ void Subject::notify() {
64 m_notify_mode = false; 64 m_notify_mode = false;
65 65
66 // remove dead observers 66 // remove dead observers
67 if (m_dead_observers.size()) { 67 if (!m_dead_observers.empty()) {
68 std::for_each(m_dead_observers.begin(), 68 std::for_each(m_dead_observers.begin(),
69 m_dead_observers.end(), 69 m_dead_observers.end(),
70 std::bind1st(std::mem_fun(&Subject::detach), this)); 70 std::bind1st(std::mem_fun(&Subject::detach), this));
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index 3c2843f..a99d785 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -323,7 +323,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
323 if (submenu == 0) 323 if (submenu == 0)
324 return; 324 return;
325 325
326 if (str_cmd.size()) 326 if (!str_cmd.empty())
327 submenu->setLabel(str_cmd); 327 submenu->setLabel(str_cmd);
328 else 328 else
329 submenu->setLabel(str_label); 329 submenu->setLabel(str_label);
diff --git a/src/Remember.cc b/src/Remember.cc
index 017188e..fbb4a2e 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -387,7 +387,7 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
387 387
388 bool had_error = false; 388 bool had_error = false;
389 389
390 if (!str_key.size()) 390 if (str_key.empty())
391 continue; //read next line 391 continue; //read next line
392 if (strcasecmp(str_key.c_str(), "Workspace") == 0) { 392 if (strcasecmp(str_key.c_str(), "Workspace") == 0) {
393 unsigned int w; 393 unsigned int w;
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index c5eff60..54ee239 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -416,7 +416,7 @@ void Toolbar::reconfigure() {
416 416
417 m_tools = tools; // copy values 417 m_tools = tools; // copy values
418 418
419 if (m_tools.size()) { 419 if (!m_tools.empty()) {
420 // make lower case 420 // make lower case
421 transform(m_tools.begin(), m_tools.end(), 421 transform(m_tools.begin(), m_tools.end(),
422 m_tools.begin(), 422 m_tools.begin(),
diff --git a/src/Window.cc b/src/Window.cc
index b9ef2ff..a5cf6fd 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2605,10 +2605,14 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
2605 2605
2606void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) { 2606void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
2607 2607
2608 if ((re.button == 1) && (re.state & Mod1Mask) && !screen().clickRaises()) 2608 if ((re.button == 1) && (re.state & Fluxbox::instance()->getModKey())
2609 && !screen().clickRaises()) {
2610
2609 if (!isMoving()) 2611 if (!isMoving())
2610 raise(); 2612 raise();
2611 2613
2614 }
2615
2612 if (isMoving()) 2616 if (isMoving())
2613 stopMoving(); 2617 stopMoving();
2614 else if (isResizing()) 2618 else if (isResizing())