summaryrefslogtreecommitdiff
path: root/sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c')
-rw-r--r--sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c b/sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c
index 690e60d19477..3fb76b17c097 100644
--- a/sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c
+++ b/sysutils/xfce4-power-manager/files/patch-src_xfpm-backlight-helper.c
@@ -1,15 +1,15 @@
---- src/xfpm-backlight-helper.c.orig 2020-01-26 23:15:39 UTC
+--- src/xfpm-backlight-helper.c.orig 2024-11-21 06:26:21 UTC
+++ src/xfpm-backlight-helper.c
-@@ -49,6 +49,8 @@
- #define EXIT_CODE_INVALID_USER 4
- #define EXIT_CODE_NO_BRIGHTNESS_SWITCH 5
+@@ -51,6 +51,8 @@
+ #define EXIT_CODE_INVALID_USER 4
+ #define EXIT_CODE_NO_BRIGHTNESS_SWITCH 5
-+#define MAX_DEVICE_NUM 8
++#define MAX_DEVICE_NUM 8
+
- #if !defined(BACKEND_TYPE_FREEBSD)
- #define BACKLIGHT_SYSFS_LOCATION "/sys/class/backlight"
- #define BRIGHTNESS_SWITCH_LOCATION "/sys/module/video/parameters/brightness_switch_enabled"
-@@ -204,19 +206,23 @@ backlight_helper_get_device (void)
+ #ifndef BACKEND_TYPE_FREEBSD
+ #define BACKLIGHT_SYSFS_LOCATION "/sys/class/backlight"
+ #define BRIGHTNESS_SWITCH_LOCATION "/sys/module/video/parameters/brightness_switch_enabled"
+@@ -211,20 +213,24 @@ backlight_helper_get_device (void)
/* devices in priority order */
gchar *types[] = { "lcd", "crt", "out", "ext", "tv", NULL };
gchar *device = NULL;
@@ -19,7 +19,8 @@
- device = (gchar *) g_malloc (sizeof (gchar));
+ device = (gchar *) g_malloc (sizeof (gchar) * 8);
- for (i = 0; types[i] != NULL; i++) {
+ for (i = 0; types[i] != NULL; i++)
+ {
- g_snprintf (device, (gulong) strlen (types[i]), "%s0", types[i]);
+ for (j = 0; j < MAX_DEVICE_NUM; j++) {
+ g_snprintf (device, 8, "%s%i", types[i], j);