1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtfile/Desktop: CID 88133,88159,88339,88798,89331,89466

This commit is contained in:
Jon Trulson 2018-04-11 12:23:33 -06:00
parent 694b6ef5eb
commit 7e61925f1b

View file

@ -987,9 +987,9 @@ LoadDesktopInfo(
char *session) char *session)
{ {
static char * desktopFileName = NULL; static char * desktopFileName = NULL;
char *fileName, *full_path, *ptr; char *fileName = NULL, *full_path = NULL, *ptr = NULL;
char *workSpace; char *workSpace = NULL;
char *message; char *message = NULL;
int i, j, numWindows, count, index, bufferSize; int i, j, numWindows, count, index, bufferSize;
int rX, rY; int rX, rY;
FILE * fptr; FILE * fptr;
@ -1073,21 +1073,33 @@ LoadDesktopInfo(
/* read the data for each Window, then popup that window */ /* read the data for each Window, then popup that window */
for (i = count; i < numWindows + count; i++) for (i = count; i < numWindows + count; i++)
{ {
int len, toolbox, view, order, direction, positionEnabled; int len = 0, toolbox, view, order, direction, positionEnabled;
desktopWindow = desktop_data->desktopWindows[index]; desktopWindow = desktop_data->desktopWindows[index];
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
desktopWindow->file_name = XtNewString(message); len = strlen(message); message[len-1] = 0x0;
desktopWindow->file_name = XtNewString(message);
}
else
desktopWindow->file_name = NULL;
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
workSpace = XtNewString(message); len = strlen(message); message[len-1] = 0x0;
workSpace = XtNewString(message);
}
else
workSpace = NULL;
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
desktopWindow->dir_linked_to = XtNewString(message); len = strlen(message); message[len-1] = 0x0;
desktopWindow->dir_linked_to = XtNewString(message);
}
else
desktopWindow->dir_linked_to = NULL;
{ /* Construct the full path and check for the file or link { /* Construct the full path and check for the file or link
existence. existence.
@ -1130,30 +1142,46 @@ LoadDesktopInfo(
path = NULL; path = NULL;
} }
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
if( strcmp(message, NULL_STRING) == 0 ) len = strlen(message); message[len-1] = 0x0;
desktopWindow->restricted_directory = NULL; if( strcmp(message, NULL_STRING) == 0 )
desktopWindow->restricted_directory = NULL;
else
desktopWindow->restricted_directory = XtNewString(message);
}
else else
desktopWindow->restricted_directory = XtNewString(message); desktopWindow->restricted_directory = NULL;
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
if( strcmp(message, NULL_STRING) == 0 ) len = strlen(message); message[len-1] = 0x0;
desktopWindow->title = NULL; if( strcmp(message, NULL_STRING) == 0 )
desktopWindow->title = NULL;
else
desktopWindow->title = XtNewString(message);
}
else else
desktopWindow->title = XtNewString(message); desktopWindow->title = NULL;
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
len = strlen(message); message[len-1] = 0x0; {
if( strcmp(message, NULL_STRING) == 0 ) len = strlen(message); message[len-1] = 0x0;
desktopWindow->helpVol = NULL; if( strcmp(message, NULL_STRING) == 0 )
desktopWindow->helpVol = NULL;
else
desktopWindow->helpVol = XtNewString(message);
}
else else
desktopWindow->helpVol = XtNewString(message); desktopWindow->helpVol = NULL;
fgets(message, bufferSize, fptr); if (fgets(message, bufferSize, fptr))
sscanf( message, "%d %d %d %d %d %d %d\n", {
&toolbox, &view, &order, &direction, &positionEnabled, &rX, &rY ); sscanf( message, "%d %d %d %d %d %d %d\n",
&toolbox, &view, &order, &direction, &positionEnabled, &rX, &rY );
}
else
message = NULL;
desktopWindow->toolbox = (char)toolbox; desktopWindow->toolbox = (char)toolbox;
desktopWindow->view = (char)view; desktopWindow->view = (char)view;
@ -2707,8 +2735,8 @@ CalculateRootCoordinates (
int *root_x, int *root_x,
int *root_y) int *root_y)
{ {
int row, column; int row = 0, column = 0;
Boolean rDirection, cDirection, whichFirst; Boolean rDirection = False, cDirection = False, whichFirst = False;
Boolean error = False; Boolean error = False;
int numGridsR, numGridsC, i, j; int numGridsR, numGridsC, i, j;
@ -3759,7 +3787,7 @@ CheckDesktopMarquee(
XRectangle incoming_rect; XRectangle incoming_rect;
unsigned char pixmapPosition; unsigned char pixmapPosition;
DtIconGadget g; DtIconGadget g;
WorkspaceRec *workspaceData; WorkspaceRec *workspaceData = NULL;
unsigned char flags; unsigned char flags;
Region region; Region region;
Display *display; Display *display;
@ -3800,6 +3828,13 @@ CheckDesktopMarquee(
} }
} }
/* This shouldn't happen, but... */
if (!workspaceData)
{
fprintf(stderr, "%s: workspaceData == NULL!\n", __FUNCTION__);
return;
}
/* now lets loop through the icons used, first check to see if they are /* now lets loop through the icons used, first check to see if they are
* in the same workspace. If not continue else we need to check to see * in the same workspace. If not continue else we need to check to see
* if they are in the region passed in. * if they are in the region passed in.