forked from enlightenment/enlightenment
aleksej patch for segv on moving window to a new desk if its negative desk
count :) SVN revision: 18817
This commit is contained in:
parent
d8c635f964
commit
9bb58eca2c
|
@ -700,11 +700,43 @@ ACT_FN_GO(window_desk_move_by)
|
||||||
{
|
{
|
||||||
E_Desk *desk;
|
E_Desk *desk;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
int to_x = 0, to_y = 0;
|
||||||
|
|
||||||
e_desk_xy_get(bd->desk, &dx, &dy);
|
e_desk_xy_get(bd->desk, &dx, &dy);
|
||||||
desk = e_desk_at_xy_get(bd->zone, dx + x, dy + y);
|
|
||||||
|
to_x = dx + x; to_y = dy + y;
|
||||||
|
while( ( desk = e_desk_at_xy_get(bd->zone, to_x , to_y ) ) == NULL )
|
||||||
|
{
|
||||||
|
// here we are out of our desktop range
|
||||||
|
while( to_x >= bd->zone->desk_x_count )
|
||||||
|
{
|
||||||
|
to_x -= bd->zone->desk_x_count;
|
||||||
|
to_y ++;
|
||||||
|
}
|
||||||
|
while( to_x < 0 )
|
||||||
|
{
|
||||||
|
to_x += bd->zone->desk_x_count;
|
||||||
|
to_y --;
|
||||||
|
}
|
||||||
|
|
||||||
|
while( to_y >= bd->zone->desk_y_count )
|
||||||
|
{
|
||||||
|
to_y -= bd->zone->desk_y_count;
|
||||||
|
}
|
||||||
|
while( to_y < 0 )
|
||||||
|
{
|
||||||
|
to_y += bd->zone->desk_y_count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (desk)
|
if (desk)
|
||||||
e_border_desk_set(bd, desk);
|
{
|
||||||
|
// switch desktop. Quite usefull from the interface point of view.
|
||||||
|
e_zone_desk_flip_by( bd->zone, to_x - dx , to_y - dy );
|
||||||
|
// send the border to the required desktop.
|
||||||
|
e_border_desk_set(bd, desk);
|
||||||
|
e_border_focus_set( bd, 1, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -313,7 +313,9 @@ e_desk_at_xy_get(E_Zone *zone, int x, int y)
|
||||||
|
|
||||||
if ((x >= zone->desk_x_count) || (y >= zone->desk_y_count))
|
if ((x >= zone->desk_x_count) || (y >= zone->desk_y_count))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
else if ((x < 0) || (y < 0))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return zone->desks[x + (y * zone->desk_x_count)];
|
return zone->desks[x + (y * zone->desk_x_count)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue