What do people think of this patch?



This patch simply adds another function to gdk/x11/gdkselection-x11.c
which allows applications to detect if there is an owner of a clipboard
or primary selection. It can use this info to allow "Paste" to be active
or not. It is similar to gdk_selection_owner_get, however it returns
true even if the owner is not a gtk program.

The function is called 'gdk_selection_owner_is_set'

I have actually sent two patches - the second is an update to the
documentation.

Comments? Flames?

Damian
-- 
Damian Ivereigh
CEPS Team Lead
http://wwwin-print.cisco.com
Desk: +61 2 8446 6344
Mob: +61 418 217 582
*** gtk+-1.3.7/gdk/x11/gdkselection-x11.c.old	Tue Sep 11 21:52:33 2001
--- gtk+-1.3.7/gdk/x11/gdkselection-x11.c	Tue Sep 11 21:57:40 2001
***************
*** 160,165 ****
--- 160,171 ----
    return gdk_window_lookup (xwindow);
  }
  
+ gboolean
+ gdk_selection_owner_is_set (GdkAtom selection)
+ {
+ 	return(XGetSelectionOwner (gdk_display, selection) != None);
+ }
+ 
  void
  gdk_selection_convert (GdkWindow *requestor,
  		       GdkAtom    selection,
*** gtk+-1.3.7/gdk/gdkselection.h.old	Tue Sep 11 21:58:51 2001
--- gtk+-1.3.7/gdk/gdkselection.h	Tue Sep 11 22:00:21 2001
***************
*** 44,49 ****
--- 44,50 ----
  				    guint32	  time,
  				    gboolean      send_event);
  GdkWindow* gdk_selection_owner_get (GdkAtom	  selection);
+ gboolean   gdk_selection_owner_is_set (GdkAtom	  selection);
  void	   gdk_selection_convert   (GdkWindow	 *requestor,
  				    GdkAtom	  selection,
  				    GdkAtom	  target,
*** gtk+-1.3.7/docs/reference/gdk/gdk-sections.txt.old	Tue Sep 11 22:16:49 2001
--- gtk+-1.3.7/docs/reference/gdk/gdk-sections.txt	Tue Sep 11 22:17:28 2001
***************
*** 607,612 ****
--- 607,613 ----
  GdkTarget
  gdk_selection_owner_set
  gdk_selection_owner_get
+ gdk_selection_owner_is_set
  gdk_selection_convert
  gdk_selection_property_get
  gdk_selection_send_notify
*** gtk+-1.3.7/docs/reference/gdk/tmpl/selections.sgml.old	Wed Sep 12 11:52:23 2001
--- gtk+-1.3.7/docs/reference/gdk/tmpl/selections.sgml	Wed Sep 12 12:05:28 2001
***************
*** 134,139 ****
--- 134,152 ----
            this call.
  
  
+ <!-- ##### FUNCTION gdk_selection_owner_is_set ##### -->
+ <para>
+ Determine if there is an owner of the given selection
+ </para>
+ 
+ @selection: an atom indentifying a selection.
+ @Returns: if there is a selection owner for this window,
+           then return %TRUE otherwise %FALSE. This function
+           differs from gdk_selection_owner_get() in that
+           it does not matter if the owner is known to
+           the current process.
+ 
+ 
  <!-- ##### FUNCTION gdk_selection_convert ##### -->
  <para>
  Retrieve the contents of a selection in a given


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]