summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-04 22:21:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-04 22:21:30 (GMT)
commitf0d4ff8d29c015e389b8947e4c1883b804b7303c (patch)
tree9b264e72fc5d344c908995eb352468b88fefdd4b
parentd9df4d392d528489c139f609482da610a6c4321e (diff)
parent5161961e105852e93b7331def1f5868d79bcfeb8 (diff)
downloadtk-f0d4ff8d29c015e389b8947e4c1883b804b7303c.zip
tk-f0d4ff8d29c015e389b8947e4c1883b804b7303c.tar.gz
tk-f0d4ff8d29c015e389b8947e4c1883b804b7303c.tar.bz2
[Bug 2768586]: Menu posting problem on dual monitors
-rw-r--r--ChangeLog4
-rw-r--r--library/menu.tcl17
-rw-r--r--unix/Makefile.in2
3 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 047b464..f4dfe0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/menu.tcl: [Bug 2768586]: Menu posting problem on dual monitors
+
2012-04-29 Jan Nijtmans <nijtmans@users.sf.net>
* library/tk.tcl: [Bug 533519]: Window placement with multiple screens
diff --git a/library/menu.tcl b/library/menu.tcl
index e00dad9..8337eae 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -286,8 +286,8 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set x [winfo rootx $w]
set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}]
# if we go offscreen to the top, show as 'below'
- if {$y < 0} {
- set y [expr {[winfo rooty $w] + [winfo height $w]}]
+ if {$y < [winfo vrooty $w]} {
+ set y [expr {[winfo vrooty $w] + [winfo rooty $w] + [winfo reqheight $w]}]
}
PostOverPoint $menu $x $y
}
@@ -296,8 +296,8 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set y [expr {[winfo rooty $w] + [winfo height $w]}]
# if we go offscreen to the bottom, show as 'above'
set mh [winfo reqheight $menu]
- if {($y + $mh) > [winfo screenheight $w]} {
- set y [expr {[winfo rooty $w] - $mh}]
+ if {($y + $mh) > ([winfo vrooty $w] + [winfo vrootheight $w])} {
+ set y [expr {[winfo vrooty $w] + [winfo vrootheight $w] + [winfo rooty $w] - $mh}]
}
PostOverPoint $menu $x $y
}
@@ -1240,16 +1240,15 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} {
if {$ver < 6} {
set yoffset [expr {[winfo screenheight $menu] \
- $y - [winfo reqheight $menu] - 10}]
- if {$yoffset < 0} {
+ if {$yoffset < [winfo vrooty $menu]} {
# The bottom of the menu is offscreen, so adjust upwards
- incr y $yoffset
- if {$y < 0} { set y 0 }
+ incr y [expr {$yoffset - [winfo vrooty $menu]}]
}
# If we're off the top of the screen (either because we were
# originally or because we just adjusted too far upwards),
# then make the menu popup on the top edge.
- if {$y < 0} {
- set y 0
+ if {$y < [winfo vrooty $menu]} {
+ set y [winfo vrooty $menu]
}
}
}
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 0e73871..3a20048 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -129,7 +129,7 @@ CFLAGS_WARNING = @CFLAGS_WARNING@
# The default switches for optimization or debugging
CFLAGS_DEBUG = @CFLAGS_DEBUG@
-CFLAGS_OPTIMIZE = -DNDEBUG @CFLAGS_OPTIMIZE@
+CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@
# To change the compiler switches, for example to change from optimization to
# debugging symbols, change the following line: