]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Fix reloading of local layout file (bug #11120)
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index 110b63ec21b2cc4e1020fdeeccc5f8b693177d80..79f14d64582840a3bf00600734b47369b3429a72 100644 (file)
 #include <X11/Xatom.h>
 #include <X11/Xlib.h>
 #include <QX11Info>
+#undef CursorShape
 #undef None
 #elif defined(QPA_XCB)
 #include <xcb/xcb.h>
@@ -1395,16 +1396,18 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
                current_view_->currentBufferView()->cursor().saveBeforeDispatchPosXY();
                buffer = &current_view_->currentBufferView()->buffer();
        }
-       // This handles undo groups automagically
-       UndoGroupHelper ugh(buffer);
 
        DispatchResult dr;
+       dr.screenUpdate(Update::FitCursor);
+       {
+               // This handles undo groups automagically
+               UndoGroupHelper ugh(buffer);
+               dispatch(cmd, dr);
+       }
+
        // redraw the screen at the end (first of the two drawing steps).
        // This is done unless explicitly requested otherwise
-       dr.screenUpdate(Update::FitCursor);
-       dispatch(cmd, dr);
        updateCurrentView(cmd, dr);
-
        d->dispatch_result_ = dr;
        return d->dispatch_result_;
 }
@@ -1721,8 +1724,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        }
 
        case LFUN_SET_COLOR: {
-               string lyx_name;
-               string const x11_name = split(to_utf8(cmd.argument()), lyx_name, ' ');
+               string const lyx_name = cmd.getArg(0);
+               string const x11_name = cmd.getArg(1);
                if (lyx_name.empty() || x11_name.empty()) {
                        if (current_view_)
                                current_view_->message(
@@ -1849,8 +1852,11 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        dr.setMessage(bformat(_("Cannot iterate more than %1$d times"), max_iter));
                        dr.setError(true);
                } else {
-                       for (int i = 0; i < count; ++i)
-                               dispatch(lyxaction.lookupFunc(rest));
+                       for (int i = 0; i < count; ++i) {
+                               FuncRequest lfun = lyxaction.lookupFunc(rest);
+                               lfun.allowAsync(false);
+                               dispatch(lfun);
+                       }
                }
                break;
        }
@@ -1867,6 +1873,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        string first;
                        arg = split(arg, first, ';');
                        FuncRequest func(lyxaction.lookupFunc(first));
+                       func.allowAsync(false);
                        func.setOrigin(cmd.origin());
                        dispatch(func);
                }