Commit a1bcfb25 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Apply an port a patch from <tim.jansen@systembureau.com>, furhter modified

Thu Feb 01 17:05:54 2001  George Lebl <jirka@5z.com>

	* Apply an port a patch from <tim.jansen@systembureau.com>,
	  furhter modified default config (config/gdm.conf.in) and the
	  configuratior (gui/gdmconfig.c) to include the screen option

	* gui/gdmlogin.c, configure.in: added support for Xinerama,
          the new key greeter/XineramaScreen selects on which screen the
          greeter will be centered
parent e13a5a7a
Thu Feb 01 17:05:54 2001 George Lebl <jirka@5z.com>
* Apply an port a patch from <tim.jansen@systembureau.com>,
furhter modified default config (config/gdm.conf.in) and the
configuratior (gui/gdmconfig.c) to include the screen option
* gui/gdmlogin.c, configure.in: added support for Xinerama,
the new key greeter/XineramaScreen selects on which screen the
greeter will be centered
Thu Feb 01 04:49:11 2001 George Lebl <jirka@5z.com>
* config/gdm.conf.in: Add gdm to the list of default excludes
......
......@@ -10,3 +10,4 @@
#undef HAVE_TCPWRAPPERS
#undef HAVE_SHADOW
#undef HAVE_CRYPT
#undef HAVE_LIBXINERAMA
......@@ -64,6 +64,7 @@ LockPosition=false
SetPosition=false
PositionX=0
PositionY=0
XineramaScreen=0
[chooser]
DefaultHostImg=@pixmapdir@/nohost.png
......
......@@ -129,6 +129,12 @@ fi
AC_SUBST(VRFY)
# X11 Xinerama extension
AC_CHECK_HEADER(X11/extensions/Xinerama.h, [
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,,, $GTK_LIBS)
])
AC_OUTPUT([
Makefile
daemon/Makefile
......
......@@ -123,6 +123,7 @@
#define GDM_KEY_QUIVER "greeter/Quiver=1"
#define GDM_KEY_SYSMENU "greeter/SystemMenu=0"
#define GDM_KEY_WELCOME "greeter/Welcome=Welcome to %h"
#define GDM_KEY_XINERAMASCREEN "greeter/XineramaScreen=0"
#define GDM_KEY_BACKGROUNDPROG "greeter/BackgroundProgram="
#define GDM_KEY_LOCK_POSITION "greeter/LockPosition=false"
#define GDM_KEY_SET_POSITION "greeter/SetPosition=false"
......@@ -138,6 +139,7 @@
#define GDM_KEY_SERVERS "servers"
typedef struct _GdmDisplay GdmDisplay;
struct _GdmDisplay {
......
......@@ -55,10 +55,9 @@ gchar *s = N_("Select a log to be displayed during login");
gchar *s = N_("Greeter Look and Feel");
gchar *s = N_("Show the 'system' menu, (for reboot, shutdown etc.)");
gchar *s = N_("Quiver on failure");
gchar *s = N_("Welcome to %n\n"
"%n\n"
"This is %n\n"
"");
gchar *s = N_("Welcome to %n");
gchar *s = N_("%n");
gchar *s = N_("This is %n");
gchar *s = N_("This is %n");
gchar *s = N_("Default font: ");
gchar *s = N_("Exclude these users: ");
......@@ -68,10 +67,11 @@ gchar *s = N_("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz");
gchar *s = N_("Background Program: ");
gchar *s = N_("Select a file containing Locale information");
gchar *s = N_("Position");
gchar *s = N_("Set position");
gchar *s = N_("Manually set position");
gchar *s = N_("Lock position");
gchar *s = N_("X position: ");
gchar *s = N_("Y position: ");
gchar *s = N_("Xinerama screen: ");
gchar *s = N_("User Interface");
gchar *s = N_("Face browser");
gchar *s = N_("Show choosable user images (enable face browser)");
......
......@@ -166,6 +166,7 @@ gdm_config_parse_most (void)
gdm_toggle_set ("set_position", gnome_config_get_bool (GDM_KEY_SET_POSITION));
gdm_spin_set ("position_x", gnome_config_get_int (GDM_KEY_POSITIONX));
gdm_spin_set ("position_y", gnome_config_get_int (GDM_KEY_POSITIONY));
gdm_spin_set ("xinerama_screen", gnome_config_get_int (GDM_KEY_XINERAMASCREEN));
gdm_entry_set("exclude_users", gnome_config_get_string (GDM_KEY_EXCLUDE));
/* font picker is in parse_remaining() */
......@@ -322,6 +323,7 @@ write_new_config_file (GnomePropertyBox *gnomepropertybox,
gdm_toggle_write("set_position", GDM_KEY_SET_POSITION);
gdm_spin_write("position_x", GDM_KEY_POSITIONX);
gdm_spin_write("position_y", GDM_KEY_POSITIONY);
gdm_spin_write("xinerama_screen", GDM_KEY_XINERAMASCREEN);
gdm_entry_write("exclude_users", GDM_KEY_EXCLUDE);
gdm_font_write("font_picker", GDM_KEY_FONT);
......
......@@ -2619,7 +2619,7 @@ This is %n
<widget>
<class>GtkTable</class>
<name>table12</name>
<rows>2</rows>
<rows>3</rows>
<columns>4</columns>
<homogeneous>False</homogeneous>
<row_spacing>3</row_spacing>
......@@ -2708,7 +2708,7 @@ This is %n
<class>GtkCheckButton</class>
<name>set_position</name>
<can_focus>True</can_focus>
<label>Set position</label>
<label>Manually set position</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
......@@ -2801,6 +2801,72 @@ This is %n
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox4</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<left_attach>0</left_attach>
<right_attach>4</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkLabel</class>
<name>label57</name>
<label>Xinerama screen: </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkSpinButton</class>
<name>xinerama_screen</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>can_apply_now</handler>
<last_modification_time>Tue, 21 Mar 2000 21:37:59 GMT</last_modification_time>
</signal>
<climb_rate>1</climb_rate>
<digits>0</digits>
<numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>True</snap>
<wrap>False</wrap>
<value>0</value>
<lower>0</lower>
<upper>32000</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
......@@ -3670,6 +3736,7 @@ This is %n
<last_modification_time>Tue, 21 Mar 2000 21:40:24 GMT</last_modification_time>
</signal>
<label>Add Server</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -3687,6 +3754,7 @@ This is %n
<last_modification_time>Tue, 21 Mar 2000 21:40:32 GMT</last_modification_time>
</signal>
<label>Edit Server</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -3704,6 +3772,7 @@ This is %n
<last_modification_time>Tue, 21 Mar 2000 21:41:27 GMT</last_modification_time>
</signal>
<label>Delete Server</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -3731,6 +3800,7 @@ This is %n
<last_modification_time>Wed, 22 Mar 2000 21:08:56 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_UP</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -3748,6 +3818,7 @@ This is %n
<last_modification_time>Wed, 22 Mar 2000 21:08:49 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_DOWN</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
......
......@@ -35,7 +35,9 @@
#include <X11/Xlib.h>
#include <pwd.h>
#include <sys/utsname.h>
#ifdef HAVE_LIBXINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#include "gdmlogin.h"
#include "gdm.h"
#include "filecheck.h"
......@@ -50,6 +52,7 @@ static gboolean GdmQuiver;
static gint GdmRelaxPerms;
static gboolean GdmSystemMenu;
static gint GdmUserMaxFile;
static gint GdmXineramaScreen;
static gchar *GdmLogo;
static gchar *GdmWelcome;
static gchar *GdmBackgroundProg;
......@@ -77,6 +80,7 @@ static GtkWidget *sessmenu;
static GtkWidget *langmenu;
static GdkWindow *rootwin;
static GdkWindow *rootwin_overlay = NULL;
static GdkRectangle screen;
static GnomeIconList *browser;
static GdkImlibImage *defface;
......@@ -429,6 +433,18 @@ gdm_parse_enriched_string (const gchar *s)
return buffer;
}
static void
gdm_center_window (GtkWindow *cw)
{
GtkRequisition req;
gint x, y;
gtk_widget_size_request (GTK_WIDGET (cw), &req);
x = screen.x + (screen.width - req.width)/2;
y = screen.y + (screen.height - req.height)/2;
gtk_widget_set_uposition (GTK_WIDGET (cw), x, y);
}
static gboolean
gdm_login_query (const gchar *msg)
......@@ -442,8 +458,7 @@ gdm_login_query (const gchar *msg)
NULL);
gtk_window_set_modal (GTK_WINDOW (req), TRUE);
gtk_window_set_position (GTK_WINDOW (req), GTK_WIN_POS_CENTER);
gdm_center_window (GTK_WINDOW (req));
return (!gnome_dialog_run (GNOME_DIALOG(req)));
}
......@@ -507,6 +522,7 @@ gdm_login_parse_config (void)
GdmDebug = gnome_config_get_bool (GDM_KEY_DEBUG);
GdmIconMaxWidth = gnome_config_get_int (GDM_KEY_ICONWIDTH);
GdmIconMaxHeight = gnome_config_get_int (GDM_KEY_ICONHEIGHT);
GdmXineramaScreen = gnome_config_get_int (GDM_KEY_XINERAMASCREEN);
GdmLockPosition = gnome_config_get_bool (GDM_KEY_LOCK_POSITION);
GdmSetPosition = gnome_config_get_bool (GDM_KEY_SET_POSITION);
GdmPositionX = gnome_config_get_int (GDM_KEY_POSITIONX);
......@@ -1377,7 +1393,6 @@ gdm_login_handle_motion (GtkWidget *widget, GdkEventMotion *event)
GdmSetPosition = TRUE;
GdmPositionX = xp - p->x;
GdmPositionY = yp - p->y;
gtk_window_position (GTK_WINDOW (login), GTK_WIN_POS_NONE);
return TRUE;
}
......@@ -1485,6 +1500,7 @@ gdm_login_gui_init (void)
if(*GdmGtkRC)
gtk_rc_parse (GdmGtkRC);
rootwin = gdk_window_foreign_new (GDK_ROOT_WINDOW ());
gdm_init_root_window_overlay ();
......@@ -1628,8 +1644,8 @@ gdm_login_gui_init (void)
/* FIXME */
gtk_widget_set_usize (GTK_WIDGET (bbox),
(gint) gdk_screen_width () * 0.5,
(gint) gdk_screen_height () * 0.25);
(gint) screen.width * 0.5,
(gint) screen.height * 0.25);
}
if (GdmLogo && !access (GdmLogo, R_OK)) {
......@@ -1763,7 +1779,7 @@ gdm_login_gui_init (void)
if (GdmSetPosition) {
set_screen_pos (login, GdmPositionX, GdmPositionY);
} else {
gtk_window_position (GTK_WINDOW (login), GTK_WIN_POS_CENTER);
gdm_center_window (GTK_WINDOW (login));
}
gtk_widget_show_all (GTK_WIDGET (login));
......@@ -1936,6 +1952,39 @@ gdm_login_users_init (void)
}
static void
gdm_screen_init (void)
{
#ifdef HAVE_LIBXINERAMA
if (XineramaIsActive (GDK_DISPLAY ())) {
int screen_num;
XineramaScreenInfo *screens = XineramaQueryScreens (GDK_DISPLAY (),
&screen_num);
if (screen_num <= 0)
gdm_login_abort ("Xinerama active, but <= 0 screens?");
if (screen_num < GdmXineramaScreen)
GdmXineramaScreen = 0;
screen.x = screens[GdmXineramaScreen].x_org;
screen.y = screens[GdmXineramaScreen].y_org;
screen.width = screens[GdmXineramaScreen].width;
screen.height = screens[GdmXineramaScreen].height;
XFree (screens);
}
else
#endif
{
screen.x = 0;
screen.y = 0;
screen.width = gdk_screen_width ();
screen.height = gdk_screen_height ();
}
}
int
main (int argc, char *argv[])
{
......@@ -1964,17 +2013,20 @@ main (int argc, char *argv[])
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
/* XXX: with our own centering this should not be neccessary, is it? */
gnome_preferences_set_dialog_position (GTK_WIN_POS_CENTER);
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
gdm_login_parse_config();
gdm_login_parse_config ();
gdm_screen_init ();
if (GdmBrowser)
gdm_login_users_init ();
gdm_login_gui_init();
gdm_login_gui_init ();
if (GdmBrowser)
gdm_login_browser_update();
......@@ -2035,10 +2087,11 @@ main (int argc, char *argv[])
NULL);
g_io_channel_unref (ctrlch);
gtk_main();
gtk_main ();
kill_background ();
exit(EXIT_SUCCESS);
return EXIT_SUCCESS;
}
/* EOF */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment