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

feat(xwindow): allow pinning window titles to output where the bar is displayed #576

Closed
wants to merge 7 commits into from

Conversation

raidzero
Copy link
Contributor

@raidzero raidzero commented May 10, 2017

Having the active window title displayed on all bars did not make sense to me. With this pull request I added a config value to skip displaying the window title on bars on other monitors.

-boolean config property called "pin-output". defaults to false
-window title is only displayed on bar on currently focused monitor
-window geometry from xcb is used to determine a window's position

Fixes #252.

… displayed

-boolean config property called "pin-output". defaults to false
-window title is only displayed on bar on currently focused monitor
-window geometry from scb is used to determine a windows position
@jaagr
Copy link
Member

jaagr commented May 17, 2017

Thank you for contributing. I'll check it out once I have some time.

@raidzero
Copy link
Contributor Author

Well, out of nowhere I decided to give bspwm a try. Turns out, this does not work on bspwm. I'll see about fixing that.

@raidzero
Copy link
Contributor Author

This may show just how little I understand X11, but on bspwm using xcb to query window size is returning unexpected values. The positions are being given back doubled. A window is at actual horizontal pixel 6459, but xcb is saying 12918.

@raidzero
Copy link
Contributor Author

I did some testing with other WM's (i3, openbox, fluxbox, awesome, xfce, lxqt, lxde, mate at least). bspwm is the only one that I have seen that exhibits this behavior. The workaround is to not use translated coordinates relative to the root window, since for whatever reason on bspwm the coordinates relative to parent window (given by xcb_get_geometry()) are correct. I cleaned up the active_window_on_monitor() function and put in a check for the bspwm socket. If it is found, do not check the window position using the translated coordinates. I do not know a better way around this bspwm oddity.

TLDR: the last commit implements a workaround which fixes detection of window positions on bspwm.

@betaboon
Copy link

betaboon commented Dec 5, 2018

I am interested in this feature.
i just tried it out against current master after compensating for bit-rot.
so i am now using this patch: https://gist.github.com/betaboon/5483f73600532c69d2ea5b2713aa162f

@betaboon
Copy link

@raidzero @jaagr so how to move this forward?

@NBonaparte
Copy link
Member

@betaboon I have a somewhat stale PR #1122 which is basically a refactor of this. The old method is somewhat hacky so I decided to rewrite it, but it seems I forgot to close this PR. I'll take a look at fixing it up in the next few weeks; you are welcome to help test and/or fix anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants