aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-08 16:20:34 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-08 16:20:34 +0000
commit04e566492cd831f038afb5ef8908453efca84cde (patch)
tree4c1afad056fa981fdc4293b4bc9afeeb22db9ea1
parentmulti-seat: re-enable mouse button+motion reporting support (diff)
multi-seat: re-enable scrollback search support
-rw-r--r--input.c2
-rw-r--r--search.c35
-rw-r--r--search.h4
-rw-r--r--wayland.c4
4 files changed, 16 insertions, 29 deletions
diff --git a/input.c b/input.c
index 67d28102..1980e2b5 100644
--- a/input.c
+++ b/input.c
@@ -553,7 +553,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
if (term->is_searching) {
if (should_repeat)
start_repeater(seat, key - 8);
- search_input(term, key, sym, effective_mods, serial);
+ search_input(seat, term, key, sym, effective_mods, serial);
return;
}
diff --git a/search.c b/search.c
index 7d52bf47..17b1a05e 100644
--- a/search.c
+++ b/search.c
@@ -18,7 +18,6 @@
#include "shm.h"
#include "util.h"
-#if 0
static bool
search_ensure_size(struct terminal *term, size_t wanted_size)
{
@@ -37,7 +36,6 @@ search_ensure_size(struct terminal *term, size_t wanted_size)
return true;
}
-#endif
static void
search_cancel_keep_selection(struct terminal *term)
@@ -101,7 +99,6 @@ search_cancel(struct terminal *term)
selection_cancel(term);
}
-#if 0
static void
search_update_selection(struct terminal *term,
int start_row, int start_col,
@@ -171,8 +168,7 @@ search_update_selection(struct terminal *term,
selection_update(term, end_col, selection_row);
}
}
-#endif
-#if 0
+
static void
search_find_next(struct terminal *term)
{
@@ -285,8 +281,7 @@ search_find_next(struct terminal *term)
selection_cancel(term);
#undef ROW_DEC
}
-#endif
-#if 0
+
static void
search_match_to_end_of_word(struct terminal *term, bool spaces_only)
{
@@ -361,8 +356,7 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
search_update_selection(
term, term->search.match.row, term->search.match.col, end_row, end_col);
}
-#endif
-#if 0
+
static size_t
distance_next_word(const struct terminal *term)
{
@@ -390,8 +384,7 @@ distance_next_word(const struct terminal *term)
return cursor - term->search.cursor;
}
-#endif
-#if 0
+
static size_t
distance_prev_word(const struct terminal *term)
{
@@ -417,8 +410,7 @@ distance_prev_word(const struct terminal *term)
return term->search.cursor - cursor;
}
-#endif
-#if 0
+
static bool
execute_binding(struct terminal *term, enum bind_action_search action,
uint32_t serial)
@@ -575,20 +567,18 @@ execute_binding(struct terminal *term, enum bind_action_search action,
assert(false);
return false;
}
-#endif
void
-search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym,
- xkb_mod_mask_t mods, uint32_t serial)
+search_input(struct seat *seat, struct terminal *term, uint32_t key,
+ xkb_keysym_t sym, xkb_mod_mask_t mods, uint32_t serial)
{
-#if 0
LOG_DBG("search: input: sym=%d/0x%x, mods=0x%08x", sym, sym, mods);
enum xkb_compose_status compose_status = xkb_compose_state_get_status(
- term->wl->kbd.xkb_compose_state);
+ seat->kbd.xkb_compose_state);
/* Key bindings */
- tll_foreach(term->wl->kbd.bindings.search, it) {
+ tll_foreach(seat->kbd.bindings.search, it) {
if (it->item.bind.mods != mods)
continue;
@@ -614,13 +604,13 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym,
if (compose_status == XKB_COMPOSE_COMPOSED) {
count = xkb_compose_state_get_utf8(
- term->wl->kbd.xkb_compose_state, (char *)buf, sizeof(buf));
- xkb_compose_state_reset(term->wl->kbd.xkb_compose_state);
+ seat->kbd.xkb_compose_state, (char *)buf, sizeof(buf));
+ xkb_compose_state_reset(seat->kbd.xkb_compose_state);
} else if (compose_status == XKB_COMPOSE_CANCELLED) {
count = 0;
} else {
count = xkb_state_key_get_utf8(
- term->wl->kbd.xkb_state, key, (char *)buf, sizeof(buf));
+ seat->kbd.xkb_state, key, (char *)buf, sizeof(buf));
}
const char *src = (const char *)buf;
@@ -653,5 +643,4 @@ update_search:
LOG_DBG("search: buffer: %S", term->search.buf);
search_find_next(term);
render_refresh_search(term);
-#endif
}
diff --git a/search.h b/search.h
index 69930c07..178b6140 100644
--- a/search.h
+++ b/search.h
@@ -5,5 +5,5 @@
void search_begin(struct terminal *term);
void search_cancel(struct terminal *term);
-void search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask_t mods,
- uint32_t serial);
+void search_input(struct seat *seat, struct terminal *term, uint32_t key,
+ xkb_keysym_t sym, xkb_mod_mask_t mods, uint32_t serial);
diff --git a/wayland.c b/wayland.c
index 19f8ce3e..54d65927 100644
--- a/wayland.c
+++ b/wayland.c
@@ -958,6 +958,7 @@ wayl_init(const struct config *conf, struct fdm *fdm)
goto out;
}
+ /* Trigger listeners registered when handling globals */
wl_display_roundtrip(wayl->display);
if (!wayl->have_argb8888) {
@@ -976,9 +977,6 @@ wayl_init(const struct config *conf, struct fdm *fdm)
it->item.ppi.scaled.x, it->item.ppi.scaled.y);
}
-#if 0
-#endif
-
wayl->fd = wl_display_get_fd(wayl->display);
if (fcntl(wayl->fd, F_SETFL, fcntl(wayl->fd, F_GETFL) | O_NONBLOCK) < 0) {
LOG_ERRNO("failed to make Wayland socket non-blocking");