This file is indexed.

/usr/lib/exmh/exwin.tcl is in exmh 1:2.8.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# exwin.tcl
#
# Main window layout for the application
#
# Copyright (c) 1993 Xerox Corporation.
# Use and copying of this software and preparation of derivative works based
# upon this software are permitted. Any distribution of this software or
# derivative works must comply with all applicable United States export
# control laws. This software is made available AS IS, and Xerox Corporation
# makes no warranty about the software, its performance or its conformity to
# any specification.

proc Exwin_Init {} {
    global exwin
    Preferences_Add "Windows & Scrolling" \
"Window placement and scroll-related preferences are set here.
Contrained scrolling keeps the last line of text in a window stuck
to the bottom of the window.  This can be set independently for
the scan listing (FTOC)." {
	{exwin(scrollbarSide) scrollbarSide {CHOICE left right} {Vertical Scrollbar Side}
"Which side the vertical scrollbars appear on.  This
only takes effect after you restart exmh."}
	{exwin(hscrollbarSide) hscrollbarSide {CHOICE none top bottom} {Horizontal Scrollbar Side}
"Which side the horizontal scrollbars appear on.  This
only takes effect after you restart exmh."}
	{exwin(scrollSpeed) scrollSpeed 1 {Drag-Scroll speed}
"How fast things scroll when you drag a text widget
around with the (by default) middle button."}
	{exwin(scrollAccel) scrollAccel 4 {Drag-Scroll acceleration}
"How fast things scroll when you drag a text widget
around with the (by default) middle button with Shift depressed."}
  	{exwin(wheelEnabled) wheelEnabled OFF "Wheel Mouse"
"Enables the use of wheel mice, assuming proper
X Server support (ie, button 4 + 5)
You must restart exmh for this option to take effect."}
    {widgetText(constrained) textConstrainScroll OFF "Constrained Scrolling"
"Constrained scrolling clamps the last line
of text to the bottom of the text widget."} 
    {widgetText(constrainFtoc) textConstrainFtoc ON "Constrain FTOC"
"In spite of the general constrained text setting,
constrain the scrolling of the folder table-of-contents."}
    {widgetText(scrollContext) textContextLines 2 "Scroll Context"
"Scroll context is the number of lines that pages
overlap when paging up and down through text."}
    {widgetText(smoothScroll) textSmoothScroll ON "Smooth-scroll ends"
"If set, the last partial page is scrolled line-by-line instead
of jumping to the new location.  This helps you maintain context."}
    {widgetText(selectDelay) textSelectDelay 50 "Scroll/Select Time Constant"
"When you drag a selection off the top or bottom of a text widget,
the widget automatically scrolls and extends the selection.  This
parameter is a polling time period that affects the behavior.  Too
big and it is not responsive enough.  Too small and it may consume too
many cycles.  Units are milliseconds."}
    {widgetText(autoNext) textAutoNext ON "Scroll into the next message"
"If on, hitting spacebar (or your scroll down key) on the last page
of a message automatically advances you to the next message, as if
you had hit the Next button. If off, you must always explicitly
advance via appropriate exmh commands or buttons, making it safe to
just hit space repeatedly until things stop scrolling to skim a
message."}
	{exwin(placeToplevel)	placeToplevel ON	{Remember window placement}
"With this enabled, exmh will remember the placement of the various
popup windows between sessions.  This means you can position them
once manually and they will always appear there.  However, if you
use a virtual root window manager and run exmh in different \"rooms\"
then a remembered placement might be in the wrong room.  You can nuke
all the placement memory from the end of the .exmh-defaults file and
always run exmh from the same room, or just disable this feature."}
    {exwin(keepPlaces) keepPlaces ON {Remember within session}
"With this enabled, exmh will remember window placements within a
session.  This means that even if \"Remember window placement\" is
OFF, if you place a window and dismiss it, exmh will remember its
placement and re-use it for the rest of the current session.
Disabling this option always allows your window manager to place
windows."}
    {exwin(toplevelFtoc) toplevelFtoc OFF {Use separate Ftoc window}
"Display Folder Table of Contents (FTOC) in a separate window.
(You can still only display a single folder at a time.)"}
    {exwin(toplevelMsg) toplevelMsg OFF {Use separate Msg window}
"Display mail messages in a separate window.
This setting only takes effect after restarting exmh."}
    {exwin(mtextLines) mtextLines 25 {Lines in message display}
"The height (in lines) of the message display. 
Only applies to the separate message display window."}
    {exwin(mtextWidth) mtextWidth 80 {Width of message display}
"The width (in characters) of the message display.
Only applies to the separate message display window."}
    }
    set exwin(ftextLinesSave) $exwin(ftextLines)
    trace variable exwin(ftextLines) w ExwinFixupFtextLines
    trace variable exwin(mtextLines) w ExwinFixupMtext
    trace variable exwin(mtextWidth) w ExwinFixupMtext

    if {$exwin(wheelEnabled)} {
	mscroll TScroll 5
    }

    if ![info exists exwin(toplevels)] {
	set exwin(toplevels) [option get . exwinPaths {}]
    }
}

proc mscroll {bindtag num} {
    bind $bindtag <Button-5> [list %W yview scroll $num units]
    bind $bindtag <Button-4> [list %W yview scroll -$num units]
    bind $bindtag <Shift-Button-5> [list %W yview scroll 1 units]
    bind $bindtag <Shift-Button-4> [list %W yview scroll -1 units]
    bind $bindtag <Control-Button-5> [list %W yview scroll 1 pages]
    bind $bindtag <Control-Button-4> [list %W yview scroll -1 pages]
}


proc ExwinFixupFtextLines { args } {
    global exwin
    Exmh_Debug ExwinFixupFtextLines $exwin(ftextLines)
    if [catch {
	$exwin(ftext) configure -height $exwin(ftextLines)
	set exwin(ftextLinesSave) $exwin(ftextLines)
    } err] {
	Exmh_Status $err
	set exwin(ftextLines) $exwin(ftextLinesSave)
	$exwin(ftext) configure -height $exwin(ftextLines)
    }
}

proc ExwinFixupMtext { args } {
    global exwin
    Exmh_Debug ExwinMixupFtext $exwin(mtextLines) $exwin(mtextWidth)
    $exwin(mtext) configure -height $exwin(mtextLines) -width $exwin(mtextWidth)
}

# Main window layout.
# This has grown complicated because of the exwin(toplevelMsg) and exwin(toplevelFtoc)
# options that put some windows in or out of the main window.  Consider
# redoing this code so the various cases are grouped better for clarity.

proc Exwin_Layout {} {
    global exwin exmh

    # All windows want fill so their display uses its allocated space.
    # The "expand" attribute is more subtle.  The rule of thumb is
    # that one window in a top-level should get expand in order to
    # grow its space allocation in case the toplevel is resized.

    set fixed {top fill}
    set expand {top fill expand}
    set exwin(grab) {}

    wm minsize . 100 100
    Flag_Init

    # Top row of buttons for global ops and version string
    set exwin(mainButtons) [Widget_Frame . main Main $fixed]
    Buttons_Main $exwin(mainButtons)
    Label_MainSetup $exwin(mainButtons)

    # Fdisp is a canvas that displays a "button" for each folder
    # that indicates its unseen message state.
    Fdisp_Window [Widget_Frame . flist Fdisp $fixed]

    # The folder buttons and Ftoc display are put in here
    if {$exwin(toplevelFtoc)} {
        set exwin(ftocframe) .ftocframe
        Exwin_Toplevel $exwin(ftocframe) "Folder ToC" Ftoc no_dismiss_button]
        wm protocol $exwin(ftocframe) WM_DELETE_WINDOW {Exwin_Dismiss $exwin(ftocframe)}
    } else {
        set pack_opts [expr {$exwin(toplevelMsg) ? "$expand" : "$fixed"}]
        set exwin(ftocframe) [Widget_Frame . ftocframe Ftoc $pack_opts]
    }
    # Second row of buttons for folder ops and current folder label
    set exwin(fopButtons) [Widget_Frame .ftocframe fops Fops $fixed]
    if {$exwin(toplevelMsg) && !$exwin(toplevelFtoc)} {
        # FTOC/MSG boundary changer jammed in with the folder buttons
        ExwinFtocMsgBoundary $exwin(fopButtons)
    }
    Buttons_Folder $exwin(fopButtons)
    Label_FolderSetup $exwin(fopButtons)

    # Folder display (Ftoc).  If this shares the window with the message
    # display, then do the non-expand (i.e., fixed) packing.  Otherwise
    # pack it so it with expand enabled so it fills up the window.
    set pack_opts [expr {( $exwin(toplevelMsg) || $exwin(toplevelFtoc) ) ? "$expand" : "$fixed"}]
    set exwin(ftext) [Widget_Text [Widget_Frame .ftocframe ftoc Ftoc $pack_opts] \
				$exwin(ftextLines)]
    Ftoc_Bindings $exwin(ftext)
    Ftoc_InitSequences $exwin(ftext)

    if {$exwin(wheelEnabled)} {
	mscroll $exwin(ftext) 1
    }

    # Create a frame for Message stuff.
    # The message buttons and display are put in here.
    if {$exwin(toplevelMsg)} {
        set exwin(msgframe) .msgframe
        Exwin_Toplevel $exwin(msgframe) "Message Display" Msg no_dismiss_button
        wm protocol $exwin(msgframe) WM_DELETE_WINDOW {Exwin_Dismiss $exwin(msgframe)}
    } else {
        set exwin(msgframe) [Widget_Frame . msgframe Msg $expand]
    }
    # Turning off pack propagation is almost never a good thing
    # pack propagate $exwin(msgframe) 0

    # Frame for faces, status, message buttons
    set mid [Widget_Frame .msgframe mid Mid $fixed]
    Widget_SplitFrameR $mid Face Right
    Faces_Create $mid.left

    # Status line + MsgID
    set right $mid.right
    Widget_SplitFrameV $right Status Mops

    # FTOC/MSG boundary changer goes with the non-toplevel msg window
    if {!$exwin(toplevelMsg)} {
        ExwinFtocMsgBoundary $right.top
    }

    set exwin(status) [Widget_Entry $right.top msg {right expand fill}]
    set statusConfig [option get .msgframe statusConfig StatusConfig]
    if {[string length $statusConfig] > 0} {
        catch [concat $exwin(status) configure $statusConfig]
    }
    Label_MessageSetup $right.top
    # Status line does double-duty for folder/msg selection typein
    Select_EntryBind $exwin(status)

    # Buttons for message ops, plus display of current message id
    set exwin(mopButtons) $right.bot
    Buttons_Message $exwin(mopButtons)

    # Message display
    set exwin(mtext) [Widget_Text [Widget_Frame .msgframe msg Msg $expand] \
				$exwin(mtextLines) -width $exwin(mtextWidth)]
    Msg_Setup $exwin(mtext)
    Bindings_Main $exwin(mtext)
    if {$exwin(toplevelMsg) || $exwin(toplevelFtoc)} {
      Ftoc_Bindings $exwin(ftext)
      focus $exwin(ftext)
    } else {
      focus $exwin(mtext)
    }
}
proc Exwin_SeeToplevelMsg {} {
    global exwin
    if {$exwin(toplevelMsg)} {
      # Ensure this is displayed
      # This'll raise errors if the user managed to destroy the window
      wm deiconify $exwin(msgframe)
      raise $exwin(msgframe)
    }
}

proc ExwinFtocMsgBoundary {frame} {
    global exwin
    set c [canvas $frame.boundary -width 16 -height 15]
    pack $frame.boundary -side right -fill y
    set fg [option get . c_foreground {}]
    set it [$c create poly 8 2  15 9  8 16  1 9 -fill $fg]
    $c bind $it <ButtonPress-1> {ExwinFtocMsgScroll %W %x %y}
    $c bind $it <B1-Motion> {ExwinFtocMsgMove %W %x %y}
    $c bind $it <ButtonRelease-1> {ExwinFtocMsgStop %W %x %y}
    set exwin(mode) {}
}

proc ExwinTopY {w y} {
    # Find Y hit relative to toplevel window
    set top [winfo toplevel $w]
    while {[string compare $w $top] != 0} {
	incr y [winfo y $w]
	set w [winfo parent $w]
    }
    return $y
}
proc ExwinFtocMsgScroll {canvas x y} {
    global exwin
    set top [winfo toplevel $canvas]
    if {$top == "."} {
	set exwin(boundary) .boundary
    } else {
	set exwin(boundary) $top.boundary
    }
    set bg [option get . c_foreground {}]
    frame $exwin(boundary) -width [winfo width $top] -height 2 -bg $bg
    place $exwin(boundary) -y [ExwinTopY $canvas $y] -x 0 -anchor w
    global fdisp
    Exmh_Status "Adjust FTOC (and other) subwindow boundaries"

    # Record Y coordinate of bottom of each subwindow
    if {!$exwin(toplevelFtoc)} {
      set exwin(yftoc) [ExwinTopY $exwin(ftext) [winfo height $exwin(ftext)]]
    } else {
	catch {unset exwin(yftoc)}
    }
    if [info exists fdisp(cache)] {
	set exwin(yfcache) \
	    [ExwinTopY $fdisp(cache) [winfo height $fdisp(cache)]]
    } else {
	catch {unset exwin(yfcache)}
    }
    if {!$fdisp(toplevel)} {
	set exwin(yfdisp) \
	    [ExwinTopY $fdisp(canvas) [winfo height $fdisp(canvas)]]
    } else {
	catch {unset exwin(yfdisp)}
    }
    if {!$exwin(toplevelFtoc)} {
        set exwin(mode) ftoc
    } elseif {!$fdisp(toplevel)} {
        set exwin(mode) fdisp
    } elseif {[info exist fdisp(cache)]} {
        set exwin(mode) fcache
    } else {
        set exwin(mode) null
    }
}
proc ExwinFtocMsgMove {canvas x y} {
    global exwin
    set ytop [ExwinTopY $canvas $y]
    place $exwin(boundary) -y $ytop
    switch $exwin(mode) {
	ftoc {
	    if {[info exists exwin(yfcache)] &&
		$ytop <= $exwin(yfcache)} {	# Above FTOC window
		set exwin(mode) fcache
		Exmh_Status "Adjust Folder Cache boundary"
	    } elseif {[info exists exwin(yfdisp)] &&
		$ytop <= $exwin(yfdisp)} {	# Above Fcache window
		set exwin(mode) fdisp
		Exmh_Status "Adjust Folder Display boundary"
	    }
	}
	fcache {
	    if {[info exists exwin(yfdisp)] &&
		$ytop <= $exwin(yfdisp)} {	# Above Fcache window
		set exwin(mode) fdisp
		Exmh_Status "Adjust Folder Display boundary"
	    }
	    if {[info exists exwin(yftoc)] &&
                $ytop >= $exwin(yftoc)} {       # Below FTOC window
		set exwin(mode) ftoc
		Exmh_Status "Adjust FTOC boundary"
	    }
	}
	fdisp {
	    if {[info exists exwin(yfcache)] &&
		$ytop >= $exwin(yfcache)} {	# Below Fcache window
		set exwin(mode) fcache
		Exmh_Status "Adjust Folder Cache boundary"
	    } elseif {[info exists exwin(yftoc)] &&
                $ytop >= $exwin(yftoc)} { # Below FTOC window
		set exwin(mode) ftoc
		Exmh_Status "Adjust FTOC boundary"
	    }
	}
    }
}
proc ExwinFtocMsgStop {canvas x y} {
    global exwin fdisp
    catch {destroy $exwin(boundary)}
    # Deduce height of text line in FTOC
    if ![info exists exwin(ftocLineHeight)] {
	if [catch {ExwinLineHeight $exwin(ftext)} x] {
	    Exmh_Status "Display a message before resizing" warn
	    return
	}
	set exwin(ftocLineHeight) $x
    }
    switch $exwin(mode) {
	ftoc {
	    set dy [expr [ExwinTopY $canvas $y] - $exwin(yftoc)]
	    set chunk $exwin(ftocLineHeight)
	}
	fcache {
	    set dy [expr [ExwinTopY $canvas $y] - $exwin(yfcache)]
	    set chunk [expr $fdisp(itemHeight) + $fdisp(ygap)]
	}
	fdisp {
	    set dy [expr [ExwinTopY $canvas $y] - $exwin(yfdisp)]
	    set chunk [expr $fdisp(itemHeight) + $fdisp(ygap)]
	}
        default {
            set dy 0 ; set chunk 1
        }
    }
    set dl [expr int(round($dy / double($chunk)))]
    if {$dl != 0} {
	# The exwin(ftextLines) and fdisp(maxLines) are traced so
	# the display updates when they change.
	switch $exwin(mode) {
	    ftoc {
		set x [expr $exwin(ftextLines) + $dl]
		if {$x <= 0} {set x 1}
		set exwin(ftextLines) $x
		set msg "Saving preference: $exwin(ftextLines) FTOC lines"
		set var exwin(ftextLines)
	    }
	    fcache {
		global fcache
		set x [expr $fcache(lines) + $dl]
		if {$x <= 0} {set x 1}
		set fcache(lines) $x
		set msg "Saving preference: $fcache(lines) Folder Cache lines"
		set var fcache(lines)
	    }
	    fdisp {
		set x [expr $fdisp(maxLines) + $dl]
		if {$x <= 0} {set x 1}
		set fdisp(maxLines) $x
		set msg "Saving preference: $fdisp(maxLines) Folder Display lines"
		set var fdisp(maxLines)
	    }
	}

        # Don't update the window sizes directly here, but instead
        # let the variable traces do it later as a side effect of
        # the Preferences_Tweak call.
        
	# Let redisplay kick in
	after 100 "
	    Exmh_Status \"$msg...\"
	    Preferences_Tweak $var
	    Exmh_Status \"$msg...ok\"
	"
    } else {
	Exmh_Status ok
    }
}
proc ExwinLineHeight {w} {
    set i 0
    if {[scan [$w index @0,$i] %d top] != 1} {
	error ExwinLineHeight
    }
    set limit [winfo height $w]
    while {$i < $limit} {
	incr i
	scan [$w index @0,$i] %d next
	if {$next != $top} {
	    # Magic - -1 because we've overshot one pixel, and -4 for borders/etc
	    return [expr $i - 5]
	}
    }
    error "Cannot handle empty windows"
}
proc Exwin_FullFtoc {} {
    global exwin
    if ![info exists exwin(fullFtoc)] {
	set exwin(fullFtoc) notFullScreen
    }
    if {$exwin(fullFtoc) == "notFullScreen"} {
	set exwin(fullFtoc) fullScreen
	set exwin(ftocPack) [pack newinfo .msg]
	pack forget .msg
	$exwin(ftext) configure -height \
		[expr $exwin(ftextLines)+$exwin(mtextLines)]
    } else {
	set exwin(fullFtoc) notFullScreen
	$exwin(ftext) configure -height $exwin(ftextLines)
	eval pack .msg $exwin(ftocPack)
    }
}

proc Exwin_IconPosition { w icon } {
    if {[string length $icon] == 0} {
	return	;# Don't mess
    }
    # icon looks like +x+y, or -x-y, etc.
    set x 0 ; set y 0
    if {[llength $icon] == 1} {
	if [regexp {([\+-])([0-9]+)([\+-])([0-9]+)} $icon match s1 x s2 y] {
	    if {$s1 == "-"} {
		set x -$x
	    }
	    if {$s2 == "-"} {
		set y -$y
	    }
	}
    } else {
	set x [lindex $icon 0]
	set y [lindex $icon 1]
    }
    if {($x < 0) || ([string compare $x "-0"] == 0)} {
	# 48 depends on icon width
	set x [expr [winfo screenwidth $w]+$x-48]
    }
    if {($y < 0) || ([string compare $y "-0"] == 0)} {
	# 64 depends on icon height
	set y [expr [winfo screenheight $w]+$y-64]
    }
    if [catch {wm iconposition $w $x $y} err] {
	puts stderr "wm iconposition $w $x $y: $err"
    }
}

proc Exwin_Toplevel { path name {class Dialog} {dismiss yes}} {
    global exwin
    if [catch {wm state $path} state] {
	set t [Widget_Toplevel $path $name $class]
	if ![info exists exwin(toplevels)] {
	    set exwin(toplevels) [option get . exwinPaths {}]
	}
	set ix [lsearch $exwin(toplevels) $t]
	if {$ix < 0} {
	    lappend exwin(toplevels) $t
	}
	set decor [option get $path clientDecoration ClientDecoration]
	if {$decor == "none"} {
	    wm transient $path
	}
	if {$dismiss == "yes"} {
	    set f [Widget_Frame $t but Menubar {top fill}]
	    Widget_AddBut $f quit "Dismiss" [list Exwin_Dismiss $path]
	}
	return 1
    } else {
	if {$state != "normal"} {
	    catch {
		if {$exwin(keepPlaces)} {
		    wm geometry $path $exwin(geometry,$path)
		    wm positionfrom $path user
		} else {
		    wm geometry $path {}
		    wm positionfrom $path program
		}
		Exmh_Debug Exwin_Toplevel $path $exwin(geometry,$path)
	    }
	    wm deiconify $path

            # Some window managers (KDE 3.0?) need extra coaxing
            # to get the dialog to appear on top

            # This update make windows appear before they
            # update
            # are fully populated, or, for sedit, they appear with
            # old data and then are redrawn.  I'm running on a slow 
            # displayand it is annoying

            # But this raise reportedly helps
            raise $path

	} else {
	    catch {
		if {! $exwin(keepPlaces)} {
		    wm geometry $path {}
		    wm positionfrom $path program
		}
		raise $path
	    }
	}
	return 0
    }
}
proc Exwin_Dismiss { path {geo ok} } {
    global exwin
    case $geo {
	"ok" {
	    set exwin(geometry,$path) [wm geometry $path]
	}
	"nosize" {
	    set exwin(geometry,$path) [string trimleft [wm geometry $path] 0123456789x]
	}
	default {
	    catch {unset exwin(geometry,$path)}
	}
    }
    if [info exists exwin(geometry,$path)] {
	# Some window managers return geometry like
	# 80x24+-1152+10
	regsub -all {\+-} $exwin(geometry,$path) + exwin(geometry,$path)
    }
    Exmh_Focus    
    wm withdraw $path
    update idletasks	;# Helps window dismiss
}
proc Exwin_CheckPoint { } {
    global exwin
    if {! $exwin(placeToplevel)} {
	Preferences_RewriteSection "Saved Window Positions" "End Positions" {}
	return
    }
    set oldstuff [Preferences_ReadSection "Saved Window Positions" "End Positions"]
    set newstuff {}
    foreach path $exwin(toplevels) {
	set npath [string trimleft $path .]
	if [catch {wm state $path} state] {
	    # No widget - retrieve from old values, if possible
            # except for the hundreds of sedit and pref panes
	    set geo {}
            if {![regexp {^\.(sedit|pref|edit).} $path]} {
              foreach item $oldstuff {
		if [regexp ^\\*$npath\\.position: $item] {
		    set geo [lindex $item 1]
		    break
		}
              }
            }
	} else {
	    case $state {
		"normal" {set geo [wm geometry $path]}
		default {
		    if [info exists exwin(geometry,$path)] {
			set geo $exwin(geometry,$path)
		    } else {
			set geo [option get $path position Position]
			if {$geo == {}} {
			    set geo [wm geometry $path]
			}
		    }
		}
	    }
	}
	if {[string length $geo] != 0} {
	    lappend newstuff [format "*%s.position:\t%s" $npath \
			[string trimleft $geo -x0123456789]]
	} else {
	    set ix [lsearch $exwin(toplevels) $path]
	    set exwin(toplevels) [lreplace $exwin(toplevels) $ix $ix]
	}
    }
    lappend newstuff [format "*exwinPaths:\t%s" $exwin(toplevels)]
    lappend newstuff [format "%s.geometry:\t%s" [winfo name .] [wm geometry .]]
    Fdisp_Checkpoint newstuff
    Preferences_RewriteSection "Saved Window Positions" "End Positions" $newstuff
}
proc Exwin_ClearCheckPoint {} {
    Preferences_RewriteSection "Saved Window Positions" "End Positions" {}
}