[PD] new patch position on windows xp

Martin Peach martin.peach at sympatico.ca
Tue Jun 1 21:00:05 CEST 2010

Martin Peach wrote:
> Lorenzo wrote:
>> Alas, I must use Windows Xp as well... Anyway I have switched since 
>> about two months to having the taskbar at the top of the screen, 
>> meaning that when I create a new patch it is placed at absolute 0,0 
>> "absolute" with the title-bar behind the taskbar (even with "always on 
>> top" option). Any tcl/tk guru know of a hack in the pd.tk file to have 
>> the new windows positioned at 0,0 "relative" to the taskbar or 
>> alternatively just sligtly offset down?
> If it's Pd -extended, around line 395 of pd.tk:
> wm title . "Pd-extended"
> # initial location of Pd window (+x+y)
> wm geometry . +20+70
> I imagine that changing +20+70 would move the window.

Sorry, I missed the bit where you're creating new patchers, not the main 
It seems like the tcl function pdtk_canvas_new() is called only from the 
c function canvas_vis() in g_editor.c:

   sys_vgui("pdtk_canvas_new .x%lx %d %d +%d+%d %d\n", x,
     (int)(x->gl_screenx2 - x->gl_screenx1),
     (int)(x->gl_screeny2 - x->gl_screeny1),
     (int)(x->gl_screenx1), (int)(x->gl_screeny1),

The only place that gl_screenx2, gl_screeny2 are set is in glist_addglist():

     x->gl_screenx1 = x->gl_screeny1 = 0;
     x->gl_screenx2 = 450;
     x->gl_screeny2 = 300;

So unless something else is going on, changing x_glscreeny1 should 
offset new windows vertically.

So in pdtk_canvas_new, simply adding an offset to the second element of 
geometry should work.

In pd.tk, line 1418 is for MacOSX:
         if { $pd_nt == 2 && [lindex $geometry 2] < 22 } {
             lset geometry 2 22
So if you add one like this right after it for WinXP:
         if { $pd_nt == 1 && [lindex $geometry 2] < 55 } {
             lset geometry 2 55
...then new patcher windows will be offset 55 downwards.


More information about the Pd-list mailing list