diff options
author | jkim <jkim@FreeBSD.org> | 2009-02-05 01:45:32 +0800 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-02-05 01:45:32 +0800 |
commit | 03536a5aa93fea380bba4991b952ffb46156b288 (patch) | |
tree | 0044f03651d35422b1b8ed17764d98562d1bc936 /sysutils/hal/files | |
parent | d46f4790184244d7ebb8000a870b77d61cb6d599 (diff) | |
download | freebsd-ports-gnome-03536a5aa93fea380bba4991b952ffb46156b288.tar.gz freebsd-ports-gnome-03536a5aa93fea380bba4991b952ffb46156b288.tar.zst freebsd-ports-gnome-03536a5aa93fea380bba4991b952ffb46156b288.zip |
- Do not allow openning /dev/sysmouse multiple times. When there are
multiple instances of moused(8) and Xorg mouse driver
opens /dev/sysmouse multiple times, Xorg server gets confused badly,
e.g., losing input events, waiting for already processed events, etc.
- Really fix laptop brightness control. The previous commit didn't
fix IBM and Sony laptops. Pointyhat to me, again.
Reviewed by: marcus
Diffstat (limited to 'sysutils/hal/files')
-rw-r--r-- | sysutils/hal/files/patch-hald_freebsd_hf-acpi.c | 74 | ||||
-rw-r--r-- | sysutils/hal/files/patch-hald_freebsd_probing_probe-mouse.c | 23 |
2 files changed, 79 insertions, 18 deletions
diff --git a/sysutils/hal/files/patch-hald_freebsd_hf-acpi.c b/sysutils/hal/files/patch-hald_freebsd_hf-acpi.c index 08da6b1456be..a21095a5f339 100644 --- a/sysutils/hal/files/patch-hald_freebsd_hf-acpi.c +++ b/sysutils/hal/files/patch-hald_freebsd_hf-acpi.c @@ -1,6 +1,50 @@ --- hald/freebsd/hf-acpi.c.orig 2008-05-07 19:23:59.000000000 -0400 -+++ hald/freebsd/hf-acpi.c 2009-02-02 20:32:05.000000000 -0500 -@@ -105,6 +105,9 @@ ++++ hald/freebsd/hf-acpi.c 2009-02-04 11:32:27.000000000 -0500 +@@ -54,6 +54,7 @@ + static const struct laptop_panel_type { + char *access; + char *name; ++ char *get_sysctl; + char *max_sysctl; + int max_levels; + #define HF_ACPI_IBM_MAX_LEVELS 8 +@@ -64,17 +65,29 @@ + #define HF_ACPI_FUJITSU_MAX_LEVELS 8 + /* NOTE: Each new type must also be added to hf-devtree.c */ + } laptop_panel_types[] = { +- { "ibm", "IBM", NULL, ++ { "ibm", "IBM", ++ "dev.acpi_ibm.0.lcd_brightness", ++ NULL, + HF_ACPI_IBM_MAX_LEVELS }, +- { "toshiba", "Toshiba", NULL, ++ { "toshiba", "Toshiba", ++ "hw.acpi.toshiba.lcd_brightness", ++ NULL, + HF_ACPI_TOSHIBA_MAX_LEVELS }, +- { "sony", "Sony", NULL, ++ { "sony", "Sony", ++ "dev.acpi_sony.0.brightness", ++ NULL, + HF_ACPI_SONY_MAX_LEVELS }, +- { "panasonic", "Panasonic", "hw.acpi.panasonic.lcd_brightness_max", ++ { "panasonic", "Panasonic", ++ "hw.acpi.panasonic.lcd_brightness", ++ "hw.acpi.panasonic.lcd_brightness_max", + HF_ACPI_PANASONIC_MAX_LEVELS }, +- { "asus", "Asus", NULL, ++ { "asus", "Asus", ++ "hw.acpi.asus.lcd_brightness", ++ NULL, + HF_ACPI_ASUS_MAX_LEVELS }, +- { "fujitsu", "Fujitsu", NULL, ++ { "fujitsu", "Fujitsu", ++ "hw.acpi.fujitsu.lcd_brightness", ++ NULL, + HF_ACPI_FUJITSU_MAX_LEVELS } + }; + +@@ -105,6 +118,9 @@ gboolean ispresent; union acpi_battery_ioctl_arg battif, battst, battinfo; @@ -10,25 +54,31 @@ battif.unit = battst.unit = battinfo.unit = hal_device_property_get_int(device, "freebsd.unit"); -@@ -500,10 +503,17 @@ - const char *max_sysctl, const char *access, - const char *name) +@@ -497,13 +513,15 @@ + + static HalDevice * + hf_acpi_laptop_panel_new (HalDevice *parent, int max_levels, +- const char *max_sysctl, const char *access, +- const char *name) ++ const char *get_sysctl, const char *max_sysctl, ++ const char *access, const char *name) { -+ char *brightness; HalDevice *device; g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL); -+ if (! strcmp(access, "sony")) -+ brightness = "brightness"; -+ else -+ brightness = "lcd_brightness"; -+ if (! hf_has_sysctl("hw.acpi.%s.%s", access, brightness)) ++ if (get_sysctl == NULL || ! hf_has_sysctl(get_sysctl)) + return NULL; device = hf_device_new(parent); hf_device_property_set_string_printf(device, "info.product", "Laptop Panel (%s)", name); -@@ -597,7 +607,8 @@ +@@ -593,11 +611,13 @@ + HalDevice *panel_device; + + panel_device = hf_acpi_laptop_panel_new(parent, +- laptop_panel_types[i].max_levels, ++ laptop_panel_types[i].max_levels, ++ laptop_panel_types[i].get_sysctl, laptop_panel_types[i].max_sysctl, laptop_panel_types[i].access, laptop_panel_types[i].name); diff --git a/sysutils/hal/files/patch-hald_freebsd_probing_probe-mouse.c b/sysutils/hal/files/patch-hald_freebsd_probing_probe-mouse.c index 516c5773b87f..901da9333dc1 100644 --- a/sysutils/hal/files/patch-hald_freebsd_probing_probe-mouse.c +++ b/sysutils/hal/files/patch-hald_freebsd_probing_probe-mouse.c @@ -1,6 +1,6 @@ ---- hald/freebsd/probing/probe-mouse.c.orig 2009-01-25 16:54:29.000000000 -0500 -+++ hald/freebsd/probing/probe-mouse.c 2009-01-25 18:40:04.000000000 -0500 -@@ -0,0 +1,301 @@ +--- hald/freebsd/probing/probe-mouse.c.orig 2009-02-04 11:00:00.000000000 -0500 ++++ hald/freebsd/probing/probe-mouse.c 2009-02-04 11:04:43.000000000 -0500 +@@ -0,0 +1,312 @@ +/*************************************************************************** + * CVSID: $Id$ + * @@ -227,7 +227,9 @@ +probe_mouse (const char *device_file) +{ + gboolean found; ++ char **udis; + char *driver; ++ int num_udis; + + driver = libhal_device_get_property_string(hfp_ctx, hfp_udi, + "input.x11_driver", &hfp_error); @@ -255,10 +257,19 @@ + found = device_opened_by_proc(MOUSED_DEVICE, XORG_PROC_NAME); + if (! found) + { -+ libhal_device_set_property_string(hfp_ctx, hfp_udi, -+ "input.x11_driver", -+ MOUSE_DRIVER, &hfp_error); ++ udis = libhal_manager_find_device_string_match(hfp_ctx, ++ "input.device", ++ MOUSED_DEVICE, ++ &num_udis, ++ &hfp_error); + dbus_error_free(&hfp_error); ++ if (num_udis > 0 && udis != NULL && !strcmp(udis[0], hfp_udi)) { ++ libhal_device_set_property_string(hfp_ctx, hfp_udi, ++ "input.x11_driver", ++ MOUSE_DRIVER, &hfp_error); ++ dbus_error_free(&hfp_error); ++ libhal_free_string_array(udis); ++ } + } + else if (driver) + { |