Re: [g-a-devel] Re: AT-SPI, focus leaving and window IDs



Bill Haneman, le ven 04 mar 2005 16:17:01 +0000, a dit :
> This seems like a good model to me, but I am not sure how or whether 
> virtual graphical terminals are mapped to 'pseudo-terminals' on 
> Linux/Unix or not.

They use them indeed.
Whenever the "tty" program successes, there is an underlying tty, be it
pseudo- or not.
Piped inputs are not ttys, for instance.

> If they are, then I suppose BRLTTY or a similar text-mode application
> which wishes to use brlapi could use such a mechanism to grab a
> "virtual" tty.
> 
> If there's no nice way to do it at the TTY level in a virtual/graphical 
> terminal, we may need to invent some API for it.

Yes, that's what I was thinking about last week. That requires *kernel*
modifications, but I think it would be a fairly good solution on the
long term, providing every security / forwarding solutions.

> I think that it should be possible to inform a text-mode application, 
> running in a graphical terminal, when it gains or loses focus, 
> programmatically.

I think it's really not so easy.

> Certainly this could happen via at-spi, though I 
> think there is some Xlib notification that happens to terminal emulators 
> which ought to get passed on to the text mode applications running 
> inside them.  To get hard answers to this we need to chat to some 
> virtual terminal (i.e. xterm/gnome-terminal) developers.

Resizing is such example, and actually the only one I'm aware of.
When it receives an X "resize" event, The terminal emulator performs an
ioctl(TIOCSWINSZ) on the master side of the pseudo-terminal, which makes
the *kernel* send a SIGWINCH signal to the group of processes that are
attached to the slave side of the pseudo-terminal.

Such way works: if and only if the program is interested with terminal
size, it can handle the SIGWINCH signal, which will be raised whenever
terminal size changes. This is asynchronous, that's no issue here. For
focus, this *is*: if the signal arrives a bit too late (it will in many
situations), the focus gets wrong.

The only reliable way to get the focus is to ask for people who have it:
the kernel for virtual terminals, fbterm and screen for their terminals,
the Xserver for X, windows for Microsoft Windows.

Regards,
Samuel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]