Index: plugins/keyboard/gsd-keyboard-xkb.c
===================================================================
--- plugins/keyboard/gsd-keyboard-xkb.c	(revision 758)
+++ plugins/keyboard/gsd-keyboard-xkb.c	(working copy)
@@ -39,6 +39,10 @@
 #include "delayed-dialog.h"
 #include "gnome-settings-profile.h"
 
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
+#endif /* HAVE_LIBNOTIFY */
+
 static XklEngine *xkl_engine;
 
 static GkbdDesktopConfig current_config;
@@ -60,6 +64,10 @@
 
 static const char *gdm_keyboard_layout = NULL;
 
+#ifdef HAVE_LIBNOTIFY
+NotifyNotification *notification_bubble = NULL;
+#endif /* HAVE_LIBNOTIFY */
+
 #define noGSDKX
 
 #ifdef GSDKX
@@ -350,6 +358,34 @@
 	apply_xkb_settings ();
 }
 
+/* When state changes, pop up a notification */
+static void
+gsd_keyboard_state_changed (XklEngine * engine,
+			    XklEngineStateChange changeType,
+			    gint group, gboolean restore)
+{
+#ifdef HAVE_LIBNOTIFY
+	/* xkl_debug (150, "group is now %d, restore: %d\n", group, restore); */
+	if (changeType == GROUP_CHANGED) {
+		if (notification_bubble != NULL) {
+			notify_notification_close (notification_bubble, NULL);
+			g_object_unref (notification_bubble);
+			notification_bubble = NULL;
+		}
+		
+		gchar* message_format = _("Keyboard layout has changed to %s");
+		GString* message = g_string_new(NULL);
+		g_string_append_printf(message,message_format,xkl_engine_get_groups_names (engine) [group]);
+		
+		notification_bubble = notify_notification_new(
+		    (gchar*)message->str,NULL,"input-keyboard",NULL);
+		/*TODO: Get key combination to change it back and add it to message!*/
+		GError* error = NULL;
+		notify_notification_show(notification_bubble, error);
+	}
+#endif /* HAVE_LIBNOTIFY */
+}
+
 void
 gsd_keyboard_xkb_init (GConfClient * client)
 {
@@ -399,6 +435,14 @@
 			g_signal_connect (xkl_engine, "X-new-device",
 					  G_CALLBACK
 					  (gsd_keyboard_new_device), NULL);
+		
+#ifdef HAVE_LIBNOTIFY
+		notify_init ("gnome-settings-daemon");
+#endif /* HAVE_LIBNOTIFY */
+		
+		g_signal_connect (xkl_engine, "X-state-changed",
+			          G_CALLBACK (gsd_keyboard_state_changed),
+			          NULL);
 
 		gnome_settings_profile_start ("xkl_engine_start_listen");
 		xkl_engine_start_listen (xkl_engine,
