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

Fixes several issues with grid registration of the dtwm panel on dtfile startup and on workspace addition:

The panel registration code rather stupidly assumed that display
  size is always 1280x1024 pixels. Because of this, depending on screen
  size, the panel could be registered somewhere in the center of the screen
  or completely or partially beyond of it.

  The panels were registered only on startup, not  those, which were added
  from UI.

The fix moves panel registration into separate routine and removes assumption
about display size. The fix yet is not complete since it still makes assumption
about panel's geometry: from dtfile there is still no way to find out
dinamically  the size of panel and it's location.
This commit is contained in:
Eugene Doudine 2014-04-15 17:25:49 +03:00 committed by Jon Trulson
parent 8bafd85d9a
commit 5544a0fb39
3 changed files with 39 additions and 8 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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,