summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-06-01 18:50:33 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-06-01 18:50:33 (GMT)
commit3acf47c4d9a5a5e060f590628a0a3f2b2c89a042 (patch)
tree0b7243a54322f280330e26b2b528963034ad166c
parent8de179385cd2fc88059b773a97a214d857ec5b9a (diff)
parent47ff1264914b87d922a13ea6b1a49f99adba53f2 (diff)
downloadtk-3acf47c4d9a5a5e060f590628a0a3f2b2c89a042.zip
tk-3acf47c4d9a5a5e060f590628a0a3f2b2c89a042.tar.gz
tk-3acf47c4d9a5a5e060f590628a0a3f2b2c89a042.tar.bz2
Fixed bug [1292219fff] - Propagated MapNotify and UnmapNotify events of a panedwindow to its children
-rw-r--r--generic/tkPanedWindow.c9
-rw-r--r--tests/panedwindow.test17
2 files changed, 26 insertions, 0 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 384a3eb..74c9999 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -1340,6 +1340,7 @@ PanedWindowEventProc(
XEvent *eventPtr) /* Information about event. */
{
PanedWindow *pwPtr = clientData;
+ int i;
if (eventPtr->type == Expose) {
if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) {
@@ -1354,6 +1355,14 @@ PanedWindowEventProc(
}
} else if (eventPtr->type == DestroyNotify) {
DestroyPanedWindow(pwPtr);
+ } else if (eventPtr->type == UnmapNotify) {
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ Tk_UnmapWindow(pwPtr->slaves[i]->tkwin);
+ }
+ } else if (eventPtr->type == MapNotify) {
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ Tk_MapWindow(pwPtr->slaves[i]->tkwin);
+ }
}
}
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index f2e01e8..7c7e138 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -5087,6 +5087,23 @@ test panedwindow-25.1 {DestroyPanedWindow} -setup {
}
set result {}
} -result {}
+test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves} {
+ panedwindow .pw
+ .pw add [button .pw.b]
+ pack .pw
+ update
+ set result [winfo ismapped .pw.b]
+ pack forget .pw
+ update
+ lappend result [winfo ismapped .pw.b]
+ lappend result [winfo ismapped .pw]
+ pack .pw
+ update
+ lappend result [winfo ismapped .pw]
+ lappend result [winfo ismapped .pw.b]
+ destroy .pw .pw.b
+ set result
+} {1 0 0 1 1}
test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {