x11: Pass Atom directly
We convert an atom to string just to convert it to an atom. We can avoid the roundtrip. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2945>
This commit is contained in:
parent
20e2adc4fc
commit
2e82702084
@ -75,7 +75,6 @@ meta_selection_source_x11_read_async (MetaSelectionSource *source,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MetaSelectionSourceX11 *source_x11 = META_SELECTION_SOURCE_X11 (source);
|
MetaSelectionSourceX11 *source_x11 = META_SELECTION_SOURCE_X11 (source);
|
||||||
Display *xdisplay = meta_x11_display_get_xdisplay (source_x11->x11_display);
|
|
||||||
GTask *task;
|
GTask *task;
|
||||||
|
|
||||||
task = g_task_new (source, cancellable, callback, user_data);
|
task = g_task_new (source, cancellable, callback, user_data);
|
||||||
@ -91,7 +90,7 @@ meta_selection_source_x11_read_async (MetaSelectionSource *source,
|
|||||||
mimetype = "UTF8_STRING";
|
mimetype = "UTF8_STRING";
|
||||||
|
|
||||||
meta_x11_selection_input_stream_new_async (source_x11->x11_display,
|
meta_x11_selection_input_stream_new_async (source_x11->x11_display,
|
||||||
XGetAtomName (xdisplay, source_x11->xselection),
|
source_x11->xselection,
|
||||||
mimetype,
|
mimetype,
|
||||||
source_x11->timestamp,
|
source_x11->timestamp,
|
||||||
G_PRIORITY_DEFAULT,
|
G_PRIORITY_DEFAULT,
|
||||||
@ -236,7 +235,6 @@ meta_selection_source_x11_new_async (MetaX11Display *x11_display,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
|
|
||||||
MetaSelectionSourceX11 *source;
|
MetaSelectionSourceX11 *source;
|
||||||
GTask *task;
|
GTask *task;
|
||||||
|
|
||||||
@ -251,7 +249,7 @@ meta_selection_source_x11_new_async (MetaX11Display *x11_display,
|
|||||||
g_task_set_task_data (task, source, g_object_unref);
|
g_task_set_task_data (task, source, g_object_unref);
|
||||||
|
|
||||||
meta_x11_selection_input_stream_new_async (x11_display,
|
meta_x11_selection_input_stream_new_async (x11_display,
|
||||||
XGetAtomName (xdisplay, xselection),
|
xselection,
|
||||||
"TARGETS",
|
"TARGETS",
|
||||||
timestamp,
|
timestamp,
|
||||||
G_PRIORITY_DEFAULT,
|
G_PRIORITY_DEFAULT,
|
||||||
|
@ -33,7 +33,7 @@ G_DECLARE_FINAL_TYPE (MetaX11SelectionInputStream,
|
|||||||
GInputStream)
|
GInputStream)
|
||||||
|
|
||||||
void meta_x11_selection_input_stream_new_async (MetaX11Display *x11_display,
|
void meta_x11_selection_input_stream_new_async (MetaX11Display *x11_display,
|
||||||
const char *selection,
|
Atom xselection,
|
||||||
const char *target,
|
const char *target,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
int io_priority,
|
int io_priority,
|
||||||
|
@ -524,7 +524,7 @@ meta_x11_selection_input_stream_xevent (MetaX11SelectionInputStream *stream,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_x11_selection_input_stream_new_async (MetaX11Display *x11_display,
|
meta_x11_selection_input_stream_new_async (MetaX11Display *x11_display,
|
||||||
const char *selection,
|
Atom xselection,
|
||||||
const char *target,
|
const char *target,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
int io_priority,
|
int io_priority,
|
||||||
@ -548,7 +548,7 @@ meta_x11_selection_input_stream_new_async (MetaX11Display *x11_display,
|
|||||||
|
|
||||||
x11_display->selection.input_streams =
|
x11_display->selection.input_streams =
|
||||||
g_list_prepend (x11_display->selection.input_streams, stream);
|
g_list_prepend (x11_display->selection.input_streams, stream);
|
||||||
priv->xselection = XInternAtom (x11_display->xdisplay, selection, False);
|
priv->xselection = xselection;
|
||||||
priv->xtarget = XInternAtom (x11_display->xdisplay, target, False);
|
priv->xtarget = XInternAtom (x11_display->xdisplay, target, False);
|
||||||
priv->xproperty = XInternAtom (x11_display->xdisplay, "META_SELECTION", False);
|
priv->xproperty = XInternAtom (x11_display->xdisplay, "META_SELECTION", False);
|
||||||
priv->window = XCreateWindow (x11_display->xdisplay,
|
priv->window = XCreateWindow (x11_display->xdisplay,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user