diff --git a/docs/radials.example.json b/docs/radials.example.json index 95efa6a..29f4b82 100644 --- a/docs/radials.example.json +++ b/docs/radials.example.json @@ -30,8 +30,8 @@ "name": "window", "button": "MiddleButton", "slices": [ - { "label": "Split ▯▯", "action": "view_split_vert" }, - { "label": "Split ⊟", "action": "view_split_horiz" }, + { "label": "Split |", "action": "view_split_vert" }, + { "label": "Split —", "action": "view_split_horiz" }, { "label": "Close", "action": "view_close_current_space" }, { "label": "Only", "action": "view_close_others" }, { "label": "Rotate", "action": "view_split_toggle" }, diff --git a/src/plugin/ollieplugin.cpp b/src/plugin/ollieplugin.cpp index 1696279..a067c36 100644 --- a/src/plugin/ollieplugin.cpp +++ b/src/plugin/ollieplugin.cpp @@ -46,8 +46,9 @@ namespace katecustom namespace { -// True for the Kate actions that move keyboard focus to another split pane. -// After one of these fires we warp the mouse pointer onto the new pane so the +// True for the Kate actions that change which split pane is active: moving +// focus between panes, or creating a split (Kate activates the new pane). After +// one of these fires we warp the mouse pointer onto the now-active pane so the // cursor follows the focus (mouse-first UX). bool isPaneFocusAction(const QString &id) { @@ -56,7 +57,9 @@ bool isPaneFocusAction(const QString &id) || id == QLatin1String("go_upward_split_view") || id == QLatin1String("go_downward_split_view") || id == QLatin1String("go_next_split_view") - || id == QLatin1String("go_prev_split_view"); + || id == QLatin1String("go_prev_split_view") + || id == QLatin1String("view_split_vert") + || id == QLatin1String("view_split_horiz"); } // Bracket pairs understood by the double-click selection feature. @@ -1152,11 +1155,12 @@ void OllieView::onRadialActivated(const QString &actionId) } if (QAction *a = findActionByName(actionId)) { a->trigger(); - // If this moved focus to another split pane, warp the pointer onto that - // pane so the mouse follows the focus. Deferred to the next event-loop - // turn so Kate has finished activating the target view first. + // If this changed the active pane (focus move, or a split that creates + // and activates a new pane), warp the pointer onto it so the mouse + // follows the focus. Deferred by ~a frame so Kate has finished + // activating — and, for a freshly created split, laying out — the pane. if (isPaneFocusAction(actionId)) { - QTimer::singleShot(0, this, [this]() { warpCursorToActiveView(); }); + QTimer::singleShot(16, this, [this]() { warpCursorToActiveView(); }); } } } diff --git a/src/radial/radialconfig.cpp b/src/radial/radialconfig.cpp index 12383a8..e77b6fc 100644 --- a/src/radial/radialconfig.cpp +++ b/src/radial/radialconfig.cpp @@ -193,8 +193,8 @@ QList RadialConfig::builtinDefault() }; window.root.children = { - leaf(QStringLiteral("Split ▯▯"), QStringLiteral("view_split_vert")), - leaf(QStringLiteral("Split ⊟"), QStringLiteral("view_split_horiz")), + leaf(QStringLiteral("Split |"), QStringLiteral("view_split_vert")), + leaf(QStringLiteral("Split —"), QStringLiteral("view_split_horiz")), leaf(QStringLiteral("Close"), QStringLiteral("view_close_current_space")), leaf(QStringLiteral("Only"), QStringLiteral("view_close_others")), leaf(QStringLiteral("Rotate"), QStringLiteral("view_split_toggle")),