Hello, You didn't like the regexp and you're right, it was wrong, but why all the hassle into changing the method, why not just fix the regexp? if you needed help, I can always help in regexp, I know them very well.. in the meantime, a simple 'grep geometry * | grep regexp' would have givven you a line in gui.tcl which looks like this : gui.tcl: regexp {=?(\d+)x(\d+)[+\-](-?\d+)[+\-](-?\d+)} $geometry -> width height x y
This is the 'corrected' regexp you had in preferences.tcl, it takes into account negative values and have been 'studied' according to Tk manuals and well tested to make sure it works in every situation (dual screen too iirc) Why not revert the changes and use this instead ? tell me what you think KKRT On Fri, Aug 18, 2006 at 06:43:20AM -0700, [EMAIL PROTECTED] wrote: > Revision: 7137 > Author: airadier > Date: 2006-08-18 06:43:16 -0700 (Fri, 18 Aug 2006) > ViewCVS: http://svn.sourceforge.net/amsn/?rev=7137&view=rev > > Log Message: > ----------- > Damn window managers driving me mad with moveinscreen... It wasn't > working correctly before. Now it should, but there are same special > cases where WM returns wrong geometry information. Catching the WM call > to avoid errors. > > Modified Paths: > -------------- > trunk/amsn/preferences.tcl > Modified: trunk/amsn/preferences.tcl > =================================================================== > --- trunk/amsn/preferences.tcl 2006-08-18 11:17:47 UTC (rev 7136) > +++ trunk/amsn/preferences.tcl 2006-08-18 13:43:16 UTC (rev 7137) > @@ -2581,41 +2581,51 @@ > > #set winx [winfo width $window] > #set winy [winfo height $window] > + > set scrx [winfo screenwidth .] > set scry [winfo screenheight .] > - set winpx [winfo rootx $window] > - set winpy [winfo rooty $window] > + > + set wi_geometry [winfo geometry $window] > + scan $wi_geometry "%dx%d+%d+%d" winx winy winpx winpy > + > + #set winpx [winfo x $window] > + #set winpy [winfo y $window] > > set geom [wm geometry $window] > scan $geom "%dx%d%c%d%c%d" winx winy sign1 decorationLeft sign2 > decorationTop > > # Measure left edge, and assume all edges except top are the > # same thickness > - if { $sign1 == 45 || $decorationLeft < 0} { ;#'-' character > - set decorationThickness 0 > + if { $sign1 == 45} { ;#'-' character > + #Get size from right decoration > + set decorationThickness [expr {($scrx - $decorationLeft) - > ($winpx + $winx)}] > + status_log "Minus: dec=$decorationThickness --> ($scrx + > $decorationLeft) - ($winpx + $winx)\n" > } else { > set decorationThickness [expr {$winpx - $decorationLeft}] > } > > # Find titlebar and menubar thickness > - if { $sign2 == 45 || $decorationTop < 0 } { ;#'-' character > - set menubarThickness 0 > + if { $sign2 == 45 } { ;#'-' character > + set menubarThickness [expr {($scry - $decorationLeft) - ($winpy > + $winy)}] > } else { > set menubarThickness [expr {$winpy - $decorationTop}] > } > > > - #status_log "Window information: $window\n" white > - #status_log "Geometry: $geom\n (menuThickness= $menubarThickness, > dec=$decorationThickness)\n" > - #status_log "Width, height: [winfo width $window]x[winfo height > $window]\n" > - #status_log "winPx, winPy: $winpx,$winpy\n" > - #status_log "decLeft=$decorationLeft / decTop=$decorationTop\n" > - #status_log "-------------------\n" white > + status_log "Window information: $window\n" white > + status_log "Geometry: $geom\n (menuThickness= $menubarThickness, > dec=$decorationThickness)\n" > + status_log "Width, height: [winfo width $window]x[winfo height > $window]\n" > + status_log "winPx, winPy: $winpx,$winpy\n" > + status_log "decLeft=$decorationLeft / decTop=$decorationTop\n" > + status_log "-------------------\n" white > > + > # Add this decoration size when checking size and limits > incr winx [expr {2 * $decorationThickness}] > incr winy $decorationThickness > incr winy $menubarThickness > + incr winpx [expr {0 - $decorationThickness}] > + incr winpy [expr {0 - $menubarThickness}] > > #check if the window is too large to fit on the screen > if { [expr {$winx > ($scrx-(2*$mindist))}] } { > @@ -2644,9 +2654,8 @@ > incr winx [expr {0 - 2 * $decorationThickness}] > incr winy [expr {0 - $decorationThickness}] > incr winy [expr {0 - $menubarThickness }] > - incr winpx [expr {0 - $decorationThickness}] > - incr winpy [expr {0 - $menubarThickness}] > - wm geometry $window "${winx}x${winy}+${winpx}+${winpy}" > + > + catch {wm geometry $window "${winx}x${winy}+${winpx}+${winpy}"} > } > > proc reload_advanced_options {path} { > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Amsn-commits mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/amsn-commits ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel