Replace g_clipboardAtom with GDK_SELECTION_CLIPBOARD
GDK_SELECTION_CLIPBOARD is the prefered way of referencing the GdkAtom for the clipboard, and using it provides a clearer distinction between the primary clipboard and the normal clipboard.
This commit is contained in:
@@ -41,7 +41,6 @@ typedef wxScopedArray<wxDataFormat> wxDataFormatArray;
|
|||||||
// data
|
// data
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static GdkAtom g_clipboardAtom = 0;
|
|
||||||
static GdkAtom g_targetsAtom = 0;
|
static GdkAtom g_targetsAtom = 0;
|
||||||
static GdkAtom g_timestampAtom = 0;
|
static GdkAtom g_timestampAtom = 0;
|
||||||
|
|
||||||
@@ -231,7 +230,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
|
|||||||
|
|
||||||
kind = wxClipboard::Primary;
|
kind = wxClipboard::Primary;
|
||||||
}
|
}
|
||||||
else if (event->selection == g_clipboardAtom)
|
else if ( event->selection == GDK_SELECTION_CLIPBOARD )
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_CLIPBOARD, wxT("Lost clipboard" ));
|
wxLogTrace(TRACE_CLIPBOARD, wxT("Lost clipboard" ));
|
||||||
|
|
||||||
@@ -471,8 +470,6 @@ wxClipboard::wxClipboard()
|
|||||||
G_CALLBACK (selection_clear_clip), NULL);
|
G_CALLBACK (selection_clear_clip), NULL);
|
||||||
|
|
||||||
// initialize atoms we use if not done yet
|
// initialize atoms we use if not done yet
|
||||||
if ( !g_clipboardAtom )
|
|
||||||
g_clipboardAtom = gdk_atom_intern( "CLIPBOARD", FALSE );
|
|
||||||
if ( !g_targetsAtom )
|
if ( !g_targetsAtom )
|
||||||
g_targetsAtom = gdk_atom_intern ("TARGETS", FALSE);
|
g_targetsAtom = gdk_atom_intern ("TARGETS", FALSE);
|
||||||
if ( !g_timestampAtom )
|
if ( !g_timestampAtom )
|
||||||
@@ -494,7 +491,7 @@ wxClipboard::~wxClipboard()
|
|||||||
GdkAtom wxClipboard::GTKGetClipboardAtom() const
|
GdkAtom wxClipboard::GTKGetClipboardAtom() const
|
||||||
{
|
{
|
||||||
return m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
|
return m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
|
||||||
: g_clipboardAtom;
|
: (GdkAtom)GDK_SELECTION_CLIPBOARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxClipboard::GTKClearData(Kind kind)
|
void wxClipboard::GTKClearData(Kind kind)
|
||||||
@@ -775,7 +772,7 @@ wxDataObject* wxClipboard::GTKGetDataObject( GdkAtom atom )
|
|||||||
|
|
||||||
return Data( wxClipboard::Primary );
|
return Data( wxClipboard::Primary );
|
||||||
}
|
}
|
||||||
else if ( atom == g_clipboardAtom )
|
else if ( atom == GDK_SELECTION_CLIPBOARD )
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_CLIPBOARD, wxT("Clipboard data requested" ));
|
wxLogTrace(TRACE_CLIPBOARD, wxT("Clipboard data requested" ));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user