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

"Already tiled" detection is too permissive when used with monitor-switch #30

Open
PeterPablo opened this issue Oct 11, 2013 · 1 comment

Comments

@PeterPablo
Copy link

Thank you for the great update! Now usage of quicktile (current commit) with a two monitor setup with XFCE (panel spanning the the lower part of the left monitor) is very nice!

I observed a small issue:

  • First I resize a window to the lower left quarter of the left monitor. (fine)
  • Now I move the window over to the second monitor. Since there is no toolbar I have a small gap to the lower bound of the monitor. (fine, since by design)
  • Now I want to resize the window to again fill the lower left quarter of the right monitor, in order to fill the gap. This does not work as expected, since quicktile remebers the last resizing action to be "lower left quarter" and as such now resizes the window to the next smaller size "lower left sixth".

I would expect that moving a window to the next monitor to reset the last remembered action so that the window would be resized to "lower left quarter", inspite of "lower left sixth".

Hopefully my explanation is understandable.

Peter

@ssokolow
Copy link
Owner

Actually, that's a flaw in how QuickTile currently detects whether a window is tiled.

Because I haven't yet figured out the cleanest, most reliable way to get a window's size after the window manager has made whatever adjustments it wants to a size request (eg. Try tiling gVim or a terminal window and notice that its dimensions snap to a multiple of the character rows and columns) but before you do anything else, QuickTile currently just guesses based on whether the window size is "close enough".

When you move the window to your other monitor, QuickTile does take the new monitor dimensions into account but, since the window's size is still within 100px (by euclidean distance) of the target size, it considers it "already tiled". (In other words, you wouldn't have noticed the problem if your panel was more than 100px thick or your monitors were of different resolutions.)

I have two fixes planned, both of which may solve your problem:

  1. See feature request "monitor-switch" keybinding should adjust dimensions if window is tiled #24 where I've announced my intentions to either change monitor-switch or make a new variant of it so it'll automatically adjust the sizes of tiled windows when switching monitors so they'll fit the new meaning of the chosen preset.
  2. In order to implement feature Grow/Shrink Bindings #10, I'll also need a more advanced way to detect "already tiled" which would fix this problem as a side-effect.

I originally chose 100px to be generous because I didn't trust my code to reliably get a window's dimensions including window borders but, since that seems to be somewhat solid now, I should probably think about a less lax approach if I don't end up writing the proper solution soon. (Maybe querying the window for the sizing hints it sends to the window manager)

In the mean time, you can experiment with different values yourself. Just find the line that says if min_distance[0] < 100: (currently line 762) and change that number to something smaller.

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

No branches or pull requests

2 participants