floating: Fix window position constraining with non-zero working area loc
Browse files at this commit7e852124a5c198cd2e7ada53b3e1626eeb87dbf7Parent: f66a49b1 changed file +2 -0
- src/layout/floating.rs +2 -0
src/layout/floating.rsmodified+2 -0
| @@ -139,6 +139,7 @@ impl Data { | |||
| 139 | let max_off_screen_hor = f64::max(0., self.size.w - min_on_screen_hor); | 139 | let max_off_screen_hor = f64::max(0., self.size.w - min_on_screen_hor); |
| 140 | let max_off_screen_ver = f64::max(0., self.size.h - min_on_screen_ver); | 140 | let max_off_screen_ver = f64::max(0., self.size.h - min_on_screen_ver); |
| 141 | 141 | ||
| 142 | + logical_pos -= self.working_area.loc; | ||
| 142 | logical_pos.x = f64::max(logical_pos.x, -max_off_screen_hor); | 143 | logical_pos.x = f64::max(logical_pos.x, -max_off_screen_hor); |
| 143 | logical_pos.y = f64::max(logical_pos.y, -max_off_screen_ver); | 144 | logical_pos.y = f64::max(logical_pos.y, -max_off_screen_ver); |
| 144 | logical_pos.x = f64::min( | 145 | logical_pos.x = f64::min( |
| @@ -149,6 +150,7 @@ impl Data { | |||
| 149 | logical_pos.y, | 150 | logical_pos.y, |
| 150 | self.working_area.size.h - self.size.h + max_off_screen_ver, | 151 | self.working_area.size.h - self.size.h + max_off_screen_ver, |
| 151 | ); | 152 | ); |
| 153 | + logical_pos += self.working_area.loc; | ||
| 152 | 154 | ||
| 153 | self.logical_pos = logical_pos; | 155 | self.logical_pos = logical_pos; |
| 154 | } | 156 | } |