]> git.lyx.org Git - lyx.git/commitdiff
fix bug 1941: toolbars disabled after dialog action
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 21 Sep 2005 13:18:15 +0000 (13:18 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 21 Sep 2005 13:18:15 +0000 (13:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10472 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxfunc.C

index c0c6ac86390d0e5e7fe882ddefbd69037858af86..8e2b76bed7a013417e9c305dfd4679a870903de8 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-12  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * lyxfunc.C (sendDispatchMessage): do not update menubar/toolbar
+       when command is internal. (bug 1941)
+
 2005-09-20  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * text2.C (cursorRight): do not honor boundary when at the end of
index b0b0aa610d2cf82af19ff75d0e2f61ab780aab98..274ff9678e57a053bf7917f45d33028228d9baa6 100644 (file)
@@ -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);