Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-01-24 12:32:22

jt1122
Member
Registered: 2021-03-26
Posts: 240

Window coordinates

Hi,

I'm trying to write a script to align several windows.

I have a top panel of height 40px. Running xprop on the panel gives:

 _NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0 

so there are no borders/padding added.

Running xprop on an xfce4-terminal gives:

 (_NET_FRAME_EXTENT(CARDINAL) = 4, 4, 24, 4 

so there is a 24px (top) + 4px (bottom) frame added.

Now I'd like to move the terminal to 200,0 with a size of 500X500. Running wmctrl:

 wmctrl -r terminal -e 0,200,0,500,500 

places the terminal at X=200 Y=88.

Why Y=88? there are 40px from the top panel so why not Y=40?.
Even adding the top + bottom frame thickness (24+4=28) doesn't add up to 88.

My question: how do I determine a window's final geometry given a top panel + desired window geometry + frame extensions (_NET_FRAME_EXTENT) ?.

Thanks

Offline

#2 2024-01-26 19:04:04

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Window coordinates

bumping.

Thanks

Offline

#3 2024-01-26 23:31:56

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,900

Re: Window coordinates

jt1122 wrote:

Why Y=88? there are 40px from the top panel so why not Y=40?.

Do you have any margins set?

Also does this happen with any other windows as well?

I can't replicate this in my testing, however, wmctrl returns wrong geometry values for me (example: panel is 40 high, frame extents are 24, windows is position at y coordinate 41, but wmctrl reports 84.



My question: how do I determine a window's final geometry given a top panel + desired window geometry + frame extensions (_NET_FRAME_EXTENT) ?.

Thanks

I would think x,y coordinates + frame extents + panel height.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2024-01-27 11:03:58

jt1122
Member
Registered: 2021-03-26
Posts: 240

Re: Window coordinates

ToZ wrote:
jt1122 wrote:

Why Y=88? there are 40px from the top panel so why not Y=40?.

Do you have any margins set?

Also does this happen with any other windows as well?

I can't replicate this in my testing, however, wmctrl returns wrong geometry values for me (example: panel is 40 high, frame extents are 24, windows is position at y coordinate 41, but wmctrl reports 84.



My question: how do I determine a window's final geometry given a top panel + desired window geometry + frame extensions (_NET_FRAME_EXTENT) ?.

Thanks

I would think x,y coordinates + frame extents + panel height.

Thanks.

It happens with other windows as well. The only exception is when I run

xfce4-terminal --hide-borders &
wmctrl -r terminal -e 0,500,0,200,200

returns Y=0 for the terminal window which is correct.

ToZ wrote:

I can't replicate this in my testing, however, wmctrl returns wrong geometry values for me (example: panel is 40 high, frame extents are 24, windows is position at y coordinate 41, but wmctrl reports 84.

Could you provide the full 4 window extents reported by xprop?.

Thanks

Last edited by jt1122 (2024-01-27 17:30:06)

Offline

Board footer

Powered by FluxBB