diff options
author | Brian Cameron <brian.cameron@sun.com> | 2005-04-20 00:47:25 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2005-04-20 00:47:25 +0000 |
commit | 5ca67028cd84eba74fbf7a1ba3504ce45866fe8d (patch) | |
tree | 8e22635152ba12a2867b43718600721bb4c5c5f2 | |
parent | 9fd02dad54e1d3195c0ba877a53ae393eff3882d (diff) | |
download | gdm-5ca67028cd84eba74fbf7a1ba3504ce45866fe8d.tar.gz |
Cleanup for login success/failure sounds. Patch provided by Mark
2005-04-19 Brian Cameron <brian.cameron@sun.com>
* config/gdm.conf.in, daemon/gdm.[ch], daemon/slave.c,
gui/gdmchooser.c, giu/gdmlogin.c: Cleanup for
login success/failure sounds. Patch provided by
Mark McLoughlin. Refer to bug #300136.
* daemon/gdm.c: Fix FlexiServer commands so that all
output for a single command is sent as a single call
to gdm_connection_write or gdm_connection_printf
rather than building commands and sending them out
in pieces. Also use gdm_connection_printf rather
than building so many temporary strings. Patch
provided by for GDM_SUP_QUERY_LOGOUT_ACTION, but
I reworked the patch so the same technique is used
for all gdmflexiserver commands. Fixes bug
#158799. Patch based on one provided by Raffaele
Sandrini <rasa@gmx.ch>
* gui/greeter/greeter_geometry.c,
gui/greeter/greeter_item.h,
gui/greeter/greeter_parser.c, docs/C/gdm.xml: Now
support ratio scaling of SVG images. Docs weren't
provided with the patch so I added some. Patch
provided by. Fixes bug 159524. Patch provided by
Vincent Untz <vincent@vuntz.net>.
* gui/gdmlogin.c: Rearrange how the widgets are
organized to make it look a bit better now that
the message fields have sizes defined to avoid gdm2
resizing. Bit more of a fix for bug #117779.
* README.install: Spell corrections and minor updates,
now mention that running configure with the option
--with-post-path=/usr/openwin/bin is recommended
on Solaris.
* MAINTAINERS, AUTHORS, NEWS, docs/C/gdm.xml,
daemon/gdm.h: Fixed spelling, added contributors
to AUTHORS file for patches made in the past
few months.
* docs/C/gdm.xml: Fixed bug 300138 by providing
better sound docs in the a11y section. Fixes
bug #300138. Patch provided by Andrew Case.
* gui/gdmsetup.glade, gui/gdmsetup-strings.c: Removed
strings "sdfg" and "asdf" since they can't be
translated. Fixes bug #301211.
* gui/gdmchooser.c: Removed needless comment.
-rw-r--r-- | AUTHORS | 29 | ||||
-rw-r--r-- | ChangeLog | 44 | ||||
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | README.install | 13 | ||||
-rw-r--r-- | config/gdm.conf.in | 8 | ||||
-rw-r--r-- | daemon/gdm.c | 85 | ||||
-rw-r--r-- | daemon/gdm.h | 20 | ||||
-rw-r--r-- | daemon/slave.c | 135 | ||||
-rw-r--r-- | docs/C/gdm.xml | 47 | ||||
-rw-r--r-- | gui/gdmchooser.c | 4 | ||||
-rw-r--r-- | gui/gdmcommon.c | 1 | ||||
-rw-r--r-- | gui/gdmlogin.c | 36 | ||||
-rw-r--r-- | gui/gdmsetup-strings.c | 7 | ||||
-rw-r--r-- | gui/gdmsetup.glade | 14 | ||||
-rw-r--r-- | gui/greeter/greeter_geometry.c | 21 | ||||
-rw-r--r-- | gui/greeter/greeter_item.h | 7 | ||||
-rw-r--r-- | gui/greeter/greeter_parser.c | 4 |
18 files changed, 276 insertions, 211 deletions
@@ -8,17 +8,22 @@ Main authors: Alex Larsson <alexl@redhat.com> (The graphical greeter) Contributions from: - Abel Cheung <maddog@linux.org.hk> Aidan Butler <Aidan.Butler@Sun.COM> Alan Cox <alan@redhat.com> Alex Duggan <aldug@gnome.org> Ali Akcaagac <ali.akcaagac@stud.fh-wilhelmshaven.de> + Andreas Schubert <andreas.schubert@mathema.de> + Andrew Case <darkfrog13@hotmail.com> + Andrew Kirillov <shurik179@gmail.com> Anton Altaparmakov <aia21@cam.ac.uk> Archana Shah <archana.shah@wipro.com> + Arvind Samptur <arvind.samptur@wipro.com> Benedikt Roth <Benedikt.Roth@gmx.net> + Bill Haneman <Bill.Haneman@Sun.COM> Brian Cameron <Brian.Cameron@Sun.COM> Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de> ChiDeok Hwang <hwang@mizi.co.kr> + Chookij Vanatham <Chookij.Vanatham@Sun.COM> Christopher Blizzard <blizzard@redhat.com> Christian Rose <menthos@menthos.com> Crossfire <xfire@xware.cx> @@ -32,7 +37,7 @@ Contributions from: Fernando Herrera <fherrera@onirica.com> Fernando Pablo Lopez-Lezcano <nando@ccrma.stanford.edu> Frederic Crozat <fcrozat@mandrakesoft.com> - Frodo Looijaard <frodol@dds.nl > + Frodo Looijaard <frodol@dds.nl> Gaute Lindkvist <lindkvis@stud.ntnu.no> Gediminas Paulauskas <menesis@delfi.lt> Gregory McLean <gregm@comstar.net> @@ -40,12 +45,15 @@ Contributions from: Havoc Pennington <hp@redhat.com> Heeten Choxi <azari.geo@yahoo.com> Ian McKellar <ian@eazel.com> + Jaap A. Haitsma <jaap@haitsma.org> Jacob Berkman <jberk+@cmu.edu> + James Cape <jcape@ignore-your.tv> Jan Arne Petersen <jpetersen@uni-bonn.de> Jarno Gassenbauer <jarno@gmx.de> Jeff Garzik <jgarzik@pobox.com> Jim Bray <jb@cs.wcu.edu> Jochen Friedrich <jochen@scram.de> + John Martinsson <johan@illion.se> Jonathan Blandford <jrb@redhat.com> Karsten Petersen <karsten.petersen@informatik.tu-chemnitz.de> Karsten Weiss <karsten@addx.au.s.shuttle.de> @@ -56,6 +64,7 @@ Contributions from: Lee Mallabone <lee0@callnetuk.com> Leena Gunda <leena.gunda@wipro.com> Luis Villa <louie@ximian.com> + Mark McLoughlin <mark@skynet.ie> Mathieu Lacage <mathieu@eazel.com> Matt Forrest <mforrest@scs.ryerson.ca> Matt Wilson <msw@redhat.com> @@ -74,7 +83,8 @@ Contributions from: Oswald Buddenhagen <ossi@kde.org> Owen Taylor <otaylor@redhat.com> Patrizio Bruno <desertconsulting@firenze.net> - Ray Strode <halfline@hawaii.rr.com> + Ray Dassen <jdassen@debian.org> + Ray Strode <rstrode@redhat.com> RĂ©mi Cohen-Scali <Remi@Cohen-Scali.com> Rosanna Yuen <zana@webwynk.net> Ross Golder <ross@golder.org> @@ -83,9 +93,13 @@ Contributions from: Stanislav Brabec <utx@penguin.cz> Steve Chaplin <stevech1097@yahoo.com.au> Steve Fox <drfickle@uberh4x0r.org> + Steve Murphy <murf@e-tools.com> Terje Rosten <terjeros@phys.ntnu.no> Tim Jansen <tim@tjansen.de> + Tuukka Hastrup <Tuukka.Hastrup@iki.fi> Vincent Berger <vincent.berger@ext.bull.net> + Vincent Untz <vincent@vuntz.net> + Vijaykumar Patwari <vijaykumar.patwari@wipro.com> Vlad Harchev <hvv@hippo.ru> Documentation: @@ -97,6 +111,9 @@ Documentation: Translators: Abel Cheung <maddog@linux.org.hk> + Adam Weinberger <adamw@gnome.org> + Adi Attar <aattar@cvs.gnome.org> + Akagic Amila <bono@linux.org.ba> Akira TAGOH <tagoh@gnome.gr.jp> Alastair McKinstry <mckinstry@computer.org> Alessio Frusciante <algol@firenze.linux.it> @@ -119,6 +136,7 @@ Translators: David O'Callaghan <david.ocallaghan@cs.tcd.ie> Dmitry G. Mastrukov <dmitry@taurussoft.org> Duarte Loreto <happyguy_pt@hotmail.com> + Dwayne Baily <dwayne@translate.org.za> Emese Kovacs <emese@gnome.hu> Evandro Fernandes Giovanini <evandrofg@ig.com.br> Fatih Demir <kabalak@gtranslator.org> @@ -140,9 +158,12 @@ Translators: Christian Rose <menthos@menthos.com> Christophe Merlet <redfox@redfoxcenter.org> Christopher R. Gabriel <cgabriel@cgabriel.org> + Gareth Owen (gowen72@yahoo.com> + Guntupalli Karuakar <karunakar@freedomink.org> Ian McKellar <ian@eazel.com> Jarkko Ranta <jjranta@cc.joensuu.fi> Jesus Bravo Alvarez <jba@pobox.com> + John Barstow <jbowtie@amathaine.com> Jordi Mallach <jordi@sindominio.net> KAMAGASAKO Masatoshi <emerald@gnome.gr.jp> Kang Jeong-Hee <Keizi@mail.co.kr> @@ -170,7 +191,9 @@ Translators: Pablo Saratxaga <pablo@mandrakesoft.com> Paul Duffy <dubhthach@frink.nuigalway.ie> Pauli Virtanen <pauli.virtanen@hut.fi> + Pawan Chitrakar <pawan@nplinux.org> Peteris Krisjanis <peteris.krisjanis@os.lv> + Richard Allan <ra@ra.is> Richard Hult <rhult@frenzy.hemmet.chalmers.se> Robert Sedak <robert.sedak@sk.htnet.hr> Rodrigo Stulzer Lopes <rodrigo@conectiva.com.br> @@ -1,3 +1,47 @@ +2005-04-19 Brian Cameron <brian.cameron@sun.com> + + * config/gdm.conf.in, daemon/gdm.[ch], daemon/slave.c, + gui/gdmchooser.c, giu/gdmlogin.c: Cleanup for + login success/failure sounds. Patch provided by + Mark McLoughlin. Refer to bug #300136. + * daemon/gdm.c: Fix FlexiServer commands so that all + output for a single command is sent as a single call + to gdm_connection_write or gdm_connection_printf + rather than building commands and sending them out + in pieces. Also use gdm_connection_printf rather + than building so many temporary strings. Patch + provided by for GDM_SUP_QUERY_LOGOUT_ACTION, but + I reworked the patch so the same technique is used + for all gdmflexiserver commands. Fixes bug + #158799. Patch based on one provided by Raffaele + Sandrini <rasa@gmx.ch> + * gui/greeter/greeter_geometry.c, + gui/greeter/greeter_item.h, + gui/greeter/greeter_parser.c, docs/C/gdm.xml: Now + support ratio scaling of SVG images. Docs weren't + provided with the patch so I added some. Patch + provided by. Fixes bug 159524. Patch provided by + Vincent Untz <vincent@vuntz.net>. + * gui/gdmlogin.c: Rearrange how the widgets are + organized to make it look a bit better now that + the message fields have sizes defined to avoid gdm2 + resizing. Bit more of a fix for bug #117779. + * README.install: Spell corrections and minor updates, + now mention that running configure with the option + --with-post-path=/usr/openwin/bin is recommended + on Solaris. + * MAINTAINERS, AUTHORS, NEWS, docs/C/gdm.xml, + daemon/gdm.h: Fixed spelling, added contributors + to AUTHORS file for patches made in the past + few months. + * docs/C/gdm.xml: Fixed bug 300138 by providing + better sound docs in the a11y section. Fixes + bug #300138. Patch provided by Andrew Case. + * gui/gdmsetup.glade, gui/gdmsetup-strings.c: Removed + strings "sdfg" and "asdf" since they can't be + translated. Fixes bug #301211. + * gui/gdmchooser.c: Removed needless comment. + 2005-04-18 Brian Cameron <brian.cameron@sun.com> * daemon/gdm.[ch], daemon/slave.c, docs/C/gdm.xml, diff --git a/MAINTAINERS b/MAINTAINERS index a5ef1e85..78a705cc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,2 +1,2 @@ The Queen of England -Email: Brian.Cameron@sun.com +Email: Brian.Cameron@sun.com or yippi@hypermall.com @@ -133,7 +133,7 @@ Ahh news... 2.6.0.4 stuff: -- Allow not checcking directory owners with CheckDirOwner key, +- Allow not checking directory owners with CheckDirOwner key, (Andreas Schubert) - FreeBSD support for VTAllocation stuff (Alexander Nedousukov) @@ -367,7 +367,7 @@ Ahh news... - Built in sessions are out of /etc/X11/dm/Sessions and moved to <datadir>/gdm/BuiltInSessions -- Fix chooser commonication vs. accessibility stuff (#125064) +- Fix chooser communication vs. accessibility stuff (#125064) - Fix RetryDelay and make it default to 1 and not 3 (Leena Gunda, me, #128507) @@ -949,7 +949,7 @@ Major changes in 2.4.4.x since 2.4.1.x: looks nicer and converts encoding correctly. - Be very careful when opening files just about everywhere, - so this prevents some possible damange someone could do if + so this prevents some possible damage someone could do if they do manage to get the gdm user privs. - If X server crashes or doesn't otherwise whack its lockfile, @@ -1882,7 +1882,7 @@ Issues with this version: - SECURITY FIX! Make sure the egid is reset to the user gid before starting a session. This could present a security risk under a - certain circumstances, that is if your /bin/sh does not drop privilages. + certain circumstances, that is if your /bin/sh does not drop privileges. It also fixes the failsafe gnome session - PositionX and PositionY now take negative values that work @@ -2358,7 +2358,7 @@ Issues with this version: - Properly runs with a missing gdm.conf -- Remove old failsafe stuff and use the new builtin falisafes, which +- Remove old failsafe stuff and use the new builtin failsafes, which are much nicer - Saner focus on all gdm windows, and give the failsafe xterm focus diff --git a/README.install b/README.install index 7db0ca12..004142e6 100644 --- a/README.install +++ b/README.install @@ -23,12 +23,12 @@ proper operation! This userid is used to run the GDM GUI programs required for login. All functionality that requires root authority is done by the GDM daemon process. This design ensures that if the GUI programs are somehow exploited, only the dedicated user -privilidges are available. By default GDM assumes the user and the +privileges are available. By default GDM assumes the user and the group are called `gdm'. These are configured via the User and Group configuration options in the gdm.conf file. The user and group should be created before running "make install". -Distributions and system admistrators using GDM are expected to +Distributions and system administrators using GDM are expected to setup the dedicated user properly. It is recommended that this userid be configured to disallow login and to not have a default shell. Distributions and system administrators should set up @@ -48,7 +48,7 @@ user "nobody" is not appropriate for gdm. If the gdm user is set up properly and gdm user access is somehow exploited, this means that the GDM user should only be able to -malicoiusly modify the Xauth keys causing potential +maliciously modify the Xauth keys causing potential Denial-Of-Service attacks. If a person gains the ability to run programs as the user gdm, it would be possible to snoop on running GDM processes, including usernames and passwords as they are @@ -65,7 +65,7 @@ you run with the debug option all the time. (Not to mention it generates a LOT of spew) XDMCP is disabled by default since XDMCP can be exploited to -create Denial-Of-Service attacks if a malicous user sends a +create Denial-Of-Service attacks if a malicious user sends a flood of XDMCP requests to your computer. It may be enabled by setting "enable=true" in the "[xdmcp]" section of the gdm.conf file. @@ -95,7 +95,7 @@ file is located (default is sysconfdir - /etc). If you want accessibility to work and have AT programs like gok and gnopernicus installed to a different directory than EXPANDED_BINDIR, -then use the --with-at-bindir configure optin. +then use the --with-at-bindir configure option. If you want IPv6 enabled, use --enable-ipv6=yes option to configure. @@ -129,6 +129,9 @@ the box. Solaris ------- +Configuring GDM with the "--with-post-path=/usr/openwin/bin" on Solaris +is recommended. + GDM includes code to integrate with /etc/logindevperm and Solaris audit API's. These interfaces are only supported on Solaris 10 and higher. GDM should not be used on Solaris 9 and earlier if auditing is needed. diff --git a/config/gdm.conf.in b/config/gdm.conf.in index 4bc29c74..973c2b96 100644 --- a/config/gdm.conf.in +++ b/config/gdm.conf.in @@ -386,6 +386,14 @@ GraphicalThemeDir=@EXPANDED_DATADIR@/gdm/themes/ # instead of just beeping #SoundOnLogin=true #SoundOnLoginFile= +# If SoundOnLoginSuccess, then the greeter will play a sound (as above) +# when a user successfully logs in +#SoundOnLoginSuccess=false +#SoundOnLoginSuccessFile= +# If SoundOnLoginFailure, then the greeter will play a sound (as above) +# when a user fails to log in +#SoundOnLoginFailure=false +#SoundOnLoginFailureFile= # The chooser is what's displayed when a user wants an indirect XDMCP # session, or selects Run XDMCP chooser from the system menu diff --git a/daemon/gdm.c b/daemon/gdm.c index fcbd22c7..3e4abcd4 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -211,7 +211,9 @@ gboolean GdmVTAllocation = TRUE; gboolean GdmDisallowTCP = TRUE; gchar *GdmSoundProgram = NULL; gchar *GdmSoundOnLoginReadyFile = NULL; +gboolean GdmSoundOnLoginSuccess = FALSE; gchar *GdmSoundOnLoginSuccessFile = NULL; +gboolean GdmSoundOnLoginFailure = FALSE; gchar *GdmSoundOnLoginFailureFile = NULL; gchar *GdmConsoleCannotHandle = NULL; @@ -449,8 +451,12 @@ gdm_config_parse (void) GdmSoundProgram = ve_config_get_string (cfg, GDM_KEY_SOUND_PROGRAM); GdmSoundOnLoginReadyFile = ve_config_get_string (cfg, GDM_KEY_SOUND_ON_LOGIN_READY_FILE); + GdmSoundOnLoginSuccess = ve_config_get_bool (cfg, + GDM_KEY_SOUND_ON_LOGIN_SUCCESS); GdmSoundOnLoginSuccessFile = ve_config_get_string (cfg, GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE); + GdmSoundOnLoginFailure = ve_config_get_bool (cfg, + GDM_KEY_SOUND_ON_LOGIN_FAILURE); GdmSoundOnLoginFailureFile = ve_config_get_string (cfg, GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE); @@ -2782,13 +2788,10 @@ gdm_handle_message (GdmConnection *conn, const char *msg, gpointer data) d->socket_conn = NULL; if (conn != NULL) { - char *msg = g_strdup_printf - ("OK %s\n", d->name); gdm_connection_set_close_notify (conn, NULL, NULL); - if ( ! gdm_connection_write (conn, msg)) + if ( ! gdm_connection_printf (conn, "OK %s\n", d->name)) gdm_display_unmanage (d); - g_free (msg); } gdm_debug ("Got FLEXI_OK"); @@ -3753,64 +3756,69 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data) g_free (dispname); g_free (xauthfile); } else if (strcmp (msg, GDM_SUP_CONSOLE_SERVERS) == 0) { + GString *msg; GSList *li; const char *sep = " "; - gdm_connection_write (conn, "OK"); + + msg = g_string_new ("OK"); for (li = displays; li != NULL; li = li->next) { GdmDisplay *disp = li->data; if ( ! disp->console) continue; - gdm_connection_printf (conn, - "%s%s,%s,", - sep, + g_string_append_printf (msg, "%s%s,%s,", sep, ve_sure_string (disp->name), ve_sure_string (disp->login)); sep = ";"; if (disp->type == TYPE_FLEXI_XNEST) { - gdm_connection_write - (conn, + g_string_append (msg, ve_sure_string (disp->xnest_disp)); } else { - gdm_connection_printf (conn, "%d", - disp->vt); + g_string_append_printf (msg, "%d", disp->vt); } } - gdm_connection_write (conn, "\n"); + g_string_append (msg, "\n"); + gdm_connection_write (conn, msg->str); + g_string_free (msg, TRUE); } else if (strcmp (msg, GDM_SUP_ALL_SERVERS) == 0) { + GString *msg; GSList *li; const char *sep = " "; - gdm_connection_write (conn, "OK"); + + msg = g_string_new ("OK"); for (li = displays; li != NULL; li = li->next) { GdmDisplay *disp = li->data; - gdm_connection_printf (conn, - "%s%s,%s", - sep, + g_string_append_printf (msg, "%s%s,%s", sep, ve_sure_string (disp->name), ve_sure_string (disp->login)); sep = ";"; } - gdm_connection_write (conn, "\n"); + g_string_append (msg, "\n"); + gdm_connection_write (conn, msg->str); + g_string_free (msg, TRUE); } else if (strcmp (msg, GDM_SUP_GREETERPIDS) == 0) { + GString *msg; GSList *li; const char *sep = " "; - gdm_connection_write (conn, "OK"); + + msg = g_string_new ("OK"); for (li = displays; li != NULL; li = li->next) { GdmDisplay *disp = li->data; if (disp->greetpid > 0) { - gdm_connection_printf (conn, "%s%ld", + g_string_append_printf (msg, "%s%ld", sep, (long)disp->greetpid); sep = ";"; } } - gdm_connection_write (conn, "\n"); + g_string_append (msg, "\n"); + gdm_connection_write (conn, msg->str); + g_string_free (msg, TRUE); } else if (strncmp (msg, GDM_SUP_UPDATE_CONFIG " ", strlen (GDM_SUP_UPDATE_CONFIG " ")) == 0) { const char *key = &msg[strlen (GDM_SUP_UPDATE_CONFIG " ")]; if ( ! update_config (key)) { - char *msg = g_strdup_printf ("ERROR 50 Unsupported key <%s>\n", key); - gdm_connection_write (conn, msg); + gdm_connection_printf (conn, "ERROR 50 Unsupported key <%s>\n", key); } else { gdm_connection_write (conn, "OK\n"); } @@ -3826,16 +3834,15 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data) val = ve_config_get_string (cfg, key); if (val == NULL) { - char *msg = g_strdup_printf ("ERROR 50 Unsupported key <%s>\n", key); - gdm_connection_write (conn, msg); + gdm_connection_printf (conn, "ERROR 50 Unsupported key <%s>\n", key); } else { - char *msg = g_strdup_printf ("OK %s\n", val); - gdm_connection_write (conn, msg); + gdm_connection_printf (conn, "OK %s\n", val); } } else if (strcmp (msg, GDM_SUP_QUERY_LOGOUT_ACTION) == 0) { const char *sep = " "; GdmDisplay *disp; GdmLogoutAction logout_action; + GString *msg; disp = gdm_connection_get_display (conn); @@ -3850,7 +3857,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data) return; } - gdm_connection_write (conn, "OK"); + msg = g_string_new ("OK"); logout_action = disp->logout_action; if (logout_action == GDM_LOGOUT_ACTION_NONE) @@ -3859,34 +3866,30 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data) if (GdmSystemMenu && disp->console && ! ve_string_empty (GdmHaltReal)) { - gdm_connection_printf (conn, "%s%s", - sep, - GDM_SUP_LOGOUT_ACTION_HALT); + g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_HALT); if (logout_action == GDM_LOGOUT_ACTION_HALT) - gdm_connection_write (conn, "!"); + g_string_append (msg, "!"); sep = ";"; } if (GdmSystemMenu && disp->console && ! ve_string_empty (GdmRebootReal)) { - gdm_connection_printf (conn, "%s%s", - sep, - GDM_SUP_LOGOUT_ACTION_REBOOT); + g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_REBOOT); if (logout_action == GDM_LOGOUT_ACTION_REBOOT) - gdm_connection_write (conn, "!"); + g_string_append (msg, "!"); sep = ";"; } if (GdmSystemMenu && disp->console && ! ve_string_empty (GdmSuspendReal)) { - gdm_connection_printf (conn, "%s%s", - sep, - GDM_SUP_LOGOUT_ACTION_SUSPEND); + g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_SUSPEND); if (logout_action == GDM_LOGOUT_ACTION_SUSPEND) - gdm_connection_write (conn, "!"); + g_string_append (msg, "!"); sep = ";"; } - gdm_connection_write (conn, "\n"); + g_string_append (msg, "\n"); + gdm_connection_write (conn, msg->str); + g_string_free (msg, TRUE); } else if (strncmp (msg, GDM_SUP_SET_LOGOUT_ACTION " ", strlen (GDM_SUP_SET_LOGOUT_ACTION " ")) == 0) { const char *action = diff --git a/daemon/gdm.h b/daemon/gdm.h index 08e5bddb..bc92345d 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -265,8 +265,8 @@ enum { #define GDM_KEY_INFO_MSG_FONT "greeter/InfoMsgFont=" #define GDM_KEY_SOUND_ON_LOGIN_READY "greeter/SoundOnLogin=true" -#define GDM_KEY_SOUND_ON_LOGIN_SUCCESS "greeter/SoundOnLoginSuccess=true" -#define GDM_KEY_SOUND_ON_LOGIN_FAILURE "greeter/SoundOnLoginFailure=true" +#define GDM_KEY_SOUND_ON_LOGIN_SUCCESS "greeter/SoundOnLoginSuccess=false" +#define GDM_KEY_SOUND_ON_LOGIN_FAILURE "greeter/SoundOnLoginFailure=false" #define GDM_KEY_SOUND_ON_LOGIN_READY_FILE "greeter/SoundOnLoginFile=" #define GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE "greeter/SoundOnLoginSuccessFile=" #define GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE "greeter/SoundOnLoginFailureFile=" @@ -535,7 +535,7 @@ void gdm_final_cleanup (void); /* if user already logged in somewhere, the ack response will be <display>,<vt>,<display>,<vt>,... */ #define GDM_SOP_DISP_NUM "DISP_NUM" /* <slave pid> <display as int> */ -/* For linux only currently */ +/* For Linux only currently */ #define GDM_SOP_VT_NUM "VT_NUM" /* <slave pid> <vt as int> */ #define GDM_SOP_FLEXI_ERR "FLEXI_ERR" /* <slave pid> <error num> */ /* 3 = X failed */ @@ -708,7 +708,7 @@ void gdm_final_cleanup (void); * 999 = Unknown error */ #define GDM_SUP_CONSOLE_SERVERS "CONSOLE_SERVERS" /* None */ -/* CONSOLE_SERVERS: List all console servers, useful for linux mostly +/* CONSOLE_SERVERS: List all console servers, useful for Linux mostly * Doesn't list xdmcp and xnest non-console servers * Supported since: 2.2.4.0 * Arguments: None @@ -718,7 +718,7 @@ void gdm_final_cleanup (void); * <server> is <display>,<logged in user>,<vt or xnest display> * * <logged in user> can be empty in case no one logged in yet, - * and <vt> can be -1 if it's not known or not supported (on non-linux + * and <vt> can be -1 if it's not known or not supported (on non-Linux * for example). If the display is an xnest display and is a console one * (that is, it is an xnest inside another console display) it is listed * and instead of vt, it lists the parent display in standard form. @@ -831,7 +831,7 @@ void gdm_final_cleanup (void); * over SET_SAFE_LOGOUT_ACTION. * ERROR <err number> <english error description> * 0 = Not implemented - * 100 = Not authenticanted + * 100 = Not authenticated * 200 = Too many messages * 999 = Unknown error */ @@ -851,7 +851,7 @@ void gdm_final_cleanup (void); * ERROR <err number> <english error description> * 0 = Not implemented * 7 = Unknown logout action, or not available - * 100 = Not authenticanted + * 100 = Not authenticated * 200 = Too many messages * 999 = Unknown error */ @@ -875,7 +875,7 @@ void gdm_final_cleanup (void); * ERROR <err number> <english error description> * 0 = Not implemented * 7 = Unknown logout action, or not available - * 100 = Not authenticanted + * 100 = Not authenticated * 200 = Too many messages * 999 = Unknown error */ @@ -899,7 +899,7 @@ void gdm_final_cleanup (void); * ERROR <err number> <english error description> * 0 = Not implemented * 8 = Virtual terminals not supported - * 100 = Not authenticanted + * 100 = Not authenticated * 200 = Too many messages * 999 = Unknown error */ @@ -917,7 +917,7 @@ void gdm_final_cleanup (void); * 0 = Not implemented * 8 = Virtual terminals not supported * 9 = Invalid virtual terminal number - * 100 = Not authenticanted + * 100 = Not authenticated * 200 = Too many messages * 999 = Unknown error */ diff --git a/daemon/slave.c b/daemon/slave.c index 7fc2a6d9..71dfa852 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -185,7 +185,9 @@ extern gboolean GdmDebug; extern gboolean GdmDisallowTCP; extern gchar *GdmSoundProgram; extern gchar *GdmSoundOnLoginReadyFile; +extern gboolean GdmSoundOnLoginSuccess; extern gchar *GdmSoundOnLoginSuccessFile; +extern gboolean GdmSoundOnLoginFailure; extern gchar *GdmSoundOnLoginFailureFile; @@ -1750,6 +1752,41 @@ restart_the_greeter (void) gdm_slave_sensitize_config (); } +static gboolean +play_login_sound (const char *sound_file) +{ + pid_t pid; + + if (ve_string_empty (GdmSoundProgram) || + ve_string_empty (sound_file) || + access (GdmSoundProgram, X_OK) != 0 || + access (sound_file, F_OK) != 0) + return FALSE; + + gdm_sigchld_block_push (); + gdm_sigterm_block_push (); + + pid = fork (); + if (pid == 0) + gdm_unset_signals (); + + gdm_sigterm_block_pop (); + gdm_sigchld_block_pop (); + + if (pid == 0) { + setsid (); + seteuid (0); + setegid (0); + execl (GdmSoundProgram, + GdmSoundProgram, + sound_file, + NULL); + _exit (0); + } + + return TRUE; +} + static void gdm_slave_wait_for_login (void) { @@ -1935,37 +1972,12 @@ gdm_slave_wait_for_login (void) gdm_debug ("gdm_slave_wait_for_login: No login/Bad login"); gdm_slave_greeter_ctl_no_ret (GDM_RESET, ""); - /* Play sounds if specified for a failed login*/ + /* Play sounds if specified for a failed login */ if (d->console && - ! G_UNLIKELY (do_configurator) && - ! ve_string_empty (GdmSoundProgram) && - ! ve_string_empty (GdmSoundOnLoginFailureFile) && - access (GdmSoundProgram, X_OK) == 0 && - access (GdmSoundOnLoginFailureFile, F_OK) == 0) { - - pid_t pid; - - gdm_sigchld_block_push (); - gdm_sigterm_block_push (); - pid = fork (); - if (pid == 0) - gdm_unset_signals (); - gdm_sigterm_block_pop (); - gdm_sigchld_block_pop (); - - if (pid == 0) { - setsid (); - seteuid (0); - setegid (0); - execl (GdmSoundProgram, - GdmSoundProgram, - GdmSoundOnLoginFailureFile, - NULL); - - _exit (0); - } - } else if (! G_UNLIKELY (do_configurator)) { - gdm_error (_("Login sound requested on non-local display or the play software cannot be run or the sound does not exist.")); + GdmSoundOnLoginFailure && + ! play_login_sound (GdmSoundOnLoginFailureFile)) { + gdm_error (_("Login sound requested on non-local display or the play " + "software cannot be run or the sound does not exist.")); } } } @@ -1984,34 +1996,11 @@ gdm_slave_wait_for_login (void) /* Play sounds if specified for a successful login */ if (login != NULL && - d->console && - ! ve_string_empty (GdmSoundProgram) && - ! ve_string_empty (GdmSoundOnLoginSuccessFile) && - access (GdmSoundProgram, X_OK) == 0 && - access (GdmSoundOnLoginSuccessFile, F_OK) == 0) { - - pid_t pid; - - gdm_sigchld_block_push (); - gdm_sigterm_block_push (); - pid = fork (); - if (pid == 0) - gdm_unset_signals (); - gdm_sigterm_block_pop (); - gdm_sigchld_block_pop (); - if (pid == 0) { - setsid (); - seteuid (0); - setegid (0); - execl (GdmSoundProgram, - GdmSoundProgram, - GdmSoundOnLoginSuccessFile, - NULL); - - _exit (0); - } - } else if (! G_UNLIKELY (do_configurator)) { - gdm_error (_("Login sound requested on non-local display or the play software cannot be run or the sound does not exist.")); + d->console && + GdmSoundOnLoginSuccess && + ! play_login_sound (GdmSoundOnLoginSuccessFile)) { + gdm_error (_("Login sound requested on non-local display or the play software " + "cannot be run or the sound does not exist.")); } gdm_debug ("gdm_slave_wait_for_login: got_login for '%s'", @@ -4920,33 +4909,9 @@ check_for_interruption (const char *msg) return TRUE; case GDM_INTERRUPT_LOGIN_SOUND: if (d->console && - ! ve_string_empty (GdmSoundProgram) && - ! ve_string_empty (GdmSoundOnLoginReadyFile) && - access (GdmSoundProgram, X_OK) == 0 && - access (GdmSoundOnLoginReadyFile, F_OK) == 0) { - pid_t pid; - - gdm_sigchld_block_push (); - gdm_sigterm_block_push (); - pid = fork (); - if (pid == 0) - gdm_unset_signals (); - gdm_sigterm_block_pop (); - gdm_sigchld_block_pop (); - - if (pid == 0) { - setsid (); - seteuid (0); - setegid (0); - execl (GdmSoundProgram, - GdmSoundProgram, - GdmSoundOnLoginReadyFile, - NULL); - - _exit (0); - } - } else { - gdm_error (_("Login sound requested on non-local display or the play software cannot be run or the sound does not exist")); + ! play_login_sound (GdmSoundOnLoginReadyFile)) { + gdm_error (_("Login sound requested on non-local display or the play software " + "cannot be run or the sound does not exist")); } return TRUE; case GDM_INTERRUPT_SELECT_USER: diff --git a/docs/C/gdm.xml b/docs/C/gdm.xml index 9e6132ac..2ed65cd4 100644 --- a/docs/C/gdm.xml +++ b/docs/C/gdm.xml @@ -479,7 +479,7 @@ on an on demand mounted filesystem like AFS, then GDM may mount all the home directories just to check for pictures if the face browser is on. GDM will try to give up after 5 seconds of activity however and - only display the users whoose pictures it has gotten so far. + only display the users whose pictures it has gotten so far. </para> <para> @@ -640,19 +640,19 @@ <para> The GDM user, and group, which are normally just <filename>gdm</filename> should not be user or group of any particular - privilage. The reason for using them is to have the user interface - run as a user without privilages so that in the unlikely case that + privilege. The reason for using them is to have the user interface + run as a user without privileges so that in the unlikely case that someone finds a weakness in the GUI, they cannot access root on the machine. </para> <para> It should however be noted that the GDM user and group have some - privilages that make them somewhat dangerous. For one they have + privileges that make them somewhat dangerous. For one they have access to the server authorization directory (the <filename>ServAuthDir</filename>), which contains all the X server authorization files and other private information. This means that - someone who gains the GDM user/group privilages can then connect to + someone who gains the GDM user/group privileges can then connect to any session. So you should not, under any circumstances, make this some user/group which may be easy to get access to, such as the user <filename>nobody</filename>. @@ -1598,7 +1598,7 @@ XKeepsCrashing want to set this to <filename>/tmp</filename> when user has the home directory on NFS, since you really don't want cookie files to go over the wire. The users should really have write - privilages to this directory, and this directory should really + privileges to this directory, and this directory should really be sticky and all that, just like the <filename>/tmp</filename> directory. </para> @@ -2692,7 +2692,7 @@ XKeepsCrashing Note that the actions menu is only shown on local logins as it would not be safe or even desirable on remote logins, so you don't have to worry about remote users having any sort of - console privilages. + console privileges. </para> <para> @@ -3372,7 +3372,7 @@ Answers: <sect3 id="consoleservers"> <title>CONSOLE_SERVERS</title> <screen> -CONSOLE_SERVERS: List all console servers, useful for linux +CONSOLE_SERVERS: List all console servers, useful for Linux mostly. Doesn't list xdmcp and xnest non-console servers Supported since: 2.2.4.0 @@ -3384,7 +3384,7 @@ Answers: <logged in user> can be empty in case no one logged in yet, and <vt> can be -1 if it's not known or not - supported (on non-linux for example). If the display is an + supported (on non-Linux for example). If the display is an xnest display and is a console one (that is, it is an xnest inside another console display) it is listed and instead of vt, it lists the parent display in standard form. @@ -3523,7 +3523,7 @@ Answers: SET_SAFE_LOGOUT_ACTION. ERROR <err number> <english error description> 0 = Not implemented - 100 = Not authenticanted + 100 = Not authenticated 200 = Too many messages 999 = Unknown error </screen> @@ -3547,7 +3547,7 @@ Answers: ERROR <err number> <english error description> 0 = Not implemented 7 = Unknown logout action, or not available - 100 = Not authenticanted + 100 = Not authenticated 200 = Too many messages 999 = Unknown error </screen> @@ -3561,7 +3561,7 @@ SET_SAFE_LOGOUT_ACTION: Tell the daemon to halt/reboot/suspend one person logs out, then this is obviously the same as the SET_LOGOUT_ACTION. Note that - SET_LOGOUT_ACTION has precendence over + SET_LOGOUT_ACTION has precedence over SET_SAFE_LOGOUT_ACTION if it is set to something other then NONE. If no one is logged in, then the action takes @@ -3579,7 +3579,7 @@ Answers: ERROR <err number> <english error description> 0 = Not implemented 7 = Unknown logout action, or not available - 100 = Not authenticanted + 100 = Not authenticated 200 = Too many messages 999 = Unknown error </screen> @@ -3603,7 +3603,7 @@ Answers: ERROR <err number> <english error description> 0 = Not implemented 8 = Virtual terminals not supported - 100 = Not authenticanted + 100 = Not authenticated 200 = Too many messages 999 = Unknown error </screen> @@ -3625,7 +3625,7 @@ Answers: 0 = Not implemented 8 = Virtual terminals not supported 9 = Invalid virtual terminal number - 100 = Not authenticanted + 100 = Not authenticated 200 = Too many messages 999 = Unknown error </screen> @@ -4535,6 +4535,12 @@ ypadding="num" spacing="num" homogeneous="bool"> </para> <para> + If the item contains an SVG image, you can specify width and height + to be "scale" to mean that the SVG image should be scaled to fit + the requested area. + </para> + + <para> You can also specify an "expand" property to either be "true" or false. If true then the child will be expanded in the box as much as possible (that is it will be given more space if available). @@ -4924,6 +4930,17 @@ ypadding="num" spacing="num" homogeneous="bool"> "audio" group </para> </sect2> + <sect2 id="accessibilitysound"> + <title>Accessibility Login Sound Configuration</title> + <para> + By default, gdm requires a media application such as "sox" to be + present to play login sounds. GDM defaults the location of this + application to <filename>/usr/bin/play</filename> by way of the + SoundProgram configuration option in <filename>gdm.conf</filename>. + This value can be changed by modifying the value in the + <filename>gdm.conf</filename> file. + </para> + </sect2> </sect1> <sect1 id="exampleconf"> diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c index 089d352b..c1b1534c 100644 --- a/gui/gdmchooser.c +++ b/gui/gdmchooser.c @@ -172,11 +172,7 @@ static gchar *GdmMulticastAddr; /* */ gchar *GdmInfoMsgFont; /* */ gchar *GdmSoundProgram; /* */ gboolean GdmSoundOnLoginReady; -/* */ gboolean GdmSoundOnLoginSuccess; -/* */ gboolean GdmSoundOnLoginFailure; /* */ gchar *GdmSoundOnLoginReadyFile; -/* */ gchar *GdmSoundOnLoginSuccessFile; -/* */ gchar *GdmSoundOnLoginFailureFile; /* */ void /* */ gdm_kill_thingies (void) /* */ { diff --git a/gui/gdmcommon.c b/gui/gdmcommon.c index 65706f96..e7701048 100644 --- a/gui/gdmcommon.c +++ b/gui/gdmcommon.c @@ -238,7 +238,6 @@ gdm_common_int_same (VeConfig *config, int cur, const char *key) } } -/* TODO: make for each sound */ void gdm_common_login_sound (void) { diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c index c470c84b..3ab5a6f7 100644 --- a/gui/gdmlogin.c +++ b/gui/gdmlogin.c @@ -131,11 +131,7 @@ static gint GdmFlexiReapDelayMinutes; gchar *GdmInfoMsgFile; gchar *GdmInfoMsgFont; gboolean GdmSoundOnLoginReady; -gboolean GdmSoundOnLoginSuccess; -gboolean GdmSoundOnLoginFailure; gchar *GdmSoundOnLoginReadyFile; -gchar *GdmSoundOnLoginSuccessFile; -gchar *GdmSoundOnLoginFailureFile; gchar *GdmSoundProgram; gint GdmIconMaxHeight; gint GdmIconMaxWidth; @@ -775,16 +771,8 @@ gdm_login_parse_config (void) GdmSoundOnLoginReady = ve_config_get_bool (config, GDM_KEY_SOUND_ON_LOGIN_READY); - GdmSoundOnLoginSuccess = ve_config_get_bool (config, - GDM_KEY_SOUND_ON_LOGIN_SUCCESS); - GdmSoundOnLoginFailure = ve_config_get_bool (config, - GDM_KEY_SOUND_ON_LOGIN_FAILURE); GdmSoundOnLoginReadyFile = ve_config_get_string (config, GDM_KEY_SOUND_ON_LOGIN_READY_FILE); - GdmSoundOnLoginSuccessFile = ve_config_get_string (config, - GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE); - GdmSoundOnLoginFailureFile = ve_config_get_string (config, - GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE); GdmSoundProgram = ve_config_get_string (config, GDM_KEY_SOUND_PROGRAM); if (GdmIconMaxWidth < 0) GdmIconMaxWidth = 128; @@ -3022,7 +3010,8 @@ gdm_login_gui_init (void) } /* this will make the logo always left justified */ - logo_frame = gtk_alignment_new (0, 0.5, 0, 0); +/* HERE */ + logo_frame = gtk_alignment_new (0, 0.10, 0, 0); gtk_widget_show (logo_frame); frame = gtk_frame_new (NULL); @@ -3065,13 +3054,12 @@ gdm_login_gui_init (void) gtk_widget_show (welcome); gtk_table_attach (GTK_TABLE (stack), welcome, 0, 1, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 15); /* Put in error box here */ - err_box = gtk_label_new (NULL); gtk_widget_set_name (err_box, "Error box"); - gtk_widget_set_size_request (err_box, -1, 50); + gtk_widget_set_size_request (err_box, -1, 40); g_signal_connect (G_OBJECT (err_box), "destroy", G_CALLBACK (gtk_widget_destroyed), &err_box); @@ -3158,7 +3146,7 @@ gdm_login_gui_init (void) gtk_table_attach (GTK_TABLE (stack), auto_timed_msg, 0, 1, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 10); - gtk_widget_set_size_request (auto_timed_msg, -1, 20); + gtk_widget_set_size_request (auto_timed_msg, -1, 15); gtk_widget_ref (auto_timed_msg); gtk_widget_show (auto_timed_msg); @@ -3203,16 +3191,16 @@ gdm_login_gui_init (void) (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); gtk_table_attach (GTK_TABLE (table), logo_frame, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_table_attach (GTK_TABLE (table), stack, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); } else { gtk_table_attach (GTK_TABLE (table), logo_frame, 0, 1, 0, 1, (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_table_attach (GTK_TABLE (table), stack, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_FILL), 0, 0); } @@ -3503,16 +3491,8 @@ gdm_reread_config (int sig, gpointer data) GdmSoundProgram = ve_config_get_string (config, GDM_KEY_SOUND_PROGRAM); GdmSoundOnLoginReady = ve_config_get_bool (config, GDM_KEY_SOUND_ON_LOGIN_READY); - GdmSoundOnLoginSuccess = ve_config_get_bool (config, - GDM_KEY_SOUND_ON_LOGIN_SUCCESS); - GdmSoundOnLoginFailure = ve_config_get_bool (config, - GDM_KEY_SOUND_ON_LOGIN_FAILURE); GdmSoundOnLoginReadyFile = ve_config_get_string (config, GDM_KEY_SOUND_ON_LOGIN_READY_FILE); - GdmSoundOnLoginSuccessFile = ve_config_get_string (config, - GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE); - GdmSoundOnLoginFailureFile = ve_config_get_string (config, - GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE); GdmUse24Clock = ve_config_get_bool (config, GDM_KEY_USE_24_CLOCK); update_clock (NULL); diff --git a/gui/gdmsetup-strings.c b/gui/gdmsetup-strings.c index e26127ce..48ad4a02 100644 --- a/gui/gdmsetup-strings.c +++ b/gui/gdmsetup-strings.c @@ -12,7 +12,9 @@ gchar *s = N_("_Remote: "); gchar *s = N_("_Welcome string: "); gchar *s = N_("Re_mote welcome string (%n = hostname): "); gchar *s = N_("String to be shown in the greeter as welcome. You can insert %n in here and it will be replaced by the name of your computer."); +gchar *s = N_("*"); gchar *s = N_("String to be shown in the greeter for people logging in remotely with XDMCP. You can insert %n in here and it will be replaced by the name of your computer."); +gchar *s = N_("*"); gchar *s = N_("Always use 24 hour cloc_k format"); gchar *s = N_("GTK+ Greeter"); gchar *s = N_("Themed Greeter"); @@ -65,12 +67,14 @@ gchar *s = N_("_Show choosable user images (Face Browser)"); gchar *s = N_("_Include All Users"); gchar *s = N_("Include"); gchar *s = N_("User to Include"); +gchar *s = N_("*"); gchar *s = N_("_Add"); gchar *s = N_("Delete"); gchar *s = N_("<"); gchar *s = N_(">"); gchar *s = N_("Exclude"); gchar *s = N_("User to exclude"); +gchar *s = N_("*"); gchar *s = N_("_Add"); gchar *s = N_("Delete"); gchar *s = N_("Apply"); @@ -98,21 +102,18 @@ gchar *s = N_("Allow theme selection in _GTK+ Greeter."); gchar *s = N_("Make a _sound when login window is ready"); gchar *s = N_(" "); gchar *s = N_("Sound file:"); -gchar *s = N_("sdfg"); gchar *s = N_("Browse"); gchar *s = N_("No Sound"); gchar *s = N_("Test Sound"); gchar *s = N_("Make a _sound after a successful login attempt"); gchar *s = N_(" "); gchar *s = N_("Sound file:"); -gchar *s = N_("asdf"); gchar *s = N_("Browse"); gchar *s = N_("No Sound"); gchar *s = N_("Test Sound"); gchar *s = N_("Make a _sound after a failed login attempt"); gchar *s = N_(" "); gchar *s = N_("Sound file:"); -gchar *s = N_("asdf"); gchar *s = N_("Browse"); gchar *s = N_("No Sound"); gchar *s = N_("Test Sound"); diff --git a/gui/gdmsetup.glade b/gui/gdmsetup.glade index 6356182d..5ecb3a19 100644 --- a/gui/gdmsetup.glade +++ b/gui/gdmsetup.glade @@ -258,7 +258,7 @@ <property name="max_length">0</property> <property name="text" translatable="yes"></property> <property name="has_frame">True</property> - <property name="invisible_char">*</property> + <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> <accessibility> <atkrelation target="welcome_label" type="labelled-by"/> @@ -284,7 +284,7 @@ <property name="max_length">0</property> <property name="text" translatable="yes"></property> <property name="has_frame">True</property> - <property name="invisible_char">*</property> + <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> <accessibility> <atkrelation target="remote_welcome_label" type="labelled-by"/> @@ -1904,7 +1904,7 @@ widget</property> <property name="max_length">0</property> <property name="text" translatable="yes"></property> <property name="has_frame">True</property> - <property name="invisible_char">*</property> + <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> </widget> <packing> @@ -2095,7 +2095,7 @@ widget</property> <property name="max_length">0</property> <property name="text" translatable="yes"></property> <property name="has_frame">True</property> - <property name="invisible_char">*</property> + <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> </widget> <packing> @@ -2837,7 +2837,7 @@ widget</property> <child> <widget class="GtkLabel" id="acc_sound_ready_file"> <property name="visible">True</property> - <property name="label" translatable="yes">sdfg</property> + <property name="label" translatable="yes"></property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -3024,7 +3024,7 @@ widget</property> <child> <widget class="GtkLabel" id="acc_sound_success_file"> <property name="visible">True</property> - <property name="label" translatable="yes">asdf</property> + <property name="label" translatable="yes"></property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -3211,7 +3211,7 @@ widget</property> <child> <widget class="GtkLabel" id="acc_sound_failure_file"> <property name="visible">True</property> - <property name="label" translatable="yes">asdf</property> + <property name="label" translatable="yes"></property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> diff --git a/gui/greeter/greeter_geometry.c b/gui/greeter/greeter_geometry.c index a4126a15..aa89192c 100644 --- a/gui/greeter/greeter_geometry.c +++ b/gui/greeter/greeter_geometry.c @@ -19,6 +19,7 @@ #include "config.h" #include <gtk/gtk.h> +#include <librsvg/rsvg.h> #include "gdmwm.h" #include "greeter_geometry.h" #include "greeter_canvas_item.h" @@ -485,6 +486,7 @@ greeter_item_size_request (GreeterItemInfo *item, case GREETER_ITEM_SIZE_BOX: set_width = box_requisition.width; break; + case GREETER_ITEM_SIZE_SCALE: case GREETER_ITEM_SIZE_UNSET: break; } @@ -500,6 +502,7 @@ greeter_item_size_request (GreeterItemInfo *item, case GREETER_ITEM_SIZE_BOX: set_height = box_requisition.height; break; + case GREETER_ITEM_SIZE_SCALE: case GREETER_ITEM_SIZE_UNSET: break; } @@ -546,6 +549,24 @@ greeter_item_size_request (GreeterItemInfo *item, req->width = gdk_pixbuf_get_width (item->data.pixmap.pixbufs[0]); req->height = gdk_pixbuf_get_height (item->data.pixmap.pixbufs[0]); } + + if (item->item_type == GREETER_ITEM_TYPE_SVG) + { + GdkPixbuf *svg; + + svg = rsvg_pixbuf_from_file (item->data.pixmap.files[0], NULL); + req->width = gdk_pixbuf_get_width (svg); + req->height = gdk_pixbuf_get_height (svg); + g_object_unref (svg); + } + + if (req->width > 0 && req->height > 0) + { + if (item->width_type == GREETER_ITEM_SIZE_SCALE && set_height > 0) + set_width = (req->width * set_height) / req->height; + else if (item->height_type == GREETER_ITEM_SIZE_SCALE && set_width > 0) + set_height = (req->height * set_width) / req->width; + } if (set_width > 0) req->width = set_width; diff --git a/gui/greeter/greeter_item.h b/gui/greeter/greeter_item.h index 517c7684..d70065df 100644 --- a/gui/greeter/greeter_item.h +++ b/gui/greeter/greeter_item.h @@ -55,7 +55,8 @@ enum _GreeterItemSizeType { GREETER_ITEM_SIZE_UNSET, GREETER_ITEM_SIZE_ABSOLUTE, GREETER_ITEM_SIZE_RELATIVE, - GREETER_ITEM_SIZE_BOX + GREETER_ITEM_SIZE_BOX, + GREETER_ITEM_SIZE_SCALE }; /* Make sure to adjust the bitfield in the structure if @@ -89,8 +90,8 @@ struct _GreeterItemInfo { float height; GreeterItemPosType x_type:2; GreeterItemPosType y_type:2; - GreeterItemSizeType width_type:2; - GreeterItemSizeType height_type:2; + GreeterItemSizeType width_type:4; + GreeterItemSizeType height_type:4; guint x_negative:1; /* needed for -0 */ guint y_negative:1; /* needed for -0 */ diff --git a/gui/greeter/greeter_parser.c b/gui/greeter/greeter_parser.c index e677b753..94117e91 100644 --- a/gui/greeter/greeter_parser.c +++ b/gui/greeter/greeter_parser.c @@ -253,6 +253,8 @@ parse_pos (xmlNodePtr node, { if (strcmp (prop, "box") == 0) info->width_type = GREETER_ITEM_SIZE_BOX; + else if (strcmp (prop, "scale") == 0) + info->width_type = GREETER_ITEM_SIZE_SCALE; else { info->width = g_ascii_strtod (prop, &p); @@ -280,6 +282,8 @@ parse_pos (xmlNodePtr node, { if (strcmp (prop, "box") == 0) info->height_type = GREETER_ITEM_SIZE_BOX; + else if (strcmp (prop, "scale") == 0) + info->height_type = GREETER_ITEM_SIZE_SCALE; else { info->height = g_ascii_strtod (prop, &p); |