Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_actions.c e_desk.c Log Message: aleksej patch for segv on moving window to a new desk if its negative desk count :) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_actions.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- e_actions.c 3 Dec 2005 15:39:25 -0000 1.43 +++ e_actions.c 4 Dec 2005 03:25:33 -0000 1.44 @@ -700,11 +700,43 @@ { E_Desk *desk; int dx, dy; + int to_x = 0, to_y = 0; 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) - 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); + } } } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_desk.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- e_desk.c 3 Dec 2005 15:39:25 -0000 1.54 +++ e_desk.c 4 Dec 2005 03:25:34 -0000 1.55 @@ -313,7 +313,9 @@ if ((x >= zone->desk_x_count) || (y >= zone->desk_y_count)) return NULL; - + else if ((x < 0) || (y < 0)) + return NULL; + return zone->desks[x + (y * zone->desk_x_count)]; } ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs