[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames
From: |
Juri Linkov |
Subject: |
Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames |
Date: |
Mon, 07 Oct 2019 02:02:20 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>> +/* Handle a mouse click at X/Y on the tab bar of TTY frame F. If the
>> + click was on the tab bar and was handled, populate the EVENT
>> + structure, store it in keyboard queue, and return true; otherwise
>> + return false. MODIFIERS are event modifiers for generating the tab
>> + release event. */
>> +bool
>> +tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p,
>> + struct input_event *event)
>> +{
>> + /* Did they click on the tab bar? */
>> + if (y < FRAME_MENU_BAR_LINES (f)
>> + || y >= FRAME_MENU_BAR_LINES (f) + FRAME_TAB_BAR_LINES (f))
>> + return false;
>> +
>> + /* Find the tab-bar item where the X,Y coordinates belong. */
>> + int prop_idx;
>> + ptrdiff_t clen;
>> + Lisp_Object caption = tty_get_tab_bar_item (f, x, &prop_idx, &clen);
>> +
>> + if (NILP (caption))
>> + return false;
>> +
>> + if (NILP (AREF (f->tab_bar_items,
>> + prop_idx * TAB_BAR_ITEM_NSLOTS + TAB_BAR_ITEM_ENABLED_P)))
>> + return false;
>> +
>> + if (down_p)
>> + f->last_tab_bar_item = prop_idx;
>
> That breaks no-x build:
>
> xdisp.c:13477:8: error: ‘struct frame’ has no member named
> ‘last_tab_bar_item’; did you mean ‘n_tab_bar_items’?
Maybe Eli has a better fix, but at least now I fixed compilation to not fail.