summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Behan2015-06-08 18:22:22 -0400
committerConnor Behan2015-06-08 18:22:22 -0400
commit95de3b31e46d4431abc22316abfec3078236b625 (patch)
tree99be5f7f38511b925b89300267bd72f1b60e57d1
downloadaur-95de3b31e46d4431abc22316abfec3078236b625.tar.gz
Initial import
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD33
-rw-r--r--nosteal.patch93
-rw-r--r--xfce4-clipman-plugin.install12
4 files changed, 163 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4bb67a216ece
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = xfce4-clipman-plugin-passive
+ pkgdesc = Clipman without buggy selection stealing
+ pkgver = 1.2.6
+ pkgrel = 1
+ url = http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin
+ install = xfce4-clipman-plugin.install
+ arch = i686
+ arch = x86_64
+ groups = xfce4-goodies
+ license = GPL
+ makedepends = intltool
+ depends = xfce4-panel
+ depends = libunique
+ depends = libxtst
+ provides = xfce4-clipman-plugin
+ conflicts = xfce4-clipman-plugin
+ replaces = xfce4-clipman-plugin
+ options = !libtool
+ source = nosteal.patch
+ source = http://archive.xfce.org/src/panel-plugins/xfce4-clipman-plugin/1.2/xfce4-clipman-plugin-1.2.6.tar.bz2
+ md5sums = 13e31835071ea506fee684154975b2cf
+ md5sums = f7f2440647493243cbd7787eaee92fcb
+
+pkgname = xfce4-clipman-plugin-passive
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c9ded9b6e381
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,33 @@
+# Contributor: Connor Behan <connor.behan@gmail.com>
+
+pkgname=xfce4-clipman-plugin-passive
+pkgver=1.2.6
+pkgrel=1
+pkgdesc="Clipman without buggy selection stealing"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin"
+groups=('xfce4-goodies')
+depends=('xfce4-panel' 'libunique' 'libxtst')
+makedepends=('intltool')
+replaces=('xfce4-clipman-plugin')
+conflicts=('xfce4-clipman-plugin')
+provides=('xfce4-clipman-plugin')
+options=('!libtool')
+install=xfce4-clipman-plugin.install
+source=(nosteal.patch http://archive.xfce.org/src/panel-plugins/xfce4-clipman-plugin/1.2/xfce4-clipman-plugin-${pkgver}.tar.bz2)
+
+build() {
+ cd "${srcdir}"/xfce4-clipman-plugin-${pkgver}
+ patch -Np1 -i "${srcdir}"/nosteal.patch
+
+ ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
+ --localstatedir=/var --disable-static --enable-unique
+ make
+}
+
+package() {
+ cd "${srcdir}"/xfce4-clipman-plugin-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
+md5sums=('13e31835071ea506fee684154975b2cf' 'f7f2440647493243cbd7787eaee92fcb')
diff --git a/nosteal.patch b/nosteal.patch
new file mode 100644
index 000000000000..88fb26154ee4
--- /dev/null
+++ b/nosteal.patch
@@ -0,0 +1,93 @@
+diff -ru xfce4-clipman-plugin-1.2.3.orig/panel-plugin/main-panel-plugin.c xfce4-clipman-plugin-1.2.3/panel-plugin/main-panel-plugin.c
+--- xfce4-clipman-plugin-1.2.3.orig/panel-plugin/main-panel-plugin.c 2012-04-30 20:12:45.000000000 -0700
++++ xfce4-clipman-plugin-1.2.3/panel-plugin/main-panel-plugin.c 2012-04-30 20:16:47.000000000 -0700
+@@ -24,6 +24,9 @@
+ #include <locale.h>
+ #endif
+
++#include <X11/Xlib.h>
++#include <X11/Xatom.h>
++
+ #include <glib/gstdio.h>
+ #include <gtk/gtk.h>
+ #include <libxfce4ui/libxfce4ui.h>
+@@ -39,6 +42,7 @@
+ static void panel_plugin_register (XfcePanelPlugin *panel_plugin);
+ XFCE_PANEL_PLUGIN_REGISTER (panel_plugin_register);
+
++static gboolean cb_remember_item (MyPlugin *plugin);
+ static gboolean plugin_set_size (MyPlugin *plugin,
+ gint size);
+ static gboolean cb_button_pressed (GtkButton *button,
+@@ -107,7 +111,10 @@
+ G_CALLBACK (plugin_set_size), plugin);
+ g_signal_connect (plugin->menu, "deactivate",
+ G_CALLBACK (cb_menu_deactivate), plugin);
+-
++
++ plugin->remembering = FALSE;
++ g_timeout_add(250, (GtkFunction)cb_remember_item, plugin);
++
+ gtk_widget_show_all (GTK_WIDGET (panel_plugin));
+ }
+
+@@ -123,6 +130,37 @@
+ return TRUE;
+ }
+
++static gboolean
++cb_remember_item (MyPlugin *plugin)
++{
++ Display *display = GDK_DISPLAY ();
++ Atom XA_CLIPBOARD = XInternAtom(display, "CLIPBOARD", 0);
++ Window owner;
++
++ ClipmanHistoryItem *item;
++ GtkClipboard *clipboard;
++ gchar *text;
++
++ if (plugin->remembering) {
++ return TRUE;
++ } else {
++ plugin->remembering = TRUE;
++ item = clipman_history_get_item_to_restore(plugin->history);
++ if (item != NULL) {
++ if (item->type == CLIPMAN_HISTORY_TYPE_TEXT) {
++ text = item->content.text;
++ clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
++ owner = XGetSelectionOwner(display, XA_CLIPBOARD);
++ if (!owner) {
++ gtk_clipboard_set_text(clipboard, text, -1);
++ }
++ }
++ }
++ plugin->remembering = FALSE;
++ }
++ return TRUE;
++}
++
+ static gboolean
+ cb_button_pressed (GtkButton *button,
+ GdkEventButton *event,
+diff -ru xfce4-clipman-plugin-1.2.3.orig/panel-plugin/plugin.h xfce4-clipman-plugin-1.2.3/panel-plugin/plugin.h
+--- xfce4-clipman-plugin-1.2.3.orig/panel-plugin/plugin.h 2012-04-30 20:12:45.000000000 -0700
++++ xfce4-clipman-plugin-1.2.3/panel-plugin/plugin.h 2012-04-30 20:17:00.000000000 -0700
+@@ -58,6 +58,7 @@
+ GtkMenuPositionFunc menu_position_func;
+ GtkWidget *popup_menu;
+ gulong popup_menu_id;
++ gboolean remembering;
+ };
+
+ /*
+diff -ru xfce4-clipman-plugin-1.2.3.orig/x11-clipboard-manager/gsd-clipboard-manager.c xfce4-clipman-plugin-1.2.3/x11-clipboard-manager/gsd-clipboard-manager.c
+--- xfce4-clipman-plugin-1.2.3.orig/x11-clipboard-manager/gsd-clipboard-manager.c 2012-04-30 20:12:45.000000000 -0700
++++ xfce4-clipman-plugin-1.2.3/x11-clipboard-manager/gsd-clipboard-manager.c 2012-04-30 20:13:35.000000000 -0700
+@@ -292,7 +292,6 @@
+ timestamp = GDK_CURRENT_TIME;
+
+ XSelectInput (display, window, PropertyChangeMask);
+- XSetSelectionOwner (display, XA_CLIPBOARD_MANAGER, window, timestamp);
+
+ g_signal_connect_swapped (manager->priv->default_clipboard, "owner-change",
+ G_CALLBACK (default_clipboard_owner_change), manager);
diff --git a/xfce4-clipman-plugin.install b/xfce4-clipman-plugin.install
new file mode 100644
index 000000000000..fee9e5d11788
--- /dev/null
+++ b/xfce4-clipman-plugin.install
@@ -0,0 +1,12 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+