mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-14 09:02:45 +02:00
handling grouping edge case for komorebi focus window
This commit is contained in:
@@ -129,6 +129,7 @@ impl BarWidget for Komorebi {
|
|||||||
if self.workspaces.enable {
|
if self.workspaces.enable {
|
||||||
let mut update = None;
|
let mut update = None;
|
||||||
|
|
||||||
|
// NOTE: There should always be at least one workspace.
|
||||||
config.grouping.apply_on_widget(ui, |ui| {
|
config.grouping.apply_on_widget(ui, |ui| {
|
||||||
for (i, (ws, should_show)) in
|
for (i, (ws, should_show)) in
|
||||||
komorebi_notification_state.workspaces.iter().enumerate()
|
komorebi_notification_state.workspaces.iter().enumerate()
|
||||||
@@ -308,8 +309,10 @@ impl BarWidget for Komorebi {
|
|||||||
|
|
||||||
if let Some(focused_window) = self.focused_window {
|
if let Some(focused_window) = self.focused_window {
|
||||||
if focused_window.enable {
|
if focused_window.enable {
|
||||||
config.grouping.apply_on_widget(ui, |ui| {
|
|
||||||
let titles = &komorebi_notification_state.focused_container_information.0;
|
let titles = &komorebi_notification_state.focused_container_information.0;
|
||||||
|
|
||||||
|
if !titles.is_empty() {
|
||||||
|
config.grouping.apply_on_widget(ui, |ui| {
|
||||||
let icons = &komorebi_notification_state.focused_container_information.1;
|
let icons = &komorebi_notification_state.focused_container_information.1;
|
||||||
let focused_window_idx =
|
let focused_window_idx =
|
||||||
komorebi_notification_state.focused_container_information.2;
|
komorebi_notification_state.focused_container_information.2;
|
||||||
@@ -382,9 +385,9 @@ impl BarWidget for Komorebi {
|
|||||||
)
|
)
|
||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
if komorebi_client::send_message(&SocketMessage::MouseFollowsFocus(
|
if komorebi_client::send_message(
|
||||||
false,
|
&SocketMessage::MouseFollowsFocus(false),
|
||||||
))
|
)
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -392,9 +395,9 @@ impl BarWidget for Komorebi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if komorebi_client::send_message(&SocketMessage::FocusStackWindow(
|
if komorebi_client::send_message(
|
||||||
i,
|
&SocketMessage::FocusStackWindow(i),
|
||||||
))
|
)
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -402,9 +405,11 @@ impl BarWidget for Komorebi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if komorebi_client::send_message(&SocketMessage::MouseFollowsFocus(
|
if komorebi_client::send_message(
|
||||||
|
&SocketMessage::MouseFollowsFocus(
|
||||||
komorebi_notification_state.mouse_follows_focus,
|
komorebi_notification_state.mouse_follows_focus,
|
||||||
))
|
),
|
||||||
|
)
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -418,6 +423,7 @@ impl BarWidget for Komorebi {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ui.add_space(WIDGET_SPACING);
|
ui.add_space(WIDGET_SPACING);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user