Re: [Usability] clipboard manager comments

On Wed, 2002-10-16 at 21:28, Gregory Merchan wrote:

> GdkAtom and Atom are no longer the same type. You'll need to do:
>   XGetSelectionOwner (gdk_display, gdk_x11_atom_to_xatom (manager));
> It's an OK check. You could try to find a name for the existing owner
> and present an alert to allow the user to replace the existing clipboard
> manager (CM). If the existing manager is also GCM, you could either exit
> quietly or pop up whatever window GCM might display. Another thing you
> might do is wait until the existing CM gives up CLIPBOARD_MANAGER; that's
> probably too messy with too little benefit.

Hmm, Because GNOME Clipboard Manager might once become more like a
deamon I don't think a Gnome popup box is a good idea here ... Or it
should be called from for example .xinitrc files using gcm& in stead of
just gcm .. (else such a modal dialog could block the starting of the X
session). It would be possible with the current source of GNOME
Clipboard Manager to wait until the other CM gives up. It would not make
the code messy; maybe a little bit less predictable ... as GCM will just
sit there and wait until the other CM gives up. I will have to implement
this using a timeout idle_func I guess.. so it would mean that GCM has
to poll the CLIPBOARD_MANAGER selection ownership until it's released
:-\ and then claim ownership of the CLIPBOARD_MANAGER selection and
CLIPBOARD selection.

> When you claim the selection, you need to be sure to do so with the
> server time. GTK may handle this itself when you pass GDK_CURRENT_TIME,
> but check. If it doesn't, then you need to call gdk_x11_get_server_time().
> Something like this:
>   guint32 server_time;
>   gtk_widget_add_events (GTK_WIDGET (mwin), GDK_PROPERTY_CHANGE_MASK);
>   server_time = gdk_x11_get_server_time (GTK_WIDGET (mwin)->window);
>   gtk_selection_owner_set (GTK_WIDGET (mwin), manager, server_time);

> Once you've done that, you need to make sure it worked. Call
>  XGetSelectionOwner() again and compare to the X window of the GdkWindow
>  of your widget.

> If it worked, you need to send an event to the root window; this is required
> for all selection managers. It allows programs which may be interested in
> the selection manager starting to know it has done so.

> Of course, if you lose the CLIPBOARD_MANAGER selection you need to either
> exit or start over.


Philip van Hoof aka freax (
irc: mailto:me at freax dot org
Go not to the Elves for counsel, for they will say both no and yes.

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