3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; either version 2, or (at your option)
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
Derived from xfdesktop's xfce4-popup-menu
20
(c) 2002-2006 Olivier Fourdan
34
#include "xfce4-popup-windowlist.h"
45
xfce4_check_is_running (GtkWidget *widget, Window *xid)
48
gchar selection_name[32];
51
gscreen = gtk_widget_get_screen (widget);
52
g_snprintf (selection_name,
53
sizeof (selection_name),
54
XFCE_WINDOW_LIST_SELECTION"%d",
55
gdk_screen_get_number (gscreen));
56
selection_atom = XInternAtom (GDK_DISPLAY (), selection_name, False);
58
if ((*xid = XGetSelectionOwner (GDK_DISPLAY (), selection_atom)))
71
gtk_init (&argc, &argv);
73
win = gtk_invisible_new();
74
gtk_widget_realize(win);
76
gev.type = GDK_CLIENT_EVENT;
77
gev.window = win->window;
78
gev.send_event = TRUE;
79
gev.message_type = gdk_atom_intern ("STRING", FALSE);
81
if (argc > 1 && !strcmp (argv[1], "-pointer"))
82
strcpy(gev.data.b, XFCE_WINDOW_LIST_AT_POINTER_MESSAGE);
84
strcpy(gev.data.b, XFCE_WINDOW_LIST_MESSAGE);
86
if (xfce4_check_is_running (win, &id))
87
gdk_event_send_client_message ((GdkEvent *)&gev,
90
g_warning ("Can't find the xfce4-panel window list to popup.\n");
93
gtk_widget_destroy (win);