|
Lines 41-46
Link Here
|
| 41 |
#include "workspace.h" |
41 |
#include "workspace.h" |
| 42 |
|
42 |
|
| 43 |
#include "geomview.h" |
43 |
#include "geomview.h" |
|
|
44 |
#include "screen.h" |
| 45 |
#include "xinerama.h" |
| 44 |
|
46 |
|
| 45 |
|
47 |
|
| 46 |
#ifdef KWM_HINTS |
48 |
#ifdef KWM_HINTS |
|
Lines 172-179
Link Here
|
| 172 |
WMUnmapWidget(scr->gview); |
174 |
WMUnmapWidget(scr->gview); |
| 173 |
} else { |
175 |
} else { |
| 174 |
if (wPreferences.move_display == WDIS_CENTER) { |
176 |
if (wPreferences.move_display == WDIS_CENTER) { |
| 175 |
moveGeometryDisplayCentered(scr, |
177 |
WMPoint p; |
| 176 |
scr->scr_width/2, scr->scr_height/2); |
178 |
#ifdef XINERAMA |
|
|
179 |
p = wGetCenterForHead(scr, |
| 180 |
wGetHeadForPointerLocation(scr), |
| 181 |
0, 0); |
| 182 |
#else |
| 183 |
p.x = scr->scr_width/2; |
| 184 |
p.y = scr->scr_height/2; |
| 185 |
#endif |
| 186 |
moveGeometryDisplayCentered(scr, p.x, p.y); |
| 177 |
} else if (wPreferences.move_display == WDIS_TOPLEFT) { |
187 |
} else if (wPreferences.move_display == WDIS_TOPLEFT) { |
| 178 |
moveGeometryDisplayCentered(scr, 1, 1); |
188 |
moveGeometryDisplayCentered(scr, 1, 1); |
| 179 |
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { |
189 |
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { |
|
Lines 193-200
Link Here
|
| 193 |
|| wPreferences.move_display == WDIS_NONE) { |
203 |
|| wPreferences.move_display == WDIS_NONE) { |
| 194 |
return; |
204 |
return; |
| 195 |
} else if (wPreferences.move_display == WDIS_CENTER) { |
205 |
} else if (wPreferences.move_display == WDIS_CENTER) { |
| 196 |
moveGeometryDisplayCentered(scr, scr->scr_width / 2, |
206 |
WMPoint p; |
| 197 |
scr->scr_height / 2); |
207 |
#ifdef XINERAMA |
|
|
208 |
p = wGetCenterForHead(scr, |
| 209 |
wGetHeadForPointerLocation(scr), |
| 210 |
0, 0); |
| 211 |
#else |
| 212 |
p.x = scr->scr_width/2; |
| 213 |
p.y = scr->scr_height/2; |
| 214 |
#endif |
| 215 |
moveGeometryDisplayCentered(scr, p.x, p.y); |
| 198 |
} else if (wPreferences.move_display == WDIS_TOPLEFT) { |
216 |
} else if (wPreferences.move_display == WDIS_TOPLEFT) { |
| 199 |
moveGeometryDisplayCentered(scr, 1, 1); |
217 |
moveGeometryDisplayCentered(scr, 1, 1); |
| 200 |
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { |
218 |
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { |
|
Lines 357-364
Link Here
|
| 357 |
WMUnmapWidget(scr->gview); |
375 |
WMUnmapWidget(scr->gview); |
| 358 |
} else { |
376 |
} else { |
| 359 |
if (wPreferences.size_display == WDIS_CENTER) { |
377 |
if (wPreferences.size_display == WDIS_CENTER) { |
| 360 |
moveGeometryDisplayCentered(scr, |
378 |
WMPoint p; |
| 361 |
scr->scr_width / 2, scr->scr_height / 2); |
379 |
#ifdef XINERAMA |
|
|
380 |
p = wGetCenterForHead(scr, |
| 381 |
wGetHeadForPointerLocation(scr), |
| 382 |
0, 0); |
| 383 |
#else |
| 384 |
p.x = scr->scr_width/2; |
| 385 |
p.y = scr->scr_height/2; |
| 386 |
#endif |
| 387 |
moveGeometryDisplayCentered(scr, p.x, p.y); |
| 362 |
} else if (wPreferences.size_display == WDIS_TOPLEFT) { |
388 |
} else if (wPreferences.size_display == WDIS_TOPLEFT) { |
| 363 |
moveGeometryDisplayCentered(scr, 1, 1); |
389 |
moveGeometryDisplayCentered(scr, 1, 1); |
| 364 |
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { |
390 |
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { |
|
Lines 380-387
Link Here
|
| 380 |
return; |
406 |
return; |
| 381 |
|
407 |
|
| 382 |
if (wPreferences.size_display == WDIS_CENTER) { |
408 |
if (wPreferences.size_display == WDIS_CENTER) { |
| 383 |
moveGeometryDisplayCentered(scr, scr->scr_width / 2, |
409 |
WMPoint p; |
| 384 |
scr->scr_height / 2); |
410 |
#ifdef XINERAMA |
|
|
411 |
p = wGetCenterForHead(scr, |
| 412 |
wGetHeadForPointerLocation(scr), |
| 413 |
0, 0); |
| 414 |
#else |
| 415 |
p.x = scr->scr_width/2; |
| 416 |
p.y = scr->scr_height/2; |
| 417 |
#endif |
| 418 |
moveGeometryDisplayCentered(scr, p.x, p.y); |
| 385 |
} else if (wPreferences.size_display == WDIS_TOPLEFT) { |
419 |
} else if (wPreferences.size_display == WDIS_TOPLEFT) { |
| 386 |
moveGeometryDisplayCentered(scr, 1, 1); |
420 |
moveGeometryDisplayCentered(scr, 1, 1); |
| 387 |
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { |
421 |
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { |
|
Lines 398-405
Link Here
|
| 398 |
{ |
432 |
{ |
| 399 |
WWindow *tmpw; |
433 |
WWindow *tmpw; |
| 400 |
int x, y; |
434 |
int x, y; |
|
|
435 |
#if 0 |
| 401 |
int scr_width = wwin->screen_ptr->scr_width; |
436 |
int scr_width = wwin->screen_ptr->scr_width; |
| 402 |
int scr_height = wwin->screen_ptr->scr_height; |
437 |
int scr_height = wwin->screen_ptr->scr_height; |
|
|
438 |
#endif |
| 403 |
|
439 |
|
| 404 |
if (!array || !WMGetArrayItemCount(array)) { |
440 |
if (!array || !WMGetArrayItemCount(array)) { |
| 405 |
wWindowMove(wwin, wwin->frame_x + dx, wwin->frame_y + dy); |
441 |
wWindowMove(wwin, wwin->frame_x + dx, wwin->frame_y + dy); |
|
Lines 412-417
Link Here
|
| 412 |
|
448 |
|
| 413 |
/* don't let windows become unreachable */ |
449 |
/* don't let windows become unreachable */ |
| 414 |
|
450 |
|
|
|
451 |
#if 0 |
| 415 |
if (x + (int)tmpw->frame->core->width < 20) |
452 |
if (x + (int)tmpw->frame->core->width < 20) |
| 416 |
x = 20 - (int)tmpw->frame->core->width; |
453 |
x = 20 - (int)tmpw->frame->core->width; |
| 417 |
else if (x + 20 > scr_width) |
454 |
else if (x + 20 > scr_width) |
|
Lines 421-426
Link Here
|
| 421 |
y = 20 - (int)tmpw->frame->core->height; |
458 |
y = 20 - (int)tmpw->frame->core->height; |
| 422 |
else if (y + 20 > scr_height) |
459 |
else if (y + 20 > scr_height) |
| 423 |
y = scr_height - 20; |
460 |
y = scr_height - 20; |
|
|
461 |
#else |
| 462 |
wScreenBringInside(wwin->screen_ptr, &x, &y, |
| 463 |
(int)tmpw->frame->core->width, |
| 464 |
(int)tmpw->frame->core->height); |
| 465 |
#endif |
| 424 |
|
466 |
|
| 425 |
wWindowMove(tmpw, x, y); |
467 |
wWindowMove(tmpw, x, y); |
| 426 |
} |
468 |
} |
|
Lines 462-470
Link Here
|
| 462 |
drawFrames(WWindow *wwin, WMArray *array, int dx, int dy) |
504 |
drawFrames(WWindow *wwin, WMArray *array, int dx, int dy) |
| 463 |
{ |
505 |
{ |
| 464 |
WWindow *tmpw; |
506 |
WWindow *tmpw; |
|
|
507 |
int x, y; |
| 508 |
#if 0 |
| 465 |
int scr_width = wwin->screen_ptr->scr_width; |
509 |
int scr_width = wwin->screen_ptr->scr_width; |
| 466 |
int scr_height = wwin->screen_ptr->scr_height; |
510 |
int scr_height = wwin->screen_ptr->scr_height; |
| 467 |
int x, y; |
511 |
#endif |
| 468 |
|
512 |
|
| 469 |
if (!array) { |
513 |
if (!array) { |
| 470 |
|
514 |
|
|
Lines 483-489
Link Here
|
| 483 |
y = tmpw->frame_y + dy; |
527 |
y = tmpw->frame_y + dy; |
| 484 |
|
528 |
|
| 485 |
/* don't let windows become unreachable */ |
529 |
/* don't let windows become unreachable */ |
| 486 |
|
530 |
#if 0 |
| 487 |
if (x + (int)tmpw->frame->core->width < 20) |
531 |
if (x + (int)tmpw->frame->core->width < 20) |
| 488 |
x = 20 - (int)tmpw->frame->core->width; |
532 |
x = 20 - (int)tmpw->frame->core->width; |
| 489 |
else if (x + 20 > scr_width) |
533 |
else if (x + 20 > scr_width) |
|
Lines 493-499
Link Here
|
| 493 |
y = 20 - (int)tmpw->frame->core->height; |
537 |
y = 20 - (int)tmpw->frame->core->height; |
| 494 |
else if (y + 20 > scr_height) |
538 |
else if (y + 20 > scr_height) |
| 495 |
y = scr_height - 20; |
539 |
y = scr_height - 20; |
| 496 |
|
540 |
#else |
|
|
541 |
wScreenBringInside(wwin->screen_ptr, &x, &y, |
| 542 |
(int)tmpw->frame->core->width, |
| 543 |
(int)tmpw->frame->core->height); |
| 544 |
#endif |
| 497 |
drawTransparentFrame(tmpw, x, y, tmpw->frame->core->width, |
545 |
drawTransparentFrame(tmpw, x, y, tmpw->frame->core->width, |
| 498 |
tmpw->frame->core->height); |
546 |
tmpw->frame->core->height); |
| 499 |
} |
547 |
} |
|
Lines 955-964
Link Here
|
| 955 |
if (dx || dy) { |
1003 |
if (dx || dy) { |
| 956 |
int i; |
1004 |
int i; |
| 957 |
/* window is the leftmost window: check against screen edge */ |
1005 |
/* window is the leftmost window: check against screen edge */ |
|
|
1006 |
#ifdef XINERAMA |
| 1007 |
WMRect rect = wGetRectForHead( scr, wGetHeadForPointerLocation( scr)); |
| 1008 |
|
| 1009 |
l_edge = WMAX( scr->totalUsableArea.x1, rect.pos.x); |
| 1010 |
edge_l = l_edge - resist; |
| 1011 |
edge_r = WMIN( scr->totalUsableArea.x2, rect.pos.x + rect.size.width); |
| 1012 |
r_edge = edge_r + resist; |
| 1013 |
#else |
| 958 |
l_edge = scr->totalUsableArea.x1; |
1014 |
l_edge = scr->totalUsableArea.x1; |
| 959 |
r_edge = scr->totalUsableArea.x2 + resist; |
1015 |
r_edge = scr->totalUsableArea.x2 + resist; |
| 960 |
edge_l = scr->totalUsableArea.x1 - resist; |
1016 |
edge_l = scr->totalUsableArea.x1 - resist; |
| 961 |
edge_r = scr->totalUsableArea.x2; |
1017 |
edge_r = scr->totalUsableArea.x2; |
|
|
1018 |
#endif |
| 962 |
|
1019 |
|
| 963 |
/* 1 */ |
1020 |
/* 1 */ |
| 964 |
if ((data->rightIndex >= 0) && (data->rightIndex <= data->count)) { |
1021 |
if ((data->rightIndex >= 0) && (data->rightIndex <= data->count)) { |
|
Lines 1054-1063
Link Here
|
| 1054 |
} |
1111 |
} |
| 1055 |
|
1112 |
|
| 1056 |
/* VeRT */ |
1113 |
/* VeRT */ |
|
|
1114 |
#ifdef XINERAMA |
| 1115 |
t_edge = WMAX( scr->totalUsableArea.y1, rect.pos.y); |
| 1116 |
edge_t = t_edge - resist; |
| 1117 |
edge_b = WMIN( scr->totalUsableArea.y2, rect.pos.y + rect.size.height); |
| 1118 |
b_edge = edge_b + resist; |
| 1119 |
#else |
| 1057 |
t_edge = scr->totalUsableArea.y1; |
1120 |
t_edge = scr->totalUsableArea.y1; |
| 1058 |
b_edge = scr->totalUsableArea.y2 + resist; |
1121 |
b_edge = scr->totalUsableArea.y2 + resist; |
| 1059 |
edge_t = scr->totalUsableArea.y1 - resist; |
1122 |
edge_t = scr->totalUsableArea.y1 - resist; |
| 1060 |
edge_b = scr->totalUsableArea.y2; |
1123 |
edge_b = scr->totalUsableArea.y2; |
|
|
1124 |
#endif |
| 1061 |
|
1125 |
|
| 1062 |
if ((data->bottomIndex >= 0) && (data->bottomIndex <= data->count)) { |
1126 |
if ((data->bottomIndex >= 0) && (data->bottomIndex <= data->count)) { |
| 1063 |
WWindow *looprw; |
1127 |
WWindow *looprw; |