Skip to content

Commit

Permalink
layout: Implement next-to + open-fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Dec 26, 2024
1 parent 981f942 commit 1422688
Show file tree
Hide file tree
Showing 314 changed files with 214 additions and 360 deletions.
63 changes: 16 additions & 47 deletions src/layout/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ impl<W: LayoutElement> Workspace<W> {
let activate = activate.map_smart(|| self.active_window().unwrap().id() == next_to);

let floating_has_window = self.floating.has_window(next_to);
if is_floating || floating_has_window {

if is_floating && !tile.window().is_pending_fullscreen() {
if floating_has_window {
self.floating.add_tile_above(next_to, tile, activate);
} else {
Expand All @@ -579,58 +580,26 @@ impl<W: LayoutElement> Workspace<W> {
tile.floating_pos = Some(pos);

self.floating.add_tile(tile, activate);
}

if activate || self.scrolling.is_empty() {
self.floating_is_active = FloatingActive::Yes;
}
} else if floating_has_window {
self.scrolling
.add_tile(None, tile, activate, width, is_full_width, None);

if activate {
self.floating_is_active = FloatingActive::Yes;
}
if activate {
self.floating_is_active = FloatingActive::No;
}
} else {
self.scrolling
.add_tile_right_of(next_to, tile, activate, width, is_full_width);
}

// if is_floating && !tile.window().is_pending_fullscreen() {
// if floating_has_window {
// self.floating.add_tile_above(next_to, tile, activate);
// } else {
// // FIXME: use static pos
// let (next_to_tile, render_pos) = self
// .scrolling
// .tiles_with_render_positions()
// .find(|(tile, _)| tile.window().id() == next_to)
// .unwrap();
//
// // Position the new tile in the center above the next_to tile. Think a
// // dialog opening on top of a window.
// let tile_size = tile.tile_size();
// let pos = render_pos
// + (next_to_tile.tile_size().to_point() - tile_size.to_point())
// .downscale(2.);
// let pos = self.floating.clamp_within_working_area(pos, tile_size);
// let pos = self.floating.logical_to_size_frac(pos);
// tile.floating_pos = Some(pos);
//
// self.floating.add_tile(tile, activate);
// }
//
// if activate || self.scrolling.is_empty() {
// self.floating_is_active = FloatingActive::Yes;
// }
// } else if floating_has_window {
// self.scrolling
// .add_tile(None, tile, activate, width, is_full_width, None);
//
// if activate {
// self.floating_is_active = FloatingActive::No;
// }
// } else {
// self.scrolling
// .add_tile_right_of(next_to, tile, activate, width, is_full_width);
//
// if activate {
// self.floating_is_active = FloatingActive::No;
// }
// }
if activate {
self.floating_is_active = FloatingActive::No;
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 0 × 0, bounds: 1920 × 1080, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 0 × 0, bounds: 1920 × 1080, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1920 × 1080, states: []
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ initial configure:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1920 × 1080, states: []
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1920 × 1080, states: []
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1920 × 1080, bounds: 1920 × 1080, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1920 × 1080, states: []
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ initial configure:
size: 1280 × 720, bounds: 1280 × 720, states: [Fullscreen]

post-map configures:
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1920 × 1080, bounds: 1888 × 1048, states: [Fullscreen]
size: 0 × 0, bounds: 1920 × 1080, states: []
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 616 × 688, bounds: 1248 × 688, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ size: 0 × 0, bounds: 1280 × 720, states: []

post-map configures:
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen]
size: 0 × 0, bounds: 1280 × 720, states: [Activated]
size: 1280 × 720, bounds: 1248 × 688, states: [Fullscreen, Activated]
Loading

0 comments on commit 1422688

Please sign in to comment.