mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Fix unfullscreening not always updating view offset
This commit is contained in:
+7
-5
@@ -54,6 +54,13 @@ impl<W: LayoutElement> Tile<W> {
|
|||||||
self.options = options;
|
self.options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn update_window(&mut self) {
|
||||||
|
// FIXME: remove when we can get a fullscreen size right away.
|
||||||
|
if self.fullscreen_size != Size::from((0, 0)) {
|
||||||
|
self.is_fullscreen = self.window.is_fullscreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn advance_animations(&mut self, _current_time: Duration, is_active: bool) {
|
pub fn advance_animations(&mut self, _current_time: Duration, is_active: bool) {
|
||||||
let width = self.border.width();
|
let width = self.border.width();
|
||||||
self.border.update(
|
self.border.update(
|
||||||
@@ -62,11 +69,6 @@ impl<W: LayoutElement> Tile<W> {
|
|||||||
self.window.has_ssd(),
|
self.window.has_ssd(),
|
||||||
);
|
);
|
||||||
self.border.set_active(is_active);
|
self.border.set_active(is_active);
|
||||||
|
|
||||||
// FIXME: remove when we can get a fullscreen size right away.
|
|
||||||
if self.fullscreen_size != Size::from((0, 0)) {
|
|
||||||
self.is_fullscreen = self.window.is_fullscreen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn window(&self) -> &W {
|
pub fn window(&self) -> &W {
|
||||||
|
|||||||
@@ -569,6 +569,7 @@ impl<W: LayoutElement> Workspace<W> {
|
|||||||
.enumerate()
|
.enumerate()
|
||||||
.find(|(_, col)| col.contains(window))
|
.find(|(_, col)| col.contains(window))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
column.update_window(window);
|
||||||
column.update_tile_sizes();
|
column.update_tile_sizes();
|
||||||
|
|
||||||
if idx == self.active_column_idx {
|
if idx == self.active_column_idx {
|
||||||
@@ -1080,6 +1081,15 @@ impl<W: LayoutElement> Column<W> {
|
|||||||
self.update_tile_sizes();
|
self.update_tile_sizes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn update_window(&mut self, window: &W) {
|
||||||
|
let tile = self
|
||||||
|
.tiles
|
||||||
|
.iter_mut()
|
||||||
|
.find(|tile| tile.window() == window)
|
||||||
|
.unwrap();
|
||||||
|
tile.update_window();
|
||||||
|
}
|
||||||
|
|
||||||
fn update_tile_sizes(&mut self) {
|
fn update_tile_sizes(&mut self) {
|
||||||
if self.is_fullscreen {
|
if self.is_fullscreen {
|
||||||
self.tiles[0].request_fullscreen(self.view_size);
|
self.tiles[0].request_fullscreen(self.view_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user