yazeed1s / zwm

X11 tiling window manager
BSD 2-Clause "Simplified" License
68 stars 4 forks source link

Wrong resize behaviour #15

Closed elbachir-one closed 1 month ago

elbachir-one commented 1 month ago

When resizing and coming to the cursor, the resizing stops at the cursor pointer. Here is a short video: https://streamable.com/mgkuaz

yazeed1s commented 1 month ago

Right, the resize happens on whatever window is under cursor, it stopped resizing because the root window was under the cursor. This is the default behavior, I may change it in the future to operate on focused windows rather than windows under the cursor.

yazeed1s commented 1 month ago

If many users want this to change, I will work on it

elbachir-one commented 1 month ago

That is cool, but that should not be the default behavior.

yazeed1s commented 1 month ago

Yeah it's not expected to be the default behavior, I'll see what I can do about it later next week. If it can easily be changed I'll change it, otherwise I'll deal with it later when i have time and patience.

deadshxll commented 1 month ago

Been watching ZWM's development activity closely (good stuff, @Yazeed1s), haven't tested it myself, and i'm by no means knowledgeable of its source.

But I agree, this should not be default behavior.

Perhaps some logic like this should easily solve it? idk lol

void resize_function() {
  ...
  if (last_selected_window != current_selected_window && last_cursor_pos == current_cursor_pos) {
    force_selected_window(last_selected_window);
  }
  ...
}

// only occurs when the mouse moves
void on_mouse_move() {
  ...
  normal behavior (select the window that the mouse is over)
  ...
}
yazeed1s commented 1 month ago

@deadshxll thanks! I think I see a solution to it, I believe I have is_focused flag in every node containing a window, but i am not making a use of it in the resize function. And it gets toggled on when the cursor enters a new window too, so i will have to find a way to limit this behavior and apply the changes to the resize function. I'll work on it this weekend and see how it goes.

deadshxll commented 1 month ago

Looking forward to it!

yazeed1s commented 1 month ago

Fixed in #16