Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
session.c
Log Message:
Attempted to sort out weirdness with ...e_session-XXXXXX.clients.?.
Not entirely sure about this - please yell if it causes trouble.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- session.c 17 Aug 2003 10:15:16 -0000 1.40
+++ session.c 18 Aug 2003 22:23:22 -0000 1.41
@@ -324,6 +324,7 @@
if (GetSMfd() < 0)
return;
+
for (i = 0; i < num_match; i++)
{
if ((!matches[i].used))
@@ -385,31 +386,26 @@
* This seems a bit kludgy to me. (: */
}
- if (!ICCCM_GetEInfo(ewin))
- {
- matches[i].used = 1;
- ewin->client.already_placed = 1;
- ewin->iconified = matches[i].iconified;
- ewin->sticky = matches[i].sticky;
- ewin->shaded = matches[i].shaded;
- ewin->layer = matches[i].layer;
- if (!ewin->sticky)
- ewin->desktop = matches[i].desktop;
- /* if it's NOT (X11R6 and already placed by the client) */
- if (!((ewin->client.already_placed) && (ewin->session_id)))
- {
- ewin->client.x =
- matches[i].x -
- (desks.desk[ewin->desktop].current_area_x * root.w);
- ewin->client.y =
- matches[i].y -
- (desks.desk[ewin->desktop].current_area_y * root.h);
- ewin->client.w = matches[i].w;
- ewin->client.h = matches[i].h;
- EMoveResizeWindow(disp, ewin->client.win, ewin->client.x,
- ewin->client.y, ewin->client.w,
- ewin->client.h);
- }
+ matches[i].used = 1;
+ ewin->client.already_placed = 1;
+ ewin->iconified = matches[i].iconified;
+ ewin->sticky = matches[i].sticky;
+ ewin->shaded = matches[i].shaded;
+ ewin->layer = matches[i].layer;
+ if (!ewin->sticky)
+ ewin->desktop = matches[i].desktop;
+ /* if it's NOT (X11R6 and already placed by the client) */
+ if (!((ewin->client.already_placed) && (ewin->session_id)))
+ {
+ ewin->client.x = matches[i].x -
+ (desks.desk[ewin->desktop].current_area_x * root.w);
+ ewin->client.y = matches[i].y -
+ (desks.desk[ewin->desktop].current_area_y * root.h);
+ ewin->client.w = matches[i].w;
+ ewin->client.h = matches[i].h;
+ EMoveResizeWindow(disp, ewin->client.win, ewin->client.x,
+ ewin->client.y, ewin->client.w,
+ ewin->client.h);
}
break;
}
@@ -455,7 +451,6 @@
}
#ifndef HAVE_X11_SM_SMLIB_H
-static void LogoutCB(int val, void *data);
void
SessionInit(void)
@@ -501,7 +496,6 @@
data = NULL;
}
-static void CB_SettingsEscape(int val, void *data);
static void
CB_SettingsEscape(int val, void *data)
{
@@ -645,9 +639,16 @@
AUDIO_PLAY("SOUND_EXIT");
EExit(0);
}
+
#else /* HAVE_X11_SM_SMLIB_H */
+
#include <X11/SM/SMlib.h>
+/*
+ * NB! If the discard property is revived, the dual use of buf must be fixed.
+ */
+#define USE_DISCARD_PROPERTY 0
+
static char *sm_client_id = NULL;
static SmcConn sm_conn = NULL;
static int sm_fd = -1;
@@ -655,20 +656,6 @@
/* True if we are saving state for a doExit("restart") */
static int restarting = False;
-static void LogoutCB(int val, void *data);
-static void set_save_props(SmcConn smc_conn, int master_flag);
-static void callback_save_yourself2(SmcConn smc_conn,
- SmPointer client_data);
-static void callback_save_yourself(SmcConn smc_conn,
- SmPointer client_data,
- int save_style, Bool shutdown,
- int interact_style, Bool fast);
-static void callback_die(SmcConn smc_conn, SmPointer client_data);
-static void callback_save_complete(SmcConn smc_conn,
- SmPointer client_data);
-static void callback_shutdown_cancelled(SmcConn smc_conn,
- SmPointer client_data);
-
static void
set_save_props(SmcConn smc_conn, int master_flag)
{
@@ -683,19 +670,22 @@
char *ecachedir = "-ecachedir";
char *e_cache_dir;
char *extinitwin = "-ext_init_win";
- char *sh = "sh";
- char *c = "-c";
char buf[512];
char priority = 10;
char style;
- int n = 0;
+ int n;
SmPropValue programVal = { 0, NULL };
SmPropValue userIDVal = { 0, NULL };
+#if USE_DISCARD_PROPERTY
+ char *sh = "sh";
+ char *c = "-c";
SmPropValue discardVal[] = {
{0, NULL},
{0, NULL},
{0, NULL}
};
+ SmProp discardProp;
+#endif
SmPropValue restartVal[] = {
{0, NULL},
{0, NULL},
@@ -712,7 +702,6 @@
SmPropValue priorityVal = { 0, NULL };
SmProp programProp;
SmProp userIDProp;
- SmProp discardProp;
SmProp restartProp;
SmProp cloneProp;
SmProp styleProp;
@@ -729,10 +718,12 @@
userIDProp.num_vals = 1;
userIDProp.vals = &userIDVal;
+#if USE_DISCARD_PROPERTY
discardProp.name = (char *)SmDiscardCommand;
discardProp.type = (char *)SmLISTofARRAY8;
discardProp.num_vals = 3;
discardProp.vals = (SmPropValue *) & discardVal;
+#endif
restartProp.name = (char *)SmRestartCommand;
restartProp.type = (char *)SmLISTofARRAY8;
@@ -752,14 +743,6 @@
priorityProp.num_vals = 1;
priorityProp.vals = (SmPropValue *) & priorityVal;
- props[0] = &programProp;
- props[1] = &userIDProp;
- props[2] = &discardProp;
- props[3] = &restartProp;
- props[4] = &cloneProp;
- props[5] = &styleProp;
- props[6] = &priorityProp;
-
if (master_flag)
/* Master WM restarts immediately for a doExit("restart") */
style = restarting ? SmRestartImmediately : SmRestartIfRunning;
@@ -783,6 +766,7 @@
priorityVal.length = 1;
priorityVal.value = &priority;
+#if USE_DISCARD_PROPERTY
/* Tell session manager how to clean up our old data */
Esnprintf(buf, sizeof(buf) / sizeof(char), "rm %s*.clients.*", sm_file);
@@ -791,8 +775,10 @@
discardVal[1].length = strlen(c);
discardVal[1].value = c;
discardVal[2].length = strlen(buf);
- discardVal[2].value = buf;
+ discardVal[2].value = buf; /* ??? Also used in restartVal ??? */
+#endif
+ n = 0;
restartVal[n].length = strlen(command);
restartVal[n++].value = command;
if (single_screen_mode)
@@ -831,7 +817,18 @@
/* SM specs require SmCloneCommand excludes "-smid" option */
cloneProp.num_vals = restartProp.num_vals - 2;
- SmcSetProperties(smc_conn, sizeof(props) / sizeof(props[0]), props);
+ n = 0;
+ props[n++] = &programProp;
+ props[n++] = &userIDProp;
+#if USE_DISCARD_PROPERTY
+ props[n++] = &discardProp;
+#endif
+ props[n++] = &restartProp;
+ props[n++] = &cloneProp;
+ props[n++] = &styleProp;
+ props[n++] = &priorityProp;
+
+ SmcSetProperties(smc_conn, n, props);
if (user)
Efree(user);
}
@@ -1120,7 +1117,6 @@
}
}
-static void CB_SettingsEscape(int val, void *data);
static void
CB_SettingsEscape(int val, void *data)
{
@@ -1152,6 +1148,7 @@
if (params)
sscanf(params, "%1000s", s);
+ SaveWindowStates();
if (!params)
SaveSession(1);
if ((disp) && ((!params) || ((params) && strcmp((char *)params, "logout"))))
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs