Bug 1791417 [Wayland] Don't advertise selection clipboard support if it's disabled r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D198141
This commit is contained in:
stransky 2024-01-12 08:31:34 +00:00
Родитель e61f02bed5
Коммит 7f13f18df6
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -14,6 +14,7 @@
#endif
#if defined(MOZ_WAYLAND)
# include "nsClipboardWayland.h"
# include "nsWaylandDisplay.h"
#endif
#include "nsGtkUtils.h"
#include "nsIURI.h"
@ -194,7 +195,13 @@ nsRetrievalContext::~nsRetrievalContext() {
nsClipboard::nsClipboard()
: nsBaseClipboard(mozilla::dom::ClipboardCapabilities(
true /* supportsSelectionClipboard */,
#ifdef MOZ_WAYLAND
widget::GdkIsWaylandDisplay()
? widget::WaylandDisplayGet()->IsPrimarySelectionEnabled()
: true,
#else
true, /* supportsSelectionClipboard */
#endif
false /* supportsFindClipboard */,
false /* supportsSelectionCache */)) {
g_signal_connect(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), "owner-change",