Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
PortalRemoteDesktop.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2024 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2022 Red Hat, Inc.
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include "mt/Thread.h"
11#include "platform/EiScreen.h"
12
13#include <glib.h>
14#include <libportal/portal.h>
15
16namespace deskflow {
17
19{
20public:
23
24private:
25 void glibThread(const void *);
26 gboolean timeoutHandler() const;
27 gboolean initSession();
28 void handleInitSession(GObject *object, GAsyncResult *res);
29 void handleSessionStarted(GObject *object, GAsyncResult *res);
30 void handleSessionClosed(XdpSession *session);
31 void reconnect(unsigned int timeout = 1000);
32
34 static void handleSessionClosedCallback(XdpSession *session, gpointer data)
35 {
36 static_cast<PortalRemoteDesktop *>(data)->handleSessionClosed(session);
37 }
38
39private:
40 EiScreen *m_screen;
41 IEventQueue *m_events;
42
43 Thread *m_glibThread;
44 GMainLoop *m_glibMainLoop = nullptr;
45
46 XdpPortal *m_portal = nullptr;
47 XdpSession *m_session = nullptr;
48 char *m_sessionRestoreToken = nullptr;
49
50 guint m_sessionSignalId = 0;
51
53 guint m_sessionIteration = 0;
54};
55
56} // namespace deskflow
static int void FAR * data
Definition ArchNetworkWinsock.cpp:35
static fd_set FAR fd_set FAR fd_set FAR const struct timeval FAR * timeout
Definition ArchNetworkWinsock.cpp:40
Event queue interface.
Definition IEventQueue.h:29
Thread handle.
Definition Thread.h:33
Implementation of IPlatformScreen for X11.
Definition EiScreen.h:32
PortalRemoteDesktop(EiScreen *screen, IEventQueue *events)
Definition PortalRemoteDesktop.cpp:16
~PortalRemoteDesktop()
Definition PortalRemoteDesktop.cpp:29
Definition EventTypes.h:11