diff --git a/cde/programs/dtfile/Desktop.c b/cde/programs/dtfile/Desktop.c index fd0753972..cc6afe5b2 100644 --- a/cde/programs/dtfile/Desktop.c +++ b/cde/programs/dtfile/Desktop.c @@ -64,6 +64,7 @@ * PutOnDTCB * RegisterIconDropsDT * RegisterInGrid + * RegisterPanelInGrid * RemoveDT * RemoveMovedObjectFromDT * RunDTCommand @@ -2451,6 +2452,33 @@ DTFileIsSelected ( return(False); } +/*********************************************************************** + * + * RegisterPanelInGrid - Registers the Dtwm planel in grid + * + * Arguments: workspace - workspace number + * displayWidth - width of worspace screen + * displayHaight - height of workspace screen + * + ************************************************************************/ + +void RegisterPanelInGrid(int workspace, int displayWidth, int displayHeight ) +{ + /* want to take out space where the FP lays ... Note this only for the + default size of the FP. Right now there is no dynamic way of registering + the FP no matter what size it is */ +#define EXPECTED_PANEL_WIDTH 1105 +#define EXPECTED_PANEL_HEIGHT 83 + RegisterInGrid(EXPECTED_PANEL_WIDTH, EXPECTED_PANEL_HEIGHT, + /* the panel is expected to be horizontally centered */ + (displayWidth > EXPECTED_PANEL_WIDTH) ? + (displayWidth - EXPECTED_PANEL_WIDTH) / 2 : 0, + /* the panel is expected to be at the bottom of the screen */ + (displayHeight > EXPECTED_PANEL_HEIGHT) ? + (displayHeight - EXPECTED_PANEL_HEIGHT) : displayHeight, + workspace, True); +} + /*********************************************************************** * * InitializeDesktopGrid @@ -2458,20 +2486,16 @@ DTFileIsSelected ( ************************************************************************/ void -InitializeDesktopGrid( void ) +InitializeDesktopGrid( int displayWidth, int displayHeight) { int i,j,k; desktop_grid_size = desktop_data->numWorkspaces * numColumns * numRows; desktop_grid = (Boolean *)XtCalloc(1, desktop_grid_size); - /* want to take out space where the FP lays ... Note this only for the - default size of the FP. Right now there is no dynamic way of registering - the FP no matter what size it is */ - for(i = 1; i <= desktop_data->numWorkspaces; i++) { - RegisterInGrid((int)1132, (int)115, 78, 910, i, True); + RegisterPanelInGrid(i, displayWidth, displayHeight); } } @@ -3604,6 +3628,11 @@ InitializeNewWorkspaces ( for(k = 0; k < numRows; k++) desktop_grid[(i * numRows * numColumns) + (j * numRows) + k] = False; + + RegisterPanelInGrid( i + 1, + DisplayWidth(display,screen), + DisplayHeight(display, screen)); + } desktop_data->numWorkspaces = numInfo; diff --git a/cde/programs/dtfile/Main.c b/cde/programs/dtfile/Main.c index c41ee3edb..c5b1da875 100644 --- a/cde/programs/dtfile/Main.c +++ b/cde/programs/dtfile/Main.c @@ -1704,7 +1704,7 @@ _DtPerfChkpntMsgSend("Begin XtInitialize"); /* go build 10 desktop windows */ desktop_data = NULL; InitializeDesktopWindows(10, display); - InitializeDesktopGrid(); + InitializeDesktopGrid(displayWidth, displayHeight); LoadDesktopInfo(application_args.session); diff --git a/cde/programs/dtfile/Main.h b/cde/programs/dtfile/Main.h index 53abcefc6..bb5008462 100644 --- a/cde/programs/dtfile/Main.h +++ b/cde/programs/dtfile/Main.h @@ -1399,7 +1399,9 @@ extern void UnpostDTTextField(void) ; extern Boolean DTFileIsSelected( DesktopRec *desktopRec, FileViewData *fileViewData) ; -extern void InitializeDesktopGrid( void ) ; +extern void InitializeDesktopGrid( + int displayWidth, + int displayHeight) ; extern void RegisterInGrid( int width, int height,