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

(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/configure (-1 / +1 lines)
Lines 11747-11753 Link Here
11747
fi
11747
fi
11748
11748
11749
11749
11750
xinerama=no
11750
xinerama=yes
11751
#AC_ARG_ENABLE(xinerama,
11751
#AC_ARG_ENABLE(xinerama,
11752
#[  --disable-xinerama	  disable XInerama extension support],
11752
#[  --disable-xinerama	  disable XInerama extension support],
11753
#		xinerama=$enableval, xinerama=yes)
11753
#		xinerama=$enableval, xinerama=yes)
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/actions.c (-6 / +17 lines)
Lines 412-421 Link Here
412
    WArea usableArea = wwin->screen_ptr->totalUsableArea;
412
    WArea usableArea = wwin->screen_ptr->totalUsableArea;
413
    WArea totalArea;
413
    WArea totalArea;
414
414
415
416
    if (WFLAGP(wwin, no_resizable))
415
    if (WFLAGP(wwin, no_resizable))
417
	return;
416
	return;
418
    
417
419
    totalArea.x1 = 0;
418
    totalArea.x1 = 0;
420
    totalArea.y1 = 0;
419
    totalArea.y1 = 0;
421
    totalArea.x2 = wwin->screen_ptr->scr_width;
420
    totalArea.x2 = wwin->screen_ptr->scr_width;
Lines 1502-1511 Link Here
1502
    /*
1501
    /*
1503
     * Find out screen boundaries.
1502
     * Find out screen boundaries.
1504
     */
1503
     */
1504
#ifdef XINERAMA
1505
    WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
1506
1507
    sx1 = rect.pos.x;
1508
    sy1 = rect.pos.y;
1509
    sw = rect.size.width;
1510
    sh = rect.size.height;
1511
    sx2 = sx1 + sw;
1512
    sy2 = sy1 + sh;
1513
#else
1505
    sx1 = 0;
1514
    sx1 = 0;
1506
    sy1 = 0;
1515
    sy1 = 0;
1507
    sx2 = scr->scr_width;
1516
    sw = sx2 = scr->scr_width;
1508
    sy2 = scr->scr_height;
1517
    sh = sy2 = scr->scr_height;
1518
#endif
1519
1509
    if (scr->dock) {
1520
    if (scr->dock) {
1510
	if (scr->dock->on_right_side)
1521
	if (scr->dock->on_right_side)
1511
            sx2 -= isize + DOCK_EXTRA_SPACE;
1522
            sx2 -= isize + DOCK_EXTRA_SPACE;
Lines 1513-1520 Link Here
1513
	    sx1 += isize + DOCK_EXTRA_SPACE;
1524
	    sx1 += isize + DOCK_EXTRA_SPACE;
1514
    }
1525
    }
1515
1526
1516
    sw = isize * (scr->scr_width/isize);
1527
    sw = isize * (sw/isize);
1517
    sh = isize * (scr->scr_height/isize);
1528
    sh = isize * (sh/isize);
1518
    fullW = (sx2-sx1)/isize;
1529
    fullW = (sx2-sx1)/isize;
1519
    fullH = (sy2-sy1)/isize;
1530
    fullH = (sy2-sy1)/isize;
1520
1531
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/client.c (+13 lines)
Lines 46-51 Link Here
46
#ifdef KWM_HINTS
46
#ifdef KWM_HINTS
47
#include "kwm.h"
47
#include "kwm.h"
48
#endif
48
#endif
49
#include "xinerama.h"
49
50
50
/****** Global Variables ******/
51
/****** Global Variables ******/
51
52
Lines 770-775 Link Here
770
	if (wwin->normal_hints->flags & (USPosition|PPosition)) {
771
	if (wwin->normal_hints->flags & (USPosition|PPosition)) {
771
	    *x = wwin->normal_hints->x;
772
	    *x = wwin->normal_hints->x;
772
	    *y = wwin->normal_hints->y;
773
	    *y = wwin->normal_hints->y;
774
#ifdef XINERAMA
775
	    {
776
		WScreen *scr = wwin->screen_ptr;
777
		if ( (unsigned)(*x - scr->scr_width/2 + 10) < 20 &&
778
		     (unsigned)(*y - scr->scr_height/2 + 10) < 20) {
779
		    int head = wGetHeadForPointerLocation(scr);
780
		    WMRect rect = wGetRectForHead(scr, head);
781
		    *x = rect.pos.x + (*x * rect.size.width)/scr->scr_width;
782
		    *y = rect.pos.y + (*y * rect.size.height)/scr->scr_height;
783
		}
784
	    }
785
#endif
773
	}
786
	}
774
	if (wwin->normal_hints->flags & (USSize|PSize)) {
787
	if (wwin->normal_hints->flags & (USSize|PSize)) {
775
	    *width = wwin->normal_hints->width;
788
	    *width = wwin->normal_hints->width;
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/cycling.c (-2 / +15 lines)
Lines 37-42 Link Here
37
#include "stacking.h"
37
#include "stacking.h"
38
#include "funcs.h"
38
#include "funcs.h"
39
39
40
#include "xinerama.h"
41
42
40
/* Globals */
43
/* Globals */
41
extern WPreferences wPreferences;
44
extern WPreferences wPreferences;
42
45
Lines 303-310 Link Here
303
    }
306
    }
304
307
305
    scr->flags.doing_alt_tab = 0;
308
    scr->flags.doing_alt_tab = 0;
306
    if (openedSwitchMenu) 
309
    if (openedSwitchMenu) {
307
	OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
310
	int x, y;
311
#ifdef XINERAMA
312
	WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
313
	x = rect.pos.x + rect.size.width/2;
314
	y = rect.pos.y + rect.size.height/2;
315
#else
316
	x = scr->scr_width/2;
317
	y = scr->scr_height/2;
318
#endif
319
	OpenSwitchMenu(scr, x, y, False);
320
    }
308
    
321
    
309
    if (somethingElse) {
322
    if (somethingElse) {
310
	WMHandleEvent(&ev);
323
	WMHandleEvent(&ev);
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/dialog.c (-8 / +4 lines)
Lines 70-81 Link Here
70
    WMPoint pt;
70
    WMPoint pt;
71
    
71
    
72
#ifdef XINERAMA
72
#ifdef XINERAMA
73
    WMRect rect;
73
    return wGetCenterForHead(scr, wGetHeadForPointerLocation(scr), width, height);
74
    
75
    rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
76
77
    pt.x = rect.pos.x + (rect.size.width - width)/2;
78
    pt.y = rect.pos.y + (rect.size.height - height)/2;
79
#else
74
#else
80
    pt.x = (scr->scr_width - width) / 2;
75
    pt.x = (scr->scr_width - width) / 2;
81
    pt.y = (scr->scr_height - height) / 2;	
76
    pt.y = (scr->scr_height - height) / 2;	
Lines 144-149 Link Here
144
    WMButton *saveSessionBtn;
139
    WMButton *saveSessionBtn;
145
    Window parent;
140
    Window parent;
146
    WWindow *wwin;
141
    WWindow *wwin;
142
    WMPoint center;
147
    int result;
143
    int result;
148
144
149
    panel = WMCreateAlertPanel(scr->wmscreen, NULL, title, message,
145
    panel = WMCreateAlertPanel(scr->wmscreen, NULL, title, message,
Lines 163-171 Link Here
163
159
164
    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
160
    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
165
161
162
    center = getCenter( scr, 400, 180);
166
    wwin = wManageInternalWindow(scr, parent, None, NULL,
163
    wwin = wManageInternalWindow(scr, parent, None, NULL,
167
                                (scr->scr_width - 400)/2,
164
                                center.x, center.y, 400, 180);
168
                                (scr->scr_height - 180)/2, 400, 180);
169
    wwin->client_leader = WMWidgetXID(panel->win);
165
    wwin->client_leader = WMWidgetXID(panel->win);
170
166
171
    WMMapWidget(panel->win);
167
    WMMapWidget(panel->win);
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/dockedapp.c (-1 / +22 lines)
Lines 39-50 Link Here
39
#include "defaults.h"
39
#include "defaults.h"
40
#include "framewin.h"
40
#include "framewin.h"
41
41
42
#include "xinerama.h"
42
43
43
/**** Global variables ****/
44
/**** Global variables ****/
44
extern WPreferences wPreferences;
45
extern WPreferences wPreferences;
45
46
46
47
47
48
typedef struct _AppSettingsPanel {
48
typedef struct _AppSettingsPanel {
49
    WMWindow *win;
49
    WMWindow *win;
50
    WAppIcon *editedIcon;
50
    WAppIcon *editedIcon;
Lines 448-453 Link Here
448
448
449
    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
449
    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
450
450
451
#ifdef XINERAMA
452
    {
453
	WMRect rect = wGetRectForHead( scr, wGetHeadForPointerLocation( scr));
454
455
	y = aicon->y_pos;
456
	if ( y < rect.pos.y)
457
	    y = rect.pos.y;
458
	else if ( y + PHEIGHT > rect.pos.y + rect.size.height)
459
	    y = rect.pos.y + rect.size.height - PHEIGHT - 30;
460
461
	if (aicon->dock && aicon->dock->type == WM_DOCK) {
462
	    if (aicon->dock->on_right_side)
463
		x = rect.pos.x + rect.size.width/2;
464
	    else
465
		x = rect.pos.x + rect.size.width/2 - PWIDTH - 2;
466
	} else {
467
	    x = rect.pos.x + (rect.size.width - PWIDTH)/2;
468
	}
469
    }
470
#else
451
    y = aicon->y_pos;
471
    y = aicon->y_pos;
452
    if (y < 0)
472
    if (y < 0)
453
	y = 0;
473
	y = 0;
Lines 462-467 Link Here
462
    } else {
482
    } else {
463
	x = (scr->scr_width - PWIDTH)/2;
483
	x = (scr->scr_width - PWIDTH)/2;
464
    }
484
    }
485
#endif
465
    panel->wwin = wManageInternalWindow(scr, parent, None,
486
    panel->wwin = wManageInternalWindow(scr, parent, None,
466
					_("Docked Application Settings"),
487
					_("Docked Application Settings"),
467
					x, y, PWIDTH, PHEIGHT);
488
					x, y, PWIDTH, PHEIGHT);
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/moveres.c (-11 / +75 lines)
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;
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/placement.c (-25 / +45 lines)
Lines 40-45 Link Here
40
#include "appicon.h"
40
#include "appicon.h"
41
#include "dock.h"
41
#include "dock.h"
42
42
43
#include "xinerama.h"
43
44
44
extern WPreferences wPreferences;
45
extern WPreferences wPreferences;
45
46
Lines 144-153 Link Here
144
    /*
145
    /*
145
     * Find out screen boundaries.
146
     * Find out screen boundaries.
146
     */
147
     */
148
#ifdef XINERAMA
149
    WMRect rect = wGetRectForHead( scr, wGetHeadForPointerLocation( scr));
150
151
    sx1 = rect.pos.x;
152
    sy1 = rect.pos.y;
153
    sw = rect.size.width;
154
    sh = rect.size.height;
155
    sx2 = sx1 + sw;
156
    sy2 = sy1 + sh;
157
#else
147
    sx1 = 0;
158
    sx1 = 0;
148
    sy1 = 0;
159
    sy1 = 0;
149
    sx2 = scr->scr_width;
160
    sw = sx2 = scr->scr_width;
150
    sy2 = scr->scr_height;
161
    sh = sy2 = scr->scr_height;
162
#endif
163
    
151
    if (scr->dock) {
164
    if (scr->dock) {
152
	if (scr->dock->on_right_side)
165
	if (scr->dock->on_right_side)
153
            sx2 -= isize + DOCK_EXTRA_SPACE;
166
            sx2 -= isize + DOCK_EXTRA_SPACE;
Lines 155-162 Link Here
155
	    sx1 += isize + DOCK_EXTRA_SPACE;
168
	    sx1 += isize + DOCK_EXTRA_SPACE;
156
    }
169
    }
157
170
158
    sw = isize * (scr->scr_width/isize);
171
    sw = isize * (sw/isize);
159
    sh = isize * (scr->scr_height/isize);
172
    sh = isize * (sh/isize);
160
    fullW = (sx2-sx1)/isize;
173
    fullW = (sx2-sx1)/isize;
161
    fullH = (sy2-sy1)/isize;
174
    fullH = (sy2-sy1)/isize;
162
175
Lines 337-343 Link Here
337
350
338
static void
351
static void
339
smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
352
smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
340
                 unsigned int width, unsigned int height)
353
                 unsigned int width, unsigned int height,
354
		 WArea usableArea)
341
{
355
{
342
    WScreen *scr = wwin->screen_ptr;
356
    WScreen *scr = wwin->screen_ptr;
343
    int test_x = 0, test_y = Y_ORIGIN(scr);
357
    int test_x = 0, test_y = Y_ORIGIN(scr);
Lines 346-352 Link Here
346
    int min_isect, min_isect_x, min_isect_y;
360
    int min_isect, min_isect_x, min_isect_y;
347
    int sum_isect;
361
    int sum_isect;
348
    int extra_height;
362
    int extra_height;
349
    WArea usableArea = scr->totalUsableArea;
350
363
351
    if (wwin->frame)
364
    if (wwin->frame)
352
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
365
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
Lines 413-419 Link Here
413
426
414
static Bool
427
static Bool
415
autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
428
autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
416
                unsigned int width, unsigned int height, int tryCount)
429
                unsigned int width, unsigned int height, int tryCount,
430
		WArea usableArea)
417
{
431
{
418
    WScreen *scr = wwin->screen_ptr;
432
    WScreen *scr = wwin->screen_ptr;
419
    int test_x = 0, test_y = Y_ORIGIN(scr);
433
    int test_x = 0, test_y = Y_ORIGIN(scr);
Lines 421-427 Link Here
421
    int swidth, sx;
435
    int swidth, sx;
422
    WWindow *test_window;
436
    WWindow *test_window;
423
    int extra_height;
437
    int extra_height;
424
    WArea usableArea = scr->totalUsableArea;
425
    
438
    
426
    if (wwin->frame)
439
    if (wwin->frame)
427
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
440
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
Lines 527-536 Link Here
527
540
528
static void 
541
static void 
529
cascadeWindow(WScreen *scr, WWindow *wwin, int *x_ret, int *y_ret,
542
cascadeWindow(WScreen *scr, WWindow *wwin, int *x_ret, int *y_ret,
530
              unsigned int width, unsigned int height, int h)
543
              unsigned int width, unsigned int height, int h,
544
	      WArea usableArea)
531
{
545
{
532
    unsigned int extra_height;
546
    unsigned int extra_height;
533
    WArea usableArea = scr->totalUsableArea;
534
547
535
    if (wwin->frame)
548
    if (wwin->frame)
536
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
549
	extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
Lines 555-560 Link Here
555
{
568
{
556
    WScreen *scr = wwin->screen_ptr;
569
    WScreen *scr = wwin->screen_ptr;
557
    int h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
570
    int h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
571
    WArea usableArea;
572
573
#ifdef XINERAMA
574
    int head = wGetHeadForPointerLocation(scr);
575
    usableArea = wGetUsableAreaForHead(scr, head);
576
#else
577
    usableArea = wwin->screen_ptr->totalUsableArea;
578
#endif /* XINERAMA */
558
579
559
    switch (wPreferences.window_placement) {
580
    switch (wPreferences.window_placement) {
560
     case WPM_MANUAL:
581
     case WPM_MANUAL:
Lines 562-574 Link Here
562
	break;
583
	break;
563
584
564
     case WPM_SMART:
585
     case WPM_SMART:
565
	smartPlaceWindow(wwin, x_ret, y_ret, width, height);
586
	smartPlaceWindow(wwin, x_ret, y_ret, width, height, usableArea);
566
	break;
587
	break;
567
588
568
     case WPM_AUTO:
589
     case WPM_AUTO:
569
	if (autoPlaceWindow(wwin, x_ret, y_ret, width, height, 0)) {
590
	if (autoPlaceWindow(wwin, x_ret, y_ret, width, height, 0, usableArea)) {
570
	    break;
591
	    break;
571
	} else if (autoPlaceWindow(wwin, x_ret, y_ret, width, height, 1)) {
592
	} else if (autoPlaceWindow(wwin, x_ret, y_ret, width, height, 1, usableArea)) {
572
	    break;
593
	    break;
573
	}
594
	}
574
	/* there isn't a break here, because if we fail, it should fall
595
	/* there isn't a break here, because if we fail, it should fall
Lines 579-585 Link Here
579
        if (wPreferences.window_placement == WPM_AUTO)
600
        if (wPreferences.window_placement == WPM_AUTO)
580
            scr->cascade_index++;
601
            scr->cascade_index++;
581
602
582
	cascadeWindow(scr, wwin, x_ret, y_ret, width, height, h);
603
	cascadeWindow(scr, wwin, x_ret, y_ret, width, height, h, usableArea);
583
604
584
        if (wPreferences.window_placement == WPM_CASCADE)
605
        if (wPreferences.window_placement == WPM_CASCADE)
585
            scr->cascade_index++;
606
            scr->cascade_index++;
Lines 588-594 Link Here
588
     case WPM_RANDOM:
609
     case WPM_RANDOM:
589
	{
610
	{
590
	    int w, h, extra_height;
611
	    int w, h, extra_height;
591
	    WArea usableArea = scr->totalUsableArea;
592
612
593
            if (wwin->frame)
613
            if (wwin->frame)
594
                extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
614
                extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
Lines 611-626 Link Here
611
	*y_ret = 0;
631
	*y_ret = 0;
612
#endif
632
#endif
613
    }
633
    }
614
    
634
615
    if (*x_ret + width > scr->scr_width)
635
    if (*x_ret + width > usableArea.x2)
616
	*x_ret = scr->scr_width - width;
636
	*x_ret = usableArea.x2 - width;
617
    if (*x_ret < 0)
637
    if (*x_ret < usableArea.x1)
618
        *x_ret = 0;
638
        *x_ret = usableArea.x1;
619
639
620
    if (*y_ret + height > scr->scr_height)
640
    if (*y_ret + height > usableArea.y2)
621
	*y_ret = scr->scr_height - height;
641
	*y_ret = usableArea.y2 - height;
622
    if (*y_ret < 0)
642
    if (*y_ret < usableArea.y1)
623
        *y_ret = 0;
643
        *y_ret = usableArea.y1;
624
}
644
}
625
645
626
646
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/screen.c (-9 / +33 lines)
Lines 1155-1160 Link Here
1155
    int moved = 0;
1155
    int moved = 0;
1156
    int tol_w, tol_h;
1156
    int tol_w, tol_h;
1157
1157
1158
    int sx1, sy1, sx2, sy2;
1159
1160
#ifdef XINERAMA
1161
    WMRect rect;
1162
    int head;
1163
1164
    rect.pos.x = *x;
1165
    rect.pos.y = *y;
1166
    rect.size.width = width;
1167
    rect.size.height = height;
1168
1169
    head = wGetHeadForRect(scr, rect);
1170
    rect = wGetRectForHead(scr, head);
1171
1172
    sx1 = rect.pos.x;
1173
    sy1 = rect.pos.y;
1174
    sx2 = sx1 + rect.size.width;
1175
    sy2 = sy1 + rect.size.height;
1176
#else
1177
    sx1 = sy1 = 0;
1178
    sx2 = scr->scr_width;
1179
    sy2 = scr->scr_height;
1180
#endif
1181
1158
    if (width > 20)
1182
    if (width > 20)
1159
	tol_w = width/2;
1183
	tol_w = width/2;
1160
    else
1184
    else
Lines 1165-1179 Link Here
1165
    else
1189
    else
1166
	tol_h = 20;
1190
	tol_h = 20;
1167
1191
1168
    if (*x+width < 10)
1192
    if (*x + width < sx1 + 10)
1169
	*x = -tol_w, moved = 1;
1193
	*x = sx1 - tol_w, moved = 1;
1170
    else if (*x >= scr->scr_width - 10)
1194
    else if (*x >= sx2 - 10)
1171
	*x = scr->scr_width - tol_w - 1, moved = 1;
1195
	*x = sx2 - tol_w - 1, moved = 1;
1172
1196
1173
    if (*y < -height + 10)
1197
    if (*y < sy1 - height + 10)
1174
	*y = -tol_h, moved = 1;
1198
	*y = sy1 - tol_h, moved = 1;
1175
    else if (*y >= scr->scr_height - 10)
1199
    else if (*y >= sy2 - 10)
1176
	*y = scr->scr_height - tol_h - 1, moved = 1;
1200
	*y = sy2 - tol_h - 1, moved = 1;
1177
1201
1178
    return moved;
1202
    return moved;
1179
}
1203
}
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/window.c (+26 lines)
Lines 54-59 Link Here
54
#include "defaults.h"
54
#include "defaults.h"
55
#include "workspace.h"
55
#include "workspace.h"
56
56
57
#include "xinerama.h"
57
58
58
#ifdef MWM_HINTS
59
#ifdef MWM_HINTS
59
# include "motif.h"
60
# include "motif.h"
Lines 1109-1114 Link Here
1109
		y = transientOwner->frame_y +
1110
		y = transientOwner->frame_y +
1110
		    abs((transientOwner->frame->core->height - height)/3) + offs;
1111
		    abs((transientOwner->frame->core->height - height)/3) + offs;
1111
1112
1113
#ifdef XINERAMA
1114
		{
1115
		    WMRect rect;
1116
		    int head;
1117
1118
		    rect.pos.x = transientOwner->frame_x;
1119
		    rect.pos.y = transientOwner->frame_y;
1120
		    rect.size.width = transientOwner->frame->core->width;
1121
		    rect.size.height = transientOwner->frame->core->height;
1122
1123
		    head = wGetHeadForRect(scr, rect);
1124
		    rect = wGetRectForHead(scr, head);
1125
1126
		    if ( x < rect.pos.x)
1127
			x = rect.pos.x;
1128
		    else if ( x + width > rect.pos.x + rect.size.width)
1129
			x = rect.pos.x + rect.size.width - width;
1130
1131
		    if ( y < rect.pos.y)
1132
			y = rect.pos.y;
1133
		    else if ( y + height > rect.pos.y + rect.size.height)
1134
			y = rect.pos.y + rect.size.height - height;
1135
		}
1136
#else
1112
		if (x < 0)
1137
		if (x < 0)
1113
		    x = 0;
1138
		    x = 0;
1114
		else if (x + width > scr->scr_width)
1139
		else if (x + width > scr->scr_width)
Lines 1118-1123 Link Here
1118
		    y = 0;
1143
		    y = 0;
1119
		else if (y + height > scr->scr_height)
1144
		else if (y + height > scr->scr_height)
1120
		    y = scr->scr_height - height;
1145
		    y = scr->scr_height - height;
1146
#endif
1121
	    } else {
1147
	    } else {
1122
		PlaceWindow(wwin, &x, &y, width, height);
1148
		PlaceWindow(wwin, &x, &y, width, height);
1123
	    }
1149
	    }
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/xinerama.c (-5 / +97 lines)
Lines 53-58 Link Here
53
 *     0 if the rectangles do not intersect, 1 otherwise.
53
 *     0 if the rectangles do not intersect, 1 otherwise.
54
 */
54
 */
55
55
56
#if 0
56
typedef struct {
57
typedef struct {
57
    int x1, y1, x2, y2;
58
    int x1, y1, x2, y2;
58
} _Rectangle;
59
} _Rectangle;
Lines 97-114 Link Here
97
    rect1.x1 = x1;
98
    rect1.x1 = x1;
98
    rect1.y1 = y1;
99
    rect1.y1 = y1;
99
    rect1.x2 = x1+w1;
100
    rect1.x2 = x1+w1;
100
    rect1.x2 = y1+w1;
101
    rect1.y2 = y1+h1;
101
    
102
    
102
    rect2.x1 = x2;
103
    rect2.x1 = x2;
103
    rect2.y1 = y2;
104
    rect2.y1 = y2;
104
    rect2.x2 = x2+w2;
105
    rect2.x2 = x2+w2;
105
    rect2.x2 = y2+w2;
106
    rect2.y2 = y2+h2;
106
    
107
    
107
    if (intersect_rectangles(&rect1, &rect2, &result))
108
    if (intersect_rectangles(&rect1, &rect2, &result))
108
	return (result.x2-result.x1)*(result.y2-result.y1);
109
	return (result.x2-result.x1)*(result.y2-result.y1);
109
    else
110
    else
110
	return 0;
111
	return 0;
111
}
112
}
113
#else
114
/*
115
 * This function calculates the length of the intersection of two
116
 * line sections. (Hey, is that english?)
117
 */
118
static int
119
calcIntersectionLength(int p1, int l1, int p2, int l2)
120
{
121
    int isect;
122
    int tmp;
123
    
124
    if (p1 > p2) {
125
        tmp = p1;
126
        p1 = p2;
127
        p2 = tmp;
128
        tmp = l1;
129
        l1 = l2;
130
        l2 = tmp;
131
    }
132
133
    if (p1 + l1 < p2)
134
        isect = 0;
135
    else if (p2 + l2 < p1 + l1)
136
        isect = l2;
137
    else
138
        isect = p1 + l1 - p2;
139
        
140
    return isect;
141
}
142
143
144
/*
145
 * This function calculates the area of the intersection of two rectangles.
146
 */
147
static int
148
intersectArea(int x1, int y1, int w1, int h1, 
149
              int x2, int y2, int w2, int h2)
150
{
151
    return calcIntersectionLength(x1, w1, x2, w2)
152
           * calcIntersectionLength(y1, h1, y2, h2);
153
}
154
#endif
112
155
113
156
114
/* get the head that covers most of the rectangle */
157
/* get the head that covers most of the rectangle */
Lines 140-145 Link Here
140
	}
183
	}
141
    }
184
    }
142
185
186
    if ( best == -1)
187
	best = wGetHeadForPointerLocation(scr);
188
143
    return best;
189
    return best;
144
}
190
}
145
191
Lines 162-167 Link Here
162
    int i;	
208
    int i;	
163
209
164
    for (i = 0; i < scr->xine_count; i++) {
210
    for (i = 0; i < scr->xine_count; i++) {
211
#if 0
165
	int yy, xx;
212
	int yy, xx;
166
	
213
	
167
	xx = scr->xine_screens[i].x_org + scr->xine_screens[i].width;
214
	xx = scr->xine_screens[i].x_org + scr->xine_screens[i].width;
Lines 171-176 Link Here
171
	    point.x < xx && point.y < yy) {
218
	    point.x < xx && point.y < yy) {
172
	    return i;
219
	    return i;
173
	}
220
	}
221
#else
222
	XineramaScreenInfo *xsi = &scr->xine_screens[i];
223
224
	if ((unsigned)(point.x - xsi->x_org) < xsi->width &&
225
	    (unsigned)(point.y - xsi->y_org) < xsi->height)
226
	    return i;
227
#endif
174
    }
228
    }
175
    
229
    
176
    return scr->xine_primary_head;
230
    return scr->xine_primary_head;
Lines 184-190 Link Here
184
    int ble;
238
    int ble;
185
    unsigned int blo;
239
    unsigned int blo;
186
240
187
    
188
    if (!XQueryPointer(dpy, scr->root_win, &bla, &bla,
241
    if (!XQueryPointer(dpy, scr->root_win, &bla, &bla,
189
		       &point.x, &point.y,
242
		       &point.x, &point.y,
190
		       &ble, &ble,
243
		       &ble, &ble,
Lines 199-205 Link Here
199
{
252
{
200
    WMRect rect;
253
    WMRect rect;
201
254
202
    if (head < scr->xine_count) {
255
    if (scr->xine_count) {
256
#if 0
257
	if ( head < 0) 
258
	    head = 0;
259
	else if ( head >= scr->xine_count)
260
	    head %= scr->xine_count;
261
#endif
262
203
	rect.pos.x = scr->xine_screens[head].x_org;
263
	rect.pos.x = scr->xine_screens[head].x_org;
204
	rect.pos.y = scr->xine_screens[head].y_org;
264
	rect.pos.y = scr->xine_screens[head].y_org;
205
	rect.size.width = scr->xine_screens[head].width;
265
	rect.size.width = scr->xine_screens[head].width;
Lines 217-225 Link Here
217
    }
277
    }
218
}
278
}
219
279
220
280
#if 0
221
WMRect wGetUsableRectForHead(WScreen *scr, int head)
281
WMRect wGetUsableRectForHead(WScreen *scr, int head)
222
{
282
{
283
    WMRect rect;
284
223
    if (head < scr->xine_count) {
285
    if (head < scr->xine_count) {
224
	rect.pos.x = scr->xine_screens[head].x_org;
286
	rect.pos.x = scr->xine_screens[head].x_org;
225
	rect.pos.y = scr->xine_screens[head].y_org;
287
	rect.pos.y = scr->xine_screens[head].y_org;
Lines 237-241 Link Here
237
	return rect;
299
	return rect;
238
    }
300
    }
239
}
301
}
302
#endif
303
304
WArea wGetUsableAreaForHead(WScreen *scr, int head)
305
{
306
    WArea totalArea, usableArea = scr->totalUsableArea;
307
    WMRect rect = wGetRectForHead(scr, head);
308
309
    totalArea.x1 = rect.pos.x;
310
    totalArea.y1 = rect.pos.y;
311
    totalArea.x2 = totalArea.x1 + rect.size.width;
312
    totalArea.y2 = totalArea.y1 + rect.size.height;
313
314
    usableArea.x1 = WMAX(totalArea.x1, usableArea.x1);
315
    usableArea.y1 = WMAX(totalArea.y1, usableArea.y1);
316
    usableArea.x2 = WMIN(totalArea.x2, usableArea.x2);
317
    usableArea.y2 = WMIN(totalArea.y2, usableArea.y2);
318
319
    return usableArea;
320
}
321
322
WMPoint wGetCenterForHead(WScreen *scr, int head, int width, int height)
323
{
324
    WMPoint p;
325
    WMRect rect = wGetRectForHead(scr, head);
326
327
    p.x = rect.pos.x + (rect.size.width - width)/2;
328
    p.y = rect.pos.y + (rect.size.height - height)/2;
329
330
    return p;
331
}
240
332
241
#endif 
333
#endif 
(-)/var/tmp/portage/WindowMaker-0.80.1-r2/work/WindowMaker-0.80.1/src/xinerama.h (+4 lines)
Lines 41-46 Link Here
41
41
42
WMRect wGetUsableRectForHead(WScreen *scr, int head);
42
WMRect wGetUsableRectForHead(WScreen *scr, int head);
43
43
44
WArea wGetUsableAreaForHead(WScreen *scr, int head);
45
46
WMPoint wGetCenterForHead(WScreen *scr, int head, int width, int height);
47
44
#endif
48
#endif
45
49
46
50

Return to bug 24751