summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-10-29 23:01:08 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-10-29 23:01:08 (GMT)
commit5dbd806ccb9de26b2c953153fc9057fbc7fe729b (patch)
tree961dc8d4929836006c5b49dc593b154d2fb84277 /generic
parente2dd87abf18c856f4cda284db55b313e882e919f (diff)
downloadtk-5dbd806ccb9de26b2c953153fc9057fbc7fe729b.zip
tk-5dbd806ccb9de26b2c953153fc9057fbc7fe729b.tar.gz
tk-5dbd806ccb9de26b2c953153fc9057fbc7fe729b.tar.bz2
Enhance the tests for <<NoManagedChild>>, and fix the implementation so that this event only fires when the last slave is forgotten/removed.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkGrid.c12
-rw-r--r--generic/tkPack.c8
2 files changed, 12 insertions, 8 deletions
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 4711685..ec22016 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -1735,13 +1735,9 @@ ArrangeGrid(
* If the master has no slaves anymore, then don't change the master size.
* Otherwise there is no way to "relinquish" control over the master
* so another geometry manager can take over.
- *
- * Sends the event "NoManagedChild" to the master to inform it about there
- * being no managed children inside it.
*/
if (masterPtr->slavePtr == NULL) {
- TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL);
return;
}
@@ -2780,11 +2776,15 @@ Unlink(
/*
* If we have emptied this master from slaves it means we are no longer
* handling it and should mark it as free.
+ *
+ * Send the event "NoManagedChild" to the master to inform it about there
+ * being no managed children inside it.
*/
if ((masterPtr->slavePtr == NULL) && (masterPtr->flags & ALLOCED_MASTER)) {
TkFreeGeometryMaster(masterPtr->tkwin, "grid");
masterPtr->flags &= ~ALLOCED_MASTER;
+ TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL);
}
}
@@ -3512,11 +3512,15 @@ ConfigureSlaves(
/*
* If we have emptied this master from slaves it means we are no longer
* handling it and should mark it as free.
+ *
+ * Send the event "NoManagedChild" to the master to inform it about there
+ * being no managed children inside it.
*/
if (masterPtr->slavePtr == NULL && masterPtr->flags & ALLOCED_MASTER) {
TkFreeGeometryMaster(masterPtr->tkwin, "grid");
masterPtr->flags &= ~ALLOCED_MASTER;
+ TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL);
}
return TCL_OK;
diff --git a/generic/tkPack.c b/generic/tkPack.c
index ef6e30e..f2ba642 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -613,13 +613,9 @@ ArrangePacking(
* If the master has no slaves anymore, then leave the master's size as-is.
* Otherwise there is no way to "relinquish" control over the master
* so another geometry manager can take over.
- *
- * Sends the event "NoManagedChild" to the master to inform it about there
- * being no managed children inside it.
*/
if (masterPtr->slavePtr == NULL) {
- TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL);
return;
}
@@ -1378,11 +1374,15 @@ Unlink(
/*
* If we have emptied this master from slaves it means we are no longer
* handling it and should mark it as free.
+ *
+ * Send the event "NoManagedChild" to the master to inform it about there
+ * being no managed children inside it.
*/
if ((masterPtr->slavePtr == NULL) && (masterPtr->flags & ALLOCED_MASTER)) {
TkFreeGeometryMaster(masterPtr->tkwin, "pack");
masterPtr->flags &= ~ALLOCED_MASTER;
+ TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL);
}
}