summaryrefslogtreecommitdiff
path: root/extra/gdm
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/gdm
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/gdm')
-rw-r--r--extra/gdm/0001-port-to-libpanel-applet-3.0.patch506
-rw-r--r--extra/gdm/04_fix_external_program_directories.patch48
-rw-r--r--extra/gdm/PKGBUILD62
-rw-r--r--extra/gdm/correctly-give-focus-to-user-chooser.patch46
-rwxr-xr-xextra/gdm/gdm36
-rw-r--r--extra/gdm/gdm-autologin.pam8
-rw-r--r--extra/gdm/gdm-vt-allocation-hack.patch118
-rw-r--r--extra/gdm/gdm.install44
-rw-r--r--extra/gdm/gdm.pam10
9 files changed, 878 insertions, 0 deletions
diff --git a/extra/gdm/0001-port-to-libpanel-applet-3.0.patch b/extra/gdm/0001-port-to-libpanel-applet-3.0.patch
new file mode 100644
index 000000000..91ada7835
--- /dev/null
+++ b/extra/gdm/0001-port-to-libpanel-applet-3.0.patch
@@ -0,0 +1,506 @@
+diff --git a/configure.ac b/configure.ac
+index ed07dce..bf98669 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -45,7 +45,7 @@ GTK_REQUIRED_VERSION=2.20.0
+ PANGO_REQUIRED_VERSION=1.3.0
+ SCROLLKEEPER_REQUIRED_VERSION=0.1.4
+ GCONF_REQUIRED_VERSION=2.31.3
+-GNOME_PANEL_REQUIRED_VERSION=2.0.0
++GNOME_PANEL_REQUIRED_VERSION=2.31.90
+ LIBXKLAVIER_REQUIRED_VERSION=4.0
+ LIBCANBERRA_GTK_REQUIRED_VERSION=0.4
+ #FONTCONFIG_REQUIRED_VERSION=2.6.0
+@@ -152,7 +152,7 @@ AC_SUBST(SIMPLE_CHOOSER_LIBS)
+ PKG_CHECK_MODULES(APPLET,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
+ gtk+-2.0 >= $GTK_REQUIRED_VERSION
+- libpanelapplet-2.0 >= $GNOME_PANEL_REQUIRED_VERSION)
++ libpanelapplet-3.0 >= $GNOME_PANEL_REQUIRED_VERSION)
+ AC_SUBST(APPLET_CFLAGS)
+ AC_SUBST(APPLET_LIBS)
+
+diff --git a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in b/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
+deleted file mode 100644
+index a9b775f..0000000
+--- a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
++++ /dev/null
+@@ -1,38 +0,0 @@
+-<oaf_info>
+- <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet_Factory" type="exe"
+- location="@LIBEXECDIR@/gdm-user-switch-applet">
+-
+- <oaf_attribute name="repo_ids" type="stringv">
+- <item value="IDL:Bonobo/GenericFactory:1.0"/>
+- <item value="IDL:Bonobo/Unknown:1.0"/>
+- </oaf_attribute>
+- <oaf_attribute name="name" type="string" _value="User Switcher Applet Factory"/>
+- <oaf_attribute name="description" type="string" _value="User Switcher Applet Factory"/>
+- <oaf_attribute name="bonobo:environment" type="stringv">
+- <item value="DBUS_SESSION_BUS_ADDRESS"/>
+- <oaf_attribute name="bugzilla:bugzilla" type="string" value="GNOME"/>
+- <oaf_attribute name="bugzilla:product" type="string" value="gdm"/>
+- <oaf_attribute name="bugzilla:component" type="string" value="general"/>
+- <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/>
+- <oaf_attribute name="bugzilla:other_binaries" type="string" value="gdm-user-switch-applet"/>
+- </oaf_attribute>
+- </oaf_server>
+-
+- <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet" type="factory"
+- location="OAFIID:GNOME_FastUserSwitchApplet_Factory">
+-
+- <oaf_attribute name="repo_ids" type="stringv">
+- <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+- <item value="IDL:Bonobo/Control:1.0"/>
+- <item value="IDL:Bonobo/Unknown:1.0"/>
+- </oaf_attribute>
+- <oaf_attribute name="name" type="string" _value="User Switcher"/>
+- <oaf_attribute name="description" type="string" _value="A menu to quickly switch between users"/>
+- <oaf_attribute name="panel:icon" type="string" value="stock_people"/>
+- <oaf_attribute name="bugzilla:bugzilla" type="string" value="GNOME"/>
+- <oaf_attribute name="bugzilla:product" type="string" value="gdm"/>
+- <oaf_attribute name="bugzilla:component" type="string" value="general"/>
+- <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/>
+- <oaf_attribute name="bugzilla:other_binaries" type="string" value="gdm-user-switch-applet"/>
+- </oaf_server>
+-</oaf_info>
+diff --git a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml b/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
+deleted file mode 100644
+index e1845c8..0000000
+--- a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
++++ /dev/null
+@@ -1,20 +0,0 @@
+-<Root>
+- <popups>
+- <popup name="button3">
+- <menuitem
+- name="About Me Item"
+- verb="GdmAboutMe"
+- _label="Edit Personal _Information"/>
+- <menuitem
+- name="Users and Groups Admin Item"
+- verb="GdmUsersGroupsAdmin"
+- _label="_Edit Users and Groups"/>
+- <menuitem
+- name="About Item"
+- verb="GdmAbout"
+- _label="_About"
+- pixtype="stock"
+- pixname="gtk-about"/>
+- </popup>
+- </popups>
+-</Root>
+diff --git a/gui/user-switch-applet/Makefile.am b/gui/user-switch-applet/Makefile.am
+index 2d2cdc0..cebe890 100644
+--- a/gui/user-switch-applet/Makefile.am
++++ b/gui/user-switch-applet/Makefile.am
+@@ -13,6 +13,7 @@ AM_CPPFLAGS = \
+ -DLIBEXECDIR=\""$(libexecdir)"\" \
+ -DSBINDIR=\""$(sbindir)"\" \
+ -DGDMCONFDIR=\"$(gdmconfdir)\" \
++ -DGDM_USER_SWITCH_MENU_UI_DIR="\"$(uidir)\"" \
+ $(GTK_CFLAGS) \
+ $(APPLET_CFLAGS) \
+ $(NULL)
+@@ -34,34 +35,31 @@ gdm_user_switch_applet_LDADD = \
+ $(APPLET_LIBS) \
+ $(NULL)
+
+-# Bonobo UI
+-uidir = $(datadir)/gnome-2.0/ui
+-ui_DATA = \
+- GNOME_FastUserSwitchApplet.xml \
+- $(NULL)
++uidir = $(datadir)/gnome-2.0/ui
++ui_DATA = gdm-user-switch-applet-menu.xml
+
+-# Bonobo .server
+-serverdir = $(libdir)/bonobo/servers
+-server_in_files = \
+- GNOME_FastUserSwitchApplet.server.in \
+- $(NULL)
+-server_DATA = $(server_in_files:.server.in=.server)
++appletdir = $(datadir)/gnome-panel/applets
++applet_in_files = org.gnome.gdm.UserSwitch.panel-applet.in
++applet_DATA = $(applet_in_files:.panel-applet.in=.panel-applet)
+
+-$(server_in_files): $(server_in_files:.server.in=.server.in.in)
+- sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@VERSION\@|$(VERSION)|" $< > $@
++$(applet_in_files): $(applet_in_files).in Makefile
++ $(AM_V_GEN)$(SED) -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@VERSION\@|$(VERSION)|" $< > $@
+
+-@INTLTOOL_SERVER_RULE@
++%.panel-applet: %.panel-applet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+
+-EXTRA_DIST = \
+- $(ui_DATA) \
+- GNOME_FastUserSwitchApplet.server.in.in \
+- $(NULL)
++servicedir = $(datadir)/dbus-1/services
++service_in_files = org.gnome.panel.applet.GdmUserSwitchAppletFactory.service.in
++service_DATA = $(service_in_files:.service.in=.service)
++
++org.gnome.panel.applet.GdmUserSwitchAppletFactory.service: $(service_in_files)
++ $(AM_V_GEN)$(SED) -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
++
++EXTRA_DIST = org.gnome.gdm.UserSwitch.panel-applet.in.in \
++ $(service_in_files) \
++ $(ui_DATA) \
++ $(NULL)
++
++CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA)
+
+-DISTCLEANFILES = \
+- $(server_in_files) \
+- $(server_DATA) \
+- $(NULL)
++MAINTAINERCLEANFILES = *~ Makefile.in
+
+-MAINTAINERCLEANFILES = \
+- *~ \
+- Makefile.in
+diff --git a/gui/user-switch-applet/applet.c b/gui/user-switch-applet/applet.c
+index b4f944c..74f7882 100644
+--- a/gui/user-switch-applet/applet.c
++++ b/gui/user-switch-applet/applet.c
+@@ -34,9 +34,6 @@
+
+ #include <dbus/dbus-glib.h>
+
+-#include <bonobo/bonobo-main.h>
+-#include <bonobo/bonobo-ui-util.h>
+-
+ #include <panel-applet.h>
+ #include <panel-applet-gconf.h>
+
+@@ -102,16 +99,15 @@ static gboolean applet_factory (PanelApplet *applet,
+ const char *iid,
+ gpointer data);
+
+-PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_FastUserSwitchApplet_Factory",
+- PANEL_TYPE_APPLET,
+- "gdm-user-switch-applet", "0",
+- (PanelAppletFactoryCallback)applet_factory,
+- NULL)
++PANEL_APPLET_OUT_PROCESS_FACTORY ("GdmUserSwitchAppletFactory",
++ PANEL_TYPE_APPLET,
++ "gdm-user-switch-applet",
++ applet_factory,
++ NULL)
+
+ static void
+-about_me_cb (BonoboUIComponent *ui_container,
+- gpointer data,
+- const char *cname)
++about_me_cb (GtkAction *action,
++ gpointer data)
+ {
+ GError *err;
+
+@@ -120,10 +116,7 @@ about_me_cb (BonoboUIComponent *ui_container,
+ g_critical ("Could not run `gnome-about-me': %s",
+ err->message);
+ g_error_free (err);
+- bonobo_ui_component_set_prop (ui_container,
+- "/commands/GdmAboutMe",
+- "hidden", "1",
+- NULL);
++ gtk_action_set_visible (action, FALSE);
+ }
+ }
+
+@@ -149,9 +142,8 @@ menubar_button_press_event_cb (GtkWidget *menubar,
+ }
+
+ static void
+-about_cb (BonoboUIComponent *ui_container,
+- gpointer data,
+- const char *cname)
++about_cb (GtkAction *action,
++ gpointer data)
+ {
+ static const char *authors[] = {
+ "James M. Cape <jcape@ignore-your.tv>",
+@@ -195,9 +187,8 @@ about_cb (BonoboUIComponent *ui_container,
+
+
+ static void
+-admin_cb (BonoboUIComponent *ui_container,
+- gpointer data,
+- const char *cname)
++admin_cb (GtkAction *action,
++ gpointer data)
+ {
+ #ifdef USERS_ADMIN
+ char **args;
+@@ -231,82 +222,6 @@ admin_cb (BonoboUIComponent *ui_container,
+ }
+
+ static void
+-set_menuitem_icon (BonoboUIComponent *component,
+- const char *item_path,
+- GtkIconTheme *theme,
+- const char *icon_name,
+- gint icon_size)
+-{
+- GdkPixbuf *pixbuf;
+- int width;
+- int height;
+-
+- pixbuf = gtk_icon_theme_load_icon (theme, icon_name, icon_size, 0, NULL);
+- if (pixbuf == NULL) {
+- return;
+- }
+-
+- width = gdk_pixbuf_get_width (pixbuf);
+- height = gdk_pixbuf_get_height (pixbuf);
+- if (width > icon_size + 4 || height > icon_size + 4) {
+- GdkPixbuf *tmp;
+- if (height > width) {
+- width *= (gdouble) icon_size / (gdouble) height;
+- height = icon_size;
+- } else {
+- height *= (gdouble) icon_size / (gdouble) width;
+- width = icon_size;
+- }
+- tmp = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
+- g_object_unref (pixbuf);
+- pixbuf = tmp;
+- }
+-
+- bonobo_ui_util_set_pixbuf (component, item_path, pixbuf, NULL);
+- g_object_unref (pixbuf);
+-}
+-
+-static void
+-applet_style_set_cb (GtkWidget *widget,
+- GtkStyle *old_style,
+- gpointer data)
+-{
+- BonoboUIComponent *component;
+- GdkScreen *screen;
+- GtkIconTheme *theme;
+- int width;
+- int height;
+- int icon_size;
+-
+- if (gtk_widget_has_screen (widget)) {
+- screen = gtk_widget_get_screen (widget);
+- } else {
+- screen = gdk_screen_get_default ();
+- }
+-
+- if (gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
+- GTK_ICON_SIZE_MENU, &width, &height)) {
+- icon_size = MAX (width, height);
+- } else {
+- icon_size = 16;
+- }
+-
+- theme = gtk_icon_theme_get_for_screen (screen);
+- component = panel_applet_get_popup_component (PANEL_APPLET (widget));
+-
+- set_menuitem_icon (component,
+- "/commands/GdmAboutMe",
+- theme,
+- "user-info",
+- icon_size);
+- set_menuitem_icon (component,
+- "/commands/GdmUsersGroupsAdmin",
+- theme,
+- "stock_people",
+- icon_size);
+-}
+-
+-static void
+ applet_change_background_cb (PanelApplet *applet,
+ PanelAppletBackgroundType type,
+ GdkColor *color,
+@@ -1389,18 +1304,23 @@ on_presence_status_text_changed (DBusGProxy *presence_proxy,
+ static gboolean
+ fill_applet (PanelApplet *applet)
+ {
+- static const BonoboUIVerb menu_verbs[] = {
+- BONOBO_UI_VERB ("GdmAboutMe", about_me_cb),
+- BONOBO_UI_VERB ("GdmUsersGroupsAdmin", admin_cb),
+- BONOBO_UI_VERB ("GdmAbout", about_cb),
+- BONOBO_UI_VERB_END
++ static const GtkActionEntry gdm_user_switch_applet_actions[] = {
++ { "GdmAboutMe", "user-info", N_("Edit Personal _Information"),
++ NULL, NULL,
++ G_CALLBACK (about_me_cb) },
++ { "GdmUsersGroupsAdmin", "stock-people", N_("_Edit Users and Groups"),
++ NULL, NULL,
++ G_CALLBACK (admin_cb) },
++ { "GdmAbout", GTK_STOCK_ABOUT, N_("_About"),
++ NULL, NULL,
++ G_CALLBACK (about_cb) },
+ };
+ static gboolean first_time = FALSE;
+ char *tmp;
+- BonoboUIComponent *popup_component;
+ GdmAppletData *adata;
+ GError *error;
+ DBusGConnection *bus;
++ GtkActionGroup *action_group;
+
+ if (!first_time) {
+ first_time = TRUE;
+@@ -1438,52 +1358,51 @@ fill_applet (PanelApplet *applet)
+ gtk_container_set_border_width (GTK_CONTAINER (applet), 0);
+ gtk_widget_set_name (GTK_WIDGET (applet), "gdm-user-switch-applet");
+ panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
+- panel_applet_setup_menu_from_file (applet, NULL,
+- DATADIR "/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml",
+- NULL, menu_verbs, adata);
+
+- popup_component = panel_applet_get_popup_component (applet);
++ action_group = gtk_action_group_new ("GDM User Switch Applet Actions");
++ gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
++ gtk_action_group_add_actions (action_group,
++ gdm_user_switch_applet_actions,
++ G_N_ELEMENTS (gdm_user_switch_applet_actions),
++ adata);
++
++ panel_applet_setup_menu_from_file (applet,
++ GDM_USER_SWITCH_MENU_UI_DIR G_DIR_SEPARATOR_S "gdm-user-switch-applet-menu.xml",
++ action_group);
+
+ /* Hide the admin context menu items if locked down or no cmd-line */
+ if (gconf_client_get_bool (adata->client,
+ LOCKDOWN_COMMAND_LINE_KEY,
+ NULL) ||
+ panel_applet_get_locked_down (applet)) {
+- bonobo_ui_component_set_prop (popup_component,
+- "/popups/button3/GdmSeparator",
+- "hidden", "1", NULL);
+- bonobo_ui_component_set_prop (popup_component,
+- "/commands/GdmUsersGroupsAdmin",
+- "hidden", "1", NULL);
++ GtkAction *action;
++
++ action = gtk_action_group_get_action (action_group, "GdmUsersGroupsAdmin");
++ gtk_action_set_visible (action, FALSE);
+ } else {
++ GtkAction *action;
++
+ #ifndef USERS_ADMIN
+ # ifdef GDM_SETUP
+- bonobo_ui_component_set_prop (popup_component,
+- "/popups/button3/GdmSeparator",
+- "hidden", "1",
+- NULL);
+ # endif /* !GDM_SETUP */
+- bonobo_ui_component_set_prop (popup_component,
+- "/commands/GdmUsersGroupsAdmin",
+- "hidden", "1",
+- NULL);
++ action = gtk_action_group_get_action (action_group, "GdmUsersGroupsAdmin");
++ gtk_action_set_visible (action, FALSE);
+ #endif /* !USERS_ADMIN */
+ }
+
+ /* Hide the gdmphotosetup item if it can't be found in the path. */
+ tmp = g_find_program_in_path ("gnome-about-me");
+ if (!tmp) {
+- bonobo_ui_component_set_prop (popup_component,
+- "/commands/GdmAboutMe",
+- "hidden", "1",
+- NULL);
++ GtkAction *action;
++
++ action = gtk_action_group_get_action (action_group, "GdmAboutMe");
++ gtk_action_set_visible (action, FALSE);
+ } else {
+ g_free (tmp);
+ }
+
+- g_signal_connect (adata->applet,
+- "style-set",
+- G_CALLBACK (applet_style_set_cb), adata);
++ g_object_unref (action_group);
++
+ g_signal_connect (applet,
+ "change-background",
+ G_CALLBACK (applet_change_background_cb), adata);
+@@ -1655,7 +1574,7 @@ applet_factory (PanelApplet *applet,
+ {
+ gboolean ret;
+ ret = FALSE;
+- if (strcmp (iid, "OAFIID:GNOME_FastUserSwitchApplet") == 0) {
++ if (strcmp (iid, "GdmUserSwitchApplet") == 0) {
+ ret = fill_applet (applet);
+ }
+ return ret;
+diff --git a/gui/user-switch-applet/gdm-user-switch-applet-menu.xml b/gui/user-switch-applet/gdm-user-switch-applet-menu.xml
+new file mode 100644
+index 0000000..78301b3
+--- /dev/null
++++ b/gui/user-switch-applet/gdm-user-switch-applet-menu.xml
+@@ -0,0 +1,4 @@
++<menuitem name="About Me Item" action="GdmAboutMe"/>
++<menuitem name="Users and Groups Admin Item" action="GdmUsersGroupsAdmin"/>
++<menuitem name="About Item" action="GdmAbout"/>
++
+diff --git a/gui/user-switch-applet/org.gnome.gdm.UserSwitch.panel-applet.in.in b/gui/user-switch-applet/org.gnome.gdm.UserSwitch.panel-applet.in.in
+new file mode 100644
+index 0000000..3c77dfb
+--- /dev/null
++++ b/gui/user-switch-applet/org.gnome.gdm.UserSwitch.panel-applet.in.in
+@@ -0,0 +1,16 @@
++[Applet Factory]
++Id=GdmUserSwitchAppletFactory
++Location=@LIBEXECDIR@/gdm-user-switch-applet
++_Name=User Switcher Applet Factory
++_Description=User Switcher Applet Factory
++
++[GdmUserSwitchApplet]
++_Name=User Switcher
++_Description=A menu to quickly switch between users
++BonoboId=OAFIID:GNOME_FastUserSwitchApplet
++X-GNOME-Bugzilla-Bugzilla=GNOME
++X-GNOME-Bugzilla-Product=gdm
++X-GNOME-Bugzilla-Component=general
++X-GNOME-Bugzilla-Version=@VERSION@
++X-GNOME-Bugzilla-OtherBinaries=gdm-user-switch-applet
++
+diff --git a/gui/user-switch-applet/org.gnome.panel.applet.GdmUserSwitchAppletFactory.service.in b/gui/user-switch-applet/org.gnome.panel.applet.GdmUserSwitchAppletFactory.service.in
+new file mode 100644
+index 0000000..7bf900f
+--- /dev/null
++++ b/gui/user-switch-applet/org.gnome.panel.applet.GdmUserSwitchAppletFactory.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.gnome.panel.applet.GdmUserSwitchAppletFactory
++Exec=@LIBEXECDIR@/gdm-user-switch-applet
++
+diff --git a/po/POTFILES.in b/po/POTFILES.in
+index 1fccb90..5340391 100644
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -86,8 +86,7 @@ gui/simple-greeter/gdm-user-chooser-widget.c
+ gui/simple-greeter/greeter-main.c
+ gui/user-switch-applet/applet.c
+ gui/user-switch-applet/gdm-entry-menu-item.c
+-gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
+-gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
++gui/user-switch-applet/org.gnome.gdm.UserSwitch.panel-applet.in.in
+ utils/gdmflexiserver.c
+ utils/gdm-screenshot.c
+
+diff --git a/po/POTFILES.skip b/po/POTFILES.skip
+index 0269a0f..9032c03 100644
+--- a/po/POTFILES.skip
++++ b/po/POTFILES.skip
+@@ -7,7 +7,7 @@
+ # remove these unless you fix "make distcheck" a different way.
+ #
+ data/gdm.schemas.in
+-gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in
++gui/user-switch-applet/org.gnome.gdm.UserSwitch.panel-applet.in
+ data/greeter-autostart/at-spi-registryd-wrapper.desktop.in
+ data/greeter-autostart/gdm-simple-greeter.desktop.in
+ data/greeter-autostart/gnome-power-manager.desktop.in
+--
+1.7.2.3
+
diff --git a/extra/gdm/04_fix_external_program_directories.patch b/extra/gdm/04_fix_external_program_directories.patch
new file mode 100644
index 000000000..7ccc28644
--- /dev/null
+++ b/extra/gdm/04_fix_external_program_directories.patch
@@ -0,0 +1,48 @@
+diff -Nur gdm-2.30.2.orig/daemon/gdm-server.c gdm-2.30.2/daemon/gdm-server.c
+--- gdm-2.30.2.orig/daemon/gdm-server.c 2010-04-26 20:08:42.000000000 +0300
++++ gdm-2.30.2/daemon/gdm-server.c 2010-04-29 22:55:49.631648355 +0300
+@@ -127,7 +127,7 @@
+ g_return_val_if_fail (GDM_IS_SERVER (server), NULL);
+
+ error = NULL;
+- command = g_strdup_printf (LIBEXECDIR "/ck-get-x11-display-device --display %s",
++ command = g_strdup_printf ("/usr/lib/ConsoleKit/ck-get-x11-display-device --display %s",
+ server->priv->display_name);
+
+ g_debug ("GdmServer: Running helper %s", command);
+diff -Nur gdm-2.30.2.orig/data/greeter-autostart/gnome-settings-daemon.desktop.in.in gdm-2.30.2/data/greeter-autostart/gnome-settings-daemon.desktop.in.in
+--- gdm-2.30.2.orig/data/greeter-autostart/gnome-settings-daemon.desktop.in.in 2010-03-17 23:27:16.000000000 +0200
++++ gdm-2.30.2/data/greeter-autostart/gnome-settings-daemon.desktop.in.in 2010-04-29 22:53:54.984878068 +0300
+@@ -1,8 +1,8 @@
+ [Desktop Entry]
+ Type=Application
+ _Name=GNOME Settings Daemon
+-TryExec=@LIBEXECDIR@/gnome-settings-daemon
+-Exec=@LIBEXECDIR@/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-greeter/settings-manager-plugins
++TryExec=/usr/bin/gnome-settings-daemon
++Exec=/usr/bin/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-greeter/settings-manager-plugins
+ OnlyShowIn=GNOME;
+ X-GNOME-Autostart-Phase=Initialization
+ X-GNOME-Autostart-Notify=true
+diff -Nur gdm-2.30.2.orig/data/greeter-autostart/polkit-gnome-authentication-agent-1.desktop.in.in gdm-2.30.2/data/greeter-autostart/polkit-gnome-authentication-agent-1.desktop.in.in
+--- gdm-2.30.2.orig/data/greeter-autostart/polkit-gnome-authentication-agent-1.desktop.in.in 2010-03-26 15:28:03.000000000 +0200
++++ gdm-2.30.2/data/greeter-autostart/polkit-gnome-authentication-agent-1.desktop.in.in 2010-04-29 22:54:24.638396328 +0300
+@@ -1,5 +1,5 @@
+ [Desktop Entry]
+ Type=Application
+ _Name=PolicyKit Authentication Agent
+-Exec=@LIBEXECDIR@/polkit-gnome-authentication-agent-1
++Exec=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
+ OnlyShowIn=GNOME;
+diff -Nur gdm-2.30.2.orig/gui/simple-chooser/gdm-chooser-session.c gdm-2.30.2/gui/simple-chooser/gdm-chooser-session.c
+--- gdm-2.30.2.orig/gui/simple-chooser/gdm-chooser-session.c 2010-03-17 23:27:16.000000000 +0200
++++ gdm-2.30.2/gui/simple-chooser/gdm-chooser-session.c 2010-04-29 22:57:08.691626507 +0300
+@@ -131,7 +131,7 @@
+ ret = FALSE;
+
+ error = NULL;
+- g_spawn_command_line_async (LIBEXECDIR "/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-chooser/settings-manager-plugins", &error);
++ g_spawn_command_line_async ("/usr/bin/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-chooser/settings-manager-plugins", &error);
+ if (error != NULL) {
+ g_warning ("Error starting settings daemon: %s", error->message);
+ g_error_free (error);
diff --git a/extra/gdm/PKGBUILD b/extra/gdm/PKGBUILD
new file mode 100644
index 000000000..b5a06693f
--- /dev/null
+++ b/extra/gdm/PKGBUILD
@@ -0,0 +1,62 @@
+# $Id: PKGBUILD 117177 2011-03-29 06:49:52Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+pkgname=gdm
+pkgver=2.32.1
+pkgrel=1
+pkgdesc="Gnome Display Manager (a reimplementation of xdm)"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org"
+backup=('etc/pam.d/gdm' 'etc/pam.d/gdm-autologin' 'etc/gdm/custom.conf')
+groups=('gnome-extra')
+options=('!libtool')
+depends=('libcanberra>=0.26' 'libxklavier>=5.0' 'tcp_wrappers' 'gnome-session>=2.32.1' 'upower>=0.9.7' 'consolekit>=0.4.1-4')
+makedepends=('intltool' 'gnome-doc-utils>=0.20.1' 'xorg-server' 'gnome-panel>=2.32.0')
+optdepends=('gnome-panel: needed for user switch applet')
+conflicts=('fast-user-switch-applet')
+replaces=('fast-user-switch-applet')
+install=gdm.install
+source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.32/${pkgname}-${pkgver}.tar.bz2
+ 04_fix_external_program_directories.patch
+ gdm-vt-allocation-hack.patch
+ 0001-port-to-libpanel-applet-3.0.patch
+ correctly-give-focus-to-user-chooser.patch
+ gdm.pam
+ gdm-autologin.pam
+ gdm)
+sha256sums=('7ba9cb2a8efb9856994467b14e4837a281fcf6d9dc9a267ea38a9aae1ec55abc'
+ 'cb585c39c6671387b5a25f21a99c97e3a20eaf4188fea1b62871681a1ebf8bff'
+ '3c8b588d4af08d94dc93bcd5e4c2a983c3f4fbbbe40833bceac2a1df4f1e8215'
+ '41ca4b2408d61776ab42c50834374a90664d43d33ad7034c7c52862d9bf3234a'
+ 'ab6d9739c0cc3631d077a897291d6a38fea1c713a3647d008e2635f48c503cb4'
+ 'f1dfa4d88288d4b0a631a68a51b46c2da537bee8fe5a99f9f288c8ff75a50b19'
+ '3daff680ff6b7ea56f84f40843e46e72477c81e9e405028203c942af04d07ae5'
+ '272c08d8e8b50bf424d0705ac864d4c18c47ec4f6893b1af732c2efbc86c9550')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/04_fix_external_program_directories.patch"
+ patch -Np1 -i "${srcdir}/gdm-vt-allocation-hack.patch"
+ patch -Np1 -i "${srcdir}/0001-port-to-libpanel-applet-3.0.patch"
+ patch -Np1 -i "${srcdir}/correctly-give-focus-to-user-chooser.patch"
+ autoreconf -fi
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --libexecdir=/usr/lib/gdm --localstatedir=/var --disable-static \
+ --with-at-spi-registryd-directory=/usr/lib/at-spi \
+ --disable-scrollkeeper
+ make
+ make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/usr/share/gconf/schemas"
+ gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${pkgname}.schemas" --domain gdm ${pkgdir}/etc/gconf/schemas/*.schemas
+ rm -r "${pkgdir}/etc/gconf/schemas/"
+
+ install -m644 "${srcdir}/gdm.pam" "${pkgdir}/etc/pam.d/gdm"
+ install -m644 "${srcdir}/gdm-autologin.pam" "${pkgdir}/etc/pam.d/gdm-autologin"
+
+ install -m755 -d "${pkgdir}/etc/rc.d"
+ install -m755 "${srcdir}/gdm" "${pkgdir}/etc/rc.d/"
+
+ rmdir "${pkgdir}/var/gdm"
+ chmod 1770 "${pkgdir}/var/log/gdm"
+}
diff --git a/extra/gdm/correctly-give-focus-to-user-chooser.patch b/extra/gdm/correctly-give-focus-to-user-chooser.patch
new file mode 100644
index 000000000..e08675a36
--- /dev/null
+++ b/extra/gdm/correctly-give-focus-to-user-chooser.patch
@@ -0,0 +1,46 @@
+From b971eb1038cb92ed8211b68a7d2a99a98d86ed7f Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz@gnome.org>
+Date: Wed, 12 Jan 2011 18:38:46 +0100
+Subject: [PATCH] Correctly give focus to the user chooser on startup
+
+We manually handle how focus works in the GdmChooserWidget container,
+and we try to automatically move the focus to the treeview inside the
+chooser. However, it fails the first time because the treeview is not
+realized yet and the logic in the code assumes that if focus moved to
+the chooser, it moved to the treeview, so later attempt to get the focus
+grabbed by the treeview are just ignored.
+
+It works fine when using gtk_widget_child_focus() to give the focus to
+the treeview. And this makes more sense since the chooser is a container
+anyway.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=629310
+---
+ gui/simple-greeter/gdm-chooser-widget.c | 6 +-----
+ 1 files changed, 1 insertions(+), 5 deletions(-)
+
+diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
+index db2d9b2..ebbfdb9 100644
+--- a/gui/simple-greeter/gdm-chooser-widget.c
++++ b/gui/simple-greeter/gdm-chooser-widget.c
+@@ -910,17 +910,13 @@ _grab_focus (GtkWidget *widget)
+
+ foc_widget = GDM_CHOOSER_WIDGET (widget)->priv->items_view;
+ g_debug ("GdmChooserWidget: grabbing focus");
+- if (! gtk_widget_get_realized (foc_widget)) {
+- g_debug ("GdmChooserWidget: not grabbing focus - not realized");
+- return;
+- }
+
+ if (gtk_widget_has_focus (foc_widget)) {
+ g_debug ("GdmChooserWidget: not grabbing focus - already has it");
+ return;
+ }
+
+- gtk_widget_grab_focus (foc_widget);
++ gtk_widget_child_focus (foc_widget, GTK_DIR_TAB_FORWARD);
+ }
+
+ static void
+--
+1.7.3.4
diff --git a/extra/gdm/gdm b/extra/gdm/gdm
new file mode 100755
index 000000000..c3e635a6d
--- /dev/null
+++ b/extra/gdm/gdm
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting GDM"
+ /usr/sbin/gdm &
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+
+ add_daemon gdm
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping GDM"
+ [ -f /var/run/gdm.pid ] && kill `cat /var/run/gdm.pid` &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon gdm
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/extra/gdm/gdm-autologin.pam b/extra/gdm/gdm-autologin.pam
new file mode 100644
index 000000000..7c2f9a985
--- /dev/null
+++ b/extra/gdm/gdm-autologin.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+auth requisite pam_nologin.so
+auth required pam_env.so
+auth required pam_permit.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_limits.so
+session required pam_unix.so
diff --git a/extra/gdm/gdm-vt-allocation-hack.patch b/extra/gdm/gdm-vt-allocation-hack.patch
new file mode 100644
index 000000000..56fa5a151
--- /dev/null
+++ b/extra/gdm/gdm-vt-allocation-hack.patch
@@ -0,0 +1,118 @@
+diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
+index 39def47..03488fd 100644
+--- a/daemon/gdm-server.c
++++ b/daemon/gdm-server.c
+@@ -33,6 +33,8 @@
+ #include <grp.h>
+ #include <signal.h>
+ #include <sys/resource.h>
++#include <sys/ioctl.h>
++#include <sys/vt.h>
+
+ #include <glib.h>
+ #include <glib/gi18n.h>
+@@ -150,6 +152,92 @@ _gdm_server_query_ck_for_display_device (GdmServer *server)
+ return out;
+ }
+
++#ifndef O_NOCTTY
++# define O_NOCTTY 0
++#endif
++
++static int
++open_vt (int vtno)
++{
++ char *vtname;
++ int fd;
++
++ vtname = g_strdup_printf ("/dev/tty%d", vtno);
++
++ do {
++ errno = 0;
++ fd = open (vtname, O_RDWR | O_NOCTTY, 0);
++ } while (errno == EINTR);
++
++ g_free (vtname);
++ return fd;
++}
++
++static gint
++find_first_probably_free_vt (void)
++{
++ int fd, fdv;
++ int vtno;
++ unsigned short vtmask;
++ struct vt_stat vtstat;
++ guint v_state;
++
++ fdv = -1;
++
++ do {
++ errno = 0;
++ fd = open ("/dev/console", O_WRONLY | O_NOCTTY, 0);
++ } while (errno == EINTR);
++
++ if (fd >= 0) {
++ if (ioctl (fd, VT_GETSTATE, &vtstat) >= 0) {
++ v_state = vtstat.v_state;
++ } else {
++ close (fd);
++ v_state = 0;
++ fd = -1;
++ }
++ } else {
++ v_state = 0;
++ }
++
++ if (fd < 0) {
++ do {
++ errno = 0;
++ fd = open ("/dev/console", O_RDONLY | O_NOCTTY, 0);
++ } while (errno == EINTR);
++
++ if (fd >= 0) {
++ if (ioctl (fd, VT_GETSTATE, &vtstat) >= 0)
++ v_state = vtstat.v_state;
++ }
++ }
++
++ for (vtno = 7, vtmask = 1 << vtno; vtmask; vtno++, vtmask <<= 1) {
++ /* Is this console in use? */
++ if (v_state & vtmask)
++ continue;
++
++ /* No, try to open it */
++ fdv = open_vt (vtno);
++ if (fdv >= 0)
++ break;
++
++ /* If we're here, kernel indicated that the console was free,
++ * but we failed to open it. Just go on to higher VTs. */
++ }
++
++ if (fdv >= 0)
++ close (fdv);
++ else
++ vtno = -1;
++
++ if (fd >= 0)
++ close (fd);
++
++ return vtno;
++}
++
+ char *
+ gdm_server_get_display_device (GdmServer *server)
+ {
+@@ -310,6 +398,11 @@ gdm_server_resolve_command_line (GdmServer *server,
+
+ if (vtarg != NULL && ! gotvtarg) {
+ argv[len++] = g_strdup (vtarg);
++ } else if (!query_in_arglist && !gotvtarg) {
++ gint vtnum = find_first_probably_free_vt ();
++
++ if (vtnum > 0)
++ argv [len++] = g_strdup_printf ("vt%d", vtnum);
+ }
+
+ argv[len++] = NULL;
diff --git a/extra/gdm/gdm.install b/extra/gdm/gdm.install
new file mode 100644
index 000000000..c2b5e375e
--- /dev/null
+++ b/extra/gdm/gdm.install
@@ -0,0 +1,44 @@
+pkgname=gdm
+
+post_install() {
+ getent group gdm >/dev/null 2>&1 || groupadd -g 120 gdm
+ if getent passwd gdm > /dev/null 2>&1; then
+ usr/sbin/usermod -d /var/lib/gdm -c 'Gnome Display Manager' -s /sbin/nologin gdm > /dev/null 2>&1
+ else
+ usr/sbin/useradd -c 'Gnome Display Manager' -u 120 -g gdm -d /var/lib/gdm -s /sbin/nologin gdm
+ fi
+ passwd -l gdm > /dev/null
+ chown gdm:gdm /var/lib/gdm > /dev/null
+ chown -R gdm:gdm /var/lib/gdm/.gconf.mandatory
+
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+ gconfpkg --install ${pkgname}
+}
+
+pre_upgrade() {
+ if [ -f opt/gnome/etc/gdm/custom.conf ]; then
+ mkdir -p etc/gdm
+ sed -e 's|/opt/gnome/libexec|usr/lib/gdm|g' \
+ -e 's|/opt/gnome/etc|/etc|g' \
+ -e 's|/opt/gnome/|/usr/|g' \
+ opt/gnome/etc/gdm/custom.conf > etc/gdm/custom.conf
+ mv opt/gnome/etc/gdm/custom.conf opt/gnome/etc/gdm/custom.conf.pacsave
+ fi
+ pre_remove
+}
+
+pre_remove() {
+ if [ -f usr/share/gconf/schemas/${pkgname}.schemas ]; then
+ gconfpkg --uninstall ${pkgname}
+ fi
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+ getent passwd gdm >/dev/null 2>&1 && userdel gdm
+ getent group gdm >/dev/null 2>&1 && groupdel gdm
+}
diff --git a/extra/gdm/gdm.pam b/extra/gdm/gdm.pam
new file mode 100644
index 000000000..655299cb7
--- /dev/null
+++ b/extra/gdm/gdm.pam
@@ -0,0 +1,10 @@
+#%PAM-1.0
+auth requisite pam_nologin.so
+auth required pam_env.so
+auth required pam_unix.so
+auth optional pam_gnome_keyring.so
+account required pam_unix.so
+session required pam_limits.so
+session required pam_unix.so
+session optional pam_gnome_keyring.so auto_start
+password required pam_unix.so