Don't move the history needle when recording

This commit is contained in:
Bastien Dejean 2013-10-10 18:35:12 +02:00
parent fc041e8ba1
commit cb8415939b

View file

@ -169,7 +169,7 @@ monitor_t *history_get_monitor(monitor_t *m)
bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, client_select_t sel)
{
if (history_needle == NULL)
if (history_needle == NULL || record_history)
history_needle = history_tail;
history_t *h;
@ -180,7 +180,8 @@ bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst
|| !is_visible(h->loc.desktop, h->loc.node)
|| !node_matches(&h->loc, ref, sel))
continue;
history_needle = h;
if (!record_history)
history_needle = h;
*dst = h->loc;
return true;
}
@ -189,7 +190,7 @@ bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst
bool history_find_desktop(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, desktop_select_t sel)
{
if (history_needle == NULL)
if (history_needle == NULL || record_history)
history_needle = history_tail;
history_t *h;
@ -199,7 +200,8 @@ bool history_find_desktop(history_dir_t hdi, coordinates_t *ref, coordinates_t *
|| (h->loc.desktop == ref->desktop)
|| !desktop_matches(&h->loc, ref, sel))
continue;
history_needle = h;
if (!record_history)
history_needle = h;
*dst = h->loc;
return true;
}
@ -208,7 +210,7 @@ bool history_find_desktop(history_dir_t hdi, coordinates_t *ref, coordinates_t *
bool history_find_monitor(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, desktop_select_t sel)
{
if (history_needle == NULL)
if (history_needle == NULL || record_history)
history_needle = history_tail;
history_t *h;
@ -218,7 +220,8 @@ bool history_find_monitor(history_dir_t hdi, coordinates_t *ref, coordinates_t *
|| (h->loc.monitor == ref->monitor)
|| !desktop_matches(&h->loc, ref, sel))
continue;
history_needle = h;
if (!record_history)
history_needle = h;
*dst = h->loc;
return true;
}