From db2d879ad4bdd492daee48bf2829760b92d8e50e Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 31 May 1999 19:16:11 +0000 Subject: [PATCH] Tried to find thread/clipboard problem cause... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 4 ++-- src/gtk/clipbrd.cpp | 16 +++++++--------- src/gtk1/app.cpp | 4 ++-- src/gtk1/clipbrd.cpp | 16 +++++++--------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 32d5963bd8..d953d8d0da 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -250,7 +250,7 @@ static gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ) GDK_THREADS_LEAVE (); #endif - wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 10, wxapp_wakeup_timerout_callback, (gpointer) NULL ); + wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 20, wxapp_wakeup_timerout_callback, (gpointer) NULL ); return TRUE; } @@ -276,7 +276,7 @@ wxApp::wxApp() m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL ); #if wxUSE_THREADS - m_wakeUpTimerTag = gtk_timeout_add( 10, wxapp_wakeup_timerout_callback, (gpointer) NULL ); + m_wakeUpTimerTag = gtk_timeout_add( 20, wxapp_wakeup_timerout_callback, (gpointer) NULL ); #endif m_colorCube = (unsigned char*) NULL; diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 3eb5d9b886..a4bf7b6a6f 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -231,8 +231,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event ) if ((!wxTheClipboard->m_ownsPrimarySelection) && (!wxTheClipboard->m_ownsClipboard)) { - /* the clipboard is no longer in our hands. we can the clipboard data. */ - + /* the clipboard is no longer in our hands. we can the delete clipboard data. */ if (wxTheClipboard->m_dataBroker) { delete wxTheClipboard->m_dataBroker; @@ -445,26 +444,21 @@ bool wxClipboard::AddData( wxDataObject *data ) wxCHECK_MSG( data, FALSE, _T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ - if (!m_dataBroker) m_dataBroker = new wxDataBroker(); /* add new data to list of offered data objects */ - m_dataBroker->Add( data ); /* get native format id of new data object */ - GdkAtom format = data->GetFormat().GetAtom(); wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ - m_ownsClipboard = FALSE; m_ownsPrimarySelection = FALSE; /* Add handlers if someone requests data */ - #if (GTK_MINOR_VERSION > 0) @@ -497,9 +491,9 @@ bool wxClipboard::AddData( wxDataObject *data ) selection_handler, (gpointer) NULL ); #endif - + +// printf( "vorher.\n" ); /* Tell the world we offer clipboard data */ - if (!gtk_selection_owner_set( m_clipboardWidget, g_clipboardAtom, GDK_CURRENT_TIME )) @@ -508,6 +502,10 @@ bool wxClipboard::AddData( wxDataObject *data ) } m_ownsClipboard = TRUE; +// printf( "nachher.\n" ); + + return TRUE; + if (!gtk_selection_owner_set( m_clipboardWidget, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME )) diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 32d5963bd8..d953d8d0da 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -250,7 +250,7 @@ static gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ) GDK_THREADS_LEAVE (); #endif - wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 10, wxapp_wakeup_timerout_callback, (gpointer) NULL ); + wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 20, wxapp_wakeup_timerout_callback, (gpointer) NULL ); return TRUE; } @@ -276,7 +276,7 @@ wxApp::wxApp() m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL ); #if wxUSE_THREADS - m_wakeUpTimerTag = gtk_timeout_add( 10, wxapp_wakeup_timerout_callback, (gpointer) NULL ); + m_wakeUpTimerTag = gtk_timeout_add( 20, wxapp_wakeup_timerout_callback, (gpointer) NULL ); #endif m_colorCube = (unsigned char*) NULL; diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 3eb5d9b886..a4bf7b6a6f 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -231,8 +231,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event ) if ((!wxTheClipboard->m_ownsPrimarySelection) && (!wxTheClipboard->m_ownsClipboard)) { - /* the clipboard is no longer in our hands. we can the clipboard data. */ - + /* the clipboard is no longer in our hands. we can the delete clipboard data. */ if (wxTheClipboard->m_dataBroker) { delete wxTheClipboard->m_dataBroker; @@ -445,26 +444,21 @@ bool wxClipboard::AddData( wxDataObject *data ) wxCHECK_MSG( data, FALSE, _T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ - if (!m_dataBroker) m_dataBroker = new wxDataBroker(); /* add new data to list of offered data objects */ - m_dataBroker->Add( data ); /* get native format id of new data object */ - GdkAtom format = data->GetFormat().GetAtom(); wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ - m_ownsClipboard = FALSE; m_ownsPrimarySelection = FALSE; /* Add handlers if someone requests data */ - #if (GTK_MINOR_VERSION > 0) @@ -497,9 +491,9 @@ bool wxClipboard::AddData( wxDataObject *data ) selection_handler, (gpointer) NULL ); #endif - + +// printf( "vorher.\n" ); /* Tell the world we offer clipboard data */ - if (!gtk_selection_owner_set( m_clipboardWidget, g_clipboardAtom, GDK_CURRENT_TIME )) @@ -508,6 +502,10 @@ bool wxClipboard::AddData( wxDataObject *data ) } m_ownsClipboard = TRUE; +// printf( "nachher.\n" ); + + return TRUE; + if (!gtk_selection_owner_set( m_clipboardWidget, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME )) -- 2.45.2