xwininfo seems to be faulty.

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

xwininfo seems to be faulty.

#1 Post by sunburnt »

GreenGeek asked a Q about window geometry. I told him about xwininfo.
He said that xwininfo was occasionally reporting the wrong X and Y values,
and at the same time reported it as - when it was actually + , or worse...

I`ve used xwininfo over the years and have never seen this before.

Code: Select all

xwininfo: Window id: 0x1c00006 "rxvt"

  Absolute upper-left X:  -83
  Absolute upper-left Y:  201
  Relative upper-left X:  3
  Relative upper-left Y:  22
  Width: 576
  Height: 340
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (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:  +-83+201  -787+201  -787-483  +-83-483
  -geometry 80x24+-86+179
If you look in the last line: +-86
That`s just impossible.! And the value 86 is wrong also.

# Anyone have an explanation for this?
.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#2 Post by goingnuts »

Seems ok here - but depending on how your screen actually look...
The negative x-value comes if I place part of the rxvt window outside the desktop:
Attachments
xwininfo.png
(188.09 KiB) Downloaded 508 times

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

Yes, I experimented with it for quite awhile.

Position it so the top edge is just above and below the Y center of the screen.
Try various positions down towards the screen bottom.

Anyway you look at it, it should never have a -+ dimension.!

I`m using Puppy-5.4.X.5, I don`t know what GreenGeek is using.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

+-

#4 Post by L18L »

sunburnt wrote:Anyway you look at it, it should never have a -+ dimension.!
I am using precise 5.7.1 and there it is not -+ but +-

Example for a window moved partially outside the screen at top left : -geometry 446x189+-102+-89

If I am interpreting + as delimiter or if I am thinking of an old rule about signs then I don't have any problem with -


edit
but varying the abiword example, moved down partially (88px) outside:

-geometry 250x250+7--88

- * - = + ----> false :oops:

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#5 Post by goingnuts »

Take a view at the source for xwininfo...a small bit from the -geometry output part:

Code: Select all

 /* If edge gravity, offer a corner on that edge (because the application
     programmer cares about that edge), otherwise offer upper left unless
     some other corner is close to an edge of the screen.
     (For corner gravity, assume gravity was set by XWMGeometry.
     For CenterGravity, it doesn't matter.) */
  if (hints.win_gravity == EastGravity  ||
      (abs(xright) <= 100  &&  abs(xright) < abs(rx)
        &&  hints.win_gravity != WestGravity))
      showright = 1;
  if (hints.win_gravity == SouthGravity  ||
      (abs(ybelow) <= 100  &&  abs(ybelow) < abs(ry)
        &&  hints.win_gravity != NorthGravity))
      showbelow = 1;
  
  if (showright)
      printf("-%d", xright);
  else
      printf("+%d", rx);
  if (showbelow)
      printf("-%d", ybelow);
  else
      printf("+%d", ry);
man page also mention a bug with -geometry (
http://www.xfree86.org/4.2.0/xwininfo.1.html):
The -geometry string displayed must make assumptions about the window's border width and the behavior of the application and the window manager. As a result, the location given is not always correct.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

L18L; I`m not surprised that it produces different incorrect output.

But I am surprised it is flawed like this. This is the first I`ve seen of this.


goingnuts; As above, I am kinda shocked at X`s vagary.

I always thought X was pretty good, but maybe a replacement isn`t a bad idea?


### There seems to be no way to manage this.

Checking for the "-+" and "+-" does not solve the incorrect negative values.

### The problem is when Y is larger than +558, as Y increases it then goes to -100 and on down toward 0.
My screen size = 1200x1024
.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#7 Post by goingnuts »

For me - xwininfo is doing what it is coded to do...cant blame X in general for that...

You might try wmctrl - man page here:
http://linux.die.net/man/1/wmctrl

and a static build here:
http://www.murga-linux.com/puppy/viewto ... 199#661199

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

xwininfo seems to be faulty.

#8 Post by L18L »

sunburnt wrote:...Checking for the "-+" and "+-" does not solve the incorrect negative values...

### The problem is when Y is larger than +558, as Y increases it then goes to -100 and on down toward 0..
Yes, you are right. Signs do not remain constant when moving a window in different positions of one screen corner.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

Does the newer xcb based xwininfo behave the same?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#10 Post by sunburnt »

technosaurus; Don`t know what that is. A link?

goingnuts; This may be a Puppy version specific problem...
My Puppy version: precise-5.4.X.5 doesn`t have wmctrl
I downloaded it from your link, but it only outputs help.

Code: Select all

# /root/Downloads/wmctrl -G -x rxvt
# /root/Downloads/wmctrl -x rxvt
#

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#11 Post by technosaurus »

xwininfo was ported to libxcb from libX11. If you have 1 of the versions from right after the port, it is more likely to have bugs. Also it doesnt help that xcb has been inconsistent from version to version and that puppy tends to mix and match libs.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#12 Post by sunburnt »

technosaurus; Yep, Puppy`s a real bag of bones.

But it`s getting better now that it`s Debian, Ubuntu, and Slack based.
No longer is Puppy an orphan, now it has parentage. :wink:
If a Puppy`s made from only Ubuntu Raring files, it should have no problems.

If xwininfo was just recently ported, I could see how that could be.
Puppy variant releases are so scattered, certain apps. don`t work in some.

Some report the bug, some don`t, so this is a bug in certain Puppy variants.
As always... Just wait for the next release and get a new one.

Post Reply