X - use clipboard by default

Glynn Clements glynn at gclements.plus.com
Tue Apr 29 05:20:08 PDT 2008


Pawel K wrote:

> > > > For Athena-based programs (e.g. xpdf), you can override the
> > > > translations, e.g.:
> > > > 
> > > > *Text.translations:    #override    \n\
> > > > ~Shift ~Ctrl ~Meta <Btn2Up>:    insert-selection(CLIPBOARD, PRIMARY, CUT_BUFFER0)

Er, xpdf uses Motif, not Athena. Motif normally uses the clipboard in
preference to the selection. But that doesn't affect xpdf's document
view, which is just an XmDrawingArea widget.

> > > Unfortunately I don't know where to place the Text.translations. I do not have the resources
> > > file for e.g. xpdf.
> > > I added it at the beginning of /etc/X11/xdm/Xresources but it did not help.
> > 
> > That file only affects xdm itself.
> > 
> > > Could You give me an indication of where to put it.
> > 
> > It very much depends upon system configuration. The details are here:
> > 
> >     http://www.faqs.org/faqs/Xt-FAQ/section-21.html
> > 
> > However, the system-wide directory may be in /etc/X11 rather than
> > /usr/lib/X11 on modern systems.
> > 
> > Also, some distributions and/or desktop environments may invoke xrdb
> > without explicitly being asked to do so. The actual resources which
> > are set are sometimes found in ~/.Xresources.
> 
> thank You for help
> I put what You suggested into my ~/.Xdefaults file.
> Strace shows that xpdf reads this file as You wrote.
> Unfortunately it does not copy the tekst inside a mouse rectangle into the clipboard.
> xpdf shows the following message when starting:
> Warning: Actions not found: insert-selection
> 
> I use xpdf version 3.02 (2007)
> 
> Do You know what can be wrong ?

I don't think that you can make selections in the xpdf display window
update the clipboard. AFAICT, xpdf itself doesn't support the
clipboard (although the Motif widget set which it uses for the UI
does).

In general, programs only update the clipboard by explicit user
request (e.g. "Copy" menu item, Ctrl-C, Ctrl-Insert). The clipboard is
generally more persistent than the selection, so an application
wouldn't normally "steal" ownership of the clipboard just because the
user highlighted something.

The only real solution here is to ask the xpdf developer to add an
option to copy the selection to the clipboard.

BTW, the warning message is because of the XmComboBox widget in the
toolbar, used to set the zoom. The text field is named "Text", so the
*Text.translations setting matches it even though it is a Motif
"XmText" widget, not an Athena "Text" widget. You can prevent the
warning with:

	*XmComboBox.Text.translations:    #override

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list