ecore-x - fix barrier rect setup for screen edge barriers
@fix
This commit is contained in:
parent
d18d55d66a
commit
14049351d5
|
@ -467,7 +467,7 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
||||||
Region reg, reg2, reg3;
|
Region reg, reg2, reg3;
|
||||||
Window rwin, cwin;
|
Window rwin, cwin;
|
||||||
int rx, ry, wx, wy;
|
int rx, ry, wx, wy;
|
||||||
int i, j;
|
int i;
|
||||||
int closest_dist, dist;
|
int closest_dist, dist;
|
||||||
int sx, sy, dx, dy;
|
int sx, sy, dx, dy;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
|
@ -537,50 +537,48 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
||||||
bar_alloc = 0;
|
bar_alloc = 0;
|
||||||
if ((!screens) || (num <= 0)) return;
|
if ((!screens) || (num <= 0)) return;
|
||||||
|
|
||||||
// set up new ones given the screen list given
|
// new region
|
||||||
|
reg = XCreateRegion();
|
||||||
|
// add each screen rect + 1 pixel around it to reg
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
XRectangle xrect;
|
XRectangle xrect;
|
||||||
|
|
||||||
reg = XCreateRegion();
|
|
||||||
reg2 = XCreateRegion();
|
reg2 = XCreateRegion();
|
||||||
xrect.x = screens[i].x - 1;
|
xrect.x = screens[i].x - 1;
|
||||||
xrect.y = screens[i].y - 1;
|
xrect.y = screens[i].y - 1;
|
||||||
xrect.width = screens[i].width + 2;
|
xrect.width = screens[i].width + 2;
|
||||||
xrect.height = screens[i].height + 2;
|
xrect.height = screens[i].height + 2;
|
||||||
XUnionRectWithRegion(&xrect, reg, reg2);
|
XUnionRectWithRegion(&xrect, reg, reg2);
|
||||||
XDestroyRegion(reg);
|
XDestroyRegion(reg);
|
||||||
reg = reg2;
|
reg = reg2;
|
||||||
|
}
|
||||||
|
// del the content of each screen from the above
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
XRectangle xrect;
|
||||||
|
|
||||||
// reg == screen i + 1 pixel surrounding it
|
// create just a rect with the screen in it
|
||||||
for (j = 0; j < num; j++)
|
reg2 = XCreateRegion();
|
||||||
{
|
reg3 = XCreateRegion();
|
||||||
// create a region representing screen j
|
xrect.x = screens[i].x;
|
||||||
reg2 = XCreateRegion();
|
xrect.y = screens[i].y;
|
||||||
reg3 = XCreateRegion();
|
xrect.width = screens[i].width;
|
||||||
xrect.x = screens[j].x;
|
xrect.height = screens[i].height;
|
||||||
xrect.y = screens[j].y;
|
XUnionRectWithRegion(&xrect, reg3, reg2);
|
||||||
xrect.width = screens[j].width;
|
XDestroyRegion(reg3);
|
||||||
xrect.height = screens[j].height;
|
|
||||||
XUnionRectWithRegion(&xrect, reg2, reg3);
|
|
||||||
XDestroyRegion(reg2);
|
|
||||||
reg2 = reg3;
|
|
||||||
// reg2 == screen j
|
|
||||||
|
|
||||||
reg3 = XCreateRegion();
|
|
||||||
XSubtractRegion(reg, reg2, reg3);
|
|
||||||
XDestroyRegion(reg);
|
|
||||||
XDestroyRegion(reg2);
|
|
||||||
reg = reg3;
|
|
||||||
// reg now has had screen j cut out of the boundary
|
|
||||||
}
|
|
||||||
// reg is the result of starting with screen i and then with a
|
|
||||||
// 1 pixel boundary around it havnig adjacent screens "cut out"
|
|
||||||
// of that boundary leaving only extra bounds where no screens
|
|
||||||
// are adjacent
|
|
||||||
|
|
||||||
|
// now subtract it
|
||||||
|
reg3 = XCreateRegion();
|
||||||
|
XSubtractRegion(reg, reg2, reg3);
|
||||||
|
XDestroyRegion(reg);
|
||||||
|
XDestroyRegion(reg2);
|
||||||
|
reg = reg3;
|
||||||
|
}
|
||||||
|
if (reg)
|
||||||
|
{
|
||||||
// walk rects and create barriers
|
// walk rects and create barriers
|
||||||
for (j = 0; j < reg->numRects; j++)
|
for (i = 0; i < reg->numRects; i++)
|
||||||
{
|
{
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
|
|
||||||
|
@ -592,14 +590,15 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
||||||
if (!t)
|
if (!t)
|
||||||
{
|
{
|
||||||
bar_num--;
|
bar_num--;
|
||||||
|
XDestroyRegion(reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bar = t;
|
bar = t;
|
||||||
}
|
}
|
||||||
x1 = reg->rects[j].x1;
|
x1 = reg->rects[i].x1;
|
||||||
y1 = reg->rects[j].y1;
|
y1 = reg->rects[i].y1;
|
||||||
x2 = reg->rects[j].x2 - 1;
|
x2 = reg->rects[i].x2 - 1;
|
||||||
y2 = reg->rects[j].y2 - 1;
|
y2 = reg->rects[i].y2 - 1;
|
||||||
bar[bar_num - 1] =
|
bar[bar_num - 1] =
|
||||||
XFixesCreatePointerBarrier(_ecore_x_disp,
|
XFixesCreatePointerBarrier(_ecore_x_disp,
|
||||||
DefaultRootWindow(_ecore_x_disp),
|
DefaultRootWindow(_ecore_x_disp),
|
||||||
|
|
Loading…
Reference in New Issue