summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_gadcon.c82
3 files changed, 56 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 45cab25..88725b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
12013-12-04 Mike Blumenkrantz 12013-12-04 Mike Blumenkrantz
2 2
3 * Fixed cases where gadgets would sometimes reorder randomly on shelves
4
52013-12-04 Mike Blumenkrantz
6
3 * Fixed NoDisplay entries in Everything launcher 7 * Fixed NoDisplay entries in Everything launcher
4 * Removed capabilities to alter gadgets in EFM toolbars 8 * Removed capabilities to alter gadgets in EFM toolbars
5 9
diff --git a/NEWS b/NEWS
index 9b1aca9..50bd8c6 100644
--- a/NEWS
+++ b/NEWS
@@ -267,3 +267,4 @@ Fixes:
267 * Fix unfocusing of disabled widgets 267 * Fix unfocusing of disabled widgets
268 * Fix crash when activating e's restart from start gadget triggered menu 268 * Fix crash when activating e's restart from start gadget triggered menu
269 * Further improve initial window placement coordinates 269 * Further improve initial window placement coordinates
270 * Fixed cases where gadgets would sometimes reorder randomly on shelves
diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c
index 76838a9..979c3b4 100644
--- a/src/bin/e_gadcon.c
+++ b/src/bin/e_gadcon.c
@@ -2320,7 +2320,7 @@ _e_gadcon_client_inject(E_Gadcon *gc, E_Gadcon_Client *gcc, int x, int y)
2320 Eina_List *l; 2320 Eina_List *l;
2321 E_Gadcon_Client *gcc2; 2321 E_Gadcon_Client *gcc2;
2322 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; 2322 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0;
2323 int seq = 1; 2323 int i;
2324 2324
2325 /* Check if the gadcon client is in place */ 2325 /* Check if the gadcon client is in place */
2326 if (!gcc->hidden) 2326 if (!gcc->hidden)
@@ -2337,44 +2337,64 @@ _e_gadcon_client_inject(E_Gadcon *gc, E_Gadcon_Client *gcc, int x, int y)
2337 /* If x, y is not inside any gadcon client, seq will be 0 and it's position 2337 /* If x, y is not inside any gadcon client, seq will be 0 and it's position
2338 * will later be used for placement. */ 2338 * will later be used for placement. */
2339 gcc->state_info.seq = 0; 2339 gcc->state_info.seq = 0;
2340 EINA_LIST_FOREACH(gc->clients, l, gcc2) 2340 for (i = 0; i < 2; i++)
2341 { 2341 {
2342 if (gcc == gcc2) continue; 2342 /* two passes:
2343 if (gcc2->hidden) continue; 2343 * - find sequence position to inject
2344 if (gcc2->o_frame) 2344 * - update other gadget sequences
2345 evas_object_geometry_get(gcc2->o_frame, &cx, &cy, &cw, &ch); 2345 */
2346 else if (gcc2->o_base) 2346 EINA_LIST_FOREACH(gc->clients, l, gcc2)
2347 evas_object_geometry_get(gcc2->o_base, &cx, &cy, &cw, &ch);
2348 else return; /* make clang happy */
2349 if (e_gadcon_layout_orientation_get(gc->o_container))
2350 { 2347 {
2351 if (E_INSIDE(x, y, cx, cy, cw / 2, ch)) 2348 if (gcc == gcc2) continue;
2349 if (i == 1)
2352 { 2350 {
2353 gcc->state_info.seq = seq++; 2351 /* on second pass, increment all sequence numbers which are
2354 gcc2->state_info.seq = seq++; 2352 * >= the injected gadget's sequence to get ordering right
2353 */
2354 if (gcc2->state_info.seq >= gcc->state_info.seq)
2355 gcc2->state_info.seq++;
2356 continue;
2355 } 2357 }
2356 else if (E_INSIDE(x, y, cx + cw / 2, cy, cw / 2, ch)) 2358 if (gcc2->hidden) continue;
2359 if (gcc2->o_frame)
2360 evas_object_geometry_get(gcc2->o_frame, &cx, &cy, &cw, &ch);
2361 else if (gcc2->o_base)
2362 evas_object_geometry_get(gcc2->o_base, &cx, &cy, &cw, &ch);
2363 else return; /* make clang happy */
2364 if (e_gadcon_layout_orientation_get(gc->o_container))
2357 { 2365 {
2358 gcc2->state_info.seq = seq++; 2366 /* inside left half of gadget */
2359 gcc->state_info.seq = seq++; 2367 if (E_INSIDE(x, y, cx, cy, cw / 2, ch))
2368 {
2369 /* place before */
2370 gcc->state_info.seq = gcc2->state_info.seq;
2371 break;
2372 }
2373 /* inside right half of gadget */
2374 else if (E_INSIDE(x, y, cx + cw / 2, cy, cw / 2, ch))
2375 {
2376 /* place after */
2377 gcc->state_info.seq = gcc2->state_info.seq + 1;
2378 break;
2379 }
2360 } 2380 }
2361 else 2381 else
2362 gcc2->state_info.seq = seq++;
2363 }
2364 else
2365 {
2366 if (E_INSIDE(x, y, cx, cy, cw, ch / 2))
2367 {
2368 gcc->state_info.seq = seq++;
2369 gcc2->state_info.seq = seq++;
2370 }
2371 else if (E_INSIDE(x, y, cx, cy + ch / 2, cw, ch / 2))
2372 { 2382 {
2373 gcc2->state_info.seq = seq++; 2383 /* top half of gadget */
2374 gcc->state_info.seq = seq++; 2384 if (E_INSIDE(x, y, cx, cy, cw, ch / 2))
2385 {
2386 /* place before */
2387 gcc->state_info.seq = gcc2->state_info.seq;
2388 break;
2389 }
2390 /* bottom half of gadget */
2391 else if (E_INSIDE(x, y, cx, cy + ch / 2, cw, ch / 2))
2392 {
2393 /* place after */
2394 gcc->state_info.seq = gcc2->state_info.seq + 1;
2395 break;
2396 }
2375 } 2397 }
2376 else
2377 gcc2->state_info.seq = seq++;
2378 } 2398 }
2379 } 2399 }
2380} 2400}