duplicate patch

f41
Caolán McNamara 9 years ago
parent f257e2be69
commit 10161a6715

@ -1,4 +1,4 @@
From fb71db9506d73a8a14c3fd888bdea7778def7cc0 Mon Sep 17 00:00:00 2001 From 3af38da4f0cb6b6341efad280c73a7733de42bea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 24 Jun 2016 15:06:36 +0100 Date: Fri, 24 Jun 2016 15:06:36 +0100
Subject: [PATCH] Resolves: rhbz#1326304 cannot detect loss of wayland Subject: [PATCH] Resolves: rhbz#1326304 cannot detect loss of wayland
@ -23,8 +23,6 @@ its "paste"->m_aSystemContents->gtk->"copy"->m_aOurContents
Undoubtedly something else will break now Undoubtedly something else will break now
(cherry picked from commit 88cd9dd591d7921e5bce33c170b457ae5aa871bb)
Change-Id: I32f2e1a2cc3310687f61a094fdfa940fa0cfcc39 Change-Id: I32f2e1a2cc3310687f61a094fdfa940fa0cfcc39
Resolves: rhbz#1350478 identify that we own the selection with a unique target Resolves: rhbz#1350478 identify that we own the selection with a unique target
@ -47,14 +45,14 @@ didn't work.
Change-Id: I1154899e478b6e0cc6f70aa0c90c26663299072c Change-Id: I1154899e478b6e0cc6f70aa0c90c26663299072c
(cherry picked from commit 88f7aae022bedd61588424a11bbc033217ba4e43) (cherry picked from commit 88f7aae022bedd61588424a11bbc033217ba4e43)
--- ---
vcl/unx/gtk3/gtk3gtkinst.cxx | 127 +++++++++++++++++++++---------------------- vcl/unx/gtk3/gtk3gtkinst.cxx | 124 ++++++++++++++++++++++---------------------
1 file changed, 63 insertions(+), 64 deletions(-) 1 file changed, 63 insertions(+), 61 deletions(-)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 06a5427..25f4590 100644 index ed64ded..8b01166 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx --- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -238,50 +238,6 @@ public: @@ -238,47 +238,6 @@ public:
} }
}; };
@ -64,10 +62,7 @@ index 06a5427..25f4590 100644
-//one here for that purpose and just give it a VclGtkClipboard* member -//one here for that purpose and just give it a VclGtkClipboard* member
-class VclGtkClipboard; -class VclGtkClipboard;
- -
-typedef struct _ClipboardOwner ClipboardOwner; -struct ClipboardOwner
-typedef struct _ClipboardOwnerClass ClipboardOwnerClass;
-
-struct _ClipboardOwner
-{ -{
- GObject parent_instance; - GObject parent_instance;
- -
@ -75,7 +70,7 @@ index 06a5427..25f4590 100644
- VclGtkClipboard* m_pThis; - VclGtkClipboard* m_pThis;
-}; -};
- -
-struct _ClipboardOwnerClass -struct ClipboardOwnerClass
-{ -{
- GObjectClass parent_class; - GObjectClass parent_class;
- -
@ -105,7 +100,7 @@ index 06a5427..25f4590 100644
class VclGtkClipboard : class VclGtkClipboard :
public cppu::WeakComponentImplHelper< public cppu::WeakComponentImplHelper<
datatransfer::clipboard::XSystemClipboard, datatransfer::clipboard::XSystemClipboard,
@@ -290,7 +246,6 @@ class VclGtkClipboard : @@ -287,7 +246,6 @@ class VclGtkClipboard :
{ {
GdkAtom m_nSelection; GdkAtom m_nSelection;
osl::Mutex m_aMutex; osl::Mutex m_aMutex;
@ -113,7 +108,7 @@ index 06a5427..25f4590 100644
gulong m_nOwnerChangedSignalId; gulong m_nOwnerChangedSignalId;
Reference<css::datatransfer::XTransferable> m_aContents; Reference<css::datatransfer::XTransferable> m_aContents;
Reference<css::datatransfer::clipboard::XClipboardOwner> m_aOwner; Reference<css::datatransfer::clipboard::XClipboardOwner> m_aOwner;
@@ -352,7 +307,7 @@ public: @@ -349,7 +307,7 @@ public:
void ClipboardGet(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info); void ClipboardGet(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info);
void ClipboardClear(GtkClipboard *clipboard); void ClipboardClear(GtkClipboard *clipboard);
@ -122,7 +117,7 @@ index 06a5427..25f4590 100644
}; };
OUString VclGtkClipboard::getImplementationName() throw( RuntimeException, std::exception ) OUString VclGtkClipboard::getImplementationName() throw( RuntimeException, std::exception )
@@ -373,13 +328,13 @@ sal_Bool VclGtkClipboard::supportsService( const OUString& ServiceName ) throw( @@ -370,13 +328,13 @@ sal_Bool VclGtkClipboard::supportsService( const OUString& ServiceName ) throw(
Reference< css::datatransfer::XTransferable > VclGtkClipboard::getContents() throw( RuntimeException, std::exception ) Reference< css::datatransfer::XTransferable > VclGtkClipboard::getContents() throw( RuntimeException, std::exception )
{ {
@ -138,14 +133,13 @@ index 06a5427..25f4590 100644
return m_aContents; return m_aContents;
} }
@@ -391,9 +346,55 @@ void VclGtkClipboard::ClipboardGet(GtkClipboard* /*clipboard*/, GtkSelectionData @@ -388,9 +346,55 @@ void VclGtkClipboard::ClipboardGet(GtkClipboard* /*clipboard*/, GtkSelectionData
m_aConversionHelper.setSelectionData(m_aContents, selection_data, info); m_aConversionHelper.setSelectionData(m_aContents, selection_data, info);
} }
-void VclGtkClipboard::OwnerChanged(GtkClipboard* clipboard, GdkEvent* /*event*/) -void VclGtkClipboard::OwnerChanged(GtkClipboard* clipboard, GdkEvent* /*event*/)
+namespace +namespace
{ +{
- if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(clipboard))
+ const OString& getPID() + const OString& getPID()
+ { + {
+ static OString sPID; + static OString sPID;
@ -163,7 +157,8 @@ index 06a5427..25f4590 100644
+} +}
+ +
+void VclGtkClipboard::OwnerPossiblyChanged(GtkClipboard* clipboard, GdkEvent* /*event*/) +void VclGtkClipboard::OwnerPossiblyChanged(GtkClipboard* clipboard, GdkEvent* /*event*/)
+{ {
- if (G_OBJECT(m_pOwner) != gtk_clipboard_get_owner(clipboard))
+ if (!m_aContents.is()) + if (!m_aContents.is())
+ return; + return;
+ +
@ -196,7 +191,7 @@ index 06a5427..25f4590 100644
{ {
//null out m_aContents to return control to the system-one which //null out m_aContents to return control to the system-one which
//will be retrieved if getContents is called again //will be retrieved if getContents is called again
@@ -491,20 +492,20 @@ namespace @@ -488,20 +492,20 @@ namespace
guint info, guint info,
gpointer user_data_or_owner) gpointer user_data_or_owner)
{ {
@ -220,7 +215,7 @@ index 06a5427..25f4590 100644
} }
} }
@@ -517,8 +518,6 @@ VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection) @@ -514,8 +518,6 @@ VclGtkClipboard::VclGtkClipboard(GdkAtom nSelection)
GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
m_nOwnerChangedSignalId = g_signal_connect(clipboard, "owner-change", m_nOwnerChangedSignalId = g_signal_connect(clipboard, "owner-change",
G_CALLBACK(handle_owner_change), this); G_CALLBACK(handle_owner_change), this);
@ -229,7 +224,7 @@ index 06a5427..25f4590 100644
} }
void VclGtkClipboard::flushClipboard() void VclGtkClipboard::flushClipboard()
@@ -535,7 +534,6 @@ VclGtkClipboard::~VclGtkClipboard() @@ -534,7 +536,6 @@ VclGtkClipboard::~VclGtkClipboard()
{ {
GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
g_signal_handler_disconnect(clipboard, m_nOwnerChangedSignalId); g_signal_handler_disconnect(clipboard, m_nOwnerChangedSignalId);
@ -237,7 +232,7 @@ index 06a5427..25f4590 100644
ClipboardClear(nullptr); ClipboardClear(nullptr);
} }
@@ -600,15 +598,16 @@ void VclGtkClipboard::setContents( @@ -599,15 +600,16 @@ void VclGtkClipboard::setContents(
std::vector<GtkTargetEntry> aGtkTargets(m_aConversionHelper.FormatsToGtk(aFormats)); std::vector<GtkTargetEntry> aGtkTargets(m_aConversionHelper.FormatsToGtk(aFormats));
if (!aGtkTargets.empty()) if (!aGtkTargets.empty())
{ {

@ -1,4 +1,4 @@
From 785f89233eb588447af2e5f712c2b555b4fbc344 Mon Sep 17 00:00:00 2001 From 25477cb518a464fb052e55c2b7c250af606ba42d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 8 Jul 2016 14:50:56 +0100 Date: Fri, 8 Jul 2016 14:50:56 +0100
Subject: [PATCH] Resolves: rhbz#1352965 gtk3 infinite clipboard recursion with Subject: [PATCH] Resolves: rhbz#1352965 gtk3 infinite clipboard recursion with
@ -10,10 +10,10 @@ Change-Id: Ib67afaf532b8409e05fffbf1b8312d664460567d
1 file changed, 6 insertions(+), 5 deletions(-) 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 25f4590..72599b2 100644 index 8b01166..c92bf43 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx --- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -585,6 +585,7 @@ void VclGtkClipboard::setContents( @@ -587,6 +587,7 @@ void VclGtkClipboard::setContents(
{ {
osl::ClearableMutexGuard aGuard( m_aMutex ); osl::ClearableMutexGuard aGuard( m_aMutex );
Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner ); Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner );
@ -21,8 +21,8 @@ index 25f4590..72599b2 100644
Reference< datatransfer::XTransferable > xOldContents( m_aContents ); Reference< datatransfer::XTransferable > xOldContents( m_aContents );
m_aContents = xTrans; m_aContents = xTrans;
m_aOwner = xClipboardOwner; m_aOwner = xClipboardOwner;
@@ -592,6 +593,10 @@ void VclGtkClipboard::setContents( @@ -594,6 +595,10 @@ void VclGtkClipboard::setContents(
std::list< Reference< datatransfer::clipboard::XClipboardListener > > xListeners( m_aListeners ); std::list< Reference< datatransfer::clipboard::XClipboardListener > > aListeners( m_aListeners );
datatransfer::clipboard::ClipboardEvent aEv; datatransfer::clipboard::ClipboardEvent aEv;
+ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection); + GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
@ -32,7 +32,7 @@ index 25f4590..72599b2 100644
if (m_aContents.is()) if (m_aContents.is())
{ {
css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = xTrans->getTransferDataFlavors(); css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = xTrans->getTransferDataFlavors();
@@ -605,15 +610,11 @@ void VclGtkClipboard::setContents( @@ -607,15 +612,11 @@ void VclGtkClipboard::setContents(
aEntry.info = 0; aEntry.info = 0;
aGtkTargets.push_back(aEntry); aGtkTargets.push_back(aEntry);
@ -48,7 +48,7 @@ index 25f4590..72599b2 100644
m_aGtkTargets = aGtkTargets; m_aGtkTargets = aGtkTargets;
} }
@@ -621,7 +622,7 @@ void VclGtkClipboard::setContents( @@ -623,7 +624,7 @@ void VclGtkClipboard::setContents(
aGuard.clear(); aGuard.clear();
@ -56,7 +56,7 @@ index 25f4590..72599b2 100644
+ if (bOwnerChange) + if (bOwnerChange)
xOldOwner->lostOwnership( this, xOldContents ); xOldOwner->lostOwnership( this, xOldContents );
for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it = for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it =
xListeners.begin(); it != xListeners.end() ; ++it ) aListeners.begin(); it != aListeners.end() ; ++it )
-- --
2.7.4 2.7.4

@ -240,8 +240,7 @@ Patch10: 0001-don-t-autocapitalize-words-that-follow-a-field-mark.patch
Patch11: 0001-a11y-crash-on-deleting-certain-frame-in-certain-docu.patch Patch11: 0001-a11y-crash-on-deleting-certain-frame-in-certain-docu.patch
Patch12: 0001-Resolves-rhbz-1353069-don-t-clear-XATTR_FILL-from-st.patch Patch12: 0001-Resolves-rhbz-1353069-don-t-clear-XATTR_FILL-from-st.patch
Patch13: 0001-Resolves-rhbz-1351224-wayland-grab-related-crashes.patch Patch13: 0001-Resolves-rhbz-1351224-wayland-grab-related-crashes.patch
Patch14: 0001-Resolves-rhbz-1326304-cannot-detect-loss-of-wayland-.patch Patch14: 0001-Resolves-rhbz-1352965-gtk3-infinite-clipboard-recurs.patch
Patch15: 0001-Resolves-rhbz-1352965-gtk3-infinite-clipboard-recurs.patch
%if 0%{?rhel} %if 0%{?rhel}
# not upstreamed # not upstreamed

Loading…
Cancel
Save