Mercurial > pidgin
annotate src/browser.c @ 3500:b79894c97bed
[gaim-migrate @ 3563]
a couple prefs fixes. prefs should now save things when you change them (thanks faceprint)
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 14 Sep 2002 03:08:39 +0000 |
parents | d33ec392a5e1 |
children | cf00549c53d7 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * some code: (most in this file) | |
7 * Copyright (C) 1996 Netscape Communications Corporation, all rights reserved. | |
8 * Created: Jamie Zawinski <jwz@netscape.com>, 24-Dec-94. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 * | |
24 * This code is mainly taken from Netscape's sample implementation of | |
25 * their protocol. Nifty. | |
26 * | |
27 */ | |
28 | |
29 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
30 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2077
diff
changeset
|
31 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
32 #endif |
1 | 33 #include <stdio.h> |
34 #include <stdlib.h> | |
35 #include <unistd.h> | |
36 #include <string.h> | |
37 | |
38 | |
39 | |
40 | |
41 #include <gtk/gtk.h> | |
42 #include <gdk/gdkprivate.h> | |
43 #include <gdk/gdkx.h> | |
44 #include "gaim.h" | |
45 | |
46 #ifndef _WIN32 | |
47 | |
48 | |
49 | |
50 | |
51 #include <X11/Xlib.h> | |
52 #include <X11/Xatom.h> | |
53 | |
54 | |
55 static const char *progname = "gaim"; | |
56 static const char *expected_mozilla_version = "1.1"; | |
57 | |
58 #define MOZILLA_VERSION_PROP "_MOZILLA_VERSION" | |
59 #define MOZILLA_LOCK_PROP "_MOZILLA_LOCK" | |
60 #define MOZILLA_COMMAND_PROP "_MOZILLA_COMMAND" | |
61 #define MOZILLA_RESPONSE_PROP "_MOZILLA_RESPONSE" | |
62 | |
3466 | 63 static GdkAtom GDKA_MOZILLA_VERSION = 0; |
64 static GdkAtom GDKA_MOZILLA_LOCK = 0; | |
65 static GdkAtom GDKA_MOZILLA_COMMAND = 0; | |
66 static GdkAtom GDKA_MOZILLA_RESPONSE = 0; | |
1 | 67 |
68 | |
69 static int netscape_lock; | |
70 | |
71 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
72 static Window VirtualRootWindowOfScreen(screen) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
73 Screen *screen; |
1 | 74 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
75 static Screen *save_screen = (Screen *) 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
76 static Window root = (Window) 0; |
1 | 77 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
78 if (screen != save_screen) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
79 Display *dpy = DisplayOfScreen(screen); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
80 Atom __SWM_VROOT = None; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
81 unsigned int i; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
82 Window rootReturn, parentReturn, *children; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
83 unsigned int numChildren; |
1 | 84 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
85 root = RootWindowOfScreen(screen); |
1 | 86 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
87 /* go look for a virtual root */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
88 __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
89 if (XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren)) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
90 for (i = 0; i < numChildren; i++) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
91 Atom actual_type; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
92 int actual_format; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
93 unsigned long nitems, bytesafter; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
94 Window *newRoot = (Window *) 0; |
1 | 95 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
96 if (XGetWindowProperty(dpy, children[i], |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
97 __SWM_VROOT, 0, 1, False, XA_WINDOW, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
98 &actual_type, &actual_format, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
99 &nitems, &bytesafter, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
100 (unsigned char **)&newRoot) == Success |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
101 && newRoot) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
102 root = *newRoot; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
103 break; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
104 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
105 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
106 if (children) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
107 XFree((char *)children); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
108 } |
1 | 109 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
110 save_screen = screen; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
111 } |
1 | 112 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
113 return root; |
1 | 114 } |
115 | |
116 /* The following code is Copyright (C) 1989 X Consortium */ | |
117 | |
118 static Window TryChildren(); | |
119 | |
120 /* Find a window with WM_STATE, else return win itself, as per ICCCM */ | |
121 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
122 static Window GClientWindow(dpy, win) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
123 Display *dpy; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
124 Window win; |
1 | 125 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
126 Atom WM_STATE; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
127 Atom type = None; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
128 int format; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
129 unsigned long nitems, after; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
130 unsigned char *data; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
131 Window inf; |
1 | 132 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
133 WM_STATE = XInternAtom(dpy, "WM_STATE", True); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
134 if (!WM_STATE) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
135 return win; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
136 XGetWindowProperty(dpy, win, WM_STATE, 0, 0, False, AnyPropertyType, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
137 &type, &format, &nitems, &after, &data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
138 if (type) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
139 XFree(data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
140 return win; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
141 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
142 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
143 inf = TryChildren(dpy, win, WM_STATE); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
144 if (!inf) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
145 inf = win; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
146 |
26 | 147 XFree(data); |
148 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
149 return inf; |
1 | 150 } |
151 | |
152 static | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
153 Window TryChildren(dpy, win, WM_STATE) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
154 Display *dpy; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
155 Window win; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
156 Atom WM_STATE; |
1 | 157 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
158 Window root, parent; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
159 Window *children; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
160 unsigned int nchildren; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
161 unsigned int i; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
162 Atom type = None; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
163 int format; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
164 unsigned long nitems, after; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
165 unsigned char *data; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
166 Window inf = 0; |
1 | 167 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
168 if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren)) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
169 return 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
170 for (i = 0; !inf && (i < nchildren); i++) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
171 XGetWindowProperty(dpy, children[i], WM_STATE, 0, 0, False, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
172 AnyPropertyType, &type, &format, &nitems, &after, &data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
173 if (type) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
174 inf = children[i]; |
26 | 175 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
176 XFree(data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
177 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
178 for (i = 0; !inf && (i < nchildren); i++) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
179 inf = TryChildren(dpy, children[i], WM_STATE); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
180 if (children) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
181 XFree((char *)children); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
182 return inf; |
1 | 183 } |
184 | |
185 /* END X Consortium code */ | |
186 | |
187 | |
188 | |
189 static void mozilla_remote_init_atoms() | |
190 { | |
3466 | 191 if (!GDKA_MOZILLA_VERSION) |
192 GDKA_MOZILLA_VERSION = gdk_atom_intern(MOZILLA_VERSION_PROP, 0); | |
193 if (!GDKA_MOZILLA_LOCK) | |
194 GDKA_MOZILLA_LOCK = gdk_atom_intern(MOZILLA_LOCK_PROP, 0); | |
195 if (!GDKA_MOZILLA_COMMAND) | |
196 GDKA_MOZILLA_COMMAND = gdk_atom_intern(MOZILLA_COMMAND_PROP, 0); | |
197 if (!GDKA_MOZILLA_RESPONSE) | |
198 GDKA_MOZILLA_RESPONSE = gdk_atom_intern(MOZILLA_RESPONSE_PROP, 0); | |
1 | 199 } |
200 | |
201 static GdkWindow *mozilla_remote_find_window() | |
202 { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
203 int i; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
204 Window root = VirtualRootWindowOfScreen(DefaultScreenOfDisplay(gdk_display)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
205 Window root2, parent, *kids; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
206 unsigned int nkids; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
207 Window result = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
208 Window tenative = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
209 unsigned char *tenative_version = 0; |
1 | 210 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
211 if (!XQueryTree(gdk_display, root, &root2, &parent, &kids, &nkids)) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
212 debug_printf("%s: XQueryTree failed on display %s\n", progname, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
213 DisplayString(gdk_display)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
214 return NULL; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
215 } |
1 | 216 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
217 /* root != root2 is possible with virtual root WMs. */ |
1 | 218 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
219 if (!(kids && nkids)) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
220 debug_printf("%s: root window has no children on display %s\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
221 progname, DisplayString(gdk_display)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
222 return NULL; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
223 } |
1 | 224 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
225 for (i = nkids - 1; i >= 0; i--) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
226 Atom type; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
227 int format; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
228 unsigned long nitems, bytesafter; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
229 unsigned char *version = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
230 Window w = GClientWindow(gdk_display, kids[i]); |
3466 | 231 int status = XGetWindowProperty(gdk_display, w, |
232 gdk_x11_atom_to_xatom(GDKA_MOZILLA_VERSION), | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
233 0, (65536 / sizeof(long)), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
234 False, XA_STRING, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
235 &type, &format, &nitems, &bytesafter, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
236 &version); |
26 | 237 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
238 if (!version) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
239 continue; |
26 | 240 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
241 if (strcmp((char *)version, expected_mozilla_version) && !tenative) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
242 tenative = w; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
243 tenative_version = version; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
244 continue; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
245 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
246 XFree(version); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
247 if (status == Success && type != None) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
248 result = w; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
249 break; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
250 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
251 } |
1 | 252 |
26 | 253 XFree(kids); |
254 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
255 if (result && tenative) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
256 debug_printf("%s: warning: both version %s (0x%x) and version\n" |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
257 "\t%s (0x%x) are running. Using version %s.\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
258 progname, tenative_version, (unsigned int)tenative, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
259 expected_mozilla_version, (unsigned int)result, expected_mozilla_version); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
260 XFree(tenative_version); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
261 return gdk_window_foreign_new(result); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
262 } else if (tenative) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
263 debug_printf("%s: warning: expected version %s but found version\n" |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
264 "\t%s (0x%x) instead.\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
265 progname, expected_mozilla_version, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
266 tenative_version, (unsigned int)tenative); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
267 XFree(tenative_version); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
268 return gdk_window_foreign_new(tenative); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
269 } else if (result) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
270 return gdk_window_foreign_new(result); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
271 } else { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
272 debug_printf("%s: not running on display %s\n", progname, DisplayString(gdk_display)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
273 return NULL; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
274 } |
1 | 275 } |
276 | |
277 | |
278 static char *lock_data = 0; | |
279 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
280 static void mozilla_remote_obtain_lock(GdkWindow * window) |
1 | 281 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
282 Bool locked = False; |
1 | 283 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
284 if (!lock_data) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
285 lock_data = (char *)g_malloc(255); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
286 sprintf(lock_data, "pid%d@", getpid()); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
287 if (gethostname(lock_data + strlen(lock_data), 100)) { |
1 | 288 return; |
289 } | |
290 } | |
291 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
292 do { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
293 int result; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
294 GdkAtom actual_type; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
295 gint actual_format; |
1 | 296 gint nitems; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
297 unsigned char *data = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
298 |
3466 | 299 result = gdk_property_get(window, GDKA_MOZILLA_LOCK, |
300 gdk_x11_xatom_to_atom (XA_STRING), 0, | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
301 (65536 / sizeof(long)), 0, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
302 &actual_type, &actual_format, &nitems, &data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
303 if (result != Success || actual_type == None) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
304 /* It's not now locked - lock it. */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
305 debug_printf("%s: (writing " MOZILLA_LOCK_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
306 " \"%s\" to 0x%x)\n", progname, lock_data, (unsigned int)window); |
1 | 307 |
3466 | 308 gdk_property_change(window, GDKA_MOZILLA_LOCK, |
309 gdk_x11_xatom_to_atom (XA_STRING), | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
310 8, PropModeReplace, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
311 (unsigned char *)lock_data, strlen(lock_data)); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
312 locked = True; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
313 } |
1 | 314 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
315 if (!locked) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
316 /* Then just fuck it. */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
317 if (data) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
318 g_free(data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
319 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
320 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
321 if (data) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
322 g_free(data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
323 } while (!locked); |
1 | 324 } |
325 | |
326 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
327 static void mozilla_remote_free_lock(GdkWindow * window) |
1 | 328 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
329 int result = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
330 GdkAtom actual_type; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
331 gint actual_format; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
332 gint nitems; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
333 unsigned char *data = 0; |
1 | 334 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
335 debug_printf("%s: (deleting " MOZILLA_LOCK_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
336 " \"%s\" from 0x%x)\n", progname, lock_data, (unsigned int)window); |
1 | 337 |
3466 | 338 result = gdk_property_get(window, GDKA_MOZILLA_LOCK, |
339 gdk_x11_xatom_to_atom (XA_STRING), | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
340 0, (65536 / sizeof(long)), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
341 1, &actual_type, &actual_format, &nitems, &data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
342 if (result != Success) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
343 debug_printf("%s: unable to read and delete " MOZILLA_LOCK_PROP " property\n", progname); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
344 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
345 } else if (!data || !*data) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
346 debug_printf("%s: invalid data on " MOZILLA_LOCK_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
347 " of window 0x%x.\n", progname, (unsigned int)window); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
348 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
349 } else if (strcmp((char *)data, lock_data)) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
350 debug_printf("%s: " MOZILLA_LOCK_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
351 " was stolen! Expected \"%s\", saw \"%s\"!\n", progname, lock_data, data); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
352 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
353 } |
1 | 354 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
355 if (data) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
356 g_free(data); |
1 | 357 } |
358 | |
359 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
360 static int mozilla_remote_command(GdkWindow * window, const char *command, Bool raise_p) |
1 | 361 { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
362 int result = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
363 Bool done = False; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
364 char *new_command = 0; |
1 | 365 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
366 /* The -noraise option is implemented by passing a "noraise" argument |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
367 to each command to which it should apply. |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
368 */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
369 if (!raise_p) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
370 char *close; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
371 new_command = g_malloc(strlen(command) + 20); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
372 strcpy(new_command, command); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
373 close = strrchr(new_command, ')'); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
374 if (close) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
375 strcpy(close, ", noraise)"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
376 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
377 strcat(new_command, "(noraise)"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
378 command = new_command; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
379 } |
1 | 380 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
381 debug_printf("%s: (writing " MOZILLA_COMMAND_PROP " \"%s\" to 0x%x)\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
382 progname, command, (unsigned int)window); |
1 | 383 |
3466 | 384 gdk_property_change(window, GDKA_MOZILLA_COMMAND, |
385 gdk_x11_xatom_to_atom (XA_STRING), | |
386 8, GDK_PROP_MODE_REPLACE, (unsigned char *)command, strlen(command)); | |
1 | 387 |
388 while (!done) { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
389 GdkEvent *event; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
390 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
391 event = gdk_event_get(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
392 |
1 | 393 if (!event) |
394 continue; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
395 |
1 | 396 if (event->any.window != window) { |
397 gtk_main_do_event(event); | |
398 continue; | |
399 } | |
400 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
401 if (event->type == GDK_DESTROY && event->any.window == window) { |
1 | 402 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
403 /* Print to warn user... */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
404 debug_printf("%s: window 0x%x was destroyed.\n", progname, (unsigned int)window); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
405 result = 6; |
1267
9cff8ff01d37
[gaim-migrate @ 1277]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
406 done = True; |
1 | 407 } else if (event->type == GDK_PROPERTY_NOTIFY && |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
408 event->property.state == GDK_PROPERTY_NEW_VALUE && |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
409 event->property.window == window && |
3466 | 410 event->property.atom == GDKA_MOZILLA_RESPONSE) { |
1 | 411 GdkAtom actual_type; |
412 gint actual_format, nitems; | |
413 unsigned char *data = 0; | |
414 | |
3466 | 415 result = gdk_property_get(window, GDKA_MOZILLA_RESPONSE, |
416 gdk_x11_xatom_to_atom (XA_STRING), 0, | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
417 (65536 / sizeof(long)), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
418 1, &actual_type, &actual_format, &nitems, &data); |
1 | 419 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
420 |
1 | 421 if (result == Success && data && *data) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
422 debug_printf("%s: (server sent " MOZILLA_RESPONSE_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
423 " \"%s\" to 0x%x.)\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
424 progname, data, (unsigned int)window); |
1 | 425 } |
426 | |
427 if (result != Success) { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
428 debug_printf("%s: failed reading " MOZILLA_RESPONSE_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
429 " from window 0x%0x.\n", progname, (unsigned int)window); |
1 | 430 result = 6; |
431 done = True; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
432 } else if (!data || strlen((char *)data) < 5) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
433 debug_printf("%s: invalid data on " MOZILLA_RESPONSE_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
434 " property of window 0x%0x.\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
435 progname, (unsigned int)window); |
1 | 436 result = 6; |
437 done = True; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
438 } else if (*data == '1') { /* positive preliminary reply */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
439 debug_printf("%s: %s\n", progname, data + 4); |
1 | 440 /* keep going */ |
441 done = False; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
442 } else if (!strncmp((char *)data, "200", 3)) { |
1 | 443 result = 0; |
444 done = True; | |
445 } else if (*data == '2') { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
446 debug_printf("%s: %s\n", progname, data + 4); |
1 | 447 result = 0; |
448 done = True; | |
449 } else if (*data == '3') { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
450 debug_printf("%s: internal error: " |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
451 "server wants more information? (%s)\n", progname, data); |
1 | 452 result = 3; |
453 done = True; | |
454 } else if (*data == '4' || *data == '5') { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
455 debug_printf("%s: %s\n", progname, data + 4); |
1 | 456 result = (*data - '0'); |
457 done = True; | |
458 } else { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
459 debug_printf("%s: unrecognised " MOZILLA_RESPONSE_PROP |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
460 " from window 0x%x: %s\n", |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
461 progname, (unsigned int)window, data); |
1 | 462 result = 6; |
463 done = True; | |
464 } | |
465 | |
466 if (data) | |
467 g_free(data); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
468 } else if (event->type == GDK_PROPERTY_NOTIFY && |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
469 event->property.window == window && |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
470 event->property.state == GDK_PROPERTY_DELETE && |
3466 | 471 event->property.atom == GDKA_MOZILLA_COMMAND) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
472 debug_printf("%s: (server 0x%x has accepted " |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
473 MOZILLA_COMMAND_PROP ".)\n", progname, (unsigned int)window); |
1 | 474 } |
475 gdk_event_free(event); | |
476 } | |
477 | |
478 if (new_command) | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
479 g_free(new_command); |
1 | 480 |
481 return result; | |
482 } | |
483 | |
484 | |
485 gint check_netscape(char *msg) | |
486 { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
487 int status; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
488 GdkWindow *window; |
1 | 489 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
490 mozilla_remote_init_atoms(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
491 window = mozilla_remote_find_window(); |
1 | 492 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
493 if (window && (((GdkWindowPrivate *) window)->destroyed == FALSE)) { |
1 | 494 |
1944
2d5fef1f986d
[gaim-migrate @ 1954]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1267
diff
changeset
|
495 XSelectInput(gdk_display, GDK_WINDOW_XWINDOW(window), |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
496 (PropertyChangeMask | StructureNotifyMask)); |
1 | 497 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
498 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
499 mozilla_remote_obtain_lock(window); |
1 | 500 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
501 status = mozilla_remote_command(window, msg, False); |
1 | 502 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
503 if (status != 6) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
504 mozilla_remote_free_lock(window); |
1 | 505 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
506 netscape_lock = 0; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
507 |
1 | 508 g_free(msg); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
509 return FALSE; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
510 } else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
511 return TRUE; |
1 | 512 } |
513 | |
514 | |
515 static void netscape_command(char *command) | |
516 { | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
517 int status; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
518 pid_t pid; |
1 | 519 GdkWindow *window; |
520 | |
521 if (netscape_lock) | |
522 return; | |
523 | |
524 netscape_lock = 1; | |
525 | |
526 | |
527 | |
528 mozilla_remote_init_atoms(); | |
529 window = mozilla_remote_find_window(); | |
530 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
531 if (window && (((GdkWindowPrivate *) window)->destroyed == FALSE)) { |
1 | 532 |
1944
2d5fef1f986d
[gaim-migrate @ 1954]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1267
diff
changeset
|
533 XSelectInput(gdk_display, GDK_WINDOW_XWINDOW(window), |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
534 (PropertyChangeMask | StructureNotifyMask)); |
1 | 535 |
536 mozilla_remote_obtain_lock(window); | |
537 | |
538 status = mozilla_remote_command(window, command, False); | |
539 | |
540 if (status != 6) | |
541 mozilla_remote_free_lock(window); | |
542 | |
543 netscape_lock = 0; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
544 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
545 gdk_window_destroy(window); |
1 | 546 } else { |
547 pid = fork(); | |
548 if (pid == 0) { | |
549 char *args[2]; | |
550 int e; | |
551 | |
552 args[0] = g_strdup("netscape"); | |
553 args[1] = NULL; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
554 e = execvp(args[0], args); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
555 printf("Hello%d\n", getppid()); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
556 |
1 | 557 _exit(0); |
558 } else { | |
559 char *tmp = g_strdup(command); | |
560 gtk_timeout_add(200, (GtkFunction)check_netscape, tmp); | |
561 } | |
562 } | |
563 | |
564 } | |
565 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
566 void open_url(GtkWidget *w, char *url) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
567 { |
733 | 568 |
1 | 569 if (web_browser == BROWSER_NETSCAPE) { |
2828
06539a384d6b
[gaim-migrate @ 2841]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2827
diff
changeset
|
570 char *command; |
1 | 571 |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
572 if (misc_options & OPT_MISC_BROWSER_POPUP) |
2828
06539a384d6b
[gaim-migrate @ 2841]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2827
diff
changeset
|
573 command = g_strdup_printf("OpenURL(%s, new-window)", url); |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
574 else |
2828
06539a384d6b
[gaim-migrate @ 2841]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2827
diff
changeset
|
575 command = g_strdup_printf("OpenURL(%s)", url); |
1 | 576 |
577 netscape_command(command); | |
578 g_free(command); | |
3472 | 579 /* fixme: GNOME helper * |
580 * } else if (web_browser == BROWSER_GNOME) { * | |
581 * gnome_url_show(url); */ | |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
582 } else { |
2566 | 583 pid_t pid; |
584 | |
585 pid = fork(); | |
586 | |
587 if (pid == 0) { | |
3455 | 588 /* args will be allocated below but we don't bother |
589 * freeing it since we're just going to exec and | |
590 * exit */ | |
3466 | 591 char **args=NULL; |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
592 char command[1024]; |
3417 | 593 |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
594 if (web_browser == BROWSER_OPERA) { |
3455 | 595 args = g_new(char *, 4); |
3320 | 596 args[0] = "opera"; |
597 args[1] = "-newwindow"; | |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
598 args[2] = url; |
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
599 args[3] = NULL; |
3320 | 600 } else if (web_browser == BROWSER_KONQ) { |
3455 | 601 args = g_new(char *, 4); |
3320 | 602 args[0] = "kfmclient"; |
603 args[1] = "openURL"; | |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
604 args[2] = url; |
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
605 args[3] = NULL; |
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
606 } else if (web_browser == BROWSER_GALEON) { |
3455 | 607 args = g_new(char *, 4); |
3320 | 608 args[0] = "galeon"; |
609 if (misc_options & OPT_MISC_BROWSER_POPUP) { | |
610 args[1] = "-w"; | |
611 args[2] = url; | |
612 args[3] = NULL; | |
613 } else { | |
614 args[1] = url; | |
615 args[2] = NULL; | |
616 } | |
617 } else if (web_browser == BROWSER_MOZILLA) { | |
3455 | 618 args = g_new(char *, 4); |
3320 | 619 args[0] = "mozilla"; |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
620 args[1] = url; |
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
621 args[2] = NULL; |
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
622 } else if (web_browser == BROWSER_MANUAL) { |
3418
0d1af9166119
[gaim-migrate @ 3440]
Christian Hammond <chipx86@chipx86.com>
parents:
3417
diff
changeset
|
623 gchar *space_free_url; |
0d1af9166119
[gaim-migrate @ 3440]
Christian Hammond <chipx86@chipx86.com>
parents:
3417
diff
changeset
|
624 space_free_url = g_strdelimit(url, " ", '+'); |
0d1af9166119
[gaim-migrate @ 3440]
Christian Hammond <chipx86@chipx86.com>
parents:
3417
diff
changeset
|
625 g_snprintf(command, sizeof(command), web_command, space_free_url); |
0d1af9166119
[gaim-migrate @ 3440]
Christian Hammond <chipx86@chipx86.com>
parents:
3417
diff
changeset
|
626 g_free(space_free_url); |
0d1af9166119
[gaim-migrate @ 3440]
Christian Hammond <chipx86@chipx86.com>
parents:
3417
diff
changeset
|
627 args = g_strsplit(command, " ", 0); |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2781
diff
changeset
|
628 } |
2566 | 629 |
630 execvp(args[0], args); | |
631 _exit(0); | |
632 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
633 } |
1 | 634 } |
635 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
636 void add_bookmark(GtkWidget *w, char *url) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
637 { |
1 | 638 if (web_browser == BROWSER_NETSCAPE) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
639 char *command = g_malloc(1024); |
1 | 640 |
641 g_snprintf(command, 1024, "AddBookmark(%s)", url); | |
642 | |
643 netscape_command(command); | |
644 g_free(command); | |
645 } | |
646 } | |
647 | |
648 #else | |
649 | |
650 /* Sooner or later, I shall support Windows clicking! */ | |
651 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
652 void add_bookmark(GtkWidget *w, char *url) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
653 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
654 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
655 void open_url_nw(GtkWidget *w, char *url) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
656 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1181
diff
changeset
|
657 } |
1 | 658 |
659 | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2099
diff
changeset
|
660 #endif /* _WIN32 */ |