예제 #1
0
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;
}
예제 #2
0
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);
}
예제 #3
0
 QWaylandClientPrivate(QWaylandCompositor *compositor, wl_client *_client)
     : compositor(compositor)
     , client(_client)
 {
     // Save client credentials
     wl_client_get_credentials(client, &pid, &uid, &gid);
 }
예제 #4
0
void ShellSurface::close()
{
    pid_t pid;
    wl_client_get_credentials(m_surface->client(), &pid, NULL, NULL);

    if (pid != getpid()) {
        kill(pid, SIGTERM);
    }
}
예제 #5
0
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();
}
예제 #6
0
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);
}
예제 #7
0
파일: client.cpp 프로젝트: nyorain/iro
int Client::gid() const
{
	gid_t gid;
	wl_client_get_credentials(&wlClient(), nullptr, nullptr, &gid);
	return gid;
}
예제 #8
0
파일: client.cpp 프로젝트: nyorain/iro
int Client::uid() const
{
	uid_t uid;
	wl_client_get_credentials(&wlClient(), nullptr, &uid, nullptr);
	return uid;
}
예제 #9
0
파일: client.cpp 프로젝트: nyorain/iro
int Client::pid() const
{
	pid_t pid;
	wl_client_get_credentials(&wlClient(), &pid, nullptr, nullptr);
	return pid;
}
예제 #10
0
 QWaylandClientPrivate(wl_client *_client)
     : client(_client)
 {
     // Save client credentials
     wl_client_get_credentials(client, &pid, &uid, &gid);
 }