Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window frame extent? [how do i set the window position below the taskbar?] #18

Open
TheCheddarCheese opened this issue Nov 29, 2023 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@TheCheddarCheese
Copy link

No description provided.

@dsalt dsalt added question Further information is requested enhancement New feature or request labels Nov 29, 2023
@dsalt
Copy link
Owner

dsalt commented Nov 29, 2023

You can't position relative to another window – at least, not directly.

One way is to position the window manually, use xwininfo to get the position then use one of the positioning functions (set_window_position, set_window_position2, xy) to move the window.

Or you can get the task bar position (again, xwininfo) and the window frame extent (xwininfo -wm; use any window with a frame). The rest can be calculated from that.

(You can use xdotool instead of xwininfo. I don't know the parameters for it, though.)

I recommend something like this:

taskbar_bottom = 40		-- from "xwininfo", "-geometry" line
window_frame = { 5, 5, 20, 5 }	-- from "xwininfo -wm", "Frame extents" line
				-- note: order is left, right, top, bottom

window_name = get_window_name()
if window_name == 'foo' then
  set_window_position(window_frame[1], taskbar_bottom + window_frame[3])
end

It looks like I need to add a proper way of reading the frame extents at run-time (which is why the “enhancement” label is applied).

@dsalt dsalt changed the title how do i set the window position below the taskbar? Window frame extent? [how do i set the window position below the taskbar?] Nov 29, 2023
@dsalt
Copy link
Owner

dsalt commented Nov 29, 2023

… Is the window in question using client-side decorations? Does it belong to a GTK application? (I normally force server-side decorations, so I wouldn't normally see problems with these.)

@TheCheddarCheese
Copy link
Author

  1. as in program-specific? no i don't think so
  2. no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants