Tk Source Code

View Ticket
Login
Ticket UUID: 1ce993240c082f85b8226a6d60d0d76590c83a47
Title: set wm geometry fails from a script
Type: Bug Version: GNU/Linux
Submitter: dkf Created on: 2014-02-18 07:05:15
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Pending Last Modified: 2026-09-23 19:55:44
Resolution: None Closed By: nobody
    Closed on:
Description:

Version #1 SMP Mon Nov 11 03:23:58 EST 2013

All my widgets started popping up at +0+0 a while back. I have a simple example that fails on my Linux.

#!/bin/sh
# \
exec /usr/bin/wish "$0" ${1+"$@"}

wm geometry . 300x200+500+200
wm title . "The tk_wm problem!"
This window pops ups at +0+0.

However, the above commands work from a wish command line, as follows:

Linux -> /usr/bin/wish
% wm geometry . 300x200+500+200
% wm title . "The tk_wm problem!"
This window pops up at +500+200.

User Comments: serhiy.storchaka added on 2026-09-23 19:55:44:

Not reproducible with 9.1b1 nor with 8.6.18 on Linux with conventional window managers: the script from the report places the window at 500,200 with no window manager, and within the frame offset of that position under Window Maker, metacity, xfwm4 and icewm. Under the tiling window managers i3 and dwm the window appears in the top left corner, but they ignore wm geometry also when the window is already mapped, so they do not explain the difference between script and interactive use which the report describes.

That difference points at a placement policy of the window manager: a geometry requested before the window is mapped is a hint (PPosition) which the window manager may override, while the same command on a mapped window is a move request which it normally honours. Tk sets USPosition only for the -geometry command line option.

Which window manager was this? A workaround is to set the geometry after the window is mapped, that is after an update.


dkf added on 2014-02-18 07:06:14:

Migrated from http://core.tcl.tk/tcl/tktview?name=43c7836105