// Name: src/gtk/clipbrd.cpp
// Purpose: wxClipboard implementation for wxGTK
// Author: Robert Roebling, Vadim Zeitlin
-// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// (c) 2007 Vadim Zeitlin
// Licence: wxWindows licence
{
gtk_selection_data_set(
selection_data,
- GDK_SELECTION_TYPE_STRING,
+ format.GetFormatId(),
8*sizeof(gchar),
(const guchar*)buf.data(),
size );
wxLogTrace(TRACE_CLIPBOARD, wxT("Received selection %s"),
format.GetId().c_str());
- if ( !m_receivedData->IsSupportedFormat(format) )
+ if ( !m_receivedData->IsSupportedFormat(format, wxDataObject::Set) )
return;
m_receivedData->SetData(format,
wxClipboard::wxClipboard()
{
+ m_idSelectionGetHandler = 0;
+
m_open = false;
m_dataPrimary =
set ? m_clipboardWidget : NULL,
GTKGetClipboardAtom(),
(guint32)GDK_CURRENT_TIME
- );
+ ) != 0;
if ( !rc )
{
AddSupportedTarget(format);
}
- g_signal_connect (m_clipboardWidget, "selection_get",
+ if ( !m_idSelectionGetHandler )
+ {
+ m_idSelectionGetHandler = g_signal_connect (
+ m_clipboardWidget, "selection_get",
G_CALLBACK (selection_handler),
GUINT_TO_POINTER (gtk_get_current_event_time()) );
+ }
// tell the world we offer clipboard data
return SetSelectionOwner();