Deskflow 1.22.0.197
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
16#include <memory>
17
18namespace deskflow {
19
21{
22public:
25
26private:
27 void glibThread(void *);
28 gboolean timeoutHandler() const;
29 gboolean initSession();
30 void handleInitSession(GObject *object, GAsyncResult *res);
31 void handleSessionStarted(GObject *object, GAsyncResult *res);
32 void handleSessionClosed(XdpSession *session);
33 void reconnect(unsigned int timeout = 1000);
34
36 static void handleSessionClosedCallback(XdpSession *session, gpointer data)
37 {
38 static_cast<PortalRemoteDesktop *>(data)->handleSessionClosed(session);
39 }
40
41private:
42 EiScreen *m_screen;
43 IEventQueue *m_events;
44
45 Thread *m_glibThread;
46 GMainLoop *m_glibMainLoop = nullptr;
47
48 XdpPortal *m_portal = nullptr;
49 XdpSession *m_session = nullptr;
50 char *m_sessionRestoreToken = nullptr;
51
52 guint m_sessionSignalId = 0;
53
55 guint m_sessionIteration = 0;
56};
57
58} // namespace deskflow
static int void FAR * data
Definition ArchNetworkWinsock.cpp:34
static fd_set FAR fd_set FAR fd_set FAR const struct timeval FAR * timeout
Definition ArchNetworkWinsock.cpp:39
Event queue interface.
Definition IEventQueue.h:32
Thread handle.
Definition Thread.h:33
Implementation of IPlatformScreen for X11.
Definition EiScreen.h:33
PortalRemoteDesktop(EiScreen *screen, IEventQueue *events)
Definition PortalRemoteDesktop.cpp:14
~PortalRemoteDesktop()
Definition PortalRemoteDesktop.cpp:27
Definition EventTypes.h:11