Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Handle changes in transient_for and client_leader after map. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.497 retrieving revision 1.498 diff -u -3 -r1.497 -r1.498 --- e_border.c 10 Jun 2006 21:10:14 -0000 1.497 +++ e_border.c 10 Jun 2006 21:45:43 -0000 1.498 @@ -4522,7 +4522,33 @@ /* fetch any info queued to be fetched */ if (bd->client.icccm.fetch.client_leader) { + /* TODO: What do to if the client leader isn't mapped yet? */ + E_Border *bd_leader = NULL; + bd->client.icccm.client_leader = ecore_x_icccm_client_leader_get(bd->client.win); + if (bd->client.icccm.client_leader) + bd_leader = e_border_find_by_client_window(bd->client.icccm.client_leader); + if (bd->leader) + { + if (bd->leader != bd_leader) + { + bd->leader->group = evas_list_remove(bd->leader->group, bd); + if (bd->leader->modal == bd) bd->leader->modal = NULL; + bd->leader = NULL; + } + else + bd_leader = NULL; + } + /* If this border is the leader of the group, don't register itself */ + if ((bd_leader) && (bd_leader != bd)) + { + bd_leader->group = evas_list_append(bd_leader->group, bd); + bd->leader = bd_leader; + /* Only set the window modal to the leader it there is no parent */ + if ((e_config->modal_windows) && (bd->client.netwm.state.modal) && + ((!bd->parent) || (bd->parent->modal != bd))) + bd->leader->modal = bd; + } bd->client.icccm.fetch.client_leader = 0; } if (bd->client.icccm.fetch.title) @@ -4758,7 +4784,32 @@ } if (bd->client.icccm.fetch.transient_for) { + /* TODO: What do to if the transient for isn't mapped yet? */ + E_Border *bd_parent = NULL; + bd->client.icccm.transient_for = ecore_x_icccm_transient_for_get(bd->client.win); + if (bd->client.icccm.transient_for) + bd_parent = e_border_find_by_client_window(bd->client.icccm.transient_for); + /* If we already have a parent, remove it */ + if (bd->parent) + { + if (bd_parent != bd->parent) + { + bd->parent->transients = evas_list_remove(bd->parent->transients, bd); + if (bd->parent->modal == bd) bd->parent->modal = NULL; + bd->parent = NULL; + } + else + bd_parent = NULL; + } + if ((bd_parent) && (bd_parent != bd)) + { + bd_parent->transients = evas_list_append(bd_parent->transients, bd); + bd->parent = bd_parent; + e_border_layer_set(bd, bd->parent->layer); + if ((e_config->modal_windows) && (bd->client.netwm.state.modal)) + bd->parent->modal = bd; + } bd->client.icccm.fetch.transient_for = 0; } if (bd->client.icccm.fetch.window_role) @@ -4923,6 +4974,16 @@ bd->client.border.name = NULL; bd->client.border.changed = 1; } + if (bd->parent) + { + if ((e_config->modal_windows) && (bd->client.netwm.state.modal)) + bd->parent->modal = bd; + } + else if (bd->leader) + { + if ((e_config->modal_windows) && (bd->client.netwm.state.modal)) + bd->leader->modal = bd; + } bd->client.netwm.update.state = 0; } @@ -5237,34 +5298,6 @@ if (bd->new_client) { - if (bd->client.icccm.transient_for) - { - E_Border *bd_parent; - - bd_parent = e_border_find_by_client_window(bd->client.icccm.transient_for); - if ((bd_parent) && (bd_parent != bd)) - { - bd_parent->transients = evas_list_append(bd_parent->transients, bd); - bd->parent = bd_parent; - e_border_layer_set(bd, bd->parent->layer); - if ((e_config->modal_windows) && (bd->client.netwm.state.modal)) - bd->parent->modal = bd; - } - } - if (bd->client.icccm.client_leader) - { - E_Border *bd_leader; - - bd_leader = e_border_find_by_client_window(bd->client.icccm.client_leader); - /* If this border is the leader of the group, don't register itself */ - if ((bd_leader) && (bd_leader != bd)) - { - bd_leader->group = evas_list_append(bd_leader->group, bd); - bd->leader = bd_leader; - if ((e_config->modal_windows) && (bd->client.netwm.state.modal)) - bd->leader->modal = bd; - } - } // printf("##- NEW CLIENT SETUP 0x%x\n", bd->client.win); if (bd->re_manage) { _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs