1
0
mirror of https://github.com/dguglielmi/sunny-overlay.git synced 2025-12-06 16:02:39 +01:00

x11-misc/gpaste: Port to meson build, apply upstream patches to 3.32.0

This commit is contained in:
2020-01-06 23:07:17 +01:00
parent f0ed8ae450
commit 18f4a30800
5 changed files with 378 additions and 18 deletions

View File

@@ -0,0 +1,83 @@
From d195bf0ebc2ed82b49cb83ce9cbad8a7fa492c34 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Tue, 7 May 2019 15:58:46 +0200
Subject: [PATCH] detect when images are growing
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
src/libgpaste/core/gpaste-history.c | 3 +++
src/libgpaste/core/gpaste-image-item.c | 18 ++++++++++++++++++
src/libgpaste/core/gpaste-image-item.h | 3 +++
src/libgpaste/libgpaste.sym | 5 +++++
4 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/libgpaste/core/gpaste-history.c b/src/libgpaste/core/gpaste-history.c
index 7936fab1..02f2b4fa 100644
--- a/src/libgpaste/core/gpaste-history.c
+++ b/src/libgpaste/core/gpaste-history.c
@@ -214,6 +214,9 @@ g_paste_history_private_is_growing_line (GPasteHistoryPrivate *priv,
GPasteItem *old,
GPasteItem *new)
{
+ if (_G_PASTE_IS_IMAGE_ITEM (old) && _G_PASTE_IS_IMAGE_ITEM (new))
+ return g_paste_image_item_is_growing (_G_PASTE_IMAGE_ITEM (new), _G_PASTE_IMAGE_ITEM (old));
+
if (!(g_paste_settings_get_growing_lines (priv->settings) &&
_G_PASTE_IS_TEXT_ITEM (old) && _G_PASTE_IS_TEXT_ITEM (new) &&
!_G_PASTE_IS_PASSWORD_ITEM (old) && !_G_PASTE_IS_PASSWORD_ITEM (new)))
diff --git a/src/libgpaste/core/gpaste-image-item.c b/src/libgpaste/core/gpaste-image-item.c
index 7b3a3244..2b30a6c6 100644
--- a/src/libgpaste/core/gpaste-image-item.c
+++ b/src/libgpaste/core/gpaste-image-item.c
@@ -80,6 +80,24 @@ g_paste_image_item_get_image (const GPasteImageItem *self)
return priv->image;
}
+G_PASTE_VISIBLE gboolean
+g_paste_image_item_is_growing (const GPasteImageItem *self,
+ const GPasteImageItem *other)
+{
+ g_return_val_if_fail (_G_PASTE_IS_IMAGE_ITEM (self), FALSE);
+ g_return_val_if_fail (_G_PASTE_IS_IMAGE_ITEM (other), FALSE);
+
+ const GPasteImageItemPrivate *priv = _g_paste_image_item_get_instance_private (self);
+ const GPasteImageItemPrivate *_priv = _g_paste_image_item_get_instance_private (other);
+
+ if (!priv->image || !_priv->image)
+ return FALSE;
+
+ gsize len = MIN (gdk_pixbuf_get_byte_length (priv->image), gdk_pixbuf_get_byte_length (_priv->image));
+
+ return !memcmp (gdk_pixbuf_read_pixels (priv->image), gdk_pixbuf_read_pixels (_priv->image), len);
+}
+
static gboolean
g_paste_image_item_equals (const GPasteItem *self,
const GPasteItem *other)
diff --git a/src/libgpaste/core/gpaste-image-item.h b/src/libgpaste/core/gpaste-image-item.h
index bfc74896..b658109b 100644
--- a/src/libgpaste/core/gpaste-image-item.h
+++ b/src/libgpaste/core/gpaste-image-item.h
@@ -23,6 +23,9 @@ const gchar *g_paste_image_item_get_checksum (const GPasteImageItem *self);
const GDateTime *g_paste_image_item_get_date (const GPasteImageItem *self);
GdkPixbuf *g_paste_image_item_get_image (const GPasteImageItem *self);
+gboolean g_paste_image_item_is_growing (const GPasteImageItem *self,
+ const GPasteImageItem *other);
+
GPasteItem *g_paste_image_item_new (GdkPixbuf *img);
GPasteItem *g_paste_image_item_new_from_file (const gchar *path,
GDateTime *date);
diff --git a/src/libgpaste/libgpaste.sym b/src/libgpaste/libgpaste.sym
index daf6329e..650d2a26 100644
--- a/src/libgpaste/libgpaste.sym
+++ b/src/libgpaste/libgpaste.sym
@@ -505,3 +505,8 @@ global:
g_paste_util_empty_with_confirmation;
g_paste_util_empty_with_confirmation_sync;
} LIBGPASTE_3_28_1;
+
+LIBGPASTE_3_32_1 {
+global:
+ g_paste_iimage_item_is_growing;
+} LIBGPASTE_3_28_3;

View File

@@ -0,0 +1,179 @@
From 1eaed802448e5262cc4d3d7b9b95a408ff89494c Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Sun, 17 Mar 2019 14:20:10 +0100
Subject: [PATCH] gnome-shel: only var should be exported
Fixes part of #268
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
src/gnome-shell/aboutItem.js | 2 +-
src/gnome-shell/deleteButton.js | 2 +-
src/gnome-shell/deleteItemPart.js | 2 +-
src/gnome-shell/dummyHistoryItem.js | 2 +-
src/gnome-shell/emptyHistoryItem.js | 2 +-
src/gnome-shell/item.js | 2 +-
src/gnome-shell/pageItem.js | 2 +-
src/gnome-shell/pageSwitcher.js | 2 +-
src/gnome-shell/searchItem.js | 2 +-
src/gnome-shell/stateSwitch.js | 2 +-
src/gnome-shell/statusIcon.js | 2 +-
src/gnome-shell/uiItem.js | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/gnome-shell/aboutItem.js b/src/gnome-shell/aboutItem.js
index b4a7ff86..6c7bd972 100644
--- a/src/gnome-shell/aboutItem.js
+++ b/src/gnome-shell/aboutItem.js
@@ -6,7 +6,7 @@
const { St } = imports.gi;
-class GPasteAboutItem {
+var GPasteAboutItem = class {
constructor(client, menu) {
this.actor = new St.Button({
reactive: true,
diff --git a/src/gnome-shell/deleteButton.js b/src/gnome-shell/deleteButton.js
index 93816a1a..3de6160e 100644
--- a/src/gnome-shell/deleteButton.js
+++ b/src/gnome-shell/deleteButton.js
@@ -6,7 +6,7 @@
const { Clutter, St } = imports.gi;
-class GPasteDeleteButton {
+var GPasteDeleteButton = class {
constructor(client, index) {
this.actor = new St.Button();
diff --git a/src/gnome-shell/deleteItemPart.js b/src/gnome-shell/deleteItemPart.js
index 0b87abaf..b5a5add3 100644
--- a/src/gnome-shell/deleteItemPart.js
+++ b/src/gnome-shell/deleteItemPart.js
@@ -11,7 +11,7 @@ const Me = ExtensionUtils.getCurrentExtension();
const DeleteButton = Me.imports.deleteButton;
-class GPasteDeleteItemPart {
+var GPasteDeleteItemPart = class {
constructor(client, index) {
this.actor = new St.Bin({ x_align: St.Align.END });
this._deleteButton = new DeleteButton.GPasteDeleteButton(client, index);
diff --git a/src/gnome-shell/dummyHistoryItem.js b/src/gnome-shell/dummyHistoryItem.js
index 8d227fc9..38f3ea4f 100644
--- a/src/gnome-shell/dummyHistoryItem.js
+++ b/src/gnome-shell/dummyHistoryItem.js
@@ -10,7 +10,7 @@ const PopupMenu = imports.ui.popupMenu;
const _ = Gettext.domain('GPaste').gettext;
-class GPasteDummyHistoryItem extends PopupMenu.PopupMenuItem {
+var GPasteDummyHistoryItem = class extends PopupMenu.PopupMenuItem {
constructor() {
super(_("(Couldn't connect to GPaste daemon)"));
this.setSensitive(false);
diff --git a/src/gnome-shell/emptyHistoryItem.js b/src/gnome-shell/emptyHistoryItem.js
index 94c3df61..35bdb0c4 100644
--- a/src/gnome-shell/emptyHistoryItem.js
+++ b/src/gnome-shell/emptyHistoryItem.js
@@ -6,7 +6,7 @@
const { GLib, GPaste, St } = imports.gi;
-class GPasteEmptyHistoryItem {
+var GPasteEmptyHistoryItem = class {
constructor(client, settings, menu) {
this.actor = new St.Button({
reactive: true,
diff --git a/src/gnome-shell/item.js b/src/gnome-shell/item.js
index 99db6662..e04b8a90 100644
--- a/src/gnome-shell/item.js
+++ b/src/gnome-shell/item.js
@@ -13,7 +13,7 @@ const Me = ExtensionUtils.getCurrentExtension();
const DeleteItemPart = Me.imports.deleteItemPart;
-class GPasteItem extends PopupMenu.PopupMenuItem {
+var GPasteItem = class extends PopupMenu.PopupMenuItem {
constructor(client, size, index) {
super("");
diff --git a/src/gnome-shell/pageItem.js b/src/gnome-shell/pageItem.js
index ca0dde3e..1606016e 100644
--- a/src/gnome-shell/pageItem.js
+++ b/src/gnome-shell/pageItem.js
@@ -8,7 +8,7 @@ const { St } = imports.gi;
const Signals = imports.signals;
-class GPastePageItem {
+var GPastePageItem = class {
constructor(page) {
this.actor = new St.Button({
reactive: true,
diff --git a/src/gnome-shell/pageSwitcher.js b/src/gnome-shell/pageSwitcher.js
index 59e5c3a8..f6d09aeb 100644
--- a/src/gnome-shell/pageSwitcher.js
+++ b/src/gnome-shell/pageSwitcher.js
@@ -15,7 +15,7 @@ const PageItem = Me.imports.pageItem;
const MAX_PAGES = 20;
-class GPastePageSwitcher extends PopupMenu.PopupBaseMenuItem {
+var GPastePageSwitcher = class extends PopupMenu.PopupBaseMenuItem {
constructor() {
super({
reactive: false,
diff --git a/src/gnome-shell/searchItem.js b/src/gnome-shell/searchItem.js
index 2ec35f5d..9c3daa21 100644
--- a/src/gnome-shell/searchItem.js
+++ b/src/gnome-shell/searchItem.js
@@ -8,7 +8,7 @@ const PopupMenu = imports.ui.popupMenu;
const { St } = imports.gi;
-class GPasteSearchItem extends PopupMenu.PopupBaseMenuItem {
+var GPasteSearchItem = class extends PopupMenu.PopupBaseMenuItem {
constructor() {
super({
activate: false,
diff --git a/src/gnome-shell/stateSwitch.js b/src/gnome-shell/stateSwitch.js
index cd3fdba6..00a3d0f9 100644
--- a/src/gnome-shell/stateSwitch.js
+++ b/src/gnome-shell/stateSwitch.js
@@ -10,7 +10,7 @@ const PopupMenu = imports.ui.popupMenu;
const _ = Gettext.domain('GPaste').gettext;
-class GPasteStateSwitch extends PopupMenu.PopupSwitchMenuItem {
+var GPasteStateSwitch = class extends PopupMenu.PopupSwitchMenuItem {
constructor(client) {
super(_("Track changes"), client.is_active());
diff --git a/src/gnome-shell/statusIcon.js b/src/gnome-shell/statusIcon.js
index e2259fd6..c90a0978 100644
--- a/src/gnome-shell/statusIcon.js
+++ b/src/gnome-shell/statusIcon.js
@@ -8,7 +8,7 @@ const PopupMenu = imports.ui.popupMenu;
const { St } = imports.gi;
-class GPasteStatusIcon {
+var GPasteStatusIcon = class {
constructor() {
this.actor = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
diff --git a/src/gnome-shell/uiItem.js b/src/gnome-shell/uiItem.js
index fff0e621..6726cf82 100644
--- a/src/gnome-shell/uiItem.js
+++ b/src/gnome-shell/uiItem.js
@@ -6,7 +6,7 @@
const { GPaste, St } = imports.gi;
-class GPasteUiItem {
+var GPasteUiItem = class {
constructor(menu) {
this.actor = new St.Button({
reactive: true,