# define ProjectRoot /usr/dt
#endif
+XCOMM build the DtXinerama support
+#define CDE_USEXINERAMA YES
+
#ifdef SunArchitecture
# define DtLocalesToBuild de_DE.ISO8859-1 es_ES.ISO8859-1 fr_FR.ISO8859-1 it_IT.ISO8859-1
#endif
--- /dev/null
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2013, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+/*
+ * Jon Trulson, Xi Graphics 4/11/2001
+ *
+ * $XiGId: DtXinerama.c,v 1.1 2001/04/12 03:01:14 jon Exp $
+ *
+ * A Xinerama wrapper for CDE
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <X11/Xlib.h>
+
+#include "DtXinerama.h"
+
+/* return a DtXineramaInfo_t (or NULL if no Xinerama) available */
+
+DtXineramaInfo_t *_DtXineramaInit(Display *dpy)
+{
+ DtXineramaInfo_t *tmpDtXI = NULL;
+ XineramaScreenInfo *XinerScrnInfo = NULL;
+ int number = 0;
+
+ if (!dpy)
+ return(NULL);
+
+ XinerScrnInfo = XineramaQueryScreens(dpy, &number);
+
+ if (number <= 0 || XinerScrnInfo == NULL) /* then we don't have it */
+ return(NULL);
+
+ /* allocate some space for it */
+ if ((tmpDtXI = (DtXineramaInfo_t *)malloc(sizeof(DtXineramaInfo_t))) == NULL)
+ { /* malloc failure */
+#ifdef DEBUG
+ fprintf(stderr, "_DtXineramaInit: malloc failed\n");
+#endif
+
+ free(XinerScrnInfo);
+ return(NULL);
+ }
+
+ tmpDtXI->numscreens = number;
+ tmpDtXI->ScreenInfo = XinerScrnInfo;
+
+ return(tmpDtXI);
+}
+
+
+/* Return w, h, xorg, and yorg for the specified screen. Return True */
+/* if a valid screen, False otherwise */
+Bool _DtXineramaGetScreen(DtXineramaInfo_t *DtXI, unsigned int screen,
+ unsigned int *w, unsigned int *h,
+ unsigned int *xorg, unsigned int *yorg)
+{
+
+ if (DtXI == NULL)
+ return(False);
+
+ if (DtXI->numscreens == 0)
+ return(False); /* no screens or no Xinerama */
+
+ if (screen < 0 || screen >= DtXI->numscreens)
+ return(False); /* invalid screen */
+
+ /* now get the info from the XinerInfo */
+ /* struct and return it */
+
+ if (w != NULL)
+ *w = (DtXI->ScreenInfo[screen]).width;
+ if (h != NULL)
+ *h = (DtXI->ScreenInfo[screen]).height;
+ if (xorg != NULL)
+ *xorg = (DtXI->ScreenInfo[screen]).x_org;
+ if (yorg != NULL)
+ *yorg = (DtXI->ScreenInfo[screen]).y_org;
+
+ return(True);
+}
+
--- /dev/null
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2013, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+/*
+ * Jon Trulson, Xi Graphics 4/11/2001
+ *
+ * $XiGId: DtXinerama.h,v 1.1 2001/04/12 03:01:14 jon Exp $
+ *
+ * A Xinerama wrapper for CDE
+ *
+ */
+
+#ifndef DTXINERAMA_H_INCLUDED
+#define DTXINERAMA_H_INCLUDED
+
+#include <stdio.h>
+#include <X11/Xfuncs.h>
+
+#include <X11/extensions/Xinerama.h>
+
+typedef struct _DtXineramaInfo
+{
+ int numscreens;
+ XineramaScreenInfo *ScreenInfo;
+} DtXineramaInfo_t, *DtXineramaInfoPtr_t;
+
+
+DtXineramaInfo_t *_DtXineramaInit(Display *dpy);
+Bool _DtXineramaGetScreen(DtXineramaInfo_t *, unsigned int screen,
+ unsigned int *w, unsigned int *h,
+ unsigned int *xorg, unsigned int *yorg);
+
+#endif /* DTXINERAMA_H_INCLUDED */
--- /dev/null
+XCOMM
+XCOMM CDE - Common Desktop Environment
+XCOMM
+XCOMM Copyright (c) 1993-2013, The Open Group. All rights reserved.
+XCOMM
+XCOMM These libraries and programs are free software; you can
+XCOMM redistribute them and/or modify them under the terms of the GNU
+XCOMM Lesser General Public License as published by the Free Software
+XCOMM Foundation; either version 2 of the License, or (at your option)
+XCOMM any later version.
+XCOMM
+XCOMM These libraries and programs are distributed in the hope that
+XCOMM they will be useful, but WITHOUT ANY WARRANTY; without even the
+XCOMM implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+XCOMM PURPOSE. See the GNU Lesser General Public License for more
+XCOMM details.
+XCOMM
+XCOMM You should have received a copy of the GNU Lesser General Public
+XCOMM License along with these librararies and programs; if not, write
+XCOMM to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+XCOMM Floor, Boston, MA 02110-1301 USA
+XCOMM
+
+#define DoNormalLib YES
+#define DoSharedLib NO
+#define DoDebugLib NO
+#define DoProfileLib NO
+#define HasSharedData NO
+#define LibName DtXinerama
+#define LibHeaders YES
+
+HEADERS = DtXinerama.h
+
+SRCS = DtXinerama.c
+
+OBJS = DtXinerama.o
+
+#include <Library.tmpl>
+
+INCLUDES = -I.
+
+DependTarget()
+
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
+#if CDE_USEXINERAMA
+XINDIR = DtXinerama
+#endif
+
#if defined(UsePamLibrary) && UsePamLibrary
PAMDIR = pam
#else
PAMDIR =
#endif
-SUBDIRS = $(PAMDIR) tt DtSvc DtSearch DtWidget DtHelp DtPrint DtTerm DtMrm csa
+SUBDIRS = $(PAMDIR) tt DtSvc DtSearch DtWidget DtHelp DtPrint DtTerm DtMrm \
+ csa $(XINDIR)
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
SUBDIRS = config $(XDMSUBDIRS) $(BLSSUBDIRS) $(AFSSUBDIRS)
+#if CDE_USEXINERAMA
+XINOPT = -DUSE_XINERAMA
+XINLIB = -lDtXinerama -lXinerama
+#endif
+
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture)
SYS_LIBRARIES = -lm -lcrypt
+EXTRA_DEFINES = $(XINOPT)
+LOGINXLIB = $(XLIB) $(XINLIB)
/* just use the system provided Xau and Xdmcp*/
DEPXAUTHLIB =
DEPXDMCPLIB =
BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(LOGINXLIB)
BASE_LIBS2 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) \
- $(XTOOLLIB) $(XPLIB) $(XLIB)
+ $(XTOOLLIB) $(XPLIB) $(XLIB) $(XINLIB)
BASE_LIBS3 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XDMCPLIB) $(XMLIB) \
- $(XTOOLLIB) $(XPLIB) $(XLIB)
+ $(XTOOLLIB) $(XPLIB) $(XLIB) $(XINLIB)
LOCAL_LIBRARIES1 = $(BASE_LIBS1) $(IAFSYSLIB)
LOCAL_LIBRARIES2 = $(BASE_LIBS2)
XCOMM endif
+!!######################################################################
+!!
+!! XINERAMA
+!!
+!! Set this to the screen number where you would like the login
+!! dialogs to show up in a Xinerama configuration.
+
+
+Dtlogin*xineramaPreferredScreen: 0
+
+
!!######################################################################
!!
!! CURSOR
#include "vgmsg.h"
#include <Dt/MenuButton.h>
-
-
+#ifdef USE_XINERAMA
+#include <DtXinerama.h>
+#endif
/***************************************************************************
XtRString, sizeof(char *), XtOffset(AppInfoPtr, languageList),
XtRString, NULL },
+#if defined(USE_XINERAMA)
+ { "xineramaPreferredScreen", "XineramaPreferredScreen",
+ XtRInt, sizeof(int), XtOffset(AppInfoPtr, xineramaPreferredScreen),
+ XtRImmediate, (XtPointer) 0
+ },
+#endif
+
#if defined (ENABLE_DYNAMIC_LANGLIST)
{"languageListCmd", "LanguageListCmd",
XtRString, sizeof(char *), XtOffset(AppInfoPtr, languageListCmd),
Widget w, text;
Dimension txt_width, txt_height;
XmString ok, cancel, nw, sv;
-
-
+
+ Widget tlev;
+
/*
* do things common to all dialogs...
*/
* create the various dialogs...
*/
+ /* JET - check the matte widget, and if non-null, well use that as
+ * the parent for dialogs. Otherwise use table (the original
+ * toplevel widget for this func). This is useful for Xinerama so
+ * that child dialogs are centered on the matte, and not the whole
+ * SLS screen.
+ */
+ if (matte != (Widget)NULL)
+ tlev = matte;
+ else
+ tlev = table;
+
+
switch (dtype) {
case error:
xmstr = ReadCatalogXms(MC_ERROR_SET, MC_LOGIN, "");
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateErrorDialog(table, "error_message", argt, i);
+ w = XmCreateErrorDialog(tlev, "error_message", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
case help:
xmstr = ReadCatalogXms(MC_HELP_SET, MC_HELP, MC_DEF_HELP);
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateInformationDialog(table, "help_message", argt, i);
+ w = XmCreateInformationDialog(tlev, "help_message", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
fclose(fp);
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateInformationDialog(table, "copyright_msg", argt, i);
+ w = XmCreateInformationDialog(tlev, "copyright_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
XtSetArg(argt[i], XmNokLabelString, nw ); i++;
XtSetArg(argt[i], XmNcancelLabelString, sv ); i++;
- w = XmCreateWarningDialog(table, "hostname_msg", argt, i);
+ w = XmCreateWarningDialog(tlev, "hostname_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
MC_DEF_PASSWD_EXPIRED);
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateQuestionDialog(table, "password_msg", argt, i);
+ w = XmCreateQuestionDialog(tlev, "password_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
case help_chooser:
xmstr = ReadCatalogXms(MC_HELP_SET, MC_HELP_CHOOSER, MC_DEF_HELP_CHOOSER);
- w = XmCreateInformationDialog(table, "help_message", argt, i);
+ w = XmCreateInformationDialog(tlev, "help_message", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
# include <sys/security.h>
#endif
+#ifdef USE_XINERAMA
+# include <DtXinerama.h>
+#endif
#ifdef SIGNALRETURNSINT
#define SIGVAL int
char *languageList; /* list of languages to display in menu */
int unitType; /* widgets' unit type */
char *languageListCmd; /* command to produce language list */
+#if defined(USE_XINERAMA)
+ int xineramaPreferredScreen; /* preferred screen for xinerama */
+#endif
} AppInfo, *AppInfoPtr;
int height; /* initialized with DisplayHeight() */
Pixel black_pixel; /* initialized with BlackPixel() */
Visual *visual; /* initialized with DefaultVisual() */
+#ifdef USE_XINERAMA /* initialized with _DtXineramaInit() */
+ DtXineramaInfoPtr_t DtXineramaInfo;
+#endif
+
} DisplayInfo;
void
LayoutCB( Widget w, XtPointer client_data, XtPointer call_data )
{
- register int i, j;
+ int i, j;
Dimension width, height; /* size values returned by XtGetValues */
Dimension shadowThickness;/* size values returned by XtGetValues */
Position x, y; /* position values returned by XtGetValues */
+ int dpwidth, dpheight; /* JET - display w/h set according to */
+ int xorg, yorg; /* xinerama usage */
+
struct { /* position, size of widgets (pixels) */
int x, y;
int width;
vg_TRACE_EXECUTION("main: entered LayoutCB ...");
#endif /* VG_TRACE */
+#ifdef USE_XINERAMA
+ /* get info on the prefered screen */
+ if (!_DtXineramaGetScreen(dpyinfo.DtXineramaInfo,
+ appInfo.xineramaPreferredScreen,
+ &dpwidth, &dpheight, &xorg, &yorg))
+ { /* no joy here either - setup for normal */
+ dpwidth = dpyinfo.width;
+ dpheight = dpyinfo.height;
+ xorg = yorg = 0;
+ }
+#else /* no Xinerama */
+ dpwidth = dpyinfo.width;
+ dpheight = dpyinfo.height;
+ xorg = yorg = 0;
+#endif
+
/*
* - squeeze dialog to fit onto screen (if necessary)
*/
XtGetValues(matte, argt, i);
mw.width = ToPixel(matte, XmHORIZONTAL, (int)width );
#define HMARGIN 4 /* min sum horizontal margin of matte */
- if (mw.width+HMARGIN > dpyinfo.width)
+ if (mw.width+HMARGIN > dpwidth)
{
- int delta = mw.width + HMARGIN - dpyinfo.width;
+ int delta = mw.width + HMARGIN - dpwidth;
/*
* Matte width greater than screen so shrink matteFrame
* and matte1 width to compensate.
XtSetArg(argt[i], XmNwidth, width1 ); i++;
XtSetValues(matteFrame, argt, i);
- width1 = dpyinfo.width - HMARGIN;
+ width1 = dpwidth - HMARGIN;
mw.width = FromPixel(matte, XmHORIZONTAL, width1 );
i=0;
mw.height = ToPixel(matte, XmVERTICAL, (int)height );
mw.x = ( x > 0 ? ToPixel(matte, XmHORIZONTAL, (int) x)
- : (dpyinfo.width - mw.width)/2 );
+ : (dpwidth - mw.width)/2 );
mw.y = ( y > 0 ? ToPixel(matte, XmVERTICAL, (int) y)
- : (dpyinfo.height - mw.height)/2 );
+ : (dpheight - mw.height)/2 );
if ( mw.x < 0 ) mw.x = 0;
if ( mw.y < 0 ) mw.y = 0;
x1 = FromPixel(matte, XmHORIZONTAL, mw.x );
y1 = FromPixel(matte, XmVERTICAL, mw.y );
+ x1 += xorg; /* JET - adjust for xinerama */
+ y1 += yorg;
+
+
i = 0;
XtSetArg(argt[i], XmNx, x1 ); i++;
XtSetArg(argt[i], XmNy, y1 ); i++;
XtGetValues(copyright_msg, argt, i);
width1 = ToPixel(copyright_msg, XmHORIZONTAL, width);
- width1 = (dpyinfo.width - (int) geometry.width - 2 * width1)/2;
+ width1 = (dpwidth - (int) geometry.width - 2 * width1)/2;
x1 = FromPixel(copyright_msg, XmHORIZONTAL, width1);
y1 = FromPixel(copyright_msg, XmVERTICAL, mw.y);
#include <Dt/MenuButton.h>
+#ifdef USE_XINERAMA
+#include <DtXinerama.h>
+#endif
+
#if !defined(NL_CAT_LOCALE)
#define NL_CAT_LOCALE 0
#endif
XtRString, sizeof(char *), XtOffset(AppInfoPtr, languageList),
XtRString, NULL },
+#if defined(USE_XINERAMA)
+ { "xineramaPreferredScreen", "XineramaPreferredScreen",
+ XtRInt, sizeof(int), XtOffset(AppInfoPtr, xineramaPreferredScreen),
+ XtRImmediate, (XtPointer) 0
+ },
+#endif
+
#if defined (ENABLE_DYNAMIC_LANGLIST)
{"languageListCmd", "LanguageListCmd",
XtRString, sizeof(char *), XtOffset(AppInfoPtr, languageListCmd),
dpyinfo.black_pixel = BlackPixel (dpyinfo.dpy, dpyinfo.screen);
dpyinfo.visual = DefaultVisual(dpyinfo.dpy, dpyinfo.screen);
+ /* JET - for Xinerama, see if the extension */
+ /* is available and init accordingly. */
+
+#ifdef USE_XINERAMA
+
+ dpyinfo.DtXineramaInfo = _DtXineramaInit(dpyinfo.dpy);
+
+# ifdef DEBUG
+ if (dpyinfo.DtXineramaInfo == NULL)
+ { /* No xinerama, no joy. */
+ fprintf(stderr, "### JET VGMAIN: Xinerama NOT available.\n");
+ }
+ else
+ {
+ fprintf(stderr, "### JET VGMAIN: Xinerama available, scrns = %d\n",
+ dpyinfo.DtXineramaInfo->numscreens);
+ }
+# endif
+
+#endif
+
/*
* check if any overrides were passed in the argv string...
*/
Widget w, text;
Dimension txt_width, txt_height;
XmString ok, cancel, nw, sv;
+
+ Widget tlev; /* JET - warning, there be dragons here */
+ unsigned int dpwidth, dpheight, xorg, yorg;
+
#ifdef VG_TRACE
* do things common to all dialogs...
*/
+#ifdef USE_XINERAMA
+ /* get info on prefered screen */
+ if (!_DtXineramaGetScreen(dpyinfo.DtXineramaInfo,
+ appInfo.xineramaPreferredScreen,
+ &dpwidth, &dpheight, &xorg, &yorg))
+ { /* no joy here either - setup for normal */
+ dpwidth = dpyinfo.width;
+ dpheight = dpyinfo.height;
+ xorg = yorg = 0;
+ }
+ /* else, should be setup properly */
+#else /* no Xinerama */
+ dpwidth = dpyinfo.width;
+ dpheight = dpyinfo.height;
+ xorg = yorg = 0;
+#endif
+
ok = ReadCatalogXms(MC_LABEL_SET, MC_OK_LABEL, MC_DEF_OK_LABEL);
cancel = ReadCatalogXms(MC_LABEL_SET, MC_CANCEL_LABEL, MC_DEF_CANCEL_LABEL);
* create the various dialogs...
*/
- switch (dtype) {
+ /* JET - check the matte widget, and if non-null, well use that as
+ * the parent for dialogs. Otherwise use table (the original
+ * toplevel widget for this func). This is useful for Xinerama so
+ * that child dialogs are centered on the matte, and not the whole
+ * SLS screen.
+ */
+
+ if (matte != (Widget)NULL)
+ tlev = matte;
+ else
+ tlev = table;
+
+ switch (dtype) {
case error:
xmstr = ReadCatalogXms(MC_ERROR_SET, MC_LOGIN, "");
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateErrorDialog(table, "error_message", argt, i);
+ w = XmCreateErrorDialog(tlev, "error_message", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
case help:
- txt_width = (dpyinfo.width > 850) ? 800 : dpyinfo.width - 50;
- txt_height = (dpyinfo.height > 900) ? 600 : dpyinfo.height - 300;
+ txt_width = (dpwidth > 850) ? 800 : dpwidth - 50;
+ txt_height = (dpheight > 900) ? 600 : dpheight - 300;
xmstr = ReadCatalogXms(MC_LABEL_SET, MC_HELP_LABEL, MC_DEF_HELP_LABEL);
XtSetArg(argt[i], XmNmessageString, xmstr); i++;
- w = XmCreateInformationDialog(table, "help_message", argt, i);
+ w = XmCreateInformationDialog(tlev, "help_message", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateInformationDialog(table, "copyright_msg", argt, i);
+ w = XmCreateInformationDialog(tlev, "copyright_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
XtSetArg(argt[i], XmNokLabelString, nw ); i++;
XtSetArg(argt[i], XmNcancelLabelString, sv ); i++;
- w = XmCreateWarningDialog(table, "hostname_msg", argt, i);
+ w = XmCreateWarningDialog(tlev, "hostname_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
MC_DEF_PASSWD_EXPIRED);
XtSetArg(argt[i], XmNmessageString, xmstr ); i++;
- w = XmCreateQuestionDialog(table, "password_msg", argt, i);
+ w = XmCreateQuestionDialog(tlev, "password_msg", argt, i);
XtUnmanageChild(XmMessageBoxGetChild(w,XmDIALOG_HELP_BUTTON));
#endif
Dtsession*ignoreEnvironment: DISPLAY,SESSION_MANAGER,AUDIOSERVER
+
+!# Selects the desired screen for certain dialogs (exit confirmation,
+!# screen saver password, etc) for use in a Xinerama configuration.
+
+Dtsession*xineramaPreferredScreen: 0
#endif /* SunArchitecture */
SYS_LIBRARIES = -lm
+#if CDE_USEXINERAMA
+XINOPT = -DUSE_XINERAMA
+XINLIB = -lDtXinerama -lXinerama
+#endif
#ifdef AlphaArchitecture
SYS_LIBRARIES = -lm
#if defined(FreeBSDArchitecture)
EXTRA_DEFINES = -D${PROGRAMS} $(XINOPT)
-SYS_LIBRARIES = $(XPLIB) -lcrypt -lm
+SYS_LIBRARIES = $(XPLIB) $(XINLIB) -lcrypt -lm
#endif
PROGRAMS=dtsession
#include <Tt/tt_c.h>
#include "SmError.h"
+#ifdef USE_XINERAMA
+# include <DtXinerama.h>
+#endif
+
/*
* #define statements
*/
Boolean mergeXdefaults;
int numSessionsBackedup;
char *ignoreEnvironment;
+#if defined(USE_XINERAMA)
+ int xineramaPreferredScreen; /* prefered xinerama screen */
+#endif
} SessionResources, *SessionResourcesPtr;
/*
Boolean loggingOut; /* Is True if the current save is for
a logout; False otherwise. */
+#ifdef USE_XINERAMA /* JET - Xinerama. Schwiing! */
+ DtXineramaInfoPtr_t DtXineramaInfo;
+#endif
+
Boolean ExitComplete; /* JET - don't exit before we are ready... */
} GeneralData;
{SmNignoreEnvironment, SmCignoreEnvironment, XtRString, sizeof(String),
XtOffset(SessionResourcesPtr, ignoreEnvironment),
XtRImmediate, (XtPointer) NULL},
+#if defined(USE_XINERAMA) /* JET - Xinerama */
+ {SmNxineramaPreferredScreen, SmCxineramaPreferredScreen, XtRInt, sizeof(int),
+ XtOffset(SessionResourcesPtr, xineramaPreferredScreen),
+ XtRImmediate, (XtPointer) 0},
+#endif
+
}
;
#include <Dt/EnvControlP.h>
#include <Dt/DtP.h>
#include <Dt/Lock.h>
+#ifdef USE_XINERAMA
+#include <DtXinerama.h> /* JET - Xinerama support */
+#endif
#include "Sm.h"
#include "SmError.h"
#include "SmGlobals.h"
SM_EXIT(-1);
}
+ /* JET - initialize for Xinerama, if present 4/12/2001 */
+#ifdef USE_XINERAMA
+ smGD.DtXineramaInfo = _DtXineramaInit(smGD.display);
+
+# ifdef DEBUG
+ if (smGD.DtXineramaInfo == NULL)
+ { /* No xinerama, how... sad. */
+ fprintf(stderr, "### JET SmMain: Xinerama NOT available.\n");
+ }
+ else
+ {
+ fprintf(stderr, "### JET SmMain: Xinerama available, scrns = %d\n",
+ dpyinfo.DtXineramaInfo->numscreens);
+ }
+# endif
+
+#endif
+
+
/*
* Restore preferences
*/
extern char SmNmergeXdefaults[];
extern char SmNnumSessionsBackedup[];
extern char SmNignoreEnvironment[];
+extern char SmNxineramaPreferredScreen[];
/*
* Resource names for settings information
extern char SmCmergeXdefaults[];
extern char SmCnumSessionsBackedup[];
extern char SmCignoreEnvironment[];
+extern char SmCxineramaPreferredScreen[];
+
/*
* Class names for session settings information
char SmNmergeXdefaults[] = "mergeXdefaults";
char SmNnumSessionsBackedup[] = "numSessionsBackedup";
char SmNignoreEnvironment[] = "ignoreEnvironment";
+char SmNxineramaPreferredScreen[] = "xineramaPreferredScreen";
/* Resource names for settings information */
char SmCmergeXdefaults[] = "MergeXdefaults";
char SmCnumSessionsBackedup[] = "NumSessionsBackedup";
char SmCignoreEnvironment[] = "IgnoreEnvironment";
+char SmCxineramaPreferredScreen[] = "XineramaPreferredScreen";
/*
* Class names for session settings information
#include "SmHelp.h"
#include "SmGlobals.h"
+#ifdef USE_XINERAMA
+#include <DtXinerama.h>
+#endif
+
typedef enum {
ConfirmationNone,
ConfirmationOK,
int i;
Dimension width, height;
Position x, y;
+ unsigned int dpwidth, dpheight, xorg, yorg; /* JET - Xinerama */
/*
* Get the size of the dialog box - then compute its position
XtSetArg(uiArgs[i], XmNheight, &height);i++;
XtGetValues(w, uiArgs, i);
- x = (DisplayWidth(smGD.display, smGD.screen) / 2) - (width / 2);
- y = (DisplayHeight(smGD.display, smGD.screen) / 2) - (height / 2);
-
+ /* JET - get xinerama info */
+#ifdef USE_XINERAMA
+ /* use the 'prefered' screen */
+ if (!_DtXineramaGetScreen(smGD.DtXineramaInfo,
+ smRes.xineramaPreferredScreen,
+ &dpwidth, &dpheight, &xorg, &yorg))
+ { /* no joy here either - setup for normal */
+ dpwidth = DisplayWidth(smGD.display, smGD.screen);
+ dpheight = DisplayHeight(smGD.display, smGD.screen);
+ xorg = yorg = 0;
+ }
+#else /* no Xinerama */
+ dpwidth = DisplayWidth(smGD.display, smGD.screen);
+ dpheight = DisplayHeight(smGD.display, smGD.screen);
+ xorg = yorg = 0;
+#endif
+
+ x = (dpwidth / 2) - (width / 2);
+ y = (dpheight / 2) - (height / 2);
+
+ /* add the x/y origins for Xinerama */
+ x += xorg;
+ y += yorg;
+
i = 0;
XtSetArg(uiArgs[i], XmNx, x);i++;
XtSetArg(uiArgs[i], XmNy, y);i++;
register int i;
Dimension width, height; /* size values returned by XtGetValues */
Dimension shadowThickness;/* size values returned by XtGetValues */
+ unsigned int dpwidth, dpheight, xorg, yorg; /* JET - xinerama */
struct
{ /* position, size of widgets (pixels) */
int x1, y1; /* general position variables */
int index;
+ /* JET - get xinerama info */
+#ifdef USE_XINERAMA
+ /* use the prefered screen */
+ if (!_DtXineramaGetScreen(smGD.DtXineramaInfo,
+ smRes.xineramaPreferredScreen,
+ &dpwidth, &dpheight, &xorg, &yorg))
+ { /* no joy here either - setup for normal */
+ dpwidth = DisplayWidth(smGD.display, smGD.screen);
+ dpheight = DisplayHeight(smGD.display, smGD.screen);
+ xorg = yorg = 0;
+ }
+#else /* no Xinerama */
+ dpwidth = DisplayWidth(smGD.display, smGD.screen);
+ dpheight = DisplayHeight(smGD.display, smGD.screen);
+ xorg = yorg = 0;
+#endif
+
/*
* The partial cover has widgets of index 0 - the cover has
* index 1
mw.shadow = shadowThickness;
mw.width = width;
mw.height = height;
- mw.x = (DisplayWidth(smGD.display, smGD.screen) - mw.width)/2;
- mw.y = (DisplayHeight(smGD.display, smGD.screen) - mw.height)/2;
+ mw.x = (dpwidth - mw.width)/2;
+ mw.y = (dpheight - mw.height)/2;
if ( mw.x < 0 ) mw.x = 0;
if ( mw.y < 0 ) mw.y = 0;
- x1 = mw.x;
- y1 = mw.y;
+ /* adjust origins if using Xinerama */
+ x1 = mw.x + xorg;
+ y1 = mw.y + yorg;
i = 0;