community/mate-applets: upgrade to 1.28.1

This commit is contained in:
Francesco Colista 2025-02-12 16:43:46 +00:00
parent ab55decd92
commit d9ce6bafa4
2 changed files with 4 additions and 238 deletions

View File

@ -1,8 +1,8 @@
# Contributor: Alan Lacerda <alacerda@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=mate-applets
pkgver=1.28.0
pkgrel=1
pkgver=1.28.1
pkgrel=0
pkgdesc="Applets for use with the MATE panel"
url="https://github.com/mate-desktop/mate-applets"
arch="all"
@ -29,8 +29,7 @@ makedepends="
upower-dev
"
subpackages="$pkgname-doc $pkgname-lang"
source="https://pub.mate-desktop.org/releases/${pkgver%.*}/mate-applets-$pkgver.tar.xz
fix-stickynotes.patch"
source="https://pub.mate-desktop.org/releases/${pkgver%.*}/mate-applets-$pkgver.tar.xz"
build() {
./configure \
@ -52,6 +51,5 @@ package() {
}
sha512sums="
badc4fa6a95b840033f12688ba0d2f0d9e0558fe4c0a4a8d97eba8fc1afc8e8611d81f343efb9703d5edc9c2c33b22fc2db624660a3e1d970209567da25581a7 mate-applets-1.28.0.tar.xz
72b4ce10cc0ba4491ef1982b902474d4bb1898c31bdfbc332e9c0192abdbb34c7507bb022d907811a71629e6e03f714131e088f76f976ddbf68bd47bed46ce8c fix-stickynotes.patch
34deb17371ee18c5e42a361a0b2bcedc57dbf5d05718c40ecf48c1eda51d8775b48770136e382af6dd436a7aab3ab46df5a3cf2e161d172497ea69e4cae7d940 mate-applets-1.28.1.tar.xz
"

View File

@ -1,232 +0,0 @@
From 925c0cd7f3f306104dc794ea3a05af29255aaba9 Mon Sep 17 00:00:00 2001
From: lukefromdc <lukefromdc@hushmail.com>
Date: Fri, 22 Nov 2024 01:06:52 -0500
Subject: [PATCH 1/4] Do not call x11 functions when not in x11
*Otherwise we get segfaults
---
stickynotes/stickynotes.c | 15 ++++++++++++++-
stickynotes/stickynotes_applet_callbacks.c | 14 +++++++++++++-
stickynotes/util.c | 3 +++
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 85afdc3dc..b2ebb85c8 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -48,6 +48,11 @@ set_icon_geometry (GdkWindow *window,
int width,
int height)
{
+ /*This is x11-only, so return in wayland or anything else*/
+ GdkScreen *screen = gdk_screen_get_default();
+ if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))))
+ return;
+
gulong data[4];
Display *dpy;
@@ -731,7 +736,15 @@ stickynote_set_visible (StickyNote *note,
gtk_window_move (GTK_WINDOW (note->w_window),
note->x, note->y);
- /* Put the note on all workspaces if necessary. */
+
+
+ /*On x11, Put the note on all workspaces or move it if necessary.
+ *We can't yet change workspace on wayland
+ */
+ GdkScreen *screen = gdk_screen_get_default();
+ if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))))
+ return;
+
if (g_settings_get_boolean (stickynotes->settings, "sticky"))
gtk_window_stick (GTK_WINDOW (note->w_window));
diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c
index 80024e4a6..69869a266 100644
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -126,6 +126,10 @@ static gboolean get_desktop_window (GdkScreen *screen, Window *window)
int format_returned;
int length_returned;
+ /*This is x11-only, so return FALSE in wayland or anything else*/
+ if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))))
+ return FALSE;
+
root_window = gdk_screen_get_root_window (screen);
if (gdk_property_get (root_window,
@@ -151,7 +155,15 @@ desktop_window_event_filter (GdkXEvent *xevent,
GdkEvent *event,
gpointer data)
{
- gboolean desktop_hide = g_settings_get_boolean (stickynotes->settings,
+ gboolean desktop_hide;
+
+ GdkScreen *screen = gdk_screen_get_default();
+ if (!(GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))))
+ {
+ desktop_hide = FALSE;
+ return GDK_FILTER_CONTINUE;
+ }
+ desktop_hide = g_settings_get_boolean (stickynotes->settings,
"desktop-hide");
if (desktop_hide &&
(((XEvent*)xevent)->xany.type == PropertyNotify) &&
diff --git a/stickynotes/util.c b/stickynotes/util.c
index d13f9f41d..9b6a51800 100644
--- a/stickynotes/util.c
+++ b/stickynotes/util.c
@@ -110,6 +110,9 @@ xstuff_change_workspace (GtkWindow *window,
Display *gdk_display;
Screen *screen;
+ if (!GDK_IS_X11_DISPLAY (gdk_display_get_default()))
+ return;
+
gdk_display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
xwindow = GDK_WINDOW_XID (GDK_WINDOW (gtk_widget_get_window (GTK_WIDGET (window))));
screen = GDK_SCREEN_XSCREEN (gtk_widget_get_screen (GTK_WIDGET (window)));
From 2e0685ce77ce8427d239bbdf7c3d039287840610 Mon Sep 17 00:00:00 2001
From: lukefromdc <lukefromdc@hushmail.com>
Date: Fri, 22 Nov 2024 01:37:30 -0500
Subject: [PATCH 2/4] Replace GtkSourceView with GtkTextView
As Stickynotes doesn't seem to work with GtkSourceView anymore
---
stickynotes/sticky-notes-note.ui | 7 +++----
stickynotes/stickynotes.c | 2 +-
stickynotes/stickynotes.h | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/stickynotes/sticky-notes-note.ui b/stickynotes/sticky-notes-note.ui
index 8f8a17815..3a734cc19 100644
--- a/stickynotes/sticky-notes-note.ui
+++ b/stickynotes/sticky-notes-note.ui
@@ -2,9 +2,8 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
- <requires lib="gtksourceview" version="4.0"/>
- <object class="GtkSourceBuffer" id="body_buffer">
- <property name="max_undo_levels">-1</property>
+ <requires lib="GtkTextView" version="4.0"/>
+ <object class="GtkTextBuffer" id="body_buffer">
</object>
<object class="GtkMenu" id="stickynote_menu">
<child>
@@ -129,7 +128,7 @@
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<child>
- <object class="GtkSourceView" id="body_text">
+ <object class="GtkTextView" id="body_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="wrap_mode">word</property>
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index b2ebb85c8..e1e1f8cba 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -139,7 +139,7 @@ stickynote_new_aux (GdkScreen *screen,
gtk_widget_add_events (note->w_lock, GDK_BUTTON_PRESS_MASK);
note->buffer =
- GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (note->w_body)));
+ GTK_TEXT_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (note->w_body)));
note->w_close =
GTK_WIDGET (gtk_builder_get_object (builder, "close_button"));
diff --git a/stickynotes/stickynotes.h b/stickynotes/stickynotes.h
index 3a524189b..3edea16a8 100644
--- a/stickynotes/stickynotes.h
+++ b/stickynotes/stickynotes.h
@@ -50,7 +50,7 @@ typedef struct
GtkWidget *w_resize_se; /* Sticky Note resize button (south east) */
GtkWidget *w_resize_sw; /* Sticky Note resize button (south west) */
- GtkSourceBuffer *buffer; /* Sticky Note text buffer for undo/redo */
+ GtkTextBuffer *buffer; /* Sticky Note text buffer for undo/redo */
GtkCheckMenuItem *w_lock_toggle_item; /* Lock item in the popup menu */
From 0ec86be73c8503c196ac7e5f8ef9cc7afa97f070 Mon Sep 17 00:00:00 2001
From: lukefromdc <lukefromdc@hushmail.com>
Date: Fri, 22 Nov 2024 01:59:43 -0500
Subject: [PATCH 3/4] Remove GtkSourceView dependency as we no longer use it
---
configure.ac | 9 +--------
stickynotes/stickynotes.h | 2 --
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index de5ec7d16..9233c8f68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -297,15 +297,8 @@ AC_ARG_ENABLE([stickynotes],
AS_HELP_STRING([--enable-stickynotes], [Enable stickynotes applet.]),
enable_stickynotes=$enableval,
enable_stickynotes=yes)
-if test "x$enable_stickynotes" = "xyes"; then
- PKG_CHECK_MODULES(STICKYNOTES, gtksourceview-4,
- have_gtksourceview=yes, have_gtksourceview=no)
- if test "x$enable_stickynotes" = "xyes" -a "x$have_gtksourceview" = "xno"; then
- AC_MSG_ERROR([Stickynotes explicitly requested but gtksourceview not found])
- fi
-fi
-AM_CONDITIONAL(BUILD_STICKYNOTES_APPLET, test "x$have_gtksourceview" = "xyes")
+AM_CONDITIONAL(BUILD_STICKYNOTES_APPLET, test "x$enable_stickynotes" = "xyes")
dnl ***************************************************************************
dnl *** keyboard accessibility status applet check ***
diff --git a/stickynotes/stickynotes.h b/stickynotes/stickynotes.h
index 3edea16a8..5f42abfa6 100644
--- a/stickynotes/stickynotes.h
+++ b/stickynotes/stickynotes.h
@@ -24,8 +24,6 @@
#include <libwnck/libwnck.h>
#include <stickynotes_applet.h>
-#include <gtksourceview/gtksource.h>
-
typedef struct
{
GtkWidget *w_window; /* Sticky Note window */
From 96a8c54dbc448777e551ae5a4aad9524bba8a2ac Mon Sep 17 00:00:00 2001
From: lukefromdc <lukefromdc@hushmail.com>
Date: Fri, 22 Nov 2024 02:42:18 -0500
Subject: [PATCH 4/4] Compute screen height properly when not in X11
Don't use that value uninitialized
---
stickynotes/stickynotes_applet.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index d88709da6..0fb9b6a9b 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -219,6 +219,16 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen)))
screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+
+ else
+ {
+ /*No root window or primary monitor in wayland unless compositors add it back*/
+ GdkRectangle geometry = {0};
+ GdkMonitor *monitor;
+ monitor = gdk_display_get_monitor (gdk_screen_get_display (screen), 0);
+ gdk_monitor_get_geometry (monitor, &geometry);
+ screen_height = geometry.height;
+ }
#endif
stickynotes->max_height = (int) (0.8 * (double) screen_height);