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

fix(wm): move floats in direction across monitors #1154

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Nov 27, 2024

  1. feat(wm): listen to event_object_locationchange

    This commit adds a new WindowManagerEvent, LocationChange, which allows
    komorebi to listen to and dispatch events to border_manager when
    EVENT_OBJECT_LOCATIONCHANGE is emitted by the operating system.
    
    This is required because there is no other event which fires on window
    maximize/unmaximize.
    
    fix LGUG2Z#1137
    LGUG2Z committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    1ef0630 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2024

  1. fix(wm): move floats in direction across monitors

    This commit fixes an issue where when trying to move floating windows or
    windows on a floating workspace across boundaries to another monitor
    using the `move_container_in_direction` it wouldn't move the floating
    windows physically, although it moved them internally on komorebi,
    resulting in weird and wrong behavior.
    
    This commit creates a new method on `Monitor` to
    `add_container_with_direction` which takes a move direction and then
    uses the same logic that was previously on the
    `move_container_in_direction` function.
    It changes the `move_container_to_monitor` function to take an optional
    move direction which if it is some will have this function call the new
    method `add_container_with_direction` instead of just `add_container`.
    Lastly the `move_container_in_direction` function now when it realizes
    the move will be across monitors simply calls the
    `move_container_to_monitor` with the direction that was initially given
    to it.
    These changes require that all callers of `move_container_to_monitor`
    add an direction option, instead of passing `None` on all of them, a new
    helper function was created, named `direction_from_monitor_idx` which
    calculates the direction a move will have from the currently focused
    monitor and the target monitor return `None` if they are the same or
    returning `Some(direction)` if not. This way now all commands that call
    a move across monitor will use the logic to check from the direction if
    it should add the container on front or end.
    alex-ds13 committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    ca27f4d View commit details
    Browse the repository at this point in the history
  2. refacor(wm): use helper function on move to workspace

    Use the same `add_container_with_direction` function on
    `move_container_to_workspace` as it is being used on
    `move_container_to_monitor` or `move_container_in_direction`.
    
    This way we bring parity between all methods and make it easier to
    change the way a container is added on a monitor workspace when taking
    the move direction into consideration.
    alex-ds13 committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    44d79f6 View commit details
    Browse the repository at this point in the history