diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index 4764909d00..74843f15b4 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -203,6 +203,12 @@ struct _GdkDisplayClass GdkAtom selection, guint32 time, gboolean send_event); + void (*send_selection_notify) (GdkDisplay *dispay, + GdkNativeWindow requestor, + GdkAtom selection, + GdkAtom target, + GdkAtom property, + guint32 time_); /* Signals */ void (*closed) (GdkDisplay *display, diff --git a/gdk/gdkselection.c b/gdk/gdkselection.c index 57b85840c4..188e64f07e 100644 --- a/gdk/gdkselection.c +++ b/gdk/gdkselection.c @@ -306,3 +306,31 @@ gdk_selection_owner_get_for_display (GdkDisplay *display, return GDK_DISPLAY_GET_CLASS (display)->get_selection_owner (display, selection); } + +/** + * gdk_selection_send_notify_for_display: + * @display: the #GdkDisplay where @requestor is realized + * @requestor: window to which to deliver response + * @selection: selection that was requested + * @target: target that was selected + * @property: property in which the selection owner stored the data, + * or %GDK_NONE to indicate that the request was rejected + * @time_: timestamp + * + * Send a response to SelectionRequest event. + * + * Since: 2.2 + */ +void +gdk_selection_send_notify_for_display (GdkDisplay *display, + GdkNativeWindow requestor, + GdkAtom selection, + GdkAtom target, + GdkAtom property, + guint32 time_) +{ + g_return_if_fail (GDK_IS_DISPLAY (display)); + + GDK_DISPLAY_GET_CLASS (display) + ->send_selection_notify (display, requestor, selection,target, property, time_); +} diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 4ad87a4575..4595c67f24 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -2762,4 +2762,5 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class) display_class->pop_error_trap = pop_error_trap; display_class->get_selection_owner = _gdk_x11_display_get_selection_owner; display_class->set_selection_owner = _gdk_x11_display_set_selection_owner; + display_class->send_selection_notify = _gdk_x11_display_send_selection_notify; } diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index 68ec939491..866854ae45 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -189,13 +189,19 @@ void _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display, void _gdk_x11_display_queue_events (GdkDisplay *display); -gboolean _gdk_x11_display_set_selection_owner (GdkDisplay *display, - GdkWindow *owner, - GdkAtom selection, - guint32 time, - gboolean send_event); -GdkWindow * _gdk_x11_display_get_selection_owner (GdkDisplay *display, - GdkAtom selection); +gboolean _gdk_x11_display_set_selection_owner (GdkDisplay *display, + GdkWindow *owner, + GdkAtom selection, + guint32 time, + gboolean send_event); +GdkWindow * _gdk_x11_display_get_selection_owner (GdkDisplay *display, + GdkAtom selection); +void _gdk_x11_display_send_selection_notify (GdkDisplay *display, + GdkNativeWindow requestor, + GdkAtom selection, + GdkAtom target, + GdkAtom property, + guint32 time); void _gdk_x11_device_check_extension_events (GdkDevice *device); diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c index 0ba05199e6..81963dcad3 100644 --- a/gdk/x11/gdkselection-x11.c +++ b/gdk/x11/gdkselection-x11.c @@ -334,32 +334,16 @@ gdk_selection_property_get (GdkWindow *requestor, return 0; } -/** - * gdk_selection_send_notify_for_display: - * @display: the #GdkDisplay where @requestor is realized - * @requestor: window to which to deliver response. - * @selection: selection that was requested. - * @target: target that was selected. - * @property: property in which the selection owner stored the data, - * or %GDK_NONE to indicate that the request was rejected. - * @time_: timestamp. - * - * Send a response to SelectionRequest event. - * - * Since: 2.2 - **/ void -gdk_selection_send_notify_for_display (GdkDisplay *display, - GdkNativeWindow requestor, - GdkAtom selection, - GdkAtom target, - GdkAtom property, - guint32 time) +_gdk_x11_display_send_selection_notify (GdkDisplay *display, + GdkNativeWindow requestor, + GdkAtom selection, + GdkAtom target, + GdkAtom property, + guint32 time) { XSelectionEvent xevent; - - g_return_if_fail (GDK_IS_DISPLAY (display)); - + xevent.type = SelectionNotify; xevent.serial = 0; xevent.send_event = True;