Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfce4: fix wallpaper bug #22654

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions x11-packages/thunar/0002-fix-set-wallpaper.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- a/plugins/thunar-wallpaper/twp-provider.c
+++ b/plugins/thunar-wallpaper/twp-provider.c
@@ -163,6 +163,28 @@
return items;
}

+/* from xfdesktop/common/xfdesktop-common.c */
+static gchar*
+remove_whitespaces(gchar* str)
+{
+ gchar* dest;
+ guint offs, curr;
+
+ g_return_val_if_fail(str, NULL);
+
+ offs = 0;
+ dest = str;
+ for(curr=0; curr<=strlen(str); curr++) {
+ if(*dest == ' ' || *dest == '\t')
+ offs++;
+ else if(0 != offs)
+ *(dest-offs) = *dest;
+ dest++;
+ }
+
+ return str;
+}
+
static void
twp_action_set_wallpaper (ThunarxMenuItem *item,
gpointer user_data)
@@ -268,8 +290,8 @@
* that it works as the user expects. */
if (monitor_name)
{
- image_path_prop = g_strdup_printf ("/backdrop/screen%d/monitor%s/workspace%d/last-image", screen_nr, monitor_name, workspace);
- image_style_prop = g_strdup_printf ("/backdrop/screen%d/monitor%s/workspace%d/image-style", screen_nr, monitor_name, workspace);
+ image_path_prop = g_strdup_printf ("/backdrop/screen%d/monitor%s/workspace%d/last-image", screen_nr, remove_whitespaces(monitor_name), workspace);
+ image_style_prop = g_strdup_printf ("/backdrop/screen%d/monitor%s/workspace%d/image-style", screen_nr, remove_whitespaces(monitor_name), workspace);
}
else
{
1 change: 1 addition & 0 deletions x11-packages/thunar/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Modern file manager for XFCE environment"
TERMUX_PKG_LICENSE="GPL-2.0, LGPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="4.20.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://archive.xfce.org/src/xfce/thunar/${TERMUX_PKG_VERSION%.*}/thunar-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=e5a83ccd2992b4c4e5ada3563ce92ebcbc222e13bb53d45ec350923ce1a51b6a
TERMUX_PKG_AUTO_UPDATE=true
Expand Down
1 change: 1 addition & 0 deletions x11-packages/xfdesktop/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A desktop manager for XFCE environment"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="4.20.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://archive.xfce.org/src/xfce/xfdesktop/${TERMUX_PKG_VERSION%.*}/xfdesktop-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=227041ba80c7f3eb9c99dec817f1132b35d8aec7a4335703f61ba1735cd65632
TERMUX_PKG_AUTO_UPDATE=true
Expand Down
59 changes: 59 additions & 0 deletions x11-packages/xfdesktop/fix-wallpaper.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
--- a/src/xfdesktop-backdrop-manager.c
+++ b/src/xfdesktop-backdrop-manager.c
@@ -408,7 +408,7 @@
G_GNUC_END_IGNORE_DEPRECATIONS
return g_strdup_printf("/backdrop/screen%d/monitor%s/",
screen_num,
- monitor_get_identifier(monitor));
+ xfdesktop_remove_whitspaces(monitor_get_identifier(monitor)));
}

static gchar *
@@ -442,7 +442,7 @@

gchar *span_monitor_property_prefix = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d",
screen_num,
- monitor_get_identifier(first_monitor),
+ xfdesktop_remove_whitspaces(monitor_get_identifier(first_monitor)),
workspace_num);
gchar *first_image_style_prop = g_strconcat(span_monitor_property_prefix, "/image-style", NULL);
XfceBackdropImageStyle first_image_style = xfconf_channel_get_int(manager->channel,
@@ -467,7 +467,7 @@
}
return g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d",
screen_num,
- monitor_get_identifier(the_monitor),
+ xfdesktop_remove_whitspaces(monitor_get_identifier(the_monitor)),
workspace_num);
}
}

--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -538,7 +538,7 @@
for (gint i = 0; i < n_workspaces; ++i) {
gchar *new_name = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/%s",
screen_num,
- monitor_name,
+ xfdesktop_remove_whitspaces(monitor_name),
i,
new_setting_name);
if (!xfconf_channel_has_property(channel, new_name)) {
@@ -582,7 +582,7 @@
for (gint i = 0; i < n_workspaces; ++i) {
gchar *new_name = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/image-style",
screen_num,
- monitor_name,
+ xfdesktop_remove_whitspaces(monitor_name),
i);
if (!xfconf_channel_has_property(channel, new_name)) {
xfconf_channel_set_int(channel, new_name, XFCE_BACKDROP_IMAGE_NONE);
@@ -671,7 +671,7 @@
for (gint i = 0; i < n_workspaces; ++i) {
gchar *new_name = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/%s",
screen_num,
- monitor_name,
+ xfdesktop_remove_whitspaces(monitor_name),
i,
setting_name);
if (!xfconf_channel_has_property(channel, new_name)) {
Loading