Tk Source Code

View Ticket
Login
Ticket UUID: 608690
Title: wm geometry slow on Linux
Type: Bug Version: None
Submitter: jenglish Created on: 2002-09-13 01:04:29
Subsystem: 67. Unix Window Operations Assigned To: jenglish
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-22 17:22:39
Resolution: Wont Fix Closed By: serhiy.storchaka
    Closed on: 2026-10-16 09:14:11
Description:
On comp.lang.tcl, Ian Gay reports that:

1. A script was ok on Windows and showed slow response
on Linux.
2. Inspection showed I was frequently doing the
equivalent of
   [wm geometry . [wm geometry .]]
3. When I stopped doing this the script worked ok on
Linux. Tentative       
conclusion: Linux spends a lot of time in wm geometry.
4. Joe English reported, and I confirm, that
   time  {wm geometry . [wm geometry .]} 1000 shows
that wm geometry does not 
take a long time, it executes in microseconds, so that
can't be the answer.
5. If I source the whole script and run it a bit, and
then time the routine in 
which wm geometry occurs, I also find that routine to
be fast.
6. If I disable my binding on <Configure> then the
response is good, even when 
doing the unnecessary [wm geometry . [wm geometry .]]
calls.
7. Aha! Obviously [wm geometry . [wm geometry .]]
generates a <Configure> 
event and I have gone into some kind of loop or race.
8. No. When I instrument my <Configure> callback to
show when it is run, I 
find that [wm geometry . [wm geometry .]] does not
generate a <Configure>.

Slaven Rezic provided the missing clue:

> Add "update" or "update idletasks" [after wm
geometry].

The problem occurs under icewm, fvwm2 and twm.
User Comments: serhiy.storchaka added on 2026-10-16 09:14:11:

No, that one is not specific to fvwm1. wm geometry . [wm geometry .] is fast with every window manager, fvwm1 1.24r included. It does not change the size, so Tk sends no configure request and has nothing to wait for. Only real resizes stall, and only under fvwm1 1.24r, which does not answer every configure request.

The original report, 23 years ago, was about icewm, fvwm2 and twm. All of them have been fixed since then and now answer every request. fvwm1 1.24r is the only one still shipped frozen in time, as the Ubuntu fvwm1 package.

I agree, closing as Won't Fix.


erikleunissen added on 2026-10-16 08:51:19:
One more remark:

There is one thing unclear to me regarding:

> wm geometry . [wm geometry .] itself is innocent everywhere:
> about 2 microseconds and no Configure event at all. 

Is that also specific to fvwm1 1.24r ?

If so, I'd suggest closing this ticket as "Won't fix".

erikleunissen added on 2026-09-25 18:19:36:
Regarding:

> but it is probably not worth carrying for one pre-ICCCM window manager.

I think we should definitely not go into the trouble of supporting an exception case that isn't standards compliant (anymore).

My 2 cents.

serhiy.storchaka added on 2026-09-23 18:04:43:

I tried a dozen window managers with 9.1b1 and could reproduce the stall only on one ancient window manager, fvwm1 1.24r: 50 resizes plus an update take 2010 ms there, in every round. ctwm, vtwm, fvwm 2.7.0, icewm, Window Maker, metacity, xfwm4, i3, dwm, kwin_x11, KWin on a real display and Weston/Xwayland all stay at 0-3 ms.

The cause is WaitForEvent() in unix/tkUnixWm.c: after a configure request UpdateGeometryInfo() waits up to 2 seconds for the matching ConfigureNotify and defers all other events meanwhile. ICCCM 4.1.5 requires the window manager to answer, and all the others do — even the tiling ones, which refuse the requested size but still send the synthetic ConfigureNotify. fvwm1 sends 199 for 200 resizes and publishes no _NET_SUPPORTING_WM_CHECK.

wm geometry . [wm geometry .] itself is innocent everywhere: about 2 microseconds and no Configure event at all.

Shortening the wait per display after the first timeout fixes it (four toplevels: 8055 ms to 3536 ms), but it is probably not worth carrying for one pre-ICCCM window manager.


jenglish added on 2003-01-18 10:11:38:
Logged In: YES 
user_id=68433

Just a followup to note that I *haven't* forgotten about
this problem, just that I still have no idea how to fix it
yet.

Asking WM authors to fix the problem on their end has proven
fruitless so far.

jenglish added on 2002-09-13 08:15:30:
Logged In: YES 
user_id=68433

Initial diagnosis:  it looks like this is basically the same
problem as in TIP 107:
the window managers aren't sending synthetic
<ConfigureNotify>
messages when they're supposed to.  Tk attempts to
compensate
for this by trying to determine when the ConfigureRequest is
unnecessary, but it's guessing wrong.