Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 20:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
xwininfo seems to be faulty.
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 08 Aug 2013, 23:32    Post subject:  xwininfo seems to be faulty.  

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:
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?
.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 783

PostPosted: Fri 09 Aug 2013, 00:35    Post subject:  

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:
xwininfo.png
 Description   
 Filesize   188.09 KB
 Viewed   342 Time(s)

xwininfo.png

Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 09 Aug 2013, 04:08    Post subject:  

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.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Fri 09 Aug 2013, 06:04    Post subject: +-
Subject description: - * + = -
 

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 Embarassed
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 783

PostPosted: Fri 09 Aug 2013, 11:27    Post subject:  

Take a view at the source for xwininfo...a small bit from the -geometry output part:
Code:
 /* 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):
Quote:
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.
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 09 Aug 2013, 13:52    Post subject:  

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
.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 783

PostPosted: Fri 09 Aug 2013, 15:30    Post subject:  

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/viewtopic.php?p=661199#661199
Back to top
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sat 10 Aug 2013, 05:22    Post subject: xwininfo seems to be faulty.
Subject description: geometry
 

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.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4380

PostPosted: Sat 10 Aug 2013, 21:40    Post subject:  

Does the newer xcb based xwininfo behave the same?
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Sun 11 Aug 2013, 01:42    Post subject:  

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:
# /root/Downloads/wmctrl -G -x rxvt
# /root/Downloads/wmctrl -x rxvt
#
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4380

PostPosted: Mon 12 Aug 2013, 12:11    Post subject:  

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.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Mon 12 Aug 2013, 16:04    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0788s ][ Queries: 13 (0.0078s) ][ GZIP on ]