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

[BUG]: Inconsistent multi-monitor behaviors #1053

Open
whaaaley opened this issue Oct 14, 2024 · 4 comments
Open

[BUG]: Inconsistent multi-monitor behaviors #1053

whaaaley opened this issue Oct 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@whaaaley
Copy link

whaaaley commented Oct 14, 2024

Summary

I'm unable to focus or move windows after I reconfigured my monitor setup over the weekend. Previously everything was perfect, but I had a weird configuration for my extra monitors, using a mix of onboard and dedicated ports. Over the weekend I moved everything to dedicated by plugging my two bottom monitors into a hub.

Now I can't move or focus windows in monitor 4. Moving windows or focusing down only goes to 3. Is there something I need to do? I'm wondering if they're getting reported as a single monitor to Komorebi due to the hub, rather than individual.

image

Version Information

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22631 N/A Build 22631
komorebic 0.1.29
tag:v0.1.29
commit_hash:818ac340
build_time:2024-09-28 01:48:31 +00:00
build_env:rustc 1.81.0 (eeb90cda1 2024-09-04),stable-x86_64-pc-windows-msvc

Komorebi Configuration

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.29/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "mouse_follows_focus": false,
  "default_workspace_padding": 36,
  "default_container_padding": 12,
  "border": true,
  "border_width": 2,
  "border_offset": 0,
  "border_style": "Square",
  "border_colours": {
    "single": {
      "r": 255,
      "g": 168,
      "b": 60,
      "a": 0
    },
    "stack": {
      "r": 255,
      "g": 168,
      "b": 60,
      "a": 0
    },
    "monocle": {
      "r": 255,
      "g": 168,
      "b": 60,
      "a": 0
    },
    "unfocused": {
      "r": 0,
      "g": 0,
      "b": 0,
      "a": 255
    }
  },
  "stackbar": {
    "height": 40,
    "mode": "OnStack",
    "tabs": {
      "width": 300
    }
  },
  "display_index_preferences": {
    "0": "SAM0E14-5&1796117&0&UID4355",
    "1": "SAM0E14-5&1796117&0&UID4357",
    "2": "HHS1400-5&1796117&0&UID4650",
    "3": "HHS1400-5&1796117&0&UID4651"
  },
  "monitors": [
    {
      "workspaces": [
        {
          "name": "I",
          "layout": "VerticalStack"
        }
      ]
    }
  ]
}

Hotkey Configuration

Default

Output of komorebic check

PS C:\Users\dustin> komorebic check
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\dustin

Looking for configuration files in C:\Users\dustin

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\dustin\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

Output of komorebic monitor-information

{
  "HHS1400-5&1796117&0&UID4650": {
    "left": 640,
    "top": 1440,
    "right": 1920,
    "bottom": 1200
  },
  "HHS1400-5&1796117&0&UID4651": {
    "left": 2560,
    "top": 1440,
    "right": 1920,
    "bottom": 1200
  },
  "SAM0E14-5&1796117&0&UID4355": {
    "left": 0,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  },
  "SAM0E14-5&1796117&0&UID4357": {
    "left": 2560,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  }
}
@whaaaley whaaaley added the bug Something isn't working label Oct 14, 2024
@whaaaley whaaaley changed the title [BUG]: Unable to focus in a hub-connected monitor [BUG]: Unable to focus 4th monitor in grid layout Oct 14, 2024
@whaaaley
Copy link
Author

whaaaley commented Oct 14, 2024

I actually think this is the same issue as #447, but in my configuration it prevents me touching monitor 4. I must have had an inconsistent layout in my previous configuration that allowed it to work due to imperfect coordinates.

@whaaaley
Copy link
Author

whaaaley commented Oct 16, 2024

Shifting the bottom two monitors slightly to the right allows me to get access to monitor 4, although there's oddities.

[works] Left <---> right, between 1 and 2
[works] Left <---> right, between 3 and 4
[works] Top <---> bottom, between 1 and 3
[not working] Top ---> bottom, from 2 to 4, goes to 3 instead of 4
[not working] Bottom ---> Top, from 4 to 2, goes to 1 instead of 2

image

{
  "HHS1400-5&1796117&0&UID4650": {
    "left": 716,
    "top": 1440,
    "right": 1920,
    "bottom": 1200
  },
  "SAM0E14-5&1796117&0&UID4357": {
    "left": 2560,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  },
  "HHS1400-5&1796117&0&UID4651": {
    "left": 2636,
    "top": 1440,
    "right": 1920,
    "bottom": 1200
  },
  "SAM0E14-5&1796117&0&UID4355": {
    "left": 0,
    "top": 0,
    "right": 2560,
    "bottom": 1440
  }
}

The behavior of going down from monitor 2 to 3, instead of 4, is still present even in the most drastic of scenarios:

image

@whaaaley whaaaley changed the title [BUG]: Unable to focus 4th monitor in grid layout [BUG]: Inconsistent multi-monitor behaviors Oct 16, 2024
@LGUG2Z
Copy link
Owner

LGUG2Z commented Oct 16, 2024

pub fn monitor_idx_in_direction(&self, direction: OperationDirection) -> Option<usize> {
let current_monitor_size = self.focused_monitor_size().ok()?;
for (idx, monitor) in self.monitors.elements().iter().enumerate() {
match direction {
OperationDirection::Left => {
if monitor.size().left + monitor.size().right == current_monitor_size.left {
return Option::from(idx);
}
}
OperationDirection::Right => {
if current_monitor_size.right + current_monitor_size.left == monitor.size().left
{
return Option::from(idx);
}
}
OperationDirection::Up => {
if monitor.size().top + monitor.size().bottom == current_monitor_size.top {
return Option::from(idx);
}
}
OperationDirection::Down => {
if current_monitor_size.top + current_monitor_size.bottom == monitor.size().top
{
return Option::from(idx);
}
}
}
}
None
}

This is the logic that needs to be updated ^

@LGUG2Z
Copy link
Owner

LGUG2Z commented Oct 16, 2024

I don't have enough monitors to try this out but you can test this commit: e8e18a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants