]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Avoid extra space in tooltips
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index ee379ffb56990db1f5347f4cc67e28f1483f8510..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_;
 }
@@ -1628,14 +1631,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        case LFUN_SCREEN_FONT_UPDATE: {
                // handle the screen font changes.
                d->font_loader_.update();
-               // Backup current_view_
-               GuiView * view = current_view_;
-               // Set current_view_ to zero to forbid GuiWorkArea::redraw()
-               // to skip the refresh.
-               current_view_ = 0;
-               theBufferList().changed(false);
-               // Restore current_view_
-               current_view_ = view;
+               dr.screenUpdate(Update::Force | Update::FitCursor);
                break;
        }
 
@@ -1728,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(
@@ -1856,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;
        }
@@ -1874,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);
                }