]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Two fixes involving RtL text drawing
[lyx.git] / src / lyxfunc.C
index 0964eba16541267a52d1e5f22a66d5659d4d8dc6..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())
@@ -1408,6 +1411,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                    || inset_code == it->lyxCode())
                                        it->dispatch(cur, fr);
                        }
+                       update = true;
                        break;
                }
 
@@ -1484,7 +1488,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
 
                case LFUN_TEXTCLASS_APPLY: {
-                       recordUndoFullDocument(view());
                        Buffer * buffer = owner->buffer();
 
                        lyx::textclass_type const old_class =
@@ -1504,6 +1507,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
 
                        owner->message(_("Converting document to new document class..."));
+                       recordUndoFullDocument(view());
+                       buffer->params().textclass = new_class;
                        StableDocIterator backcur(view()->cursor());
                        ErrorList el;
                        lyx::cap::SwitchBetweenClasses(
@@ -1575,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);