From: Jean-Marc Lasgouttes Date: Wed, 21 Sep 2005 13:18:15 +0000 (+0000) Subject: fix bug 1941: toolbars disabled after dialog action X-Git-Tag: 1.6.10~13896 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3781da95c0c3872a2d1e18abd5a301c34e68829c;p=lyx.git fix bug 1941: toolbars disabled after dialog action git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10472 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index c0c6ac8639..8e2b76bed7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-09-12 Jean-Marc Lasgouttes + + * lyxfunc.C (sendDispatchMessage): do not update menubar/toolbar + when command is internal. (bug 1941) + 2005-09-20 Jean-Marc Lasgouttes * text2.C (cursorRight): do not honor boundary when at the end of diff --git a/src/lyxfunc.C b/src/lyxfunc.C index b0b0aa610d..274ff9678e 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -338,6 +338,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const application can still be accessed without giving focus to the main window. In this case, we want to disable the menu entries that are buffer-related. + + Note that this code is not perfect, as bug 1941 attests: + http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4 */ Buffer * buf; if (cmd.origin == FuncRequest::UI && !owner->hasFocus()) @@ -1577,8 +1580,15 @@ void LyXFunc::dispatch(FuncRequest const & cmd) void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & cmd) { - owner->updateMenubar(); - owner->updateToolbars(); + /* When an action did not originate from the UI/kbd, it makes + * sense to avoid updating the GUI. It turns out that this + * fixes bug 1941, for reasons that are described here: + * http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4 + */ + if (cmd.origin != FuncRequest::INTERNAL) { + owner->updateMenubar(); + owner->updateToolbars(); + } const bool verbose = (cmd.origin == FuncRequest::UI || cmd.origin == FuncRequest::COMMANDBUFFER);