Debian Codegraph @

src/inhibit.c

raw symbols SCIP
1 /*
2 * Copyright © 2016 Red Hat, Inc
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authors:
20 * Matthias Clasen <[email protected]>
21 */
22
23 #include "config.h"cxx . . $ `<file>/build/config.h`/
24
25 #include "inhibit.h"cxx . . $ `<file>/src/inhibit.h`/
26
27 #include <string.h>
28
29 #include <gio/gio.h>
30
31 #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/
32 #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/
33 #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/
34 #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/
35 #include "xdp-portal-config.h"cxx . . $ `<file>/src/xdp-portal-config.h`/
36 #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/
37 #include "xdp-session.h"cxx . . $ `<file>/src/xdp-session.h`/
38 #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/
39
40 enumcxx . . $ $anonymous_type_307c449876d076ce_0# {
41 INHIBIT_LOGOUTcxx . . $ INHIBIT_LOGOUT. = 1,
42 INHIBIT_USER_SWITCHcxx . . $ INHIBIT_USER_SWITCH. = 2,
43 INHIBIT_SUSPENDcxx . . $ INHIBIT_SUSPEND. = 4,
44 INHIBIT_IDLEcxx . . $ INHIBIT_IDLE. = 8
45 };
46
47 #define INHIBIT_ALLcxx . . $ `src/inhibit.c:47:9`! (INHIBIT_LOGOUT|INHIBIT_USER_SWITCH|INHIBIT_SUSPEND|INHIBIT_IDLE)
48
49 typedef struct _Inhibitcxx . . $ _Inhibit# Inhibitcxx . . $ Inhibit#;
50 typedef struct _InhibitClasscxx . . $ _InhibitClass# InhibitClasscxx . . $ InhibitClass#;
51
52 struct _Inhibitcxx . . $ _Inhibit#
53 {
54 XdpDbusInhibitSkeletoncxx . . $ XdpDbusInhibitSkeleton# parent_instancecxx . . $ _Inhibit#parent_instance.;
55
56 XdpContextcxx . . $ XdpContext# *contextcxx . . $ _Inhibit#context.;
57 XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *implcxx . . $ _Inhibit#impl.;
58 };
59
60 struct _InhibitClasscxx . . $ _InhibitClass#
61 {
62 XdpDbusInhibitSkeletonClasscxx . . $ XdpDbusInhibitSkeletonClass# parent_classcxx . . $ _InhibitClass#parent_class.;
63 };
64
65 GTypecxx . . $ GType# inhibit_get_typecxx . . $ inhibit_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!;
66 static void inhibit_iface_initcxx . . $ inhibit_iface_init(d1add2dbf976090). (XdpDbusInhibitIfacecxx . . $ XdpDbusInhibitIface# *iface);
67
68 G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (Inhibit, inhibit, XDP_DBUS_TYPE_INHIBIT_SKELETONcxx . . $ `build/src/xdp-dbus.h:3655:9`!,
69 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_INHIBITcxx . . $ `build/src/xdp-dbus.h:3434:9`!,
70 inhibit_iface_init));
71
72 G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (Inhibit, g_object_unref)
73
74 static void
75 inhibit_donecxx . . $ inhibit_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source,
76 GAsyncResultcxx . . $ GAsyncResult# *result,
77 gpointercxx . . $ gpointer# data)
78 {
79 XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *impl = (XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *) source;
80 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
81 XdpRequestcxx . . $ XdpRequest# *request = data;
82 int response = 0;
83
84 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
85
86 if (!xdp_dbus_impl_inhibit_call_inhibit_finishcxx . . $ xdp_dbus_impl_inhibit_call_inhibit_finish(38f99c3daa0aaa41). (impl, result, &error))
87 {
88 g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error);
89 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message);
90 response = 2;
91 }
92
93 if (request->exportedcxx . . $ _XdpRequest#exported.)
94 {
95 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) new_results =
96 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
97
98 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request),
99 response,
100 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&new_results));
101 }
102 }
103
104 static guint32cxx . . $ guint32#
105 get_allowed_inhibitcxx . . $ get_allowed_inhibit(c8c82847cb5b2b0f). (XdpAppInfocxx . . $ XdpAppInfo# *app_info)
106 {
107 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GStrv) perms = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
108 guint32cxx . . $ guint32# ret = 0;
109
110 perms = xdp_get_permissions_synccxx . . $ xdp_get_permissions_sync(6f17f7f9af8aa453). (app_info,
111 INHIBIT_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:88:9`!,
112 INHIBIT_PERMISSION_IDcxx . . $ `src/xdp-types.h:89:9`!);
113
114 if (perms != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
115 {
116 int i;
117
118 for (i = 0; perms[i]; i++)
119 {
120 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (perms[i], "logout") == 0)
121 ret |= INHIBIT_LOGOUTcxx . . $ INHIBIT_LOGOUT.;
122 else if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (perms[i], "switch") == 0)
123 ret |= INHIBIT_USER_SWITCHcxx . . $ INHIBIT_USER_SWITCH.;
124 else if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (perms[i], "suspend") == 0)
125 ret |= INHIBIT_SUSPENDcxx . . $ INHIBIT_SUSPEND.;
126 else if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (perms[i], "idle") == 0)
127 ret |= INHIBIT_IDLEcxx . . $ INHIBIT_IDLE.;
128 else
129 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Unknown inhibit flag in permission store: %s", perms[i]);
130 }
131 }
132 else
133 ret = INHIBIT_ALLcxx . . $ `src/inhibit.c:47:9`!; /* all allowed */
134
135 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Inhibit permissions for %s: %d",
136 xdp_app_info_get_id (app_info), ret);
137
138 return ret;
139 }
140
141 static void
142 handle_inhibit_in_thread_funccxx . . $ handle_inhibit_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task,
143 gpointercxx . . $ gpointer# source_object,
144 gpointercxx . . $ gpointer# task_data,
145 GCancellablecxx . . $ GCancellable# *cancellable)
146 {
147 Inhibitcxx . . $ Inhibit# *inhibit = (Inhibitcxx . . $ Inhibit# *) source_object;
148 XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data);
149 const char *window;
150 guint32cxx . . $ guint32# flags;
151 GVariantcxx . . $ GVariant# *options;
152 const char *app_id;
153
154 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
155
156 window = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "window");
157 flags = GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "flags"));
158 options = (GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options");
159
160 app_id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.);
161 flags = flags & get_allowed_inhibitcxx . . $ get_allowed_inhibit(c8c82847cb5b2b0f). (request->app_infocxx . . $ _XdpRequest#app_info.);
162
163 if (flags == 0)
164 return;
165
166 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Calling inhibit backend for %s: %d", app_id, flags);
167 xdp_dbus_impl_inhibit_call_inhibitcxx . . $ xdp_dbus_impl_inhibit_call_inhibit(e705f31f1efa71be). (inhibit->implcxx . . $ _Inhibit#impl.,
168 request->idcxx . . $ _XdpRequest#id.,
169 app_id,
170 window,
171 flags,
172 options,
173 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
174 inhibit_donecxx . . $ inhibit_done(aa1d200d824d915d).,
175 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request));
176 }
177
178 static gbooleancxx . . $ gboolean#
179 validate_reasoncxx . . $ validate_reason(c4684b9d3da33c87). (const char *key,
180 GVariantcxx . . $ GVariant# *value,
181 GVariantcxx . . $ GVariant# *options,
182 gpointercxx . . $ gpointer# user_data,
183 GErrorcxx . . $ GError# **error)
184 {
185 const char *string = g_variant_get_stringcxx . . $ g_variant_get_string(5d5cac9792ea78b8). (value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
186
187 if (g_utf8_strlencxx . . $ g_utf8_strlen(730d9b36f6411b7f). (string, -1) > 256)
188 {
189 g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!, XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT.,
190 "Not accepting overly long reasons");
191 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
192 }
193
194 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
195 }
196
197 static XdpOptionKeycxx . . $ XdpOptionKey# inhibit_optionscxx . . $ inhibit_options.[] = {
198 { "reason", G_VARIANT_TYPE_STRINGcxx . . $ `<external>/14064154155447831270/gvarianttype.h:122:9`!, validate_reasoncxx . . $ validate_reason(c4684b9d3da33c87). }
199 };
200
201 static gbooleancxx . . $ gboolean#
202 handle_inhibitcxx . . $ handle_inhibit(91e027c802f0ef96). (XdpDbusInhibitcxx . . $ XdpDbusInhibit# *object,
203 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
204 const char *arg_window,
205 guint32cxx . . $ guint32# arg_flags,
206 GVariantcxx . . $ GVariant# *arg_options)
207 {
208 Inhibitcxx . . $ Inhibit# *inhibit = (Inhibitcxx . . $ Inhibit# *) object;
209 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
210 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
211 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplRequest) impl_request = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
212 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
213 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder =
214 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
215 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
216
217 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
218
219 if ((arg_flags & ~INHIBIT_ALLcxx . . $ `src/inhibit.c:47:9`!) != 0)
220 {
221 g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation,
222 XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!,
223 XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT.,
224 "Invalid flags");
225 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
226 }
227
228 xdp_filter_optionscxx . . $ xdp_filter_options(e9350dfce557ba5e). (arg_options, &opt_builder,
229 inhibit_optionscxx . . $ inhibit_options., G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (inhibit_options),
230 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
231
232 options = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
233
234 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_window), g_freecxx . . $ g_free(5d22bdacc48458e8).);
235 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "flags", GUINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:107:9`! (arg_flags));
236 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options", g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (options), (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).);
237
238 impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). (g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl)),
239 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES.,
240 g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl)),
241 request->idcxx . . $ _XdpRequest#id.,
242 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error);
243 if (!impl_request)
244 {
245 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error);
246 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
247 }
248
249 xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request);
250 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
251
252 task = g_task_newcxx . . $ g_task_new(292d224db8478659). (inhibit, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
253 g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, handle_inhibitcxx . . $ handle_inhibit(91e027c802f0ef96).);
254 g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).);
255 g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_inhibit_in_thread_funccxx . . $ handle_inhibit_in_thread_func(4704ff26353eb8ae).);
256
257 xdp_dbus_inhibit_complete_inhibitcxx . . $ xdp_dbus_inhibit_complete_inhibit(132c4488b08310ec). (object, invocation, request->idcxx . . $ _XdpRequest#id.);
258
259 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
260 }
261
262 typedef struct _InhibitSessioncxx . . $ _InhibitSession#
263 {
264 XdpSessioncxx . . $ XdpSession# parentcxx . . $ _InhibitSession#parent.;
265
266 gbooleancxx . . $ gboolean# closedcxx . . $ _InhibitSession#closed.;
267 } InhibitSessioncxx . . $ InhibitSession#;
268
269 typedef struct _InhibitSessionClasscxx . . $ _InhibitSessionClass#
270 {
271 XdpSessionClasscxx . . $ XdpSessionClass# parent_classcxx . . $ _InhibitSessionClass#parent_class.;
272 } InhibitSessionClasscxx . . $ InhibitSessionClass#;
273
274 GTypecxx . . $ GType# inhibit_session_get_typecxx . . $ inhibit_session_get_type(f708dce9a8856c70). (void);
275
276 G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (InhibitSession, inhibit_session, xdp_session_get_type ())
277
278 G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (InhibitSession, g_object_unref)
279
280 G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! static inline InhibitSessioncxx . . $ InhibitSession# *
281 INHIBIT_SESSIONcxx . . $ INHIBIT_SESSION(80b9dbcbee079200). (gpointercxx . . $ gpointer# ptr)
282 {
283 return G_TYPE_CHECK_INSTANCE_CASTcxx . . $ `<external>/9567554376676449156/gtype.h:528:9`! (ptr, inhibit_session_get_type (), InhibitSession);
284 }
285
286 G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! static inline gbooleancxx . . $ gboolean#
287 IS_INHIBIT_SESSIONcxx . . $ IS_INHIBIT_SESSION(dedf1e9b1c614a07). (gpointercxx . . $ gpointer# ptr)
288 {
289 return G_TYPE_CHECK_INSTANCE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:541:9`! (ptr, inhibit_session_get_type ());
290 }
291
292 static void
293 inhibit_session_closecxx . . $ inhibit_session_close(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session)
294 {
295 InhibitSessioncxx . . $ InhibitSession# *inhibit_session = INHIBIT_SESSIONcxx . . $ INHIBIT_SESSION(80b9dbcbee079200). (session);
296
297 inhibit_session->closedcxx . . $ _InhibitSession#closed. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
298
299 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("inhibit session owned by '%s' closed", session->sender);
300 }
301
302 static void
303 inhibit_session_finalizecxx . . $ inhibit_session_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
304 {
305 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (inhibit_session_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
306 }
307
308 static void
309 inhibit_session_initcxx . . $ inhibit_session_init(9b5dc6554117c017). (InhibitSessioncxx . . $ InhibitSession# *inhibit_session)
310 {
311 }
312
313 static void
314 inhibit_session_class_initcxx . . $ inhibit_session_class_init(1d362984e6981af2). (InhibitSessionClasscxx . . $ InhibitSessionClass# *klass)
315 {
316 GObjectClasscxx . . $ GObjectClass# *object_class;
317 XdpSessionClasscxx . . $ XdpSessionClass# *session_class;
318
319 object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
320 object_class->finalizecxx . . $ _GObjectClass#finalize. = inhibit_session_finalizecxx . . $ inhibit_session_finalize(6087475fa43034d3).;
321
322 session_class = (XdpSessionClasscxx . . $ XdpSessionClass# *)klass;
323 session_class->closecxx . . $ _XdpSessionClass#close. = inhibit_session_closecxx . . $ inhibit_session_close(ac695378ab375fe8).;
324 }
325
326 static InhibitSessioncxx . . $ InhibitSession# *
327 inhibit_session_newcxx . . $ inhibit_session_new(2fa07a5bbefe4aa9). (Inhibitcxx . . $ Inhibit# *inhibit,
328 GVariantcxx . . $ GVariant# *options,
329 XdpRequestcxx . . $ XdpRequest# *request,
330 GErrorcxx . . $ GError# **error)
331 {
332 XdpSessioncxx . . $ XdpSession# *session;
333 const char *session_token;
334 GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *interface_skeleton = G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (request);
335 GDBusConnectioncxx . . $ GDBusConnection# *connection = g_dbus_interface_skeleton_get_connectioncxx . . $ g_dbus_interface_skeleton_get_connection(b3e1a9aea5de7a42). (interface_skeleton);
336 GDBusConnectioncxx . . $ GDBusConnection# *impl_connection = g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl));
337 const char *impl_dbus_name = g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl));
338
339 session_token = lookup_session_tokencxx . . $ lookup_session_token(d2704f6d4d26effc). (options);
340 session = g_initable_newcxx . . $ g_initable_new(a8cb3f520296c554). (inhibit_session_get_typecxx . . $ inhibit_session_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, error,
341 "context", inhibit->contextcxx . . $ _Inhibit#context.,
342 "sender", request->sendercxx . . $ _XdpRequest#sender.,
343 "app-id", xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.),
344 "token", session_token,
345 "connection", connection,
346 "impl-connection", impl_connection,
347 "impl-dbus-name", impl_dbus_name,
348 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
349
350 if (session)
351 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("inhibit session owned by '%s' created", session->sender);
352
353 return (InhibitSessioncxx . . $ InhibitSession#*)session;
354 }
355
356 static void
357 create_monitor_donecxx . . $ create_monitor_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source_object,
358 GAsyncResultcxx . . $ GAsyncResult# *res,
359 gpointercxx . . $ gpointer# data)
360 {
361 XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *impl = (XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *) source_object;
362 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data;
363 XdpSessioncxx . . $ XdpSession# *session;
364 guintcxx . . $ guint# response = 2;
365 gbooleancxx . . $ gboolean# should_close_session;
366 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) results_builder =
367 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
368 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
369
370 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
371
372 session = g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "session");
373 SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session));
374 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "session", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
375
376 if (!xdp_dbus_impl_inhibit_call_create_monitor_finishcxx . . $ xdp_dbus_impl_inhibit_call_create_monitor_finish(e88bd6ee1cdf771f). (impl, &response, res, &error))
377 {
378 g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error);
379 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message);
380 should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
381 goto out;
382 }
383
384 if (request->exportedcxx . . $ _XdpRequest#exported. && response == 0)
385 {
386 if (!xdp_session_exportcxx . . $ xdp_session_export(3c2cf3f1073dc4c7). (session, &error))
387 {
388 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to export session: %s", error->message);
389 response = 2;
390 should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
391 goto out;
392 }
393
394 should_close_session = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
395 xdp_session_registercxx . . $ xdp_session_register(ac695378ab375fe8). (session);
396 }
397 else
398 {
399 should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
400 }
401
402 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&results_builder, "{sv}",
403 "session_handle", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (session->idcxx . . $ _XdpSession#id.));
404
405 out:
406 if (request->exportedcxx . . $ _XdpRequest#exported.)
407 {
408 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request),
409 response,
410 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&results_builder));
411 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
412 }
413
414 if (should_close_session)
415 xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
416 }
417
418 static gbooleancxx . . $ gboolean#
419 handle_create_monitorcxx . . $ handle_create_monitor(75409f50a2835171). (XdpDbusInhibitcxx . . $ XdpDbusInhibit# *object,
420 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
421 const char *arg_window,
422 GVariantcxx . . $ GVariant# *arg_options)
423 {
424 Inhibitcxx . . $ Inhibit# *inhibit = (Inhibitcxx . . $ Inhibit# *) object;
425 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
426 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
427 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplRequest) impl_request = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
428 XdpSessioncxx . . $ XdpSession# *session;
429
430 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
431
432 impl_request =
433 xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). (g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl)),
434 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES.,
435 g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl)),
436 request->idcxx . . $ _XdpRequest#id.,
437 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error);
438 if (!impl_request)
439 {
440 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error);
441 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
442 }
443
444 xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request);
445 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
446
447 session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (inhibit_session_newcxx . . $ inhibit_session_new(2fa07a5bbefe4aa9). (inhibit, arg_options, request, &error));
448 if (!session)
449 {
450 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error);
451 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
452 }
453
454 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "session", g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).);
455
456 xdp_dbus_impl_inhibit_call_create_monitorcxx . . $ xdp_dbus_impl_inhibit_call_create_monitor(e94dcef4e64a61d4). (inhibit->implcxx . . $ _Inhibit#impl.,
457 request->idcxx . . $ _XdpRequest#id.,
458 session->idcxx . . $ _XdpSession#id.,
459 xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.),
460 arg_window,
461 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
462 create_monitor_donecxx . . $ create_monitor_done(aa1d200d824d915d).,
463 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request));
464
465 xdp_dbus_inhibit_complete_create_monitorcxx . . $ xdp_dbus_inhibit_complete_create_monitor(132c4488b08310ec). (object, invocation, request->idcxx . . $ _XdpRequest#id.);
466
467 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
468 }
469
470 static gbooleancxx . . $ gboolean#
471 handle_query_end_responsecxx . . $ handle_query_end_response(3f7b9c8830f787c5). (XdpDbusInhibitcxx . . $ XdpDbusInhibit# *object,
472 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
473 const char *session_id)
474 {
475 Inhibitcxx . . $ Inhibit# *inhibit = (Inhibitcxx . . $ Inhibit# *) object;
476 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpSession) session = xdp_session_lookupcxx . . $ xdp_session_lookup(7cb6de4f3c42cd2). (session_id);
477
478 if (!session)
479 {
480 g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation,
481 G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!,
482 G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED.,
483 "Invalid session");
484 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
485 }
486
487 xdp_dbus_impl_inhibit_call_query_end_responsecxx . . $ xdp_dbus_impl_inhibit_call_query_end_response(b0510354d5f6c7f2). (inhibit->implcxx . . $ _Inhibit#impl., session->idcxx . . $ _XdpSession#id.,
488 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
489 xdp_dbus_inhibit_complete_query_end_responsecxx . . $ xdp_dbus_inhibit_complete_query_end_response(3d1cf80a024c6bfc). (object, invocation);
490
491 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
492 }
493
494
495 static void
496 inhibit_iface_initcxx . . $ inhibit_iface_init(d1add2dbf976090). (XdpDbusInhibitIfacecxx . . $ XdpDbusInhibitIface# *iface)
497 {
498 iface->handle_inhibitcxx . . $ _XdpDbusInhibitIface#handle_inhibit. = handle_inhibitcxx . . $ handle_inhibit(91e027c802f0ef96).;
499 iface->handle_create_monitorcxx . . $ _XdpDbusInhibitIface#handle_create_monitor. = handle_create_monitorcxx . . $ handle_create_monitor(75409f50a2835171).;
500 iface->handle_query_end_responsecxx . . $ _XdpDbusInhibitIface#handle_query_end_response. = handle_query_end_responsecxx . . $ handle_query_end_response(3f7b9c8830f787c5).;
501 }
502
503 static void
504 inhibit_disposecxx . . $ inhibit_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
505 {
506 Inhibitcxx . . $ Inhibit# *inhibit = (Inhibitcxx . . $ Inhibit# *) object;
507
508 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&inhibit->impl);
509
510 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (inhibit_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
511 }
512
513 static void
514 inhibit_initcxx . . $ inhibit_init(c6f9460fea394520). (Inhibitcxx . . $ Inhibit# *inhibit)
515 {
516 }
517
518 static void
519 inhibit_class_initcxx . . $ inhibit_class_init(e33b71e5a9110914). (InhibitClasscxx . . $ InhibitClass# *klass)
520 {
521 GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
522
523 object_class->disposecxx . . $ _GObjectClass#dispose. = inhibit_disposecxx . . $ inhibit_dispose(6087475fa43034d3).;
524 }
525
526 static void
527 on_state_changedcxx . . $ on_state_changed(936d22a23c51ded5). (XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *impl,
528 const char *session_id,
529 GVariantcxx . . $ GVariant# *state,
530 gpointercxx . . $ gpointer# data)
531 {
532 GDBusConnectioncxx . . $ GDBusConnection# *connection = g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl));
533 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpSession) session = xdp_session_lookupcxx . . $ xdp_session_lookup(7cb6de4f3c42cd2). (session_id);
534 InhibitSessioncxx . . $ InhibitSession# *inhibit_session = INHIBIT_SESSIONcxx . . $ INHIBIT_SESSION(80b9dbcbee079200). (session);
535 gbooleancxx . . $ gboolean# active = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
536 guint32cxx . . $ guint32# session_state = 0;
537
538 g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (state, "screensaver-active", "b", &active);
539 g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (state, "session-state", "u", &session_state);
540 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Received state-changed %s: screensaver-active: %d, session-state: %u",
541 session_id, active, session_state);
542
543 if (inhibit_session && !inhibit_session->closedcxx . . $ _InhibitSession#closed.)
544 g_dbus_connection_emit_signalcxx . . $ g_dbus_connection_emit_signal(e1c7067f953d4fcb). (connection,
545 session->sendercxx . . $ _XdpSession#sender.,
546 DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!,
547 INHIBIT_DBUS_IFACEcxx . . $ `src/xdp-types.h:86:9`!,
548 "StateChanged",
549 g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(o@a{sv})", session_id, state),
550 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
551 }
552
553 static Inhibitcxx . . $ Inhibit# *
554 inhibit_newcxx . . $ inhibit_new(c1b944fc734c7b45). (XdpContextcxx . . $ XdpContext# *context,
555 XdpDbusImplInhibitcxx . . $ XdpDbusImplInhibit# *impl)
556 {
557 Inhibitcxx . . $ Inhibit# *inhibit;
558
559 inhibit = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (inhibit_get_typecxx . . $ inhibit_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
560 inhibit->contextcxx . . $ _Inhibit#context. = context;
561 inhibit->implcxx . . $ _Inhibit#impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (impl);
562
563 g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (inhibit->impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!);
564
565 g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (inhibit->implcxx . . $ _Inhibit#impl., "state-changed",
566 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (on_state_changed),
567 inhibit, G_CONNECT_DEFAULTcxx . . $ G_CONNECT_DEFAULT.);
568
569 xdp_dbus_inhibit_set_versioncxx . . $ xdp_dbus_inhibit_set_version(8824b2c24a23e76d). (XDP_DBUS_INHIBITcxx . . $ `build/src/xdp-dbus.h:3435:9`! (inhibit), 3);
570
571 return inhibit;
572 }
573
574 void
575 init_inhibitcxx . . $ init_inhibit(7d190a42f72e5c4f). (XdpContextcxx . . $ XdpContext# *context)
576 {
577 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(Inhibit) inhibit = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
578 GDBusConnectioncxx . . $ GDBusConnection# *connection = xdp_context_get_connectioncxx . . $ xdp_context_get_connection(a09559f10e8590c5). (context);
579 XdpPortalConfigcxx . . $ XdpPortalConfig# *config = xdp_context_get_configcxx . . $ xdp_context_get_config(3deea62d2e42aa7). (context);
580 XdpImplConfigcxx . . $ XdpImplConfig# *impl_config;
581 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplInhibit) impl = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
582 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
583
584 impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (config, INHIBIT_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:87:9`!);
585 if (impl_config == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
586 return;
587
588 impl = xdp_dbus_impl_inhibit_proxy_new_synccxx . . $ xdp_dbus_impl_inhibit_proxy_new_sync(10b35150a2a80f3c). (connection,
589 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
590 impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name.,
591 "/org/freedesktop/portal/desktop",
592 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error);
593 if (impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
594 {
595 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create inhibit proxy: %s", error->message);
596 return;
597 }
598
599 inhibit = inhibit_newcxx . . $ inhibit_new(c1b944fc734c7b45). (context, impl);
600
601 xdp_context_take_and_export_portalcxx . . $ xdp_context_take_and_export_portal(54303e2939dd494f). (context,
602 G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&inhibit)),
603 XDP_CONTEXT_EXPORT_FLAGS_NONEcxx . . $ XDP_CONTEXT_EXPORT_FLAGS_NONE.);
604 }