From: Óscar Fuentes on
With two monitors attached to the computer, the `winfo' and `wm'
commands adds the area of both monitors as if they were just
one. Procedures for maximizing the size of a toplevel, like this

proc maximize toplevel {
pack propagate $toplevel 0
update idletasks
wm geometry $toplevel +0+0
wm minsize $toplevel [lindex [wm maxsize $toplevel] 0] \
[lindex [wm maxsize $toplevel] 1]
}

makes the toplevel cover both screens.

Is it possible to query the size of just one monitor?

I'm not experienced with multiple-head setups on Linux, so if there is a
setting that makes possible to detach the monitors so they no longer are
considered a single one, that could be okay too.
From: Harald Oehlmann on
Hi Óscar,

On 22 Feb., 14:26, Óscar Fuentes <o...(a)wanadoo.es> wrote:
> With two monitors attached to the computer, the `winfo' and `wm'
> commands adds the area of both monitors as if they were just
> one. Procedures for maximizing the size of a toplevel, like this

I have no experience on multihead on Linux neither!

Stupid guesses by me:
- winfo screenwidth $toplevel
- winfo screenheight $toplevel
- winfo winfo vrootheight $toplevel
- winfo winfo vrootwidth $toplevel

- wm state $toplevel zoomed;winfo width $toplevel;winfo height
$toplevel

Hope this helps,
Harald
From: Óscar Fuentes on
Harald Oehlmann <wortkarg2(a)yahoo.de> writes:

>> With two monitors attached to the computer, the `winfo' and `wm'
>> commands adds the area of both monitors as if they were just
>> one. Procedures for maximizing the size of a toplevel, like this
>
> I have no experience on multihead on Linux neither!
>
> Stupid guesses by me:
> - winfo screenwidth $toplevel
> - winfo screenheight $toplevel
> - winfo winfo vrootheight $toplevel
> - winfo winfo vrootwidth $toplevel

All of them return the combined size of both monitors.

> - wm state $toplevel zoomed;winfo width $toplevel;winfo height
> $toplevel

`zoomed' is a Windows thing. The rest is not useful either because we
need the area of the monitor, not the area of the toplevel.

> Hope this helps,

Thanks for trying. At this stage I appreciate any kind of help, even
blind guesses.

Just discovered that gitk maximizes correctly. I'll look into its source
code with my fingers crossing hoping it doesn't use a binary extension
for that.
From: Koen Danckaert on
�scar Fuentes wrote:
> With two monitors attached to the computer, the `winfo' and `wm'
> commands adds the area of both monitors as if they were just
> one. Procedures for maximizing the size of a toplevel, like this
>
> proc maximize toplevel {
> pack propagate $toplevel 0
> update idletasks
> wm geometry $toplevel +0+0
> wm minsize $toplevel [lindex [wm maxsize $toplevel] 0] \
> [lindex [wm maxsize $toplevel] 1]
> }
>
> makes the toplevel cover both screens.
>

Try this:

wm attributes . -zoomed 1

--Koen
From: Óscar Fuentes on
Koen Danckaert <koen(a)spam.spam> writes:

> Try this:
>
> wm attributes . -zoomed 1

Thanks, but I'm using 8.4 and -zoomed was introduced in 8.5.

Yes, I plan to upgrade to 8.6.x (x > 1) once it is out :-)