qint64 QWaylandSurface::processId() const { struct wl_client *client = static_cast<struct wl_client *>(this->client()); pid_t pid; wl_client_get_credentials(client,&pid, 0,0); return pid; }
ShellSurface::ShellSurface(Shell *shell, Surface *surface, Handler h) : Object() , m_shell(shell) , m_surface(surface) , m_handler(std::move(h)) , m_workspace(nullptr) , m_previewView(nullptr) , m_resizeEdges(Edges::None) , m_forceMap(false) , m_currentGrab(nullptr) , m_isResponsive(true) , m_minimized(false) , m_type(Type::None) , m_nextType(Type::None) , m_parent(nullptr) , m_toplevel({ false, false, nullptr }) , m_transient({ 0, 0, false }) , m_state({ QSize(), false, false }) { surface->setMoveHandler([this](Seat *seat) { move(seat); }); surface->setShellSurface(this); for (Output *o: shell->compositor()->outputs()) { viewForOutput(o); } connect(shell->compositor(), &Compositor::outputCreated, this, &ShellSurface::outputCreated); connect(shell->compositor(), &Compositor::outputRemoved, this, &ShellSurface::outputRemoved); connect(shell->pager(), &Pager::workspaceActivated, this, &ShellSurface::workspaceActivated); wl_client_get_credentials(surface->client(), &m_pid, NULL, NULL); }
QWaylandClientPrivate(QWaylandCompositor *compositor, wl_client *_client) : compositor(compositor) , client(_client) { // Save client credentials wl_client_get_credentials(client, &pid, &uid, &gid); }
void ShellSurface::close() { pid_t pid; wl_client_get_credentials(m_surface->client(), &pid, NULL, NULL); if (pid != getpid()) { kill(pid, SIGTERM); } }
ClientConnection::Private::Private(wl_client *c, Display *display, ClientConnection *q) : client(c) , display(display) , q(q) { s_allClients << this; listener.notify = destroyListenerCallback; wl_client_add_destroy_listener(c, &listener); wl_client_get_credentials(client, &pid, &user, &group); executablePath = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); }
static void close(struct window * window) { struct shell_surface * shell_surface = wl_container_of(window, shell_surface, window); struct wl_client * client; pid_t pid; client = wl_resource_get_client(shell_surface->resource); wl_client_get_credentials(client, &pid, NULL, NULL); kill(pid, SIGTERM); }
int Client::gid() const { gid_t gid; wl_client_get_credentials(&wlClient(), nullptr, nullptr, &gid); return gid; }
int Client::uid() const { uid_t uid; wl_client_get_credentials(&wlClient(), nullptr, &uid, nullptr); return uid; }
int Client::pid() const { pid_t pid; wl_client_get_credentials(&wlClient(), &pid, nullptr, nullptr); return pid; }
QWaylandClientPrivate(wl_client *_client) : client(_client) { // Save client credentials wl_client_get_credentials(client, &pid, &uid, &gid); }