gdk: Remove ability to request selection notifications
Without selections, that's kinda pointless.
This commit is contained in:
@@ -88,8 +88,6 @@ gdk_display_supports_cursor_alpha
|
||||
gdk_display_get_default_cursor_size
|
||||
gdk_display_get_maximal_cursor_size
|
||||
gdk_display_get_default_group
|
||||
gdk_display_supports_selection_notification
|
||||
gdk_display_request_selection_notification
|
||||
gdk_display_supports_clipboard_persistence
|
||||
gdk_display_store_clipboard
|
||||
gdk_display_supports_shapes
|
||||
|
||||
@@ -358,20 +358,6 @@ gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
@@ -558,8 +544,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
display_class->has_pending = gdk_broadway_display_has_pending;
|
||||
display_class->queue_events = _gdk_broadway_display_queue_events;
|
||||
display_class->get_default_group = gdk_broadway_display_get_default_group;
|
||||
display_class->supports_selection_notification = gdk_broadway_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_broadway_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_broadway_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_broadway_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_broadway_display_supports_shapes;
|
||||
|
||||
@@ -1143,50 +1143,6 @@ gdk_display_get_default_group (GdkDisplay *display)
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_default_group (display);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_supports_selection_notification:
|
||||
* @display: a #GdkDisplay
|
||||
*
|
||||
* Returns whether #GdkEventOwnerChange events will be
|
||||
* sent when the owner of a selection changes.
|
||||
*
|
||||
* Returns: whether #GdkEventOwnerChange events will
|
||||
* be sent.
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gboolean
|
||||
gdk_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return GDK_DISPLAY_GET_CLASS (display)->supports_selection_notification (display);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_request_selection_notification:
|
||||
* @display: a #GdkDisplay
|
||||
* @selection: the #GdkAtom naming the selection for which
|
||||
* ownership change notification is requested
|
||||
*
|
||||
* Request #GdkEventOwnerChange events for ownership changes
|
||||
* of the selection named by the given atom.
|
||||
*
|
||||
* Returns: whether #GdkEventOwnerChange events will
|
||||
* be sent.
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gboolean
|
||||
gdk_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return GDK_DISPLAY_GET_CLASS (display)->request_selection_notification (display, selection);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_clipboard:
|
||||
* @display: a #GdkDisplay
|
||||
|
||||
@@ -93,12 +93,6 @@ void gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkWindow *gdk_display_get_default_group (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_selection_notification (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection);
|
||||
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
|
||||
@@ -126,9 +126,6 @@ struct _GdkDisplayClass
|
||||
void (*queue_events) (GdkDisplay *display);
|
||||
void (*make_default) (GdkDisplay *display);
|
||||
GdkWindow * (*get_default_group) (GdkDisplay *display);
|
||||
gboolean (*supports_selection_notification) (GdkDisplay *display);
|
||||
gboolean (*request_selection_notification) (GdkDisplay *display,
|
||||
GdkAtom selection);
|
||||
gboolean (*supports_shapes) (GdkDisplay *display);
|
||||
gboolean (*supports_input_shapes) (GdkDisplay *display);
|
||||
gboolean (*supports_cursor_alpha) (GdkDisplay *display);
|
||||
|
||||
@@ -400,19 +400,6 @@ gdk_mir_display_supports_cursor_color (GdkDisplay *display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
@@ -843,8 +830,6 @@ gdk_mir_display_class_init (GdkMirDisplayClass *klass)
|
||||
display_class->supports_clipboard_persistence = gdk_mir_display_supports_clipboard_persistence;
|
||||
display_class->supports_cursor_alpha = gdk_mir_display_supports_cursor_alpha;
|
||||
display_class->supports_cursor_color = gdk_mir_display_supports_cursor_color;
|
||||
display_class->supports_selection_notification = gdk_mir_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_mir_display_request_selection_notification;
|
||||
display_class->store_clipboard = gdk_mir_display_store_clipboard;
|
||||
display_class->get_default_cursor_size = gdk_mir_display_get_default_cursor_size;
|
||||
display_class->get_maximal_cursor_size = gdk_mir_display_get_maximal_cursor_size;
|
||||
|
||||
@@ -111,24 +111,6 @@ gdk_quartz_display_flush (GdkDisplay *display)
|
||||
/* Not supported. */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_quartz_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
/* FIXME: Implement */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_quartz_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_quartz_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
@@ -259,8 +241,6 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
|
||||
display_class->queue_events = _gdk_quartz_display_queue_events;
|
||||
display_class->has_pending = _gdk_quartz_display_has_pending;
|
||||
display_class->get_default_group = gdk_quartz_display_get_default_group;
|
||||
display_class->supports_selection_notification = gdk_quartz_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_quartz_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_quartz_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_quartz_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_quartz_display_supports_shapes;
|
||||
|
||||
@@ -810,21 +810,6 @@ gdk_wayland_display_get_default_group (GdkDisplay *display)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
@@ -1004,8 +989,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
|
||||
display_class->has_pending = gdk_wayland_display_has_pending;
|
||||
display_class->queue_events = _gdk_wayland_display_queue_events;
|
||||
display_class->get_default_group = gdk_wayland_display_get_default_group;
|
||||
display_class->supports_selection_notification = gdk_wayland_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_wayland_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_wayland_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_wayland_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_wayland_display_supports_shapes;
|
||||
|
||||
@@ -504,14 +504,6 @@ gdk_win32_display_get_default_group (GdkDisplay *display)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static HWND _hwnd_next_viewer = NULL;
|
||||
|
||||
/*
|
||||
@@ -686,43 +678,6 @@ failed:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
|
||||
gboolean ret = FALSE;
|
||||
gchar *selection_name = gdk_atom_name (selection);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_print ("gdk_display_request_selection_notification (..., %s)",
|
||||
selection_name));
|
||||
|
||||
if (selection == GDK_SELECTION_CLIPBOARD ||
|
||||
selection == GDK_SELECTION_PRIMARY)
|
||||
{
|
||||
if (display_win32->clipboard_hwnd == NULL)
|
||||
{
|
||||
if (register_clipboard_notification (display))
|
||||
GDK_NOTE (DND, g_print (" registered"));
|
||||
else
|
||||
GDK_NOTE (DND, g_print (" failed to register"));
|
||||
}
|
||||
ret = (display_win32->clipboard_hwnd != NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (DND, g_print (" unsupported"));
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
g_free (selection_name);
|
||||
|
||||
GDK_NOTE (DND, g_print (" -> %s\n", ret ? "TRUE" : "FALSE"));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
@@ -1226,8 +1181,6 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
|
||||
display_class->queue_events = _gdk_win32_display_queue_events;
|
||||
display_class->get_default_group = gdk_win32_display_get_default_group;
|
||||
|
||||
display_class->supports_selection_notification = gdk_win32_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_win32_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_win32_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_win32_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_win32_display_supports_shapes;
|
||||
@@ -1244,9 +1197,6 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
|
||||
display_class->create_window_impl = _gdk_win32_display_create_window_impl;
|
||||
|
||||
display_class->get_keymap = _gdk_win32_display_get_keymap;
|
||||
display_class->send_selection_notify = _gdk_win32_display_send_selection_notify;
|
||||
display_class->get_selection_property = _gdk_win32_display_get_selection_property;
|
||||
display_class->convert_selection = _gdk_win32_display_convert_selection;
|
||||
display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = _gdk_win32_display_utf8_to_string_target;
|
||||
display_class->make_gl_context_current = _gdk_win32_display_make_gl_context_current;
|
||||
|
||||
@@ -813,7 +813,7 @@ gdk_x11_clipboard_new (GdkDisplay *display,
|
||||
cb->selection = g_strdup (selection);
|
||||
cb->xselection = gdk_x11_get_xatom_by_name_for_display (display, selection);
|
||||
|
||||
gdk_display_request_selection_notification (display, gdk_atom_intern (selection, FALSE));
|
||||
gdk_x11_display_request_selection_notification (display, selection);
|
||||
g_signal_connect (display, "xevent", G_CALLBACK (gdk_x11_clipboard_xevent), cb);
|
||||
gdk_x11_clipboard_claim_remote (cb, CurrentTime);
|
||||
|
||||
|
||||
@@ -1662,8 +1662,8 @@ gdk_x11_display_open (const gchar *display_name)
|
||||
* notification, and then setup the initial state of
|
||||
* is_composited to avoid a race condition here.
|
||||
*/
|
||||
gdk_display_request_selection_notification (display,
|
||||
gdk_x11_xatom_to_atom_for_display (display, get_cm_atom (display)));
|
||||
gdk_x11_display_request_selection_notification (display,
|
||||
gdk_x11_xatom_to_atom_for_display (display, get_cm_atom (display)));
|
||||
gdk_display_set_composited (GDK_DISPLAY (display),
|
||||
XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), get_cm_atom (display)) != None);
|
||||
|
||||
@@ -2356,17 +2356,9 @@ gdk_x11_display_notify_startup_complete (GdkDisplay *display,
|
||||
g_free (free_this);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_x11_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
|
||||
return display_x11->have_xfixes;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gboolean
|
||||
gdk_x11_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
const char *selection)
|
||||
|
||||
{
|
||||
#ifdef HAVE_XFIXES
|
||||
@@ -2375,8 +2367,7 @@ gdk_x11_display_request_selection_notification (GdkDisplay *display,
|
||||
|
||||
if (display_x11->have_xfixes)
|
||||
{
|
||||
atom = gdk_x11_atom_to_xatom_for_display (display,
|
||||
selection);
|
||||
atom = gdk_x11_get_xatom_by_name_for_display (display, selection);
|
||||
XFixesSelectSelectionInput (display_x11->xdisplay,
|
||||
display_x11->leader_window,
|
||||
atom,
|
||||
@@ -3136,8 +3127,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
|
||||
display_class->has_pending = gdk_x11_display_has_pending;
|
||||
display_class->queue_events = _gdk_x11_display_queue_events;
|
||||
display_class->get_default_group = gdk_x11_display_get_default_group;
|
||||
display_class->supports_selection_notification = gdk_x11_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_x11_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_x11_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_x11_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_x11_display_supports_shapes;
|
||||
|
||||
@@ -168,15 +168,17 @@ struct _GdkX11DisplayClass
|
||||
{
|
||||
GdkDisplayClass parent_class;
|
||||
|
||||
gboolean (* xevent) (GdkX11Display *display,
|
||||
const XEvent *event);
|
||||
gboolean (* xevent) (GdkX11Display *display,
|
||||
const XEvent *event);
|
||||
};
|
||||
|
||||
GdkX11Screen *_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
|
||||
Window xrootwin);
|
||||
void _gdk_x11_display_error_event (GdkDisplay *display,
|
||||
XErrorEvent *error);
|
||||
gsize gdk_x11_display_get_max_request_size (GdkDisplay *display);
|
||||
GdkX11Screen * _gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
|
||||
Window xrootwin);
|
||||
void _gdk_x11_display_error_event (GdkDisplay *display,
|
||||
XErrorEvent *error);
|
||||
gsize gdk_x11_display_get_max_request_size (GdkDisplay *display);
|
||||
gboolean gdk_x11_display_request_selection_notification (GdkDisplay *display,
|
||||
const char *selection);
|
||||
|
||||
GdkFilterReturn _gdk_wm_protocols_filter (GdkXEvent *xev,
|
||||
GdkEvent *event,
|
||||
|
||||
Reference in New Issue
Block a user