summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-18 18:48:37 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-18 18:51:30 +0900
commit3f2ea651123c16693240999657e337122a4f7c73 (patch)
treefeda35c7000ded4ebb840577b18317a83aad46bc
parent1974f5da2d10d83285e57dd314cc43829438c0fe (diff)
e window stakcs - fix bugs with stacks by doing stack stuff in idle eval
this moves ensuring windows are centered on their parent even when moved etc. for stack (and move the whole stack not just the specific window) in the idle enterer int he pahse before all the client evals take place. much cleaner!
-rw-r--r--src/bin/e_client.c146
1 files changed, 49 insertions, 97 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 0ebd9b1d1..bc4e25447 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -1582,28 +1582,7 @@ _e_client_cb_evas_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
1582 evas_object_geometry_get(ec->frame, &x, &y, NULL, NULL); 1582 evas_object_geometry_get(ec->frame, &x, &y, NULL, NULL);
1583 if (ec->stack.prev || ec->stack.next) 1583 if (ec->stack.prev || ec->stack.next)
1584 { 1584 {
1585 if (ec->stack.ignore == 0) 1585 // do nothing - handled by idle enterer eval
1586 {
1587 Eina_List *l, *list = e_client_stack_list_prepare(ec);
1588 E_Client *child;
1589 Evas_Coord bx, by, bw, bh, cw, ch, dx, dy;
1590
1591 child = e_client_stack_bottom_get(ec);
1592 dx = x - ec->pre_cb.x;
1593 dy = y - ec->pre_cb.y;
1594 if (child != ec)
1595 evas_object_move(child->frame, child->x + dx, child->y + dy);
1596 evas_object_geometry_get(child->frame, &bx, &by, &bw, &bh);
1597 EINA_LIST_FOREACH(list->next, l, child)
1598 {
1599 if (child == ec) continue;
1600 evas_object_geometry_get(child->frame, NULL, NULL, &cw, &ch);
1601 evas_object_move(child->frame,
1602 bx + ((bw - cw) / 2),
1603 by + ((bh - ch) / 2));
1604 }
1605 e_client_stack_list_finish(list);
1606 }
1607 } 1586 }
1608 else 1587 else
1609 { 1588 {
@@ -1642,81 +1621,7 @@ _e_client_cb_evas_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
1642 evas_object_geometry_get(ec->frame, &x, &y, &w, &h); 1621 evas_object_geometry_get(ec->frame, &x, &y, &w, &h);
1643 if (ec->stack.prev || ec->stack.next) 1622 if (ec->stack.prev || ec->stack.next)
1644 { 1623 {
1645 if (ec->stack.ignore == 0) 1624 // do nothing - handled by idle enterer eval
1646 {
1647 Eina_List *l, *list = e_client_stack_list_prepare(ec);
1648 E_Client *child;
1649 Evas_Coord bx, by, bw, bh, cw, ch;
1650
1651 if (e_client_util_resizing_get(ec))
1652 {
1653 if (ec->dialog)
1654 {
1655 child = list->data;
1656 evas_object_geometry_get(child->frame, &bx, &by, &bw, &bh);
1657 EINA_LIST_FOREACH(list, l, child)
1658 {
1659 if (child == ec) continue;
1660 if (!ec->dialog)
1661 {
1662 evas_object_resize(child->frame, bw, bh);
1663 cw = bw;
1664 ch = bh;
1665 }
1666 else
1667 evas_object_geometry_get(child->frame, NULL, NULL, &cw, &ch);
1668 evas_object_move(child->frame,
1669 bx + ((bw - cw) / 2),
1670 by + ((bh - ch) / 2));
1671 }
1672 }
1673 else
1674 {
1675 child = e_client_stack_bottom_get(ec);
1676 evas_object_move(child->frame, x, y);
1677 evas_object_resize(child->frame, w, h);
1678 EINA_LIST_FOREACH(list->next, l, child)
1679 {
1680 if (child == ec) continue;
1681 if (!ec->dialog)
1682 {
1683 evas_object_move(child->frame, x, y);
1684 evas_object_resize(child->frame, w, h);
1685 cw = w;
1686 ch = h;
1687 }
1688 else
1689 evas_object_geometry_get(child->frame, NULL, NULL, &cw, &ch);
1690 evas_object_move(child->frame,
1691 x + ((w - cw) / 2),
1692 y + ((h - ch) / 2));
1693 }
1694 }
1695 }
1696 else
1697 {
1698 if (ec == e_client_stack_bottom_get(ec))
1699 {
1700 EINA_LIST_FOREACH(list->next, l, child)
1701 {
1702 if (child == ec) continue;
1703 if (!ec->dialog)
1704 {
1705 evas_object_move(child->frame, x, y);
1706 evas_object_resize(child->frame, w, h);
1707 cw = w;
1708 ch = h;
1709 }
1710 else
1711 evas_object_geometry_get(child->frame, NULL, NULL, &cw, &ch);
1712 evas_object_move(child->frame,
1713 x + ((w - cw) / 2),
1714 y + ((h - ch) / 2));
1715 }
1716 }
1717 }
1718 e_client_stack_list_finish(list);
1719 }
1720 } 1625 }
1721 else 1626 else
1722 { 1627 {
@@ -2542,6 +2447,53 @@ e_client_idler_before(void)
2542 if (e_config->screen_limits != E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL) 2447 if (e_config->screen_limits != E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL)
2543 _e_client_move_lost_window_to_center(ec); 2448 _e_client_move_lost_window_to_center(ec);
2544 } 2449 }
2450 // handle window stack
2451 if (!ec->stack.prev && ec->stack.next)
2452 {
2453 if (ec->stack.ignore == 0)
2454 {
2455 Eina_List *ll, *list = e_client_stack_list_prepare(ec);
2456 E_Client *child, *bottom, *moving = NULL, *rel;
2457 int x, y;
2458
2459 bottom = rel = e_client_stack_bottom_get(ec);
2460 EINA_LIST_FOREACH(list, ll, child)
2461 {
2462 if (child->moving)
2463 {
2464 moving = child;
2465 break;
2466 }
2467 }
2468 if (moving)
2469 {
2470 Evas_Coord ox, oy;
2471
2472 evas_object_geometry_get(ec->frame, &ox, &oy, NULL, NULL);
2473 rel = moving;
2474 }
2475 EINA_LIST_FOREACH(list, ll, child)
2476 {
2477 if (moving)
2478 {
2479 if (child == moving) continue;
2480 }
2481 else if (child == bottom) continue;
2482 x = rel->x + ((rel->w - child->w) / 2);
2483 y = rel->y + ((rel->h - child->h) / 2);
2484 if ((x != child->x) || (y != child->y))
2485 {
2486 child->x = x;
2487 child->y = y;
2488 child->pre_cb.x = x;
2489 child->pre_cb.y = y;
2490 child->changes.pos = 1;
2491 child->changed = 1;
2492 }
2493 }
2494 e_client_stack_list_finish(list);
2495 }
2496 }
2545 } 2497 }
2546 2498
2547 if (_e_client_layout_cb) 2499 if (_e_client_layout_cb)