Add action to bring focus to the window at a specific point #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the recent introduction of 4k monitors, the usable screen space on a single screen has increased significantly. I found that I spent an increased amount of time switching between windows because I was able to have more windows open on one desktop than ever before. I wanted to have a way to switch to another window in O(1) time. I decided that a way to select which window to go to based on the position in the screen in a 4x3 grid using the letters qwer,asdf,zxcv in order to select which position to go to the window. Unfortunately that functionallity was not available in openbox, so I modified it to allow this. So I added a new command "FocusOnPoint" that would bring the focus to the window at the specified point. An example of what it can be used for is in this snippet of my config file:
The FocusOnPoint action takes 2 mandatory parameters "x" and "y", and one optional parameter, "raise". The x and y parameters take either an absolute position, or a fractional position based on the width or height of the screen, or a percentage based on the width or height of the screen. "raise" when set to true will cause the window that is being focused to also be raised to the front of the z-order.
I had also added the following to my openbox config file for resizing and moving windows based on that same 4x3 grid using the same letters:
Here are some screenshots that show the problem that I was running into with a 4k screen: