shsurf->surface->timeline.force_refresh = 1;
}
+static void
+set_pid(struct shell_surface *shsurf, pid_t pid)
+{
+ /* We have no use for it */
+}
+
static void
set_type(struct shell_surface *shsurf, enum shell_surface_type t)
{
ec->shell_interface.set_title = set_title;
ec->shell_interface.set_window_geometry = set_window_geometry;
ec->shell_interface.set_maximized = shell_interface_set_maximized;
+ ec->shell_interface.set_pid = set_pid;
weston_layer_init(&shell->fullscreen_layer, &ec->cursor_layer.link);
weston_layer_init(&shell->panel_layer, &shell->fullscreen_layer.link);
uint32_t *xid;
xcb_atom_t *atom;
uint32_t i;
+ char name[1024];
if (!window->properties_dirty)
return;
free(reply);
}
+ if (window->pid > 0) {
+ gethostname(name, sizeof(name));
+ for (i = 0; i < sizeof(name); i++) {
+ if (name[i] == '\0')
+ break;
+ }
+ if (i == sizeof(name))
+ name[0] = '\0'; /* ignore stupid hostnames */
+
+ /* this is only one heuristic to guess the PID of a client is
+ * valid, assuming it's compliant with icccm and ewmh.
+ * Non-compliants and remote applications of course fail. */
+ if (!window->machine || strcmp(window->machine, name))
+ window->pid = 0;
+ }
+
if (window->shsurf && window->name)
shell_interface->set_title(window->shsurf, window->name);
if (window->frame && window->name)
frame_set_title(window->frame, window->name);
+ if (window->shsurf && window->pid > 0)
+ shell_interface->set_pid(window->shsurf, window->pid);
}
static void
{
struct weston_surface *surface = data;
struct weston_wm_window *window = get_wm_window(surface);
- char name[1024];
-
if (!window)
return;
- gethostname(name, 1024);
-
- /* this is only one heuristic to guess the PID of a client is valid,
- * assuming it's compliant with icccm and ewmh. Non-compliants and
- * remote applications of course fail. */
- if (!strcmp(window->machine, name) && window->pid != 0)
+ if (window->pid > 0)
kill(window->pid, SIGKILL);
}
if (window->name)
shell_interface->set_title(window->shsurf, window->name);
+ if (window->pid > 0)
+ shell_interface->set_pid(window->shsurf, window->pid);
if (window->fullscreen) {
window->saved_width = window->width;