mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
selection: remove selection_enabled()
Its name did not reflect its semantics. Since it was only used in a single place, “inline” it there, and get rid of it.
This commit is contained in:
parent
d6b1dbf8d9
commit
eff8481cdc
3 changed files with 4 additions and 12 deletions
10
selection.c
10
selection.c
|
|
@ -33,16 +33,6 @@ static const char *const mime_type_map[] = {
|
||||||
[DATA_OFFER_MIME_URI_LIST] = "text/uri-list",
|
[DATA_OFFER_MIME_URI_LIST] = "text/uri-list",
|
||||||
};
|
};
|
||||||
|
|
||||||
bool
|
|
||||||
selection_enabled(const struct terminal *term, struct seat *seat)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
seat->mouse.col >= 0 && seat->mouse.row >= 0 &&
|
|
||||||
(term->mouse_tracking == MOUSE_NONE ||
|
|
||||||
term_mouse_grabbed(term, seat) ||
|
|
||||||
term->is_searching);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
selection_on_rows(const struct terminal *term, int row_start, int row_end)
|
selection_on_rows(const struct terminal *term, int row_start, int row_end)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
extern const struct wl_data_device_listener data_device_listener;
|
extern const struct wl_data_device_listener data_device_listener;
|
||||||
extern const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener;
|
extern const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener;
|
||||||
|
|
||||||
bool selection_enabled(const struct terminal *term, struct seat *seat);
|
|
||||||
void selection_start(
|
void selection_start(
|
||||||
struct terminal *term, int col, int row,
|
struct terminal *term, int col, int row,
|
||||||
enum selection_kind new_kind, bool spaces_only);
|
enum selection_kind new_kind, bool spaces_only);
|
||||||
|
|
|
||||||
|
|
@ -2570,7 +2570,10 @@ term_xcursor_update_for_seat(struct terminal *term, struct seat *seat)
|
||||||
const char *xcursor
|
const char *xcursor
|
||||||
= seat->pointer.hidden ? XCURSOR_HIDDEN
|
= seat->pointer.hidden ? XCURSOR_HIDDEN
|
||||||
: term->is_searching ? XCURSOR_LEFT_PTR
|
: term->is_searching ? XCURSOR_LEFT_PTR
|
||||||
: selection_enabled(term, seat) ? XCURSOR_TEXT
|
: (seat->mouse.col >= 0 &&
|
||||||
|
seat->mouse.row >= 0 &&
|
||||||
|
term_mouse_grabbed(term, seat)) ? XCURSOR_TEXT
|
||||||
|
: term->is_searching ? XCURSOR_TEXT
|
||||||
: XCURSOR_LEFT_PTR;
|
: XCURSOR_LEFT_PTR;
|
||||||
|
|
||||||
render_xcursor_set(seat, term, xcursor);
|
render_xcursor_set(seat, term, xcursor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue