From abf2bd26e35d92cd5409ff59476dc832851adfb2 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 13 Jan 2004 12:27:51 +0000 Subject: fixed crash bug --- src/IconButton.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/IconButton.cc b/src/IconButton.cc index 5733e2c..cea49c3 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconButton.cc,v 1.14 2004/01/11 16:08:07 fluxgen Exp $ +// $Id: IconButton.cc,v 1.15 2004/01/13 12:27:51 fluxgen Exp $ #include "IconButton.hh" @@ -77,10 +77,13 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FbTk::RefCount focus(new FbTk::SimpleCommand(m_win, &FluxboxWindow::raiseAndFocus)); FbTk::RefCount hidemenus(new FbTk::SimpleCommand(win.screen(), &BScreen::hideMenus)); - FbTk::MacroCommand *focus_macro = new FbTk::MacroCommand(); - focus_macro->add(hidemenus); - focus_macro->add(focus); - FbTk::RefCount focus_cmd(focus_macro); + //!! TODO: There're some issues with MacroCommand when + // this object dies when the last macrocommand is executed (focused cmd) + // In iconbar mode Icons + // FbTk::MacroCommand *focus_macro = new FbTk::MacroCommand(); + // focus_macro->add(hidemenus); + // focus_macro->add(focus); + FbTk::RefCount focus_cmd(focus); FbTk::RefCount menu_cmd(new ::ShowMenu(m_win)); setOnClick(focus_cmd, 1); setOnClick(menu_cmd, 3); @@ -95,6 +98,7 @@ IconButton::~IconButton() { } + void IconButton::exposeEvent(XExposeEvent &event) { if (m_icon_window == event.window) m_icon_window.clear(); -- cgit v0.11.2