[Pkg-xfce-commits] r8023 - in /goodies/trunk/lightdm-gtk-greeter/debian: changelog patches/06_support-session-select-before-authentication.patch patches/series
Yves-Alexis Perez
corsac at alioth.debian.org
Sat Oct 26 20:02:49 UTC 2013
Author: corsac
Date: Sat Oct 26 20:02:49 2013
New Revision: 8023
URL: http://svn.debian.org/wsvn/pkg-xfce/?sc=1&rev=8023
Log:
06_support-session-select-before-authentication added, fix session and
languages selected in the menu not actually set for the current session.
closes: #717702
Added:
goodies/trunk/lightdm-gtk-greeter/debian/patches/06_support-session-select-before-authentication.patch
Modified:
goodies/trunk/lightdm-gtk-greeter/debian/changelog
goodies/trunk/lightdm-gtk-greeter/debian/patches/series
Modified: goodies/trunk/lightdm-gtk-greeter/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-xfce/goodies/trunk/lightdm-gtk-greeter/debian/changelog?rev=8023&op=diff
==============================================================================
--- goodies/trunk/lightdm-gtk-greeter/debian/changelog (original)
+++ goodies/trunk/lightdm-gtk-greeter/debian/changelog Sat Oct 26 20:02:49 2013
@@ -3,6 +3,9 @@
* debian/patches:
- 05_add-enter-shortcut-switch-login-password-fields added, support Enter
key to move from login to password field. closes: #727718
+ - 06_support-session-select-before-authentication added, fix session and
+ languages selected in the menu not actually set for the current session.
+ closes: #717702
-- Yves-Alexis Perez <corsac at debian.org> Fri, 25 Oct 2013 21:39:48 +0200
Added: goodies/trunk/lightdm-gtk-greeter/debian/patches/06_support-session-select-before-authentication.patch
URL: http://svn.debian.org/wsvn/pkg-xfce/goodies/trunk/lightdm-gtk-greeter/debian/patches/06_support-session-select-before-authentication.patch?rev=8023&op=file
==============================================================================
--- goodies/trunk/lightdm-gtk-greeter/debian/patches/06_support-session-select-before-authentication.patch (added)
+++ goodies/trunk/lightdm-gtk-greeter/debian/patches/06_support-session-select-before-authentication.patch Sat Oct 26 20:02:49 2013
@@ -0,0 +1,113 @@
+--- a/src/lightdm-gtk-greeter.c
++++ b/src/lightdm-gtk-greeter.c
+@@ -67,6 +67,10 @@ static int a11y_kbd_pid = 0;
+ static GPid *a11y_keyboard_pid = &a11y_kbd_pid;
+ static GError *a11y_keyboard_error;
+
++/* Current choices */
++static gchar *current_session;
++static gchar *current_language;
++
+ #if GTK_CHECK_VERSION (3, 0, 0)
+ static GdkRGBA *default_background_color = NULL;
+ #else
+@@ -271,6 +275,10 @@ get_session (void)
+ {
+ GList *menu_items, *menu_iter;
+
++ /* if the user manually selected a session, use it */
++ if (current_session)
++ return current_session;
++
+ menu_items = gtk_container_get_children(GTK_CONTAINER(session_menu));
+
+ for (menu_iter = menu_items; menu_iter != NULL; menu_iter = g_list_next(menu_iter))
+@@ -305,6 +313,7 @@ set_session (const gchar *session)
+ if (matched)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_iter->data), TRUE);
++ current_session = g_strdup(session);
+ return;
+ }
+ }
+@@ -336,6 +345,10 @@ static gchar *
+ get_language (void)
+ {
+ GList *menu_items, *menu_iter;
++
++ /* if the user manually selected a language, use it */
++ if (current_language)
++ return current_language;
+
+ menu_items = gtk_container_get_children(GTK_CONTAINER(language_menu));
+ for (menu_iter = menu_items; menu_iter != NULL; menu_iter = g_list_next(menu_iter))
+@@ -369,6 +382,7 @@ set_language (const gchar *language)
+ if (matched)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_iter->data), TRUE);
++ current_language = g_strdup(language);
+ return;
+ }
+ }
+@@ -602,8 +616,10 @@ start_authentication (const gchar *usern
+ user = lightdm_user_list_get_user_by_name (lightdm_user_list_get_instance (), username);
+ if (user)
+ {
+- set_session (lightdm_user_get_session (user));
+- set_language (lightdm_user_get_language (user));
++ if (!current_session)
++ set_session (lightdm_user_get_session (user));
++ if (!current_language)
++ set_language (lightdm_user_get_language (user));
+ }
+ else
+ {
+@@ -690,6 +706,32 @@ start_session (void)
+ g_free (session);
+ }
+
++void
++session_selected_cb(GtkMenuItem *menuitem, gpointer user_data);
++G_MODULE_EXPORT
++void
++session_selected_cb(GtkMenuItem *menuitem, gpointer user_data)
++{
++ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)))
++ {
++ gchar *session = g_object_get_data (G_OBJECT (menuitem), "session-key");
++ set_session(session);
++ }
++}
++
++void
++language_selected_cb(GtkMenuItem *menuitem, gpointer user_data);
++G_MODULE_EXPORT
++void
++language_selected_cb(GtkMenuItem *menuitem, gpointer user_data)
++{
++ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)))
++ {
++ gchar *language = g_object_get_data (G_OBJECT (menuitem), "session-key");
++ set_language(language);
++ }
++}
++
+ gboolean
+ username_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data);
+ G_MODULE_EXPORT
+@@ -1728,6 +1770,7 @@ main (int argc, char **argv)
+ radiomenuitem = gtk_radio_menu_item_new_with_label (sessions, lightdm_session_get_name (session));
+ g_object_set_data (G_OBJECT (radiomenuitem), "session-key", (gpointer) lightdm_session_get_key (session));
+ sessions = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem));
++ g_signal_connect(G_OBJECT(radiomenuitem), "activate", G_CALLBACK(session_selected_cb), NULL);
+ gtk_menu_shell_append (GTK_MENU_SHELL(session_menu), radiomenuitem);
+ gtk_widget_show (GTK_WIDGET (radiomenuitem));
+ }
+@@ -1776,6 +1819,7 @@ main (int argc, char **argv)
+ radiomenuitem = gtk_radio_menu_item_new_with_label (languages, label);
+ g_object_set_data (G_OBJECT (radiomenuitem), "language-code", (gpointer) code);
+ languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem));
++ g_signal_connect(G_OBJECT(radiomenuitem), "activate", G_CALLBACK(language_selected_cb), NULL);
+ gtk_menu_shell_append (GTK_MENU_SHELL(language_menu), radiomenuitem);
+ gtk_widget_show (GTK_WIDGET (radiomenuitem));
+ }
Modified: goodies/trunk/lightdm-gtk-greeter/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-xfce/goodies/trunk/lightdm-gtk-greeter/debian/patches/series?rev=8023&op=diff
==============================================================================
--- goodies/trunk/lightdm-gtk-greeter/debian/patches/series (original)
+++ goodies/trunk/lightdm-gtk-greeter/debian/patches/series Sat Oct 26 20:02:49 2013
@@ -1,2 +1,3 @@
04_default-gtk-greeter-config.patch
05_add-enter-shortcut-switch-login-password-fields.patch
+06_support-session-select-before-authentication.patch
More information about the Pkg-xfce-commits
mailing list