Prima
view release on metacpan or search on metacpan
pod/Prima/X11.pod view on Meta::CPAN
if Prima program aborts, the shared memory will never be returned to the OS.
To remove the leftover segments, use your OS facilities, for example, C<ipcrm>
on *BSD.
To disable shared memory with images, use C<--no-shmem> switch in command-line
arguments.
The clipboard exchange of images is incompletely implemented, since Prima does
not accompany ( and neither reads ) COLORMAP, FOREGROUND, and BACKGROUND
clipboard data, which contains pixel RGB values for a paletted image. As a
palliative, the clipboard-bound images are downgraded to a safe set of colors,
locked immutable either by X server or Prima core.
On images in the clipboard: contrary to the text in the clipboard, which can be
used several times, images seemingly cannot. The Bitmap or Pixmap descriptor,
stored in the clipboard, is rendered invalid after it has been read once.
=head1 Window managers
The original design of X protocol did not include the notion of a window
manager, and latter is was implemented as an ad-hoc patch, which results in
race conditions when configuring widgets. The extreme situation may well happen
when even a non-top level widget may be influenced by a window manager, when
for example a top-level widget was reparented into another widget, but the
window manager is not aware or this yet.
The consequences of this, as well as programming guidance are described in
C<Prima::Window>. Here, we describe other aspects of interactions with WMs, as
WM protocols, hints, and properties.
Prima was tested with alternating success under the following window managers:
mwm, kwin, wmaker, fvwm, fvwm2, enlightenment, sawfish, blackbox, 9wm, olvm, twm,
and in no-WM environment.
=head2 Protocols
Prima makes use of C<WM_DELETE_WINDOW> and C<WM_TAKE_FOCUS> protocols. While
C<WM_DELETE_WINDOW> use is straightforward and needs no further attention,
C<WM_TAKE_FOCUS> can be tricky, since X defines several of input modes for a
widget, which behave differently for each WM. In particular, 'focus follows
pointer' gives pains under twm and mwm, where navigation of drop-down combo
boxes is greatly hindered by window manager. The drop-down list is programmed
so it is dismissed as soon its focus is gone; these window managers withdraw
focus even if the pointer is over the focused widget's border.
=head2 Hints
Size, position, icons, and other standard X hints are passed to WM in a
standard way, and, as inter-client communication manual ( ICCCM ) allows,
repeatedly misinterpreted by window managers. Many ( wmaker, for example )
apply the coordinates given from the program not to the top-level widget
itself, but to its decoration. mwm defines list of accepted icon sizes so
these can be absurdly high, which adds confusion to a client who can create
icon of any size, but unable to determine the best one.
=head2 Non-standard properties
Prima tries to use WM-specific hints, known for two window managers: mwm and
kwin. For mwm ( Motif window manager ) Prima sets hints of decoration border
width and icons only. For kwin ( and probably to others, who wish to conform to
specifications of http://www.freedesktop.org/ ) Prima uses C<NET_WM_STATE>
property, in particular its maximization and task-bar visibility hints.
Use of these explicitly contradicts ICCCM, and definitely may lead to bugs in
future ( at least with C<NET_WM_STATE>, since Motif interface can hardly
expected to be changed ). To disable the use of non-standard WM properties,
C<--icccm> command-line argument can be set.
=head1 Unicode
X does not support unicode, and number of patches were applied to X servers and
clients to make the situation change. Currently ( 2003 ) standard unicode
practices are not emerged yet, so Prima copes up with what ( in author's
opinion ) is most promising: Xft and iconv libraries.
=head2 Fonts
X11 supports 8-bit and 16-bit text string display, and neither can be used
effectively to display unicode strings. A C<XCreateFontSet> technique, which
combines several fonts under one descriptor, or a similarly implemented
technique is the only way to provide correct unicode display.
Also, core font transfer protocol suffers from ineffective memory
representation, which creates latency when fonts with large span
of glyphs is loaded. Such fonts, in still uncommon though standard iso10646
encoding, are the only media to display multi-encoding text without falling
back to hacks similar to C<XCreateFontSet>.
These, and some other problems are efficiently solved by Xft library, a
superset of X core font functionality. Xft features Level 1 ( November 2003 )
unicode display and supports 32-bit text strings as well as UTF8-coded strings.
Xft does not operate with charset encodings, and these are implemented in Prima
using iconv charset converter library.
=head2 Input
Prima does not support extended input methods ( XIM etc ), primarily because
the authors are not acquainted with CIJK problem domain. Volunteers are
welcome.
=head2 Clipboard
Prima supports UTF8 text in clipboard via C<UTF8_STRING> transparently,
although not by default.
Prima::Application-> wantUnicodeInput(1)
is the easiest ( see L<Prima::Application> ) way to initiate UTF8 clipboard
text exchange.
Due to the fact that any application can take ownership over the clipboard
at any time, C<open>/C<close> brackets are not strictly respected in X11
implementation. Practically, this means that when modern X11 clipboard daemons
( KDE klipper, for example ) interfere with Prima clipboard, the results may
not be consistent from the programmer's view, for example, clipboard contains
data after C<clear> call, and the like. It must be noted though that this
behavior is expected by the users.
=head1 Other XRDB resources
=head2 Timeouts
( run in 1.688 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )