Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 6496
Collapse All | Expand All

(-)metacity-2.4.0/src/screen.c (-6 / +24 lines)
Lines 1334-1339 Link Here
1334
    }
1334
    }
1335
}
1335
}
1336
1336
1337
1337
void
1338
void
1338
meta_screen_calc_workspace_layout (MetaScreen *screen,
1339
meta_screen_calc_workspace_layout (MetaScreen *screen,
1339
                                   int         num_workspaces,
1340
                                   int         num_workspaces,
Lines 1368-1384 Link Here
1368
  if (rows <= 0 && cols <= 0)
1369
  if (rows <= 0 && cols <= 0)
1369
    cols = num_workspaces;
1370
    cols = num_workspaces;
1370
1371
1371
  if (rows <= 0)
1372
  if (rows <= 0) {
1372
    rows = num_workspaces / cols + ((num_workspaces % cols) > 0 ? 1 : 0);
1373
    /* fix PPC compile issue
1373
  if (cols <= 0)
1374
     * ICE occurs using embedded macro in calculation, split 
1374
    cols = num_workspaces / rows + ((num_workspaces % rows) > 0 ? 1 : 0);
1375
     * into if statements 
1376
     */
1377
    if ((num_workspaces % cols) > 0) { 
1378
      rows = num_workspaces / cols + 1;
1379
    } else {
1380
      rows  = num_workspaces / cols;
1381
    }
1382
  }
1383
  if (cols <= 0) {
1384
    /* another fix for PPC compile issue */
1385
    if ((num_workspaces % rows) > 0) {
1386
      cols = num_workspaces / rows + 1;
1387
    } else {
1388
      cols = num_workspaces / rows;
1389
    }
1390
  }
1375
1391
1376
  /* paranoia */
1392
  /* paranoia */
1393
1377
  if (rows < 1)
1394
  if (rows < 1)
1378
    rows = 1;
1395
    rows = 1;
1379
  if (cols < 1)
1396
  if (cols < 1)
1380
    cols = 1;
1397
    cols = 1;
1381
1398
1382
  *r = rows;
1399
  r[0] = rows;
1383
  *c = cols;
1400
  c[0] = cols;
1384
}
1401
}
1402

Return to bug 6496