all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames
       [not found] ` <20191006165511.71FAB206AB@vcs0.savannah.gnu.org>
@ 2019-10-06 22:20   ` Andreas Schwab
  2019-10-06 23:02     ` Juri Linkov
  2019-10-07 16:07     ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Schwab @ 2019-10-06 22:20 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

On Okt 06 2019, eliz@gnu.org (Eli Zaretskii) wrote:

> +/* 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’?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames
  2019-10-06 22:20   ` master ad76020 1/2: Support mouse clicks on tab bar on TTY frames Andreas Schwab
@ 2019-10-06 23:02     ` Juri Linkov
  2019-10-07 16:08       ` Eli Zaretskii
  2019-10-07 16:07     ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2019-10-06 23:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Eli Zaretskii, emacs-devel

>> +/* 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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames
  2019-10-06 22:20   ` master ad76020 1/2: Support mouse clicks on tab bar on TTY frames Andreas Schwab
  2019-10-06 23:02     ` Juri Linkov
@ 2019-10-07 16:07     ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2019-10-07 16:07 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 07 Oct 2019 00:20:32 +0200
> 
> 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’?

Sorry about that.  This is exactly why I hate terminal-specific struct
members in the display engine.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master ad76020 1/2: Support mouse clicks on tab bar on TTY frames
  2019-10-06 23:02     ` Juri Linkov
@ 2019-10-07 16:08       ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2019-10-07 16:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: schwab, emacs-devel

> From: Juri Linkov <juri@linkov.net>
> Cc: emacs-devel@gnu.org,  Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 07 Oct 2019 02:02:20 +0300
> 
> Maybe Eli has a better fix, but at least now I fixed compilation to not fail.

Thanks, your fix was exactly the right one.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-07 16:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20191006165510.22230.58295@vcs0.savannah.gnu.org>
     [not found] ` <20191006165511.71FAB206AB@vcs0.savannah.gnu.org>
2019-10-06 22:20   ` master ad76020 1/2: Support mouse clicks on tab bar on TTY frames Andreas Schwab
2019-10-06 23:02     ` Juri Linkov
2019-10-07 16:08       ` Eli Zaretskii
2019-10-07 16:07     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.