[Xfce4-commits] <xfce4-clipman-plugin:master> [daemon] Fix empty clipboard when leaving Firefox (bug #5738)

Mike Massonnet noreply at xfce.org
Sun Nov 15 21:28:01 CET 2009


Updating branch refs/heads/master
         to 2e1354a77942cb8d9733e09250d4553e22a36307 (commit)
       from 202ee0b5bbe9c226e2e4174620f858de450a326a (commit)

commit 2e1354a77942cb8d9733e09250d4553e22a36307
Author: Mike Massonnet <mmassonnet at gmail.com>
Date:   Sun Nov 15 21:26:35 2009 +0100

    [daemon] Fix empty clipboard when leaving Firefox (bug #5738)

 ChangeLog                      |    5 ++++-
 daemon/gsd-clipboard-manager.c |   13 +++++++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fb7717b..98e374f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
 2009-11-15	Mike Massonnet
+[daemon] Fix empty clipboard when leaving Firefox (bug #5738)
+
+2009-11-15	Mike Massonnet
 === Release 1.1.2 ===
 
 	Update credits in the about dialog.
@@ -21,7 +24,7 @@
 	line flag to switch between the selections and the default clipboard.
 
 2009-10-31	Mike Massonnet
-Fix popup from keyboard shortcut not always working #bug 5909
+Fix popup from keyboard shortcut not always working (bug #5909)
 
 	Factorize the popup action inside plugin.c(plugin_popup_menu) and add
 	a menu position function callback pointer within the MyPlugin
diff --git a/daemon/gsd-clipboard-manager.c b/daemon/gsd-clipboard-manager.c
index 20a6e8f..e5c85a4 100644
--- a/daemon/gsd-clipboard-manager.c
+++ b/daemon/gsd-clipboard-manager.c
@@ -185,6 +185,19 @@ default_clipboard_owner_change (GsdClipboardManager *manager,
                 default_clipboard_store (manager);
         }
         else {
+                /* This 'bug' happens with Mozilla applications, it means that
+                 * we restored the clipboard (we own it now) but somehow we are
+                 * being noticed twice about that fact where first the owner is
+                 * 0 (which is when we must restore) but then again where the
+                 * owner is ourself (which is what normally only happens and
+                 * also that means that we have to store the clipboard content
+                 * e.g. owner is not 0). By the second time we would store
+                 * ourself back with an empty clipboard... solution is to jump
+                 * over the first time and don't try to restore empty data. */
+                if (manager->priv->internal_change) {
+                        return;
+                }
+
                 manager->priv->internal_change = TRUE;
                 default_clipboard_restore (manager);
         }



More information about the Xfce4-commits mailing list