unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* GPM and mouse highlight
@ 2010-08-29  5:39 Eli Zaretskii
  2010-08-29  8:30 ` Jan Djärv
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-08-29  5:39 UTC (permalink / raw)
  To: emacs-devel

A text terminal with a GPM mouse can support mouse highlight.
However, the implementation of this support in term.c uses static
variables to track the highlighted region.  Unless I'm missing
something, this means that this support cannot be available on more
than one terminal device at the same time, even though we have
multi-tty support for quite some time.

By contrast, the GUI sessions (and the MS-DOS port) have these
variables as part of the Display_Info structure and can track several
frames/devices independently.

Questions:

1) Is there some fundamental limitation of GPM that prevents it from
supporting more than a single device at a time?

2) If the answer to the previous question is NO, then should we add
the mouse-highlight related variables to struct tty_display_info on
Unix as well?

I'm asking because, as part of working on mouse highlight of
bidirectional text, I found out that there are 3 separate
implementations of mouse highlight: one for when we
HAVE_WINDOW_SYSTEM, another one for GPM, and yet another for MS-DOS.
Due to this, bugs that were fixed in the GUI version of this support
(e.g., bug#1220) are still there in the other 2 versions.  I'd like to
merge all 3 implementations into a single one.  (If nothing else, it
will save me from writing 3 very similar implementations of bidi-aware
mouse highlighting.)



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

* Re: GPM and mouse highlight
  2010-08-29  5:39 GPM and mouse highlight Eli Zaretskii
@ 2010-08-29  8:30 ` Jan Djärv
  2010-08-29 11:34   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Djärv @ 2010-08-29  8:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Eli Zaretskii skrev 2010-08-29 07.39:

>
> 1) Is there some fundamental limitation of GPM that prevents it from
> supporting more than a single device at a time?

It can support several devices at the same time.  If you are running on two 
different machines there is no problem.  On the same machine however, GPM 
selection acts like X selection, i.e. if you select something in terminal 1 
and then later in terminal 2, the selection in terminal 1 is removed. AFAIK, 
there can only be one GPM process per machine (per mouse really).

>
> 2) If the answer to the previous question is NO, then should we add
> the mouse-highlight related variables to struct tty_display_info on
> Unix as well?
>

Sounds like the right thing to do to me.

	Jan D.



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

* Re: GPM and mouse highlight
  2010-08-29  8:30 ` Jan Djärv
@ 2010-08-29 11:34   ` Eli Zaretskii
  2010-08-29 12:34     ` Jan Djärv
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-08-29 11:34 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel

> Date: Sun, 29 Aug 2010 10:30:56 +0200
> From: Jan Djärv <jan.h.d@swipnet.se>
> CC: emacs-devel@gnu.org
> 
> > 1) Is there some fundamental limitation of GPM that prevents it from
> > supporting more than a single device at a time?
> 
> It can support several devices at the same time.  If you are running on two 
> different machines there is no problem.  On the same machine however, GPM 
> selection acts like X selection, i.e. if you select something in terminal 1 
> and then later in terminal 2, the selection in terminal 1 is removed. AFAIK, 
> there can only be one GPM process per machine (per mouse really).

Thanks.  However, it looks like there's a small misunderstanding here.
I didn't mean mouse selections, I meant mouse highlight when the mouse
pointer hovers above mouse-sensitive text.  We have such highlight in
Info, for example, where moving pointer above menu items and
cross-references changes the mouse cursor and highlights the
mouse-sensitive portion of the text.

You can have this in any buffer by evaluating the following
expression:

  (put-text-property N M 'mouse-face 'highlight)

for two buffer positions N and M.  Moving the mouse above the
specified portion of text will make the text stand out.

Suppose we have several TTY devices open in the same Emacs session.
Can GPM support mouse highlight on more than a single device in such a
session?

> > 2) If the answer to the previous question is NO, then should we add
> > the mouse-highlight related variables to struct tty_display_info on
> > Unix as well?
> >
> 
> Sounds like the right thing to do to me.

Is this also true for the mouse highlight I described above?



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

* Re: GPM and mouse highlight
  2010-08-29 11:34   ` Eli Zaretskii
@ 2010-08-29 12:34     ` Jan Djärv
  2010-08-29 13:43       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Djärv @ 2010-08-29 12:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Eli Zaretskii skrev 2010-08-29 13.34:

>
> Thanks.  However, it looks like there's a small misunderstanding here.
> I didn't mean mouse selections, I meant mouse highlight when the mouse
> pointer hovers above mouse-sensitive text.  We have such highlight in
> Info, for example, where moving pointer above menu items and
> cross-references changes the mouse cursor and highlights the
> mouse-sensitive portion of the text.
>
> You can have this in any buffer by evaluating the following
> expression:
>
>    (put-text-property N M 'mouse-face 'highlight)
>
> for two buffer positions N and M.  Moving the mouse above the
> specified portion of text will make the text stand out.
>
> Suppose we have several TTY devices open in the same Emacs session.
> Can GPM support mouse highlight on more than a single device in such a
> session?

Isn't it Emacs that records and paints hightlights in this case?  GPM only 
supplies the coordinates and the Emacs decides to highlight.  If it is so, 
then GPM has no problem supporting many terminals.


>
>>> 2) If the answer to the previous question is NO, then should we add
>>> the mouse-highlight related variables to struct tty_display_info on
>>> Unix as well?
>>>
>>
>> Sounds like the right thing to do to me.
>
> Is this also true for the mouse highlight I described above?

Yes, I think so.

	Jan D.



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

* Re: GPM and mouse highlight
  2010-08-29 12:34     ` Jan Djärv
@ 2010-08-29 13:43       ` Eli Zaretskii
  2010-08-30 15:52         ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-08-29 13:43 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel

> Date: Sun, 29 Aug 2010 14:34:05 +0200
> From: Jan Djärv <jan.h.d@swipnet.se>
> CC: emacs-devel@gnu.org
> 
> > Suppose we have several TTY devices open in the same Emacs session.
> > Can GPM support mouse highlight on more than a single device in such a
> > session?
> 
> Isn't it Emacs that records and paints hightlights in this case?  GPM only 
> supplies the coordinates and the Emacs decides to highlight.

Yes, on both counts.

> If it is so, then GPM has no problem supporting many terminals.

Thanks.  This means that tracking the highlighted regions with static
variables flies in the face of multi-tty Emacs.  I will therefore move
them to tty_display_info.



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

* Re: GPM and mouse highlight
  2010-08-29 13:43       ` Eli Zaretskii
@ 2010-08-30 15:52         ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2010-08-30 15:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Jan Djärv, emacs-devel

>> If it is so, then GPM has no problem supporting many terminals.

That's probably true of GPM, but AFAIK Emacs's support for GPM is unable
to handle more than a single connection at a time.

> Thanks.  This means that tracking the highlighted regions with static
> variables flies in the face of multi-tty Emacs.  I will therefore move
> them to tty_display_info.

That sounds like a good change, regardless of what I said above.


        Stefan



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

end of thread, other threads:[~2010-08-30 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-29  5:39 GPM and mouse highlight Eli Zaretskii
2010-08-29  8:30 ` Jan Djärv
2010-08-29 11:34   ` Eli Zaretskii
2010-08-29 12:34     ` Jan Djärv
2010-08-29 13:43       ` Eli Zaretskii
2010-08-30 15:52         ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).