aboutsummaryrefslogtreecommitdiff
path: root/x11/gdm/files/patch-hal-keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'x11/gdm/files/patch-hal-keyboard')
-rw-r--r--x11/gdm/files/patch-hal-keyboard104
1 files changed, 0 insertions, 104 deletions
diff --git a/x11/gdm/files/patch-hal-keyboard b/x11/gdm/files/patch-hal-keyboard
deleted file mode 100644
index 904f1cdaccaa..000000000000
--- a/x11/gdm/files/patch-hal-keyboard
+++ /dev/null
@@ -1,104 +0,0 @@
---- daemon/gdm-session-direct.c.orig 2009-07-20 03:09:09.000000000 +0200
-+++ daemon/gdm-session-direct.c 2009-07-20 10:14:45.000000000 +0200
-@@ -45,6 +45,8 @@
- #include <dbus/dbus-glib.h>
- #include <dbus/dbus-glib-lowlevel.h>
-
-+#include <libhal.h>
-+
- #include "gdm-session-direct.h"
- #include "gdm-session.h"
- #include "gdm-session-private.h"
-@@ -597,14 +599,66 @@ get_default_language_name (GdmSessionDir
- return setlocale (LC_MESSAGES, NULL);
- }
-
-+static char *
-+get_system_default_layout (GdmSessionDirect *session)
-+{
-+ DBusConnection *connection;
-+ LibHalContext *ctx;
-+ char **devices;
-+ int n_devices;
-+ char *layout;
-+ char *result;
-+
-+ result = NULL;
-+
-+ connection = dbus_g_connection_get_connection (session->priv->connection);
-+ ctx = libhal_ctx_new ();
-+ libhal_ctx_set_dbus_connection (ctx, connection);
-+
-+ if (!libhal_ctx_init (ctx, NULL)) {
-+ goto out;
-+ }
-+
-+ devices = libhal_find_device_by_capability (ctx,
-+ "input.keyboard",
-+ &n_devices,
-+ NULL);
-+ if (n_devices > 0) {
-+ layout = libhal_device_get_property_string (ctx,
-+ devices[0],
-+ "input.x11_options.XkbLayout",
-+ NULL);
-+ if (!layout) {
-+ layout = libhal_device_get_property_string (ctx,
-+ devices[0],
-+ "input.xkb.layout",
-+ NULL);
-+ }
-+ result = g_strdup (layout);
-+ libhal_free_string (layout);
-+ }
-+
-+ libhal_free_string_array (devices);
-+
-+ libhal_ctx_shutdown (ctx, NULL);
-+ libhal_ctx_free (ctx);
-+
-+out:
-+ if (!result) {
-+ result = g_strdup ("us");
-+ }
-+
-+ return result;
-+}
-+
- static const char *
- get_default_layout_name (GdmSessionDirect *session)
- {
-- if (session->priv->saved_layout != NULL) {
-- return session->priv->saved_layout;
-+ if (!session->priv->saved_layout) {
-+ session->priv->saved_layout = get_system_default_layout (session);
- }
-
-- return "us";
-+ return session->priv->saved_layout;
- }
-
- static char *
-@@ -1953,8 +2007,8 @@ setup_session_environment (GdmSessionDir
- "GDM_LANG",
- get_language_name (session));
-
-- if (strcmp (get_layout_name (session),
-- get_default_layout_name (session)) == 0) {
-+ if (g_strcmp0 (get_layout_name (session),
-+ get_default_layout_name (session)) != 0) {
- gdm_session_direct_set_environment_variable (session,
- "GDM_KEYBOARD_LAYOUT",
- get_layout_name (session));
---- daemon/gdm-session-settings.c.orig 2009-05-19 17:18:12.000000000 +0200
-+++ daemon/gdm-session-settings.c 2009-07-20 10:10:15.000000000 +0200
-@@ -149,8 +149,7 @@ gdm_session_settings_set_layout_name (Gd
- {
- g_return_if_fail (GDM_IS_SESSION_SETTINGS (settings));
-
-- if (settings->priv->layout_name == NULL ||
-- strcmp (settings->priv->layout_name, layout_name) != 0) {
-+ if (g_strcmp0 (settings->priv->layout_name, layout_name) != 0) {
- settings->priv->layout_name = g_strdup (layout_name);
- g_object_notify (G_OBJECT (settings), "layout-name");
- }