2
* Clipman - panel plugin for Xfce Desktop Environment
3
* popup command to show the clipman menu
4
* Copyright (C) 2002-2006 Olivier Fourdan
5
* 2008-2009 Mike Massonnet <mmassonnet@xfce.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33
clipman_plugin_check_is_running (GtkWidget *widget,
37
gchar *selection_name;
40
gscreen = gtk_widget_get_screen (widget);
41
selection_name = g_strdup_printf (XFCE_CLIPMAN_SELECTION"%d",
42
gdk_screen_get_number (gscreen));
43
selection_atom = XInternAtom (GDK_DISPLAY(), selection_name, FALSE);
45
if ((*xid = XGetSelectionOwner (GDK_DISPLAY(), selection_atom)))
52
main (gint argc, gchar *argv[])
58
gtk_init (&argc, &argv);
60
win = gtk_invisible_new ();
61
gtk_widget_realize (win);
63
gev.type = GDK_CLIENT_EVENT;
64
gev.window = win->window;
65
gev.send_event = TRUE;
66
gev.message_type = gdk_atom_intern ("STRING", FALSE);
68
g_snprintf (gev.data.b, sizeof (gev.data.b), XFCE_CLIPMAN_MESSAGE);
70
if (clipman_plugin_check_is_running (win, &id))
71
gdk_event_send_client_message ((GdkEvent *)&gev, (GdkNativeWindow)id);
73
g_warning ("Can't find the xfce4-clipman-plugin.\n");
76
gtk_widget_destroy (win);