The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 1,057β€…    Votes:  2β€…
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/1197504
Title: What is the Window Title Bar height in Pixel?
ID: /2019/12/20/What-is-the-Window-Title-Bar-height-in-Pixel_
Created: December 20, 2019    Edited:  June 12, 2020
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


From What causes the deviation in the wmctrl window move command

$ xprop | grep FRAME
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 28, 0

Whenever you get a windows position and move it to that same position it shouldn’t move on the screen but it does due to the height of the title bar. So in my case I would need to subtract 28 from the y-coordinate and move to that spot.


Improving performance

You will find the command takes about 10 seconds to run:

$ time xprop | grep FRAME
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 28, 0

real    0m9.989s
user    0m0.017s
sys     0m0.004s

This is extraordinary slow. To speed up the search pass a Window ID:

$ time xprop -id $(xdotool getactivewindow) | grep FRAME
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 28, 0

real    0m0.012s
user    0m0.011s
sys     0m0.003s

Now it’s only a hundredth of a second, faster than a blinking eye.

⇧ Bash - How to detect if a variable is more than a certain amount of characters How come the locate command doesn't find obvious files?  β‡©