-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11: Add an XdpParent on file chooser dialog
This adds a new implementation of XdpParent. To get the "parent_window" is simpler, it's just the window_id which is the window property of xcb.
- Loading branch information
Showing
4 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* cog-xdp-parent-x11.c | ||
* Copyright (C) 2023 SUSE Software Solutions Germany GmbH | ||
* | ||
* Distributed under terms of the MIT license. | ||
*/ | ||
|
||
#include "cog-xdp-parent-x11.h" | ||
|
||
#include "../common/xdp-parent-private.h" | ||
|
||
static gboolean | ||
xdp_parent_export_x11(XdpParent *parent, XdpParentExported callback, gpointer user_data) | ||
{ | ||
xcb_window_t *window_id = (xcb_window_t *) parent->data; | ||
guint32 xid = (guint32) *window_id; | ||
g_autofree char *handle = g_strdup_printf("x11:%x", xid); | ||
callback(parent, handle, user_data); | ||
return TRUE; | ||
} | ||
|
||
static void | ||
xdp_parent_unexport_x11(XdpParent *parent) | ||
{ | ||
} | ||
|
||
XdpParent * | ||
xdp_parent_new_x11(xcb_window_t *window_id) | ||
{ | ||
XdpParent *parent = g_new0(XdpParent, 1); | ||
parent->parent_export = xdp_parent_export_x11; | ||
parent->parent_unexport = xdp_parent_unexport_x11; | ||
parent->data = (gpointer) window_id; | ||
return parent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* cog-xdp-parent-x11.h | ||
* Copyright (C) 2023 SUSE Software Solutions Germany GmbH | ||
* | ||
* Distributed under terms of the MIT license. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <libportal/types.h> | ||
#include <xcb/xproto.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
XdpParent *xdp_parent_new_x11(xcb_window_t *window); | ||
|
||
G_END_DECLS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters