mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-10 07:02:44 +02:00
fix(wm): lars' secret sauce for min-width apps
This commit applies a technique shared by Lars from GlazeWM and first noticed by J.SH on Discord to add the SWP_NOSENDCHANGING flag when positioning windows to overcome any hard-coded minimum width restrictions an application might have.
This commit is contained in:
@@ -703,10 +703,12 @@ impl WindowManager {
|
|||||||
if let Layout::Custom(ref mut custom) = rule.1 {
|
if let Layout::Custom(ref mut custom) = rule.1 {
|
||||||
match sizing {
|
match sizing {
|
||||||
Sizing::Increase => {
|
Sizing::Increase => {
|
||||||
custom.set_primary_width_percentage(percentage + 5.0);
|
custom
|
||||||
|
.set_primary_width_percentage(percentage + 5.0);
|
||||||
}
|
}
|
||||||
Sizing::Decrease => {
|
Sizing::Decrease => {
|
||||||
custom.set_primary_width_percentage(percentage - 5.0);
|
custom
|
||||||
|
.set_primary_width_percentage(percentage - 5.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1040,7 +1040,7 @@ impl WindowManager {
|
|||||||
.get_mut(first_idx)
|
.get_mut(first_idx)
|
||||||
.ok_or_else(|| anyhow!("There is no monitor"))?
|
.ok_or_else(|| anyhow!("There is no monitor"))?
|
||||||
.remove_workspaces();
|
.remove_workspaces();
|
||||||
|
|
||||||
let second_workspaces = self
|
let second_workspaces = self
|
||||||
.monitors_mut()
|
.monitors_mut()
|
||||||
.get_mut(second_idx)
|
.get_mut(second_idx)
|
||||||
|
|||||||
@@ -303,7 +303,10 @@ impl WindowsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn position_window(hwnd: HWND, layout: &Rect, top: bool) -> Result<()> {
|
pub fn position_window(hwnd: HWND, layout: &Rect, top: bool) -> Result<()> {
|
||||||
let flags = SetWindowPosition::NO_ACTIVATE;
|
let flags = SetWindowPosition::NO_ACTIVATE
|
||||||
|
| SetWindowPosition::NO_SEND_CHANGING
|
||||||
|
| SetWindowPosition::NO_COPY_BITS
|
||||||
|
| SetWindowPosition::FRAME_CHANGED;
|
||||||
|
|
||||||
let position = if top { HWND_TOPMOST } else { HWND_BOTTOM };
|
let position = if top { HWND_TOPMOST } else { HWND_BOTTOM };
|
||||||
Self::set_window_pos(hwnd, layout, position, flags.bits())
|
Self::set_window_pos(hwnd, layout, position, flags.bits())
|
||||||
|
|||||||
Reference in New Issue
Block a user