Lines 1145-1181
_wnck_get_session_id (Screen *screen,
Link Here
|
1145 |
_wnck_atom_get ("SM_CLIENT_ID")); |
1145 |
_wnck_atom_get ("SM_CLIENT_ID")); |
1146 |
} |
1146 |
} |
1147 |
|
1147 |
|
1148 |
int |
1148 |
#ifdef HAVE_XRES |
1149 |
_wnck_get_pid (Screen *screen, |
1149 |
static int |
1150 |
Window xwindow) |
1150 |
xres_get_pid (Screen *screen, |
|
|
1151 |
Window xwindow) |
1151 |
{ |
1152 |
{ |
1152 |
int pid = -1; |
1153 |
int pid = -1; |
1153 |
|
|
|
1154 |
#ifdef HAVE_XRES |
1155 |
XResClientIdSpec client_spec; |
1154 |
XResClientIdSpec client_spec; |
1156 |
long client_id_count = 0; |
1155 |
long client_id_count = 0; |
1157 |
XResClientIdValue *client_ids = NULL; |
1156 |
XResClientIdValue *client_ids = NULL; |
1158 |
|
1157 |
|
1159 |
client_spec.client = xwindow; |
1158 |
client_spec.client = xwindow; |
1160 |
client_spec.mask = XRES_CLIENT_ID_PID_MASK; |
1159 |
client_spec.mask = XRES_CLIENT_ID_PID_MASK; |
1161 |
|
1160 |
|
1162 |
if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec, |
1161 |
if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec, |
1163 |
&client_id_count, &client_ids) == Success) |
1162 |
&client_id_count, &client_ids) == Success) |
1164 |
{ |
1163 |
{ |
1165 |
long i; |
1164 |
long i; |
1166 |
|
1165 |
|
1167 |
for (i = 0; i < client_id_count; i++) |
1166 |
for (i = 0; i < client_id_count; i++) |
1168 |
{ |
1167 |
{ |
1169 |
pid = XResGetClientPid (&client_ids[i]); |
1168 |
pid = XResGetClientPid (&client_ids[i]); |
1170 |
if (pid != -1) |
1169 |
if (pid != -1) |
1171 |
break; |
1170 |
break; |
1172 |
} |
1171 |
} |
1173 |
|
1172 |
|
1174 |
XResClientIdsDestroy (client_id_count, client_ids); |
1173 |
XResClientIdsDestroy (client_id_count, client_ids); |
1175 |
|
|
|
1176 |
if (pid != -1) |
1177 |
return pid; |
1178 |
} |
1174 |
} |
|
|
1175 |
|
1176 |
return pid; |
1177 |
} |
1178 |
#endif |
1179 |
|
1180 |
int |
1181 |
_wnck_get_pid (Screen *screen, |
1182 |
Window xwindow) |
1183 |
{ |
1184 |
int pid = -1; |
1185 |
|
1186 |
#ifdef HAVE_XRES |
1187 |
pid = xres_get_pid (screen, xwindow); |
1188 |
|
1189 |
if (pid != -1) |
1190 |
return pid; |
1179 |
#endif |
1191 |
#endif |
1180 |
|
1192 |
|
1181 |
if (!_wnck_get_cardinal (screen, xwindow, |
1193 |
if (!_wnck_get_cardinal (screen, xwindow, |