ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] aspect ratios...


From: Greg Minshall
Subject: Re: [RP] aspect ratios...
Date: Sun, 03 Feb 2013 07:29:11 -0500

hi.  more on this.  poking around, i see i was wrong (and Jérémie was
right) about gnuplot *not* using aspect ratio hints.  so, i played
around with that.  the below summarizes my changes; {PARAM} was a value
i played with.

with {PARAM} set to 1 (so, max_{width,height} are just the size of the
plot), i get the window aspect ratio i want.  but, it takes up only a
small part of the geometry available to it.  so, i set {PARAM} to 100
(to look "greedy").  with this setting, i get a window that takes up all
the space available to it (good), but then the aspect ratio (whose hints
i've provided) is ignored (bad).

below also is (the relevant part of) what "xwininfo -stats -size" says
in that latter case.  reading it, it seems to me the aspect ratio hints
are set (correctly?), but the geometry of the window is *not* a multiple
of this aspect ratio.  i *see* (but haven't played around with) the code
in ratpoison/src/manage.c that seems to be trying to honor my hints.

any ideas what i might be doing wrong?

cheers, Greg
----
gplt_x11.c fragments:
----
...
!         hints.flags = 
(plot->posn_flags&~(PPosition|PSize))|PMinSize|PMaxSize|PAspect|PBaseSize;
...
      hints.x = gX;
      hints.y = gY;
      hints.width = plot->width;
      hints.height = plot->height;
+     hints.min_width = 10;       /* XXX */
+     hints.min_height = 10;      /* XXX */
+     hints.max_width = {PARAM}*plot->width;
+     hints.max_height = {PARAM}*plot->height;
+     hints.min_aspect.x = hints.max_aspect.x = plot->width;
+     hints.min_aspect.y = hints.max_aspect.y = plot->height;
+     hints.base_width = plot->width;
+     hints.base_height = plot->height;
  
      XSetNormalHints(dpy, plot->window, &hints);
----

xwininfo -stats -size output:
----
  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1278
  Height: 776
  Depth: 24
  Visual: 0x22
  Visual Class: TrueColor
  Border width: 1
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 1278x776+0+0

  Normal window size hints:
      Program supplied minimum size: 10 by 10
      Program supplied maximum size: 64000 by 45000
      Program supplied min aspect ratio: 640/450
      Program supplied max aspect ratio: 640/450
----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]