LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2024, 03:13 AM   #1
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Rep: Reputation: Disabled
Window coordinates


Hi,

I'm trying to write a script to align several windows. I'm using the XFCE desktop.4.18, GTK 3.24.39 .

I have a top panel of height 40px. Running xprop on the panel gives:
Code:
 _NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0
so there are no borders/padding added.

Running xprop on an xfce4-terminal gives:
Code:
 (_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:
Code:
 wmctrl -r terminal -e 0,200,0,500,500
places the terminal at X=200 Y=88.

Why is it placed at Y=88? there are 40px from top due to the 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
 
Old 01-25-2024, 06:35 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
works fine here, could be its your window manager getting in the way, do you have any sort 'smart' or 'snap' placement switched on?
 
Old 01-25-2024, 06:53 AM   #3
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
Thanks, which specific settings do you suggest checking?

I've tried xfce4-terminal --hide-borders & it works as I would have expected , i.e. placed at Y=40, just below the top panel.
 
Old 01-25-2024, 07:14 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
I'm guessing you are using xfwm4, I haven't used it in quite a few years but if I remember its in settings->window manager tweaks, have an explore!
 
Old 01-25-2024, 07:20 AM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
In xfce4-settings-manager check xfwm4->general->snap_to_border/snap_width etc.
 
Old 01-25-2024, 07:23 AM   #6
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
Thanks.

I am using xfwm4, it the stock xfce WM.
In "window manager tweaks" there is "minimum size of window to trigger smart placement". The slider is at about 25% (close to small).

I ticked-off Window snapping>To screen borders but no effect.

The wmctrl shows the window's top Y coordinate is 88 but it's placed just flush against the top panel which ends at Y=40.

Last edited by jt1122; 01-25-2024 at 07:33 AM.
 
Old 01-25-2024, 08:45 AM   #7
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Well as I said I don't use xfce any more but my last suggestion is to use xfce4-settings-editor as you can sometimes do things you can't do in the other settings managers.
 
Old 01-26-2024, 12:52 PM   #8
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
I've scanned the options in "Window Manager" & "Window Manager Tweaks". Nothing affected the placement.

One interesting find: If I change the theme then the Y position reported (by wmctrl) also changes, e.g.
setting the "greyleigh"
Code:
wmctrl -r xterm -e 0,100,0,500,500
wmctrl -lG
shows Y=48 for xterm.
Setting the theme to "Default" & repeating these steps gives Y=58.

What is still a mystery is why the Y coordinate isn't 0 when the xterm window is visibly flush against the top of the screen.
 
Old 01-26-2024, 02:19 PM   #9
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by jt1122 View Post
...
What is still a mystery is why the Y coordinate isn't 0 when the xterm window is visibly flush against the top of the screen.
Dont forget the height of the title bar.
 
Old 01-27-2024, 04:57 AM   #10
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keith Hedger View Post
Dont forget the height of the title bar.
Isn't this defined in the "_NET_FRAME_EXTENTS" property?

xprop on the xterm window gives:
Code:
_NET_FRAME_EXTENTS(CARDINAL) = 4, 4, 24, 4
so it seems the titlebar height is 24px. The bottom border thickness is 4px so that's a total of 28px.

There are still 20px missing since wmctrl reports the window is at Y=48.

Isn't the reported value the position of top left corner of the window border?.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding on-screen coordinates of colored rectangle aravind137 Linux - General 0 06-23-2008 12:01 PM
Visual Python: problem changing coordinates of cylinder raskol Programming 1 04-03-2008 01:10 PM
Anyone know how to capture mouse click x and y coordinates? aatwell Programming 1 12-01-2007 03:28 PM
GIMP does not negative coordinates in a .eps leontini Linux - Software 1 12-18-2005 01:46 PM
Offsetting the default "window coordinates" burnthesource Linux - Newbie 2 11-02-2005 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration