[packages/xfce4-notes-plugin] - add updates from upstream git - rel 5
baggins
baggins at pld-linux.org
Thu Dec 31 02:30:44 CET 2020
commit 90788a8b15601c98f4a9a157992b65038afa016d
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu Dec 31 02:30:02 2020 +0100
- add updates from upstream git
- rel 5
git.patch | 1854 +++++++++++++++++++++++++++++++++++++++++++++++
xfce4-notes-plugin.spec | 11 +-
2 files changed, 1863 insertions(+), 2 deletions(-)
---
diff --git a/xfce4-notes-plugin.spec b/xfce4-notes-plugin.spec
index e600a87..9ed420c 100644
--- a/xfce4-notes-plugin.spec
+++ b/xfce4-notes-plugin.spec
@@ -2,12 +2,13 @@ Summary: Notes plugin for the Xfce panel
Summary(pl.UTF-8): Notatki dla panelu Xfce
Name: xfce4-notes-plugin
Version: 1.8.1
-Release: 4
+Release: 5
License: GPL
Group: X11/Applications
Source0: http://archive.xfce.org/src/panel-plugins/xfce4-notes-plugin/1.8/%{name}-%{version}.tar.bz2
# Source0-md5: 31cb9520b01512a94344770b4befdb3b
Patch0: format-security.patch
+Patch1: git.patch
URL: http://goodies.xfce.org/projects/panel-plugins/xfce4-notes-plugin
BuildRequires: Thunar-devel >= 1.2.0
BuildRequires: autoconf >= 2.63
@@ -18,6 +19,8 @@ BuildRequires: libunique-devel
BuildRequires: libxfce4ui-devel
BuildRequires: pkgconfig
BuildRequires: rpmbuild(macros) >= 1.601
+BuildRequires: vala-xfconf >= 4.16.0
+BuildRequires: vala-xfce4-panel >= 4.16.0
BuildRequires: xfce4-dev-tools >= 4.8.0
BuildRequires: xfce4-panel-devel >= 4.8.0
BuildRequires: xfconf-devel >= 4.8.0
@@ -37,6 +40,9 @@ notatek na pulpicie.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+
+%{__rm} lib/ext-gdk.* lib/popup.* lib/theme-gtkrc.* src/xfce4-popup-notes.*
%build
%{__intltoolize}
@@ -46,6 +52,7 @@ notatek na pulpicie.
%{__autoheader}
%{__automake}
%configure \
+ --enable-maintainer-mode \
--disable-silent-rules \
--disable-static
@@ -81,6 +88,6 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/xfce4-notes-settings
%attr(755,root,root) %{_libdir}/xfce4/panel/plugins/libnotes.so*
%{_datadir}/xfce4-notes-plugin
-%{_datadir}/xfce4/panel-plugins/xfce4-notes-plugin.desktop
+%{_datadir}/xfce4/panel/plugins/xfce4-notes-plugin.desktop
%{_iconsdir}/hicolor/*/apps/*.*
%{_desktopdir}/xfce4-notes.desktop
diff --git a/git.patch b/git.patch
new file mode 100644
index 0000000..5992a3c
--- /dev/null
+++ b/git.patch
@@ -0,0 +1,1854 @@
+diff --git a/Makefile.am b/Makefile.am
+index 23b69e4..f320cb5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,3 +1,5 @@
++ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
++
+ @SET_MAKE@
+
+ SUBDIRS = \
+@@ -9,13 +11,21 @@ SUBDIRS = \
+ distclean-local:
+ rm -rf *.cache *~
+
++.PHONY: ChangeLog
++
++ChangeLog: Makefile
++ (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp \
++ && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) \
++ || (touch ChangeLog; echo 'Git directory not found: installing possibly empty changelog.' >&2)
++
++dist-hook: ChangeLog
++
+ EXTRA_DIST = \
+ AUTHORS \
+ ChangeLog \
+ COPYING \
+- INSTALL \
+ NEWS \
+- README \
++ README.md \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in \
+@@ -38,7 +38,6 @@
+ config.h.in \
+ config.sub \
+ configure \
+- configure.ac \
+ depcomp \
+ install-sh \
+ ltmain.sh \
+diff --git a/README.md b/README.md
+new file mode 100644
+index 0000000..2126a0f
+--- /dev/null
++++ b/README.md
+@@ -0,0 +1,49 @@
++[![License](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://gitlab.xfce.org/panel-plugins/xfce4-notes-plugin/-/blob/master/COPYING)
++
++# xfce4-notes-plugin
++
++The notes plugin provides you a quick way to write down a todo list,
++to paste a piece of code, to leave a note to your friend, or whatever
++else you had like to do with a Post-It note.
++
++----
++
++### Homepage
++
++[xfce4-notes-plugin documentation](https://docs.xfce.org/panel-plugins/xfce4-notes-plugin)
++
++### Changelog
++
++See [NEWS](https://gitlab.xfce.org/panel-plugins/xfce4-notes-plugin/-/blob/master/NEWS) for details on changes and fixes made in the current release.
++
++### Source Code Repository
++
++[Xfce4-notes-plugin source code](https://gitlab.xfce.org/panel-plugins/xfce4-notes-plugin)
++
++### Download a Release Tarball
++
++[Xfce4-notes-plugin archive](https://archive.xfce.org/src/panel-plugins/xfce4-notes-plugin)
++ or
++[Xfce4-notes-plugin tags](https://gitlab.xfce.org/panel-plugins/xfce4-notes-plugin/-/tags)
++
++### Installation
++
++From source code repository:
++
++ % cd xfce4-notes-plugin
++ % ./autogen.sh
++ % make
++ % make install
++
++From release tarball:
++
++ % tar xf xfce4-notes-plugin-<version>.tar.bz2
++ % cd xfce4-notes-plugin-<version>
++ % ./configure
++ % make
++ % make install
++
++### Reporting Bugs
++
++Visit the [reporting bugs](https://docs.xfce.org/panel-plugins/xfce4-notes-plugin/bugs) page to view currently open bug reports and instructions on reporting new bugs or submitting bugfixes.
++
+diff --git a/configure.ac b/configure.ac
+index 1f15797..f5d80ad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,20 +2,20 @@ dnl
+ dnl xfce4-notes-plugin - Notes plugin for the Xfce4 panel
+ dnl
+ dnl 2003 Jakob Henriksson <b0kaj+dev at lysator.liu.se>
+-dnl 2006-2012 Mike Massonnet <mmassonnet at gmail.com>
++dnl 2006-2016 Mike Massonnet <mmassonnet at xfce.org>
+ dnl
+
+ m4_define([xfce4_notes_plugin_version_major], [1])
+-m4_define([xfce4_notes_plugin_version_minor], [8])
+-m4_define([xfce4_notes_plugin_version_micro], [1])
++m4_define([xfce4_notes_plugin_version_minor], [9])
++m4_define([xfce4_notes_plugin_version_micro], [0])
+ m4_define([xfce4_notes_plugin_version_nano], [])
+ m4_define([xfce4_notes_plugin_version_build], [c48ff8b])
+-m4_define([xfce4_notes_plugin_version_tag], []) # Leave empty for releases
++m4_define([xfce4_notes_plugin_version_tag], [git]) # Leave empty for releases
+ m4_define([xfce4_notes_plugin_version], [xfce4_notes_plugin_version_major().xfce4_notes_plugin_version_minor().xfce4_notes_plugin_version_micro()ifelse(xfce4_notes_plugin_version_nano(), [], [], [.xfce4_notes_plugin_version_nano()])ifelse(xfce4_notes_plugin_version_tag(), [git], [xfce4_notes_plugin_version_tag()-xfce4_notes_plugin_version_build()], [xfce4_notes_plugin_version_tag()])])
+
+ AC_PREREQ([2.50])
+-AC_INIT([Notes], [xfce4_notes_plugin_version], [http://bugzilla.xfce.org/], [xfce4-notes-plugin],
+- [http://goodies.xfce.org/projects/panel-plugins/xfce4-notes-plugin])
++AC_INIT([Notes], [xfce4_notes_plugin_version], [https://gitlab.xfce.org/panel-plugins/xfce4-notes-plugin], [xfce4-notes-plugin],
++ [https://docs.xfce.org/panel-plugins/xfce4-notes-plugin])
+ AC_REVISION([xfce4_notes_plugin_version_build])
+ AC_CANONICAL_TARGET()
+ AC_CONFIG_HEADERS([config.h])
+@@ -23,9 +23,10 @@ AC_CONFIG_HEADERS([config.h])
+ LT_PREREQ([2.2.6])
+ LT_INIT([disable-static])
+
+-AM_INIT_AUTOMAKE([1.13 dist-bzip2 no-dist-gzip])
++AM_INIT_AUTOMAKE([1.13 dist-bzip2 no-dist-gzip foreign])
+ AM_MAINTAINER_MODE()
+ AM_SILENT_RULES([yes])
++AC_CONFIG_MACRO_DIRS([m4])
+
+ dnl Check for basic programs
+ AM_PROG_CC_C_O()
+@@ -41,40 +42,19 @@ AC_SUBST([MATH_LIBS], [" -lm"])
+
+ dnl Check for required packages
+ XDT_CHECK_LIBX11_REQUIRE()
+-XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
+-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
+-XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
+-
+-dnl Check for GTK
+-AC_ARG_ENABLE([gtk3],
+- [AC_HELP_STRING([--enable-gtk3], [Build with GTK3])],
+- [enable_gtk3=$enableval], [enable_gtk3=no])
+-if test "x$enable_gtk3" = "xyes"; then
+- dnl GIO 2.28 for GApplication
+- XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.28.0])
+- XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.2.0])
+- XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
+- AC_DEFINE([ENABLE_GTK3], [1], [Defined if build with GTK3 is enabled])
+-else
+- XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0])
+- XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.20.0])
+- XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
+- XDT_CHECK_PACKAGE([UNIQUE], [unique-1.0], [1.0.0])
+-fi
+-AM_CONDITIONAL([ENABLE_GTK3], [test "x$enable_gtk3" = "xyes"])
+-
+-dnl Check for Xfce Panel
+-if test "x$enable_gtk3" = "xno" ; then
+-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.10.0])
+-fi
+-
++XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.30.0])
++XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.30.0])
++XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0])
++XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.14.0])
++XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.14.0])
++XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.14.0])
++XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.14.0])
+ dnl Check for valac
+ if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
+- AM_PROG_VALAC([0.16.0])
++ AM_PROG_VALAC([0.46.0])
+ if test "x$VALAC" = "x" ; then
+ AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
+ fi
+- XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.10])
+ fi
+
+ dnl Translations
+@@ -87,9 +67,7 @@ XDT_FEATURE_DEBUG()
+ AC_OUTPUT([
+ Makefile
+ data/Makefile
+-data/gtk-2.0/Makefile
+-data/gtk-2.0/tabs/Makefile
+-data/gtk-2.0/scrollbars/Makefile
++data/gtk-3.0/Makefile
+ data/icons/Makefile
+ data/icons/16x16/Makefile
+ data/icons/22x22/Makefile
+@@ -112,21 +90,10 @@ echo "* Maintainer Mode: $USE_MAINTAINER_MODE"
+ if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
+ echo
+ echo " * Vala: $VALAC $am__vala_version"
+-if test "x$enable_gtk3" = "xno" ; then
+-echo " * Xfce4-vala: $XFCE4VALA_VERSION"
+-fi
+ echo
+ fi
+ echo "* GTK+: $GTK_VERSION"
+-if test "x$enable_gtk3" = "xyes" ; then
+-echo "* W"
+-echo "* W GTK3 support is only experimental, don't use for production."
+-echo "* W"
+-echo
+-fi
+-if test "x$enable_gtk3" = "xno" ; then
+ echo "* Xfce Panel: $LIBXFCE4PANEL_VERSION"
+-fi
+ echo "* Debug Support: $enable_debug"
+ echo
+
+diff --git a/data/Makefile.am b/data/Makefile.am
+index c081716..e01936e 100644
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -1,5 +1,5 @@
+ SUBDIRS = \
+- gtk-2.0 \
++ gtk-3.0 \
+ icons \
+ pixmaps
+
+diff --git a/data/gtk-3.0/Makefile.am b/data/gtk-3.0/Makefile.am
+new file mode 100644
+index 0000000..a6a4c3a
+--- /dev/null
++++ b/data/gtk-3.0/Makefile.am
+@@ -0,0 +1,3 @@
++notesgtkcssdir = $(pkgdatadir)/gtk-3.0
++dist_notesgtkcss_DATA = \
++ gtk-main.css
+diff --git a/data/gtk-3.0/gtk-main.css b/data/gtk-3.0/gtk-main.css
+index 0000000..9628dfd
+--- /dev/null
++++ b/data/gtk-3.0/gtk-main.css
+@@ -0,0 +1,160 @@
++ at define-color theme_base_color @notes_bg_color;
++ at define-color theme_text_color shade (@theme_base_color, 0.4);
++ at define-color theme_bg_color @theme_base_color;
++ at define-color theme_fg_color shade (@theme_base_color, 0.3);
++ at define-color theme_selected_bg_color shade (@theme_base_color, 0.8);
++ at define-color theme_selected_fg_color shade (@theme_base_color, 1.4);
++ at define-color insensitive_bg_color shade (@theme_bg_color, 1.1);
++ at define-color insensitive_fg_color shade (@theme_fg_color, 1.8);
++
++ at define-color borders shade (@theme_base_color, 0.8);
++ at define-color frame_color shade (@theme_base_color, 0.7);
++ at define-color notebook_active_tab_border shade (@theme_base_color, 1.1);
++ at define-color notebook_selected_tab_color shade (@theme_base_color, 0.9);
++
++* {
++ border-width: 0px;
++}
++
++/* window and frame */
++window {
++ background-image: linear-gradient(to bottom,
++ shade (@theme_base_color, 0.8),
++ shade (@theme_base_color, 0.95) 87px);
++}
++
++window frame {
++ padding: 1px 2px 4px 2px;
++ border: 1px solid shade (@theme_base_color, 0.7);
++}
++
++/* icon buttons in window title bar */
++window widget#notes-icon-button {
++ color: black;
++ background-color: transparent;
++}
++window widget#notes-icon-button:active {
++ color: darker (@theme_fg_color);
++ text-shadow: 1px 1px lighter (@theme_bg_color);
++}
++window widget#notes-icon-button:disabled {
++ color: shade (@insensitive_fg_color, 1.2);
++}
++window widget#notes-icon-button:hover {
++ color: shade (@insensitive_fg_color, 0.8);
++}
++
++/* notebook */
++notebook > header {
++ background: transparent;
++}
++notebook > header.top {
++ border-bottom: 2px solid @theme_selected_bg_color;
++}
++notebook > header.bottom {
++ border-top: 2px solid @theme_selected_bg_color;
++}
++notebook > header.left {
++ border-right: 2px solid @theme_selected_bg_color;
++}
++notebook > header.right {
++ border-left: 2px solid @theme_selected_bg_color;
++}
++
++/* notebook tab style */
++notebook > header.top tab, notebook > header.bottom tab {
++ padding: 0px 4px;
++}
++notebook > header.right tab, notebook > header.left tab {
++ padding: 4px 0px;
++}
++
++notebook > header tab {
++ box-shadow: none;
++ color: @insensitive_fg_color;
++ background: transparent;
++}
++notebook > header tab:checked {
++ color: shade (@theme_text_color, 0.8);
++}
++notebook > header tab.dnd {
++ background: @theme_selected_bg_color;
++}
++
++notebook > header.top > tabs > tab:checked {
++ box-shadow: inset 0px -3px shade (@theme_selected_bg_color, 1.3), 0px 2px 3px @theme_selected_bg_color;
++}
++notebook > header.top > tabs > tab:checked:hover {
++ box-shadow: inset 0px -2px shade (@theme_selected_bg_color, 1.3), 0px 2px 3px @theme_selected_bg_color;
++ background: @theme_selected_bg_color; /* NOTE: must be set before .dnd */
++}
++notebook > header.top > tabs > tab:hover {
++ box-shadow: inset 0px -2px shade (@theme_selected_bg_color, 1.3);
++}
++
++notebook > header.bottom > tabs > tab:checked {
++ box-shadow: inset 0px 3px shade (@theme_selected_bg_color, 1.3), 0px -2px 3px @theme_selected_bg_color;
++}
++notebook > header.bottom > tabs > tab:checked:hover {
++ box-shadow: inset 0px 2px shade (@theme_selected_bg_color, 1.3), 0px -2px 3px @theme_selected_bg_color;
++ background: @theme_selected_bg_color;
++}
++notebook > header.bottom > tabs > tab:hover {
++ box-shadow: inset 0px 2px shade (@theme_selected_bg_color, 1.3);
++}
++
++notebook > header.left > tabs > tab:checked {
++ box-shadow: inset -3px 0px shade (@theme_selected_bg_color, 1.3), 0px 0px 3px @theme_selected_bg_color;
++}
++notebook > header.left > tabs > tab:checked:hover {
++ box-shadow: inset -2px 0px shade (@theme_selected_bg_color, 1.3), 0px 0px 3px @theme_selected_bg_color;
++ background: @theme_selected_bg_color;
++}
++notebook > header.left > tabs > tab:hover {
++ box-shadow: inset -2px 0px shade (@theme_selected_bg_color, 1.3);
++}
++
++notebook > header.right > tabs > tab:checked {
++ box-shadow: inset 3px 0px shade (@theme_selected_bg_color, 1.3), 0px 0px 3px @theme_selected_bg_color;
++}
++notebook > header.right > tabs > tab:checked:hover {
++ box-shadow: inset 2px 0px shade (@theme_selected_bg_color, 1.3), 0px 0px 3px @theme_selected_bg_color;
++ background: @theme_selected_bg_color;
++}
++notebook > header.right > tabs > tab:hover {
++ box-shadow: inset 2px 0px shade (@theme_selected_bg_color, 1.3);
++}
++
++textview > text {
++ color: @theme_text_color;
++ background-image: linear-gradient(to bottom,
++ shade (@theme_bg_color, 1.2),
++ shade (@theme_bg_color, 1.3) 20em);
++}
++
++textview > text > selection {
++ color: @theme_selected_fg_color;
++ background-color: @theme_selected_bg_color;
++}
++
++scrollbar {
++ background-color: transparent;
++}
++scrollbar slider {
++ background-color: shade (@theme_bg_color, 0.55);
++ min-width: 8px;
++}
++scrollbar slider:hover {
++ background-color: shade (@theme_bg_color, 0.7);
++ transition: 400ms;
++}
++scrollbar slider:hover:active {
++ background-color: shade (@theme_bg_color, 0.55);
++ transition: 200ms;
++}
++
++tooltip, tooltip * {
++ margin: 0px;
++ padding: 0px;
++}
++
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 118582a..c971e9c 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -6,18 +6,8 @@ libnotes_la_VALAFLAGS = \
+ --vapidir=$(srcdir) \
+ --pkg=config \
+ --pkg=libxfconf-0 \
+- --pkg=libxfce4util-1.0
+-
+-if ENABLE_GTK3
+-libnotes_la_VALAFLAGS += \
+- -D ENABLE_GTK3 \
++ --pkg=libxfce4util-1.0 \
+ --pkg=gtk+-3.0
+-else
+-libnotes_la_VALAFLAGS += \
+- --pkg=ext-gdk \
+- --pkg=theme-gtkrc \
+- --pkg=gtk+-2.0
+-endif
+
+ libnotes_la_SOURCES = \
+ icon-button.vala \
+@@ -26,17 +16,8 @@ libnotes_la_SOURCES = \
+ hypertextview.vala \
+ note.vala \
+ window.vala \
+- theme.vala
+-
+-if ENABLE_GTK3
+-libnotes_la_SOURCES += \
++ theme.vala \
+ theme-gtkcss.vala
+-else
+-libnotes_la_SOURCES += \
+- popup.c \
+- ext-gdk.c \
+- theme-gtkrc.c
+-endif
+
+ libnotes_la_CFLAGS = \
+ -DPKGDATADIR=\""$(pkgdatadir)"\" \
+@@ -56,17 +37,6 @@ libnotes_la_LIBADD = \
+ @XFCONF_LIBS@
+
+ EXTRA_DIST = \
+- ext-gdk.h \
+- theme-gtkrc.h \
+- popup.h \
+ libnotes.vapi \
+ libnotes.h
+
+-if ENABLE_GTK3
+-EXTRA_DIST += \
+- ext-gdk.c \
+- theme-gtkrc.c \
+- popup.c
+-else
+-endif
+-
+diff --git a/lib/application.vala b/lib/application.vala
+index 243f80e..ebee595 100644
+--- a/lib/application.vala
++++ b/lib/application.vala
+@@ -31,15 +31,10 @@ namespace Xnp {
+ private Xfconf.Channel xfconf_channel;
+
+ construct {
+-#if !ENABLE_GTK3
+- var notesgtkrc = "%s/xfce4/xfce4-notes.gtkrc".printf (GLib.Environment.get_user_config_dir ());
+- Gtk.rc_parse (notesgtkrc);
+-#endif
+-
+ try {
+- Xfce.PosixSignalHandler.init ();
+- Xfce.PosixSignalHandler.set_handler(ProcessSignal.TERM, quit);
+- Xfce.PosixSignalHandler.set_handler(ProcessSignal.INT, quit);
++ Xfce.posix_signal_handler_init ();
++ Xfce.posix_signal_handler_set_handler(ProcessSignal.TERM, quit);
++ Xfce.posix_signal_handler_set_handler(ProcessSignal.INT, quit);
+ }
+ catch (GLib.Error e) {
+ critical ("Unable to connect to UNIX signals. %s", e.message);
+@@ -48,7 +43,7 @@ namespace Xnp {
+ try {
+ Xfconf.init ();
+ }
+- catch (Xfconf.Error e) {
++ catch (GLib.Error e) {
+ critical ("%s", e.message);
+ }
+
+@@ -145,13 +140,8 @@ namespace Xnp {
+ private void update_color () {
+ string color = xfconf_channel.get_string ("/global/background-color", "#F7EB96");
+ if (color == "GTK+") {
+-#if ENABLE_GTK3
+ // TODO: Read from StyleContext with default CssProvider
+ return;
+-#else
+- var style_widget = new Gtk.Invisible ();
+- color = style_widget.get_style ().bg[Gtk.StateType.NORMAL].to_string ();
+-#endif
+ }
+ Xnp.Theme.set_background_color (color);
+ }
+@@ -231,9 +221,9 @@ namespace Xnp {
+ window_monitor_list_add (window);
+
+ /* Global settings */
+- Xfconf.Property.bind (xfconf_channel, "/global/skip-taskbar-hint",
++ Xfconf.property_bind (xfconf_channel, "/global/skip-taskbar-hint",
+ typeof (bool), window, "skip-taskbar-hint");
+- Xfconf.Property.bind (xfconf_channel, "/global/tabs-position",
++ Xfconf.property_bind (xfconf_channel, "/global/tabs-position",
+ typeof (int), window, "tabs-position");
+
+ /* Connect signals */
+@@ -268,7 +258,7 @@ namespace Xnp {
+ }
+ });
+ window.note_inserted.connect ((win, note) => {
+- Xfconf.Property.bind (xfconf_channel, "/global/font-description",
++ Xfconf.property_bind (xfconf_channel, "/global/font-description",
+ typeof (string), note.text_view, "font");
+
+ string path = "%s/%s/%s".printf (notes_path, win.name, note.name);
+@@ -318,7 +308,7 @@ namespace Xnp {
+ note.name = name;
+ var buffer = note.text_view.get_buffer ();
+ buffer.set_text (contents, -1);
+- Xfconf.Property.bind (xfconf_channel, "/global/font-description",
++ Xfconf.property_bind (xfconf_channel, "/global/font-description",
+ typeof (string), note.text_view, "font");
+ }
+ catch (FileError e) {
+@@ -433,20 +423,13 @@ namespace Xnp {
+ */
+ private void rename_window (Xnp.Window window) {
+ var dialog = new Gtk.Dialog.with_buttons (_("Rename group"), window,
+-#if ENABLE_GTK3
+ Gtk.DialogFlags.DESTROY_WITH_PARENT,
+-#else
+- Gtk.DialogFlags.DESTROY_WITH_PARENT|Gtk.DialogFlags.NO_SEPARATOR,
+-#endif
+- Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.OK, Gtk.ResponseType.OK);
++ "_Cancel", Gtk.ResponseType.CANCEL, "_OK", Gtk.ResponseType.OK);
+ Gtk.Box content_area = (Gtk.Box)dialog.get_content_area ();
+ dialog.set_default_response (Gtk.ResponseType.OK);
+ dialog.resizable = false;
+- dialog.icon_name = Gtk.Stock.EDIT;
++ dialog.icon_name = "gtk-edit";
+ dialog.border_width = 4;
+-#if !ENABLE_GTK3
+- content_area.border_width = 6;
+-#endif
+
+ var entry = new Gtk.Entry ();
+ entry.text = window.name;
+@@ -730,24 +713,6 @@ namespace Xnp {
+ * Open the about dialog.
+ */
+ public void open_about_dialog () {
+-#if !ENABLE_GTK3
+- Gtk.AboutDialog.set_url_hook ((dialog, uri) => {
+- string command;
+- try {
+- command = "exo-open %s".printf (uri);
+- GLib.Process.spawn_command_line_async (command);
+- return;
+- } catch (GLib.Error e) {
+- }
+- try {
+- command = "firefox %s".printf (uri);
+- GLib.Process.spawn_command_line_async (command);
+- return;
+- } catch (GLib.Error e) {
+- }
+- });
+-#endif
+-
+ string[] authors = {
+ "(c) 2006-2010 Mike Massonnet",
+ "(c) 2003 Jakob Henriksson",
+@@ -759,10 +724,10 @@ namespace Xnp {
+ "logo-icon-name", "xfce4-notes-plugin",
+ "comments", _("Ideal for your quick notes"),
+ "version", Config.PACKAGE_VERSION,
+- "copyright", "Copyright © 2003-2010 The Xfce development team",
++ "copyright", "Copyright © 2003-2020 The Xfce development team",
+ "license", Xfce.get_license_text (Xfce.LicenseTextType.GPL),
+- "website", "http://goodies.xfce.org/projects/panel-plugins/xfce4-notes-plugin",
+- "website-label", "goodies.xfce.org",
++ "website", "https://docs.xfce.org/panel-plugins/xfce4-notes-plugin",
++ "website-label", "docs.xfce.org",
+ "authors", authors,
+ "translator-credits", _("translator-credits"),
+ null);
+@@ -799,13 +764,11 @@ namespace Xnp {
+ // New group menu item
+ var mi_sep = new Gtk.SeparatorMenuItem ();
+ menu.append (mi_sep);
+- var mi_add = new Gtk.ImageMenuItem.with_mnemonic (_("_Add a new group"));
++ var mi_add = new Gtk.MenuItem.with_mnemonic (_("_Add a new group"));
+ mi_add.activate.connect (() => {
+ var new_win = create_window ();
+ new_win.show ();
+ });
+- var image = new Gtk.Image.from_stock (Gtk.Stock.ADD, Gtk.IconSize.MENU);
+- mi_add.set_image (image);
+ menu.append (mi_add);
+
+ // Show all items
+diff --git a/lib/config.vapi b/lib/config.vapi
+index 0000000..ed99c17 100644
+--- /dev/null
++++ b/lib/config.vapi
+@@ -0,0 +1,21 @@ namespace Xnp {
++[CCode (cprefix = "", lower_case_prefix = "", cheader_filename = "config.h")]
++namespace Config {
++ [CCode (cname = "GETTEXT_PACKAGE")]
++ public const string GETTEXT_PACKAGE;
++ [CCode (cname = "PACKAGE_LOCALE_DIR")]
++ public const string PACKAGE_LOCALE_DIR;
++ [CCode (cname = "PACKAGE")]
++ public const string PACKAGE;
++ [CCode (cname = "PACKAGE_BUGREPORT")]
++ public const string PACKAGE_BUGREPORT;
++ [CCode (cname = "PACKAGE_NAME")]
++ public const string PACKAGE_NAME;
++ [CCode (cname = "PACKAGE_STRING")]
++ public const string PACKAGE_STRING;
++ [CCode (cname = "PACKAGE_TARNAME")]
++ public const string PACKAGE_TARNAME;
++ [CCode (cname = "PACKAGE_VERSION")]
++ public const string PACKAGE_VERSION;
++ [CCode (cname = "PKGDATADIR")]
++ public const string PKGDATADIR;
++}
+diff --git a/lib/hypertextview.vala b/lib/hypertextview.vala
+index ffb2c64..ed99c17 100644
+--- a/lib/hypertextview.vala
++++ b/lib/hypertextview.vala
+@@ -24,8 +24,8 @@ namespace Xnp {
+
+ public class HypertextView : Gtk.TextView {
+
+- private Gdk.Cursor hand_cursor = new Gdk.Cursor (Gdk.CursorType.HAND2);
+- private Gdk.Cursor regular_cursor = new Gdk.Cursor (Gdk.CursorType.XTERM);
++ private Gdk.Cursor hand_cursor = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.HAND2);
++ private Gdk.Cursor regular_cursor = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.XTERM);
+
+ private bool cursor_over_link = false;
+
+@@ -45,7 +45,7 @@ namespace Xnp {
+ set {
+ this._font = value;
+ Pango.FontDescription font_descr = Pango.FontDescription.from_string (value);
+- modify_font (font_descr);
++ override_font (font_descr);
+ }
+ }
+
+@@ -107,7 +107,7 @@ namespace Xnp {
+ if (iter.has_tag (this.tag_link)) {
+ start = end = iter;
+
+- if (!start.begins_tag (this.tag_link)) {
++ if (!start.starts_tag (this.tag_link)) {
+ start.backward_to_tag_toggle (this.tag_link);
+ }
+
+@@ -220,7 +220,7 @@ namespace Xnp {
+ Gtk.TextIter start, end;
+
+ /* Text is inserted inside a tag */
+- if (location.has_tag (this.tag_link) && !location.begins_tag (this.tag_link)) {
++ if (location.has_tag (this.tag_link) && !location.starts_tag (this.tag_link)) {
+ start = location;
+ start.backward_to_tag_toggle (this.tag_link);
+
+@@ -406,7 +406,7 @@ namespace Xnp {
+ while (iter.forward_search ("http://", Gtk.TextSearchFlags.TEXT_ONLY, out start, out end, null)) {
+ iter = end;
+
+- if (start.begins_tag (this.tag_link))
++ if (start.starts_tag (this.tag_link))
+ continue;
+
+ if (!iter.forward_search (" ", Gtk.TextSearchFlags.TEXT_ONLY, out end, null, null)) {
+diff --git a/lib/icon-button.vala b/lib/icon-button.vala
+index 07b6b14..1ec0b16 100644
+--- a/lib/icon-button.vala
++++ b/lib/icon-button.vala
+@@ -28,12 +28,10 @@ namespace Xnp {
+ public signal void clicked ();
+
+ construct {
++ ((Gtk.Widget)this).name = "notes-icon-button";
+ set_visible_window (false);
+ set_above_child (true);
+ set_size_request (22, 22);
+-#if !ENABLE_GTK3
+- set_border_width (2);
+-#endif
+
+ enter_notify_event.connect (on_enter_notify_event);
+ leave_notify_event.connect (on_leave_notify_event);
+@@ -43,7 +41,6 @@ namespace Xnp {
+ protected abstract void draw_icon (Cairo.Context cr, int width, int height);
+
+ protected void set_widget_source_color (Cairo.Context cr) {
+-#if ENABLE_GTK3
+ var style_context = get_style_context ();
+
+ if (sensitive && active) {
+@@ -53,21 +50,12 @@ namespace Xnp {
+ Gdk.cairo_set_source_rgba (cr, style_context.get_color (Gtk.StateFlags.NORMAL));
+ else if (!sensitive)
+ Gdk.cairo_set_source_rgba (cr, style_context.get_color (Gtk.StateFlags.INSENSITIVE));
+-#else
+- if (sensitive && active)
+- Gdk.cairo_set_source_color (cr, style.base[Gtk.StateType.NORMAL]);
+- else if (sensitive && !active)
+- Gdk.cairo_set_source_color (cr, style.fg[Gtk.StateType.INSENSITIVE]);
+- else if (!sensitive)
+- Gdk.cairo_set_source_color (cr, style.text[Gtk.StateType.INSENSITIVE]);
+-#endif
+ }
+
+ public override void add (Gtk.Widget widget) {
+ warning ("This object doesn't allow packing child widgets.");
+ }
+
+-#if ENABLE_GTK3
+ public override bool draw (Cairo.Context cr) {
+ int width = get_allocated_width ();
+ int height = get_allocated_height ();
+@@ -86,29 +74,6 @@ namespace Xnp {
+
+ return false;
+ }
+-#else
+- public override bool expose_event (Gdk.EventExpose event) {
+- Gtk.Allocation allocation;
+- get_allocation (out allocation);
+-
+- int width = allocation.width - (int)border_width * 2;
+- int height = allocation.height - (int)border_width * 2;
+- int x = allocation.width / 2 - width / 2 + allocation.x;
+- int y = allocation.height / 2 - height / 2 + allocation.y;
+-
+- var cr = Gdk.cairo_create (get_window ());
+- cr.rectangle (x, y, width, height);
+- cr.clip ();
+-
+- var surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
+- var cr_ = new Cairo.Context (surface);
+- draw_icon (cr_, width, height);
+- cr.set_source_surface (surface, x, y);
+- cr.paint ();
+-
+- return false;
+- }
+-#endif
+
+ private bool on_enter_notify_event (Gdk.EventCrossing event) {
+ active = true;
+diff --git a/lib/note.vala b/lib/note.vala
+index 3d4266e..148d470 100644
+--- a/lib/note.vala
++++ b/lib/note.vala
+@@ -104,7 +104,8 @@ namespace Xnp {
+
+ }
+
+-/*public class GtkSample : Window {
++#if DEBUG_XNP_NOTE
++public class GtkSample : Window {
+
+ public GtkSample () {
+ this.title = "Sample Window";
+@@ -122,5 +123,6 @@ namespace Xnp {
+ return 0;
+ }
+
+-}*/
++}
++#endif
+
+diff --git a/lib/theme-gtkcss.vala b/lib/theme-gtkcss.vala
+index becd371..93a17cb 100644
+--- a/lib/theme-gtkcss.vala
++++ b/lib/theme-gtkcss.vala
+@@ -17,7 +17,6 @@
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+-#if ENABLE_GTK3
+ namespace Xnp {
+
+ public class ThemeGtkcss : GLib.Object {
+@@ -40,7 +39,7 @@ namespace Xnp {
+ try {
+ var cssprovider = new Gtk.CssProvider ();
+ cssprovider.load_from_path (get_css_path ());
+- Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), cssprovider, 255);
++ Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), cssprovider, Gtk.STYLE_PROVIDER_PRIORITY_USER);
+ } catch (GLib.Error e) {
+ warning ("%s", e.message);
+ }
+@@ -49,5 +48,4 @@ namespace Xnp {
+ }
+
+ }
+-#endif
+
+diff --git a/lib/theme.vala b/lib/theme.vala
+index d6b50ef..e0c821d 100644
+--- a/lib/theme.vala
++++ b/lib/theme.vala
+@@ -28,13 +28,8 @@ namespace Xnp {
+ return;
+ }
+
+-#if ENABLE_GTK3
+ Xnp.ThemeGtkcss.update_css (gdkcolor);
+ Xnp.ThemeGtkcss.update_style_context ();
+-#else
+- Xnp.ThemeGtkrc.update_gtkrc (gdkcolor);
+- Gtk.rc_reparse_all ();
+-#endif
+ }
+
+ }
+diff --git a/lib/window.vala b/lib/window.vala
+index a930327..1fb5a4d 100644
+--- a/lib/window.vala
++++ b/lib/window.vala
+@@ -40,11 +40,7 @@ namespace Xnp {
+ private Xnp.TitleBarButton left_arrow_button;
+ private Xnp.TitleBarButton right_arrow_button;
+ private Xnp.TitleBarButton close_button;
+-#if ENABLE_GTK3
+ private Gtk.Box content_box;
+-#else
+- private Gtk.VBox content_box;
+-#endif
+ private Gtk.Notebook notebook;
+
+ private Gtk.UIManager ui;
+@@ -78,13 +74,13 @@ namespace Xnp {
+ };
+
+ private int CORNER_MARGIN = 20;
+- private Gdk.Cursor CURSOR_RIGHT = new Gdk.Cursor (Gdk.CursorType.RIGHT_SIDE);
+- private Gdk.Cursor CURSOR_LEFT = new Gdk.Cursor (Gdk.CursorType.LEFT_SIDE);
+- private Gdk.Cursor CURSOR_BOTTOM_RC = new Gdk.Cursor (Gdk.CursorType.BOTTOM_RIGHT_CORNER);
+- private Gdk.Cursor CURSOR_BOTTOM = new Gdk.Cursor (Gdk.CursorType.BOTTOM_SIDE);
+- private Gdk.Cursor CURSOR_BOTTOM_LC = new Gdk.Cursor (Gdk.CursorType.BOTTOM_LEFT_CORNER);
++ private Gdk.Cursor CURSOR_RIGHT = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.RIGHT_SIDE);
++ private Gdk.Cursor CURSOR_LEFT = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.LEFT_SIDE);
++ private Gdk.Cursor CURSOR_BOTTOM_RC = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.BOTTOM_RIGHT_CORNER);
++ private Gdk.Cursor CURSOR_BOTTOM = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.BOTTOM_SIDE);
++ private Gdk.Cursor CURSOR_BOTTOM_LC = new Gdk.Cursor.for_display (Gdk.Display.get_default(), Gdk.CursorType.BOTTOM_LEFT_CORNER);
+
+- private unowned SList<unowned Xnp.Window> window_list;
++ private unowned SList<Xnp.Window> window_list;
+
+ public new string name { default = _("Notes"); get; set; }
+ public int n_pages { get; set; }
+@@ -219,22 +215,14 @@ namespace Xnp {
+ frame.modify_style (style);
+ frame.show ();
+ add (frame);
+-#if ENABLE_GTK3
+ var vbox_frame = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
+-#else
+- var vbox_frame = new Gtk.VBox (false, 0);
+-#endif
+
+ vbox_frame.spacing = 1;
+ vbox_frame.show ();
+ frame.add (vbox_frame);
+
+ /* Build title bar */
+-#if ENABLE_GTK3
+ var title_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
+-#else
+- var title_box = new Gtk.HBox (false, 0);
+-#endif
+ var menu_evbox = new Gtk.EventBox ();
+ menu_evbox.tooltip_text = _("Menu");
+ menu_evbox.set_visible_window (false);
+@@ -284,11 +272,7 @@ namespace Xnp {
+ vbox_frame.pack_start (title_box, false, false, 0);
+
+ /* Build content box */
+-#if ENABLE_GTK3
+ this.content_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
+-#else
+- this.content_box = new Gtk.VBox (false, 0);
+-#endif
+ this.content_box.show ();
+ vbox_frame.pack_start (this.content_box, true, true, 0);
+
+@@ -298,9 +282,6 @@ namespace Xnp {
+ this.notebook.show_border = true;
+ this.notebook.show_tabs = false;
+ this.notebook.tab_pos = Gtk.PositionType.TOP;
+-#if !ENABLE_GTK3
+- this.notebook.tab_border = 4;
+-#endif
+ this.notebook.scrollable = true;
+ this.notebook.show ();
+ this.content_box.pack_start (this.notebook, true, true, 0);
+@@ -645,13 +626,8 @@ namespace Xnp {
+ Gtk.Requisition requisition;
+ Gtk.Allocation allocation;
+
+-#if ENABLE_GTK3
+ get_window ().get_geometry (out winx, out winy, out width, out height);
+ menu.get_preferred_size (out requisition, null);
+-#else
+- get_window ().get_geometry (out winx, out winy, out width, out height, null);
+- menu.size_request (out requisition);
+-#endif
+ get_window ().get_origin (out x, out y);
+ push_in = false;
+
+@@ -667,13 +643,9 @@ namespace Xnp {
+ }
+ if (x + requisition.width > Gdk.Screen.width ()) {
+ /* Adjust menu left */
+-#if ENABLE_GTK3
+ int menu_width;
+ menu.get_preferred_width (out menu_width, null);
+ x = x - menu_width + allocation.y;
+-#else
+- x = x - menu.requisition.width + content_box.allocation.y;
+-#endif
+ }
+ }
+
+@@ -699,24 +671,22 @@ namespace Xnp {
+ mi = new Gtk.SeparatorMenuItem ();
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.NEW, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_New"));
+ mi.set_accel_path (this.action_group.get_action ("new-note").get_accel_path ());
+ mi.activate.connect (action_new_note);
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.DELETE, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Delete"));
+ mi.set_accel_path (this.action_group.get_action ("delete-note").get_accel_path ());
+ mi.activate.connect (action_delete_note);
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Rename"));
+- var image = new Gtk.Image.from_stock (Gtk.Stock.EDIT, Gtk.IconSize.MENU);
+- ((Gtk.ImageMenuItem)mi).set_image (image);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Rename"));
+ mi.set_accel_path (this.action_group.get_action ("rename-note").get_accel_path ());
+ mi.activate.connect (action_rename_note);
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.UNDO, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Undo"));
+ mi.set_accel_path (this.action_group.get_action ("cancel").get_accel_path ());
+ mi.activate.connect (action_cancel);
+ menu.append (mi);
+@@ -739,11 +709,11 @@ namespace Xnp {
+ mi = new Gtk.SeparatorMenuItem ();
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.PROPERTIES, null);
++ mi = new Gtk.MenuItem.with_mnemonic ("_Properties");
+ mi.activate.connect (() => { action ("properties"); });
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.ABOUT, null);
++ mi = new Gtk.MenuItem.with_mnemonic ("_About");
+ mi.activate.connect (() => { action ("about"); });
+ menu.append (mi);
+
+@@ -775,11 +745,7 @@ namespace Xnp {
+ int n_pages = this.notebook.get_n_pages ();
+ for (int p = 0; p < n_pages; p++) {
+ var note = (Xnp.Note)(this.notebook.get_nth_page (p));
+- mi = new Gtk.ImageMenuItem.with_label (note.name);
+- if (note == current_note) {
+- image = new Gtk.Image.from_stock (Gtk.Stock.GO_FORWARD, Gtk.IconSize.MENU);
+- ((Gtk.ImageMenuItem)mi).set_image (image);
+- }
++ mi = new Gtk.MenuItem.with_label (note.name);
+ mi.set_data ("page", p.to_pointer ());
+ mi.activate.connect ((i) => {
+ int page = i.get_data<int> ("page");
+@@ -805,23 +771,17 @@ namespace Xnp {
+ }
+ }
+
+- mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Rename group"));
+- image = new Gtk.Image.from_stock (Gtk.Stock.EDIT, Gtk.IconSize.MENU);
+- ((Gtk.ImageMenuItem)mi).set_image (image);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Rename group"));
+ mi.set_accel_path (this.action_group.get_action ("rename-window").get_accel_path ());
+ mi.activate.connect (action_rename_window);
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Delete group"));
+- image = new Gtk.Image.from_stock (Gtk.Stock.REMOVE, Gtk.IconSize.MENU);
+- ((Gtk.ImageMenuItem)mi).set_image (image);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Delete group"));
+ mi.set_accel_path (this.action_group.get_action ("delete-window").get_accel_path ());
+ mi.activate.connect (action_delete_window);
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Add a new group"));
+- image = new Gtk.Image.from_stock (Gtk.Stock.ADD, Gtk.IconSize.MENU);
+- ((Gtk.ImageMenuItem)mi).set_image (image);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Add a new group"));
+ mi.set_accel_path (this.action_group.get_action ("new-window").get_accel_path ());
+ mi.activate.connect (action_new_window);
+ menu.append (mi);
+@@ -853,7 +813,7 @@ namespace Xnp {
+ * Saves a list of window inside window.window_list to be shown
+ * within the window menu.
+ */
+- public void set_window_list (SList<Xnp.Window> list) {
++ public void set_window_list (SList <Xnp.Window> list) {
+ this.window_list = list;
+ }
+
+@@ -1057,16 +1017,12 @@ namespace Xnp {
+ var note = (Xnp.Note)(this.notebook.get_nth_page (page));
+
+ var dialog = new Gtk.Dialog.with_buttons (_("Rename note"), (Gtk.Window)get_toplevel (),
+-#if ENABLE_GTK3
+ Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT,
+-#else
+- Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT|Gtk.DialogFlags.NO_SEPARATOR,
+-#endif
+- Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.OK, Gtk.ResponseType.OK);
++ "_Cancel", Gtk.ResponseType.CANCEL, "_OK", Gtk.ResponseType.OK);
+ Gtk.Box content_area = (Gtk.Box)dialog.get_content_area ();
+ dialog.set_default_response (Gtk.ResponseType.OK);
+ dialog.resizable = false;
+- dialog.icon_name = Gtk.Stock.EDIT;
++ dialog.icon_name = "gtk-edit";
+ dialog.border_width = 4;
+ content_area.border_width = 6;
+
+@@ -1079,7 +1035,7 @@ namespace Xnp {
+ int res = dialog.run ();
+ dialog.hide ();
+ if (res == Gtk.ResponseType.OK) {
+- weak string name = entry.text;
++ string name = entry.text;
+ if (note_name_exists (name)) {
+ var error_dialog = new Gtk.MessageDialog (this, Gtk.DialogFlags.DESTROY_WITH_PARENT,
+ Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, _("The name %s is already in use"), name);
+@@ -1106,21 +1062,12 @@ namespace Xnp {
+ return;
+ var note = (Xnp.Note)(this.notebook.get_nth_page (page));
+
+-#if ENABLE_GTK3
+ var dialog = new Gtk.FontChooserDialog ("Choose current note font", this);
+ dialog.set_font (note.text_view.font);
+-#else
+- var dialog = new Gtk.FontSelectionDialog ("Choose current note font");
+- dialog.set_font_name (note.text_view.font);
+-#endif
+ int res = dialog.run ();
+ dialog.hide ();
+ if (res == Gtk.ResponseType.OK) {
+-#if ENABLE_GTK3
+ note.text_view.font = dialog.get_font ();
+-#else
+- note.text_view.font = dialog.get_font_name ();
+-#endif
+ }
+ dialog.destroy ();
+ }
+@@ -1179,7 +1126,8 @@ namespace Xnp {
+ }
+ }
+
+-/* valac -X '-I..' -X '-DGETTEXT_PACKAGE="xfce4-notes-plugin"' -X '-DPKGDATADIR="../data"' -D ENABLE_GTK3 --pkg=gtk+-3.0 --pkg=libxfce4util-1.0 --pkg=libxfconf-0 --pkg=color --pkg=config --vapidir=.. --vapidir=. window.vala note.vala hypertextview.vala icon-button.vala
++/* valac -X '-I..' -X '-DGETTEXT_PACKAGE="xfce4-notes-plugin"' -X '-DPKGDATADIR="../data"' -D DEBUG_XNP_WINDOW --pkg=gtk+-3.0 --pkg=libxfce4util-1.0 --pkg=libxfconf-0 --pkg=color --pkg=config --vapidir=.. --vapidir=. window.vala note.vala hypertextview.vala icon-button.vala */
++#if DEBUG_XNP_WINDOW
+ static int main (string[] args) {
+ Gtk.init (ref args);
+ var sample = new Xnp.Window ();
+@@ -1187,8 +1135,7 @@ namespace Xnp {
+ Gtk.main ();
+ return 0;
+ }
+-// */
+-
++#endif
+ }
+
+ }
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9ce0ebf..be01afa 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -13,7 +13,6 @@ AM_CPPFLAGS = \
+
+ bin_PROGRAMS = xfce4-popup-notes
+
+-if ENABLE_GTK3
+ if MAINTAINER_MODE
+ xfce4_popup_notes_VALAFLAGS = \
+ --pkg=gtk+-3.0
+@@ -31,19 +30,6 @@ xfce4_popup_notes_CFLAGS = \
+
+ xfce4_popup_notes_LDADD = \
+ @GTK_LIBS@
+-else
+-xfce4_popup_notes_SOURCES = \
+- $(top_srcdir)/lib/popup.h \
+- xfce4-popup-notes.c
+-
+-xfce4_popup_notes_CFLAGS = \
+- @LIBX11_CFLAGS@ \
+- @GTK_CFLAGS@
+-
+-xfce4_popup_notes_LDADD = \
+- @LIBX11_LIBS@ \
+- @GTK_LIBS@
+-endif
+
+ #
+ # Settings dialog
+@@ -59,43 +45,31 @@ xfce4_notes_settings_CFLAGS = \
+ @LIBX11_CFLAGS@ \
+ @GTK_CFLAGS@ \
+ @LIBXFCE4UI_CFLAGS@ \
+- @XFCONF_CFLAGS@ \
+- @UNIQUE_CFLAGS@
++ @XFCONF_CFLAGS@
+
+ xfce4_notes_settings_LDADD = \
+ $(top_builddir)/lib/libnotes.la \
+ @LIBX11_LIBS@ \
+ @GTK_LIBS@ \
+ @LIBXFCE4UI_LIBS@ \
+- @XFCONF_LIBS@ \
+- @UNIQUE_LIBS@
++ @XFCONF_LIBS@
+
+ #
+ # Panel plugin
+ #
+
+-if !ENABLE_GTK3
+-# REM Xfce Panel is not yet built with GTK3 support
+-# hence it's impossible to build a panel plugin yet
+-
+ if MAINTAINER_MODE
+ notes_VALAFLAGS = \
+- --vapidir=$(top_srcdir)/lib \
+- --pkg=libnotes \
++ --vapidir=$(top_srcdir)/lib \
++ --pkg=libnotes \
+ --pkg=config \
+- --pkg=libxfce4panel-1.0 \
++ --pkg=libxfce4panel-2.0 \
+ --pkg=libxfconf-0 \
+ --pkg=libxfce4util-1.0
+
+-if ENABLE_GTK3
+ notes_VALAFLAGS += \
+ -D ENABLE_GTK3 \
+ --pkg=gtk+-3.0
+-else
+-notes_VALAFLAGS += \
+- --pkg=popup \
+- --pkg=gtk+-2.0
+-endif
+
+ BUILT_SOURCES += main-panel-plugin.c
+ main-panel-plugin.c: main-panel-plugin.vala
+@@ -104,30 +78,30 @@ endif
+
+ plugindir = $(libdir)/xfce4/panel/plugins
+ plugin_LTLIBRARIES = libnotes.la
+-
++#
+ libnotes_la_SOURCES = \
+ main-panel-plugin.c
+-
++#
+ libnotes_la_CFLAGS = \
+ @LIBX11_CFLAGS@ \
+ @LIBXFCE4PANEL_CFLAGS@ \
+ @LIBXFCE4UTIL_CFLAGS@ \
+ @XFCONF_CFLAGS@
+-
++#
+ libnotes_la_LIBADD = \
+ $(top_builddir)/lib/libnotes.la \
+ @LIBX11_LIBS@ \
+ @LIBXFCE4PANEL_LIBS@ \
+ @LIBXFCE4UTIL_LIBS@ \
+ @XFCONF_LIBS@
+-
++#
+ libnotes_la_LDFLAGS = \
+ -avoid-version \
+ -module \
+ -no-undefined \
+ -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+ $(PLATFORM_LDFLAGS)
+-endif
++#endif
+
+ #
+ # Status icon
+@@ -143,18 +117,8 @@ xfce4_notes_VALAFLAGS = \
+ --vapidir=. \
+ --pkg=xfce-autostart \
+ --pkg=libxfconf-0 \
+- --pkg=libxfce4util-1.0
+-
+-if ENABLE_GTK3
+-xfce4_notes_VALAFLAGS += \
+- -D ENABLE_GTK3 \
++ --pkg=libxfce4util-1.0 \
+ --pkg=gtk+-3.0
+-else
+-xfce4_notes_VALAFLAGS += \
+- --pkg=popup \
+- --pkg=unique-1.0 \
+- --pkg=gtk+-2.0
+-endif
+
+ BUILT_SOURCES += main-status-icon.c
+ main-status-icon.c: main-status-icon.vala
+@@ -170,22 +134,20 @@ xfce4_notes_CFLAGS = \
+ @LIBX11_CFLAGS@ \
+ @GTK_CFLAGS@ \
+ @LIBXFCE4UTIL_CFLAGS@ \
+- @XFCONF_CFLAGS@ \
+- @UNIQUE_CFLAGS@
++ @XFCONF_CFLAGS@
+
+ xfce4_notes_LDADD = \
+ $(top_builddir)/lib/libnotes.la \
+ @LIBX11_LIBS@ \
+ @GTK_LIBS@ \
+ @LIBXFCE4UTIL_LIBS@ \
+- @XFCONF_LIBS@ \
+- @UNIQUE_LIBS@
++ @XFCONF_LIBS@
+
+ #
+ # Plugin desktop file
+ #
+
+-desktopdir = $(datadir)/xfce4/panel-plugins
++desktopdir = $(datadir)/xfce4/panel/plugins
+ desktop_in_files = xfce4-notes-plugin.desktop.in
+ desktop_DATA = xfce4-notes-plugin.desktop
+ @INTLTOOL_DESKTOP_RULE@
+@@ -215,15 +177,11 @@ autostart_DATA = xfce4-notes-autostart.desktop
+ EXTRA_DIST = \
+ main-panel-plugin.vala \
+ main-status-icon.vala \
++ main-popup.vala \
+ $(desktop_in_files) \
+ $(applications_in_files) \
+ $(autostart_in_files)
+
+-if ENABLE_GTK3
+-EXTRA_DIST += \
+- xfce4-popup-notes.c
+-endif
+-
+ DISTCLEANFILES = \
+ $(desktop_DATA) \
+ $(applications_DATA) \
+diff --git a/src/defines.h b/src/defines.h
+index 678fc47..cc68b78 100644
+--- a/src/defines.h
++++ b/src/defines.h
+@@ -19,7 +19,7 @@
+ #ifndef DEFINES_H
+ #define DEFINES_H
+
+-#define PLUGIN_WEBSITE "http://goodies.xfce.org/projects/panel-plugins/xfce4-notes-plugin"
++#define PLUGIN_WEBSITE "https://docs.xfce.org/panel-plugins/xfce4-notes-plugin"
+ #define PLUGIN_XFCONF_CHANNEL "xfce4-notes-plugin"
+
+ #define BORDER 6
+diff --git a/src/main-panel-plugin.vala b/src/main-panel-plugin.vala
+index 9b09c0b..5117d7d 100644
+--- a/src/main-panel-plugin.vala
++++ b/src/main-panel-plugin.vala
+@@ -25,7 +25,7 @@ public class NotesPlugin : Xfce.PanelPlugin {
+
+ private Gtk.Invisible invisible;
+ private Gtk.Button button;
+- private Xfce.PanelImage image;
++ private Gtk.Image image;
+ private Xnp.Application application;
+
+ public NotesPlugin () {
+@@ -33,11 +33,11 @@ public class NotesPlugin : Xfce.PanelPlugin {
+ }
+
+ public override void @construct () {
+- Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
++ Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR, "UTF-8");
+ application = new Xnp.Application (save_location (true));
+
+ button = (Gtk.Button)Xfce.panel_create_button ();
+- image = new Xfce.PanelImage.from_source ("xfce4-notes-plugin");
++ image = new Gtk.Image.from_icon_name ("xfce4-notes-plugin", BUTTON);
+ button.add (image);
+ button.clicked.connect (() => { application.show_hide_notes (); });
+ button.show_all ();
+@@ -54,11 +54,11 @@ public class NotesPlugin : Xfce.PanelPlugin {
+ mi.show_all ();
+ menu_insert_item (mi);
+
+- set_x_selection ();
+-
+ size_changed.connect ((p, size) => {
+ size = size / (int)nrows;
+ button.set_size_request (size, size);
++ var icon_size = p.get_icon_size();
++ image.set_pixel_size(icon_size);
+ return true;
+ });
+ save.connect (() => { application.save_windows_configuration (); });
+@@ -71,28 +71,6 @@ public class NotesPlugin : Xfce.PanelPlugin {
+ destroy.connect (() => { Gtk.main_quit (); });
+ }
+
+- /**
+- * set_x_selection:
+- *
+- * Set an X selection to listen to for the popup command.
+- */
+- private bool set_x_selection () {
+-#if !ENABLE_GTK3
+- invisible = new Gtk.Invisible ();
+- if (!Xnp.Popup.set_x_selection (invisible)) {
+- return false;
+- }
+- invisible.client_event.connect ((w, event) => {
+- if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
+- application.show_hide_notes ();
+- return true;
+- }
+- return false;
+- });
+-#endif
+- return true;
+- }
+-
+ }
+
+ [ModuleInit]
+diff --git a/src/main-settings-dialog.c b/src/main-settings-dialog.c
+index ae8ed44..0dce94e 100644
+--- a/src/main-settings-dialog.c
++++ b/src/main-settings-dialog.c
+@@ -21,16 +21,12 @@
+ #include <config.h>
+ #endif
+
+-#ifndef ENABLE_GTK3
+-#include <unique/unique.h>
+-#endif
+ #include <xfconf/xfconf.h>
+ #include <gtk/gtk.h>
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfce4ui/libxfce4ui.h>
+
+ #include "defines.h"
+-#include "ext-gdk.h"
+
+ #if 0
+ static GtkWidget *notes_path_button_new ();
+@@ -46,7 +42,7 @@ enum
+ COMBOBOX_TABS_LEFT,
+ };
+
+-static GtkWidget *tabs_combo_box_new ();
++static GtkWidget *tabs_combo_box_new (void);
+
+ enum
+ {
+@@ -55,10 +51,10 @@ enum
+ COMBOBOX_SIZE_LARGE,
+ };
+
+-static GtkWidget *size_combo_box_new ();
++static GtkWidget *size_combo_box_new (void);
+ static void cb_size_combobox_changed (GtkComboBox *combobox, gpointer data);
+
+-#ifndef ENABLE_GTK3
++#if 0
+ enum
+ {
+ COMBOBOX_BACKGROUND_YELLOW,
+@@ -88,7 +84,7 @@ static gboolean cb_color_button_pressed (GtkButton *button, GdkEventButton *even
+
+ static GtkWidget *parent_window = NULL;
+ static XfconfChannel *xfconf_channel = NULL;
+-#ifndef ENABLE_GTK3
++#if 0
+ static GtkWidget *color_combobox = NULL;
+ static GtkWidget *color_button = NULL;
+ #endif
+@@ -105,11 +101,7 @@ prop_dialog_new (void)
+ /* Dialog */
+ parent_window = dialog =
+ xfce_titled_dialog_new_with_buttons (_("Notes"), NULL,
+-#ifdef ENABLE_GTK3
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+-#else
+- GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_NO_SEPARATOR,
+-#endif
+ GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
+ NULL);
+ xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), _("Configure the plugin"));
+@@ -126,19 +118,11 @@ prop_dialog_new (void)
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), notebook);
+
+ /* VBox */
+-#ifdef ENABLE_GTK3
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+-#else
+- vbox = gtk_vbox_new (FALSE, 0);
+-#endif
+ gtk_container_add (GTK_CONTAINER (notebook), vbox);
+
+ /* === Global settings === */
+-#ifdef ENABLE_GTK3
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, BORDER);
+-#else
+- box = gtk_vbox_new (FALSE, BORDER);
+-#endif
+ frame = xfce_gtk_frame_box_new_with_content (_("Global settings"), box);
+ gtk_container_set_border_width (GTK_CONTAINER (frame), BORDER);
+ gtk_container_add (GTK_CONTAINER (vbox), frame);
+@@ -159,11 +143,7 @@ prop_dialog_new (void)
+ * to select an empty directory otherwise things might really get
+ * mixed up.
+ */
+-#ifdef ENABLE_GTK3
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
+-#else
+- hbox = gtk_hbox_new (FALSE, BORDER);
+-#endif
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new (_("Notes path:"));
+@@ -174,11 +154,7 @@ prop_dialog_new (void)
+ #endif
+
+ /* Tabs position */
+-#ifdef ENABLE_GTK3
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
+-#else
+- hbox = gtk_hbox_new (FALSE, BORDER);
+-#endif
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new (_("Tabs position:"));
+@@ -187,13 +163,9 @@ prop_dialog_new (void)
+ button = tabs_combo_box_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+-#ifndef ENABLE_GTK3
++#if 0
+ /* Background color */
+-#ifdef ENABLE_GTK3
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
+-#else
+- hbox = gtk_hbox_new (FALSE, BORDER);
+-#endif
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new (_("Background:"));
+@@ -207,11 +179,7 @@ prop_dialog_new (void)
+ #endif
+
+ /* Font description */
+-#ifdef ENABLE_GTK3
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
+-#else
+- hbox = gtk_hbox_new (FALSE, BORDER);
+-#endif
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new (_("Font:"));
+@@ -223,11 +191,7 @@ prop_dialog_new (void)
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+ /* === New window settings === */
+-#ifdef ENABLE_GTK3
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, BORDER);
+-#else
+- box = gtk_vbox_new (FALSE, BORDER);
+-#endif
+ frame = xfce_gtk_frame_box_new_with_content (_("New group settings"), box);
+ gtk_container_set_border_width (GTK_CONTAINER (frame), BORDER);
+ gtk_container_add (GTK_CONTAINER (vbox), frame);
+@@ -247,11 +211,7 @@ prop_dialog_new (void)
+ gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
+
+ /* Size */
+-#ifdef ENABLE_GTK3
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
+-#else
+- hbox = gtk_hbox_new (FALSE, BORDER);
+-#endif
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new (_("Size:"));
+@@ -323,21 +283,12 @@ tabs_combo_box_new (void)
+ {
+ GtkWidget *combobox;
+
+-#ifdef ENABLE_GTK3
+ combobox = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("None"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Top"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Right"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Bottom"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Left"));
+-#else
+- combobox = gtk_combo_box_new_text ();
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("None"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Top"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Right"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Bottom"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Left"));
+-#endif
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
+
+ xfconf_g_property_bind (xfconf_channel, "/global/tabs-position",
+@@ -352,17 +303,10 @@ size_combo_box_new (void)
+ GtkWidget *combobox;
+ gint size;
+
+-#ifdef ENABLE_GTK3
+ combobox = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Small"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Normal"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Large"));
+-#else
+- combobox = gtk_combo_box_new_text ();
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Small"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Normal"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Large"));
+-#endif
+
+ size = xfconf_channel_get_int (xfconf_channel, "/new-window/width", SIZE_NORMAL);
+ if (size == SIZE_SMALL)
+@@ -412,7 +356,7 @@ cb_size_combobox_changed (GtkComboBox *combobox,
+ xfconf_channel_set_int (xfconf_channel, "/new-window/height", height);
+ }
+
+-#ifndef ENABLE_GTK3
++#if 0
+ static GtkWidget *
+ background_combo_box_new (void)
+ {
+@@ -420,7 +364,6 @@ background_combo_box_new (void)
+ gchar *color;
+ gint id;
+
+-#ifdef ENABLE_GTK3
+ combobox = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Yellow"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Blue"));
+@@ -433,20 +376,6 @@ background_combo_box_new (void)
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Android"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("GTK+"));
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Custom..."));
+-#else
+- combobox = gtk_combo_box_new_text ();
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Yellow"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Blue"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Green"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Indigo"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Olive"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Carmine"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Mimosa"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("White"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Android"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("GTK+"));
+- gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _("Custom..."));
+-#endif
+
+ color = xfconf_channel_get_string (xfconf_channel, "/global/background-color", GENERAL_BACKGROUND_COLOR);
+ if (!g_ascii_strcasecmp (color, BACKGROUND_YELLOW))
+@@ -634,9 +563,6 @@ color_button_new (void)
+ g_free (color);
+
+ button = gtk_color_button_new_with_color (&gdkcolor);
+-#ifndef ENABLE_GTK3
+- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+-#endif
+
+ g_signal_connect (button, "button-press-event", G_CALLBACK (cb_color_button_pressed), NULL);
+
+@@ -666,38 +592,16 @@ cb_color_button_pressed (GtkButton *button,
+
+
+
+-#ifndef ENABLE_GTK3
+-static UniqueResponse
+-cb_unique_app (UniqueApp *app,
+- gint command,
+- UniqueMessageData *message_data,
+- guint time_,
+- gpointer user_data)
+-{
+- GtkWidget *dialog = user_data;
+- if (command != UNIQUE_ACTIVATE)
+- {
+- return UNIQUE_RESPONSE_PASSTHROUGH;
+- }
+- gtk_window_present (GTK_WINDOW (dialog));
+- return UNIQUE_RESPONSE_OK;
+-}
+-#endif
+-
+ gint main (gint argc,
+ gchar *argv[])
+ {
+ GtkWidget *dialog;
+-#ifdef ENABLE_GTK3
+ GtkApplication *app;
+ GError *error = NULL;
+-#else
+- UniqueApp *app;
+-#endif
+ xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, NULL);
+ xfconf_init (NULL);
+ gtk_init (&argc, &argv);
+-#ifdef ENABLE_GTK3
++
+ app = gtk_application_new ("org.xfce.NotesSettings", 0);
+
+ g_application_register (G_APPLICATION (app), NULL, &error);
+@@ -714,25 +618,10 @@ gint main (gint argc,
+ g_object_unref (app);
+ return 0;
+ }
+-#else
+- app = unique_app_new ("org.xfce.NotesSettings", NULL);
+- if (unique_app_is_running (app))
+- {
+- if (unique_app_send_message (app, UNIQUE_ACTIVATE, NULL) == UNIQUE_RESPONSE_OK)
+- {
+- g_object_unref (app);
+- return 0;
+- }
+- }
+-#endif
+
+ dialog = prop_dialog_new ();
+
+-#ifdef ENABLE_GTK3
+ g_signal_connect_swapped (app, "activate", G_CALLBACK (gtk_window_present), dialog);
+-#else
+- g_signal_connect (app, "message-received", G_CALLBACK (cb_unique_app), dialog);
+-#endif
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+diff --git a/src/main-status-icon.vala b/src/main-status-icon.vala
+index 429b6d8..6c385ac 100644
+--- a/src/main-status-icon.vala
++++ b/src/main-status-icon.vala
+@@ -27,8 +27,8 @@ static Gtk.StatusIcon status_icon;
+ static Gtk.Menu context_menu;
+
+ static void build_plugin () {
+- Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR);
+- var save_location = Xfce.Resource.save_location (Xfce.ResourceType.CONFIG, "xfce4/xfce4-notes.rc", true);
++ Xfce.textdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALE_DIR, "UTF-8");
++ var save_location = Xfce.resource_save_location (Xfce.ResourceType.CONFIG, "xfce4/xfce4-notes.rc", true);
+ application = new Xnp.Application (save_location);
+ status_icon = new Gtk.StatusIcon.from_icon_name ("xfce4-notes-plugin");
+ status_icon.set_tooltip_text (_("Notes"));
+@@ -44,7 +44,6 @@ static void build_plugin () {
+ status_icon.popup_menu.connect (() => {
+ context_menu.popup (null, null, status_icon.position_menu, 0, Gtk.get_current_event_time ());
+ });
+- set_x_selection ();
+ }
+
+ static Gtk.Menu build_context_menu () {
+@@ -58,18 +57,18 @@ static Gtk.Menu build_context_menu () {
+ mi = new Gtk.SeparatorMenuItem ();
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.PROPERTIES, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Properties"));
+ mi.activate.connect (() => { application.open_settings_dialog (); });
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.ABOUT, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_About"));
+ mi.activate.connect (() => { application.open_about_dialog (); });
+ menu.append (mi);
+
+ mi = new Gtk.SeparatorMenuItem ();
+ menu.append (mi);
+
+- mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.REMOVE, null);
++ mi = new Gtk.MenuItem.with_mnemonic (_("_Remove"));
+ mi.activate.connect (() => {
+ application.save_notes ();
+ Xfce.Autostart. at set ("xfce4-notes-autostart", "xfce4-notes", true);
+@@ -82,26 +81,8 @@ static Gtk.Menu build_context_menu () {
+ return menu;
+ }
+
+-static bool set_x_selection () {
+-#if !ENABLE_GTK3
+- invisible = new Gtk.Invisible ();
+- if (!Xnp.Popup.set_x_selection (invisible)) {
+- return false;
+- }
+- invisible.client_event.connect ((w, event) => {
+- if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
+- application.show_hide_notes ();
+- return true;
+- }
+- return false;
+- });
+-#endif
+- return true;
+-}
+-
+ static int main (string[] args) {
+ Gtk.init (ref args);
+-#if ENABLE_GTK3
+ Gtk.Application app = new Gtk.Application ("org.xfce.Notes", 0);
+
+ try {
+@@ -118,21 +99,7 @@ static int main (string[] args) {
+ app.activate.connect (() => {
+ application.show_hide_notes ();
+ });
+-#else
+- Unique.App app = new Unique.App ("org.xfce.Notes", null);
+- if (app.is_running) {
+- if (app.send_message (Unique.Command.ACTIVATE, null) == Unique.Response.OK) {
+- app = null;
+- return 0;
+- }
+- }
+- app.message_received.connect ((command, message_data, time_) => {
+- if (command != Unique.Command.ACTIVATE) {
+- return Unique.Response.PASSTHROUGH;
+- }
+- return Unique.Response.OK;
+- });
+-#endif
++
+ GLib.Environment.set_application_name (_("Notes"));
+ build_plugin ();
+ Xfce.Autostart. at set ("xfce4-notes-autostart", "xfce4-notes", false);
+diff --git a/src/xfce4-notes-plugin.desktop.in b/src/xfce4-notes-plugin.desktop.in
+index 7da3981..0313d38 100644
+--- a/src/xfce4-notes-plugin.desktop.in
++++ b/src/xfce4-notes-plugin.desktop.in
+@@ -7,3 +7,4 @@ Icon=xfce4-notes-plugin
+ X-XFCE-Unique=true
+ X-XFCE-Module=notes
+ X-XFCE-Internal=FALSE
++X-XFCE-API=2.0
+diff --git a/src/main-popup.vala b/src/main-popup.vala
+new file mode 100644
+index 0000000..e52f7ac
+--- /dev/null
++++ b/src/main-popup.vala
+@@ -0,0 +1,43 @@
++/*
++ * Notes - panel plugin for Xfce Desktop Environment
++ * Copyright (C) 2006-2013 Mike Massonnet <mmassonnet at xfce.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
++ */
++
++static int main (string[] args) {
++ Gtk.init (ref args);
++ var app = new GLib.Application ("org.xfce.Notes", 0);
++ try {
++ app.register ();
++ } catch (GLib.Error e) {
++ warning ("Unable to register: %s", e.message);
++ return -1;
++ }
++ if (!app.get_is_remote ()) {
++ // We are the primary instance, in that case start xfce4-notes
++ try {
++ message ("xfce4-notes isn't currently running, trying to start it...");
++ GLib.Process.spawn_command_line_async ("xfce4-notes");
++ } catch (GLib.Error e) {
++ critical ("%s", e.message);
++ return -1;
++ }
++ } else {
++ // Send an activate signal which is used to show/hide the notes
++ app.activate ();
++ }
++ return 0;
++}
+diff --git a/src/xfce-autostart.vapi b/src/xfce-autostart.vapi
+new file mode 100644
+index 0000000..87eb24c
+--- /dev/null
++++ b/src/xfce-autostart.vapi
+@@ -0,0 +1,5 @@
++[CCode (cheader_filename = "xfce-autostart.h")]
++namespace Xfce.Autostart {
++ public static void @set (string name, string exec, bool hidden);
++ public static void set_full (string name, string exec, bool hidden, bool terminal, string? comment, string? icon);
++}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xfce4-notes-plugin.git/commitdiff/90788a8b15601c98f4a9a157992b65038afa016d
More information about the pld-cvs-commit
mailing list