diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2026-02-17 18:16:39 +0200 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2026-02-17 18:16:39 +0200 |
| commit | 4f12f3b8306ad9579e2b41278cc3332a3d067149 (patch) | |
| tree | 74db62252751e8fe2c0188535d819f2de2ad9cfc /xfce-base | |
| parent | package.use: rewrite comments (diff) | |
| download | orf-overlay-4f12f3b8306ad9579e2b41278cc3332a3d067149.tar.gz orf-overlay-4f12f3b8306ad9579e2b41278cc3332a3d067149.zip | |
xfce-base/xfdesktop: add Fix-the-broken-background-picture-setup-on-Wayland.patch
Small hack that fixes setting up the wallpaper on wayland using
xfdesktop. Taken from https://gitlab.xfce.org/xfce/xfdesktop/-/issues/413#note_109994
Diffstat (limited to 'xfce-base')
| -rw-r--r-- | xfce-base/xfdesktop/files/0001-Fix-the-broken-background-picture-setup-on-Wayland.patch | 73 | ||||
| -rw-r--r-- | xfce-base/xfdesktop/xfdesktop-4.20.1.ebuild | 8 |
2 files changed, 81 insertions, 0 deletions
diff --git a/xfce-base/xfdesktop/files/0001-Fix-the-broken-background-picture-setup-on-Wayland.patch b/xfce-base/xfdesktop/files/0001-Fix-the-broken-background-picture-setup-on-Wayland.patch new file mode 100644 index 0000000..a0cde02 --- /dev/null +++ b/xfce-base/xfdesktop/files/0001-Fix-the-broken-background-picture-setup-on-Wayland.patch | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | From e6dd0929842a00c02953dbdfb7de470445fdf6a9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Takashi Iwai <tiwai@suse.de> | ||
| 3 | Date: Mon, 18 Aug 2025 13:55:18 +0200 | ||
| 4 | Subject: [PATCH] Fix the broken background picture setup on Wayland | ||
| 5 | |||
| 6 | The xfdesktop-settings picks up the backdrop prefix with the monitor | ||
| 7 | name returned from xfdesktop_get_monitor_name_from_gtk_widget(), where | ||
| 8 | it tries to get the monitor name from gdk. On Wayland, this returns | ||
| 9 | the actual monitor name or model, not the connector name. | ||
| 10 | Meanwhile, the xfdesktop itself uses the backdrop prefix with the | ||
| 11 | connector name (e.g. "eDP-1" or "Virtual-1"). This difference made | ||
| 12 | the setup done by xfdesktop-settings ignored. | ||
| 13 | |||
| 14 | Instead of deducing the prefix name from gdk, try to guess from the | ||
| 15 | given XfwWindow. | ||
| 16 | |||
| 17 | I'm not 100% sure whether it's the correct solution, but it seems | ||
| 18 | working in most cases. | ||
| 19 | --- | ||
| 20 | settings/xfdesktop-background-settings.c | 23 +++++++++++++++++++++-- | ||
| 21 | 1 file changed, 21 insertions(+), 2 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/settings/xfdesktop-background-settings.c b/settings/xfdesktop-background-settings.c | ||
| 24 | index 21315b6eaeeb..b92b53a5ac18 100644 | ||
| 25 | --- a/settings/xfdesktop-background-settings.c | ||
| 26 | +++ b/settings/xfdesktop-background-settings.c | ||
| 27 | @@ -1447,6 +1447,25 @@ xfdesktop_settings_get_active_workspace(XfdesktopBackgroundSettings *background_ | ||
| 28 | return workspace_num; | ||
| 29 | } | ||
| 30 | |||
| 31 | +static gchar *get_monitor_name(XfdesktopBackgroundSettings *background_settings, | ||
| 32 | + int monitor_num) | ||
| 33 | +{ | ||
| 34 | +#ifdef ENABLE_WAYLAND | ||
| 35 | + /* FIXME: gtk3 has no easy way to know the connector, so guess from xfw window instead */ | ||
| 36 | + if (xfw_windowing_get() != XFW_WINDOWING_X11) { | ||
| 37 | + GList *monitors = xfw_screen_get_monitors(xfw_window_get_screen(background_settings->xfw_window)); | ||
| 38 | + gpointer p = g_list_nth_data(monitors, monitor_num); | ||
| 39 | + XfwMonitor *xfw_mon = xfw_screen_get_primary_monitor(xfw_window_get_screen(background_settings->xfw_window)); | ||
| 40 | + if (p) { | ||
| 41 | + gchar *name = xfw_monitor_get_connector(XFW_MONITOR(p)); | ||
| 42 | + if (name) | ||
| 43 | + return g_strdup(name); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | +#endif | ||
| 47 | + return xfdesktop_get_monitor_name_from_gtk_widget(background_settings->image_iconview, monitor_num); | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | static void | ||
| 51 | cb_update_background_tab(XfwWindow *xfw_window, XfdesktopBackgroundSettings *background_settings) { | ||
| 52 | /* If we haven't found our window return now and wait for that */ | ||
| 53 | @@ -1464,7 +1483,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS | ||
| 54 | GdkDisplay *display = gdk_window_get_display(window); | ||
| 55 | GdkMonitor *monitor = gdk_display_get_monitor_at_window(display, window); | ||
| 56 | gint monitor_num = xfdesktop_get_monitor_num(display, monitor); | ||
| 57 | - gchar *monitor_name = xfdesktop_get_monitor_name_from_gtk_widget(background_settings->image_iconview, monitor_num); | ||
| 58 | + gchar *monitor_name = get_monitor_name(background_settings, monitor_num); | ||
| 59 | |||
| 60 | /* Most of the time we won't change monitor, screen, or workspace so try | ||
| 61 | * to bail out now if we can */ | ||
| 62 | @@ -1494,7 +1513,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS | ||
| 63 | background_settings->screen = screen_num; | ||
| 64 | background_settings->monitor = monitor_num; | ||
| 65 | g_free(background_settings->monitor_name); | ||
| 66 | - background_settings->monitor_name = xfdesktop_get_monitor_name_from_gtk_widget(background_settings->image_iconview, monitor_num); | ||
| 67 | + background_settings->monitor_name = get_monitor_name(background_settings, monitor_num); | ||
| 68 | |||
| 69 | /* The first monitor has the option of doing the "spanning screens" style, | ||
| 70 | * but only if there's multiple monitors attached. Remove it in all other cases. | ||
| 71 | -- | ||
| 72 | 2.50.1 | ||
| 73 | |||
diff --git a/xfce-base/xfdesktop/xfdesktop-4.20.1.ebuild b/xfce-base/xfdesktop/xfdesktop-4.20.1.ebuild index cfecdd1..cb63940 100644 --- a/xfce-base/xfdesktop/xfdesktop-4.20.1.ebuild +++ b/xfce-base/xfdesktop/xfdesktop-4.20.1.ebuild | |||
| @@ -48,6 +48,14 @@ BDEPEND=" | |||
| 48 | virtual/pkgconfig | 48 | virtual/pkgconfig |
| 49 | " | 49 | " |
| 50 | 50 | ||
| 51 | PATCHES=( | ||
| 52 | "${FILESDIR}/0001-Fix-the-broken-background-picture-setup-on-Wayland.patch" | ||
| 53 | ) | ||
| 54 | |||
| 55 | src_prepare() { | ||
| 56 | default | ||
| 57 | } | ||
| 58 | |||
| 51 | src_configure() { | 59 | src_configure() { |
| 52 | local emesonargs=( | 60 | local emesonargs=( |
| 53 | $(meson_feature wayland) | 61 | $(meson_feature wayland) |
