For more on this topic, check out the comments in pdtk_canvas.tcl and this link:
http://wiki.tcl.tk/11502

Tk X11 returns the size of the window without the framing, and the framing
varies widely depending on the WM.

For your plugin, you'll want to override pdtk_canvas_place_window using
'rename' and write one that works for your WM.

.hc

On 02/01/2013 05:34 PM, Roman Haefeli wrote:
> Hi all
> 
> The assumed window border sizes are hard-coded in tcl/pd-gui.tcl:
> 
> set ::windowframex 3
> set ::windowframey 53
> 
> However, those values might not be correct on some systems. On my system
> (with fluxbox as a window manager) those values actually are 0 and 44.
> This leads to moving canvas: Whenever I save a patch, close and open it
> again, it shifts 9px up and 3px to the left. This shift even happens on
> each 'vis 0, vis 1' cycle sent to [s pd-canvasname]. 
> 
> This is actually not a Pd question: Is there a way to know the actual
> windowframe sizes in tcl/tk? Detecting the actual sizes would be the
> only real solution to this problem, I suppose.
> 
> Alternatively, is there a way to write a GUI plugin to put my
> adjustments into, so that I don't have to modify tcl/pd-gui.tcl after
> every Pd update? I - naively - tried to simply put this:
> 
> set ::windowframex 0
> set ::windowframey 44
> 
> into ~/pd-externals/correct_windowframe-plugin.tcl. It seems to work so
> far, if I load patches from the file->open menu. When loading a patch
> from the command line, the wrong values still are used for the main
> patch. For all sub-sequent canvases (a.k.a subpatches of the main patch,
> abstractions of the main patch or sub-sequently opened patches), the
> correct values from the plugin are taken.
> 
> Another issue is the wrapping of the menu in narrow canvases. When I
> work in a patch that shows the menu in two lines, the offset increases
> by another 28px. This means that on each save/reload cycle (or 'vis 0,
> vis 1' cycle, for that matter) the canvas shifts up by 28px. Of course,
> it's not a really urgent problem, but still slightly annoying.
> 
> Roman
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Pd-dev mailing list
> Pd-dev@iem.at
> http://lists.puredata.info/listinfo/pd-dev
> 

_______________________________________________
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev

Reply via email to