tree: allow showing floating windows above fullscreen
This commit is contained in:
parent
f3179b7794
commit
0c02cb5033
17 changed files with 118 additions and 6 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- Needs jay-config release.
|
||||||
|
- Needs jay-toml-config release.
|
||||||
|
- Needs jay-compositor release.
|
||||||
|
|
||||||
# 1.10.0
|
# 1.10.0
|
||||||
|
|
||||||
- Needs jay-algorithms release.
|
- Needs jay-algorithms release.
|
||||||
|
|
|
||||||
|
|
@ -768,6 +768,16 @@ impl Client {
|
||||||
self.send(&ClientMessage::SetColorManagementEnabled { enabled });
|
self.send(&ClientMessage::SetColorManagementEnabled { enabled });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_float_above_fullscreen(&self, above: bool) {
|
||||||
|
self.send(&ClientMessage::SetFloatAboveFullscreen { above });
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_float_above_fullscreen(&self) -> bool {
|
||||||
|
let res = self.send_with_response(&ClientMessage::GetFloatAboveFullscreen);
|
||||||
|
get_response!(res, false, GetFloatAboveFullscreen { above });
|
||||||
|
above
|
||||||
|
}
|
||||||
|
|
||||||
pub fn connector_connected(&self, connector: Connector) -> bool {
|
pub fn connector_connected(&self, connector: Connector) -> bool {
|
||||||
let res = self.send_with_response(&ClientMessage::ConnectorConnected { connector });
|
let res = self.send_with_response(&ClientMessage::ConnectorConnected { connector });
|
||||||
get_response!(res, false, ConnectorConnected { connected });
|
get_response!(res, false, ConnectorConnected { connected });
|
||||||
|
|
|
||||||
|
|
@ -542,6 +542,10 @@ pub enum ClientMessage<'a> {
|
||||||
connector: Connector,
|
connector: Connector,
|
||||||
brightness: Option<f64>,
|
brightness: Option<f64>,
|
||||||
},
|
},
|
||||||
|
SetFloatAboveFullscreen {
|
||||||
|
above: bool,
|
||||||
|
},
|
||||||
|
GetFloatAboveFullscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
|
@ -690,6 +694,9 @@ pub enum Response {
|
||||||
GetSocketPath {
|
GetSocketPath {
|
||||||
path: String,
|
path: String,
|
||||||
},
|
},
|
||||||
|
GetFloatAboveFullscreen {
|
||||||
|
above: bool,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -273,3 +273,22 @@ pub fn set_ui_drag_threshold(threshold: i32) {
|
||||||
pub fn set_color_management_enabled(enabled: bool) {
|
pub fn set_color_management_enabled(enabled: bool) {
|
||||||
get!().set_color_management_enabled(enabled);
|
get!().set_color_management_enabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets whether floating windows are shown above fullscreen windows.
|
||||||
|
///
|
||||||
|
/// The default is `false`.
|
||||||
|
pub fn set_float_above_fullscreen(above: bool) {
|
||||||
|
get!().set_float_above_fullscreen(above);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Gets whether floating windows are shown above fullscreen windows.
|
||||||
|
pub fn get_float_above_fullscreen() -> bool {
|
||||||
|
get!().get_float_above_fullscreen()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Toggles whether floating windows are shown above fullscreen windows.
|
||||||
|
///
|
||||||
|
/// The default is `false`.
|
||||||
|
pub fn toggle_float_above_fullscreen() {
|
||||||
|
set_float_above_fullscreen(!get_float_above_fullscreen())
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- Floating windows can now be configured to be shown above fullscreen windows
|
||||||
|
by using the `enable-float-above-fullscreen` action.
|
||||||
|
|
||||||
# 1.10.0 (2025-04-22)
|
# 1.10.0 (2025-04-22)
|
||||||
|
|
||||||
- Various bugfixes.
|
- Various bugfixes.
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,7 @@ fn start_compositor2(
|
||||||
workspace_managers: Default::default(),
|
workspace_managers: Default::default(),
|
||||||
color_management_enabled: Cell::new(false),
|
color_management_enabled: Cell::new(false),
|
||||||
color_manager,
|
color_manager,
|
||||||
|
float_above_fullscreen: Cell::new(false),
|
||||||
});
|
});
|
||||||
state.tracker.register(ClientId::from_raw(0));
|
state.tracker.register(ClientId::from_raw(0));
|
||||||
create_dummy_output(&state);
|
create_dummy_output(&state);
|
||||||
|
|
|
||||||
|
|
@ -1136,6 +1136,21 @@ impl ConfigProxyHandler {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn handle_set_float_above_fullscreen(&self, above: bool) {
|
||||||
|
self.state.float_above_fullscreen.set(above);
|
||||||
|
for seat in self.state.globals.seats.lock().values() {
|
||||||
|
seat.emulate_cursor_moved();
|
||||||
|
seat.trigger_tree_changed(false);
|
||||||
|
}
|
||||||
|
self.state.root.update_visible(&self.state);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn handle_get_float_above_fullscreen(&self) {
|
||||||
|
self.respond(Response::GetFloatAboveFullscreen {
|
||||||
|
above: self.state.float_above_fullscreen.get(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
fn handle_set_vrr_mode(
|
fn handle_set_vrr_mode(
|
||||||
&self,
|
&self,
|
||||||
connector: Option<Connector>,
|
connector: Option<Connector>,
|
||||||
|
|
@ -2039,6 +2054,10 @@ impl ConfigProxyHandler {
|
||||||
} => self
|
} => self
|
||||||
.handle_connector_set_brightness(connector, brightness)
|
.handle_connector_set_brightness(connector, brightness)
|
||||||
.wrn("connector_set_brightness")?,
|
.wrn("connector_set_brightness")?,
|
||||||
|
ClientMessage::SetFloatAboveFullscreen { above } => {
|
||||||
|
self.handle_set_float_above_fullscreen(above)
|
||||||
|
}
|
||||||
|
ClientMessage::GetFloatAboveFullscreen => self.handle_get_float_above_fullscreen(),
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1093,6 +1093,10 @@ impl WlSeatGlobal {
|
||||||
self.apply_changes();
|
self.apply_changes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn emulate_cursor_moved(&self) {
|
||||||
|
self.changes.or_assign(CHANGE_CURSOR_MOVED);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clear_shortcuts(&self) {
|
pub fn clear_shortcuts(&self) {
|
||||||
self.shortcuts.borrow_mut().clear();
|
self.shortcuts.borrow_mut().clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,7 @@ pub struct State {
|
||||||
pub workspace_managers: WorkspaceManagerState,
|
pub workspace_managers: WorkspaceManagerState,
|
||||||
pub color_management_enabled: Cell<bool>,
|
pub color_management_enabled: Cell<bool>,
|
||||||
pub color_manager: Rc<ColorManager>,
|
pub color_manager: Rc<ColorManager>,
|
||||||
|
pub float_above_fullscreen: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// impl Drop for State {
|
// impl Drop for State {
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ impl FloatNode {
|
||||||
let floater = Rc::new(FloatNode {
|
let floater = Rc::new(FloatNode {
|
||||||
id: state.node_ids.next(),
|
id: state.node_ids.next(),
|
||||||
state: state.clone(),
|
state: state.clone(),
|
||||||
visible: Cell::new(ws.container_visible()),
|
visible: Cell::new(ws.float_visible()),
|
||||||
position: Cell::new(position),
|
position: Cell::new(position),
|
||||||
display_link: RefCell::new(None),
|
display_link: RefCell::new(None),
|
||||||
workspace_link: Cell::new(None),
|
workspace_link: Cell::new(None),
|
||||||
|
|
@ -408,7 +408,7 @@ impl FloatNode {
|
||||||
self.workspace_link
|
self.workspace_link
|
||||||
.set(Some(ws.stacked.add_last(self.clone())));
|
.set(Some(ws.stacked.add_last(self.clone())));
|
||||||
self.workspace.set(ws.clone());
|
self.workspace.set(ws.clone());
|
||||||
self.stacked_set_visible(ws.container_visible());
|
self.stacked_set_visible(ws.float_visible());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_child_title(self: &Rc<Self>, title: &str) {
|
fn update_child_title(self: &Rc<Self>, title: &str) {
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,10 @@ impl WorkspaceNode {
|
||||||
self.visible.get() && self.fullscreen.is_none()
|
self.visible.get() && self.fullscreen.is_none()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn float_visible(&self) -> bool {
|
||||||
|
self.visible.get() && (self.fullscreen.is_none() || self.state.float_above_fullscreen.get())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn change_extents(&self, rect: &Rect) {
|
pub fn change_extents(&self, rect: &Rect) {
|
||||||
self.position.set(*rect);
|
self.position.set(*rect);
|
||||||
if let Some(c) = self.container.get() {
|
if let Some(c) = self.container.get() {
|
||||||
|
|
@ -197,7 +201,7 @@ impl WorkspaceNode {
|
||||||
}
|
}
|
||||||
for stacked in self.stacked.iter() {
|
for stacked in self.stacked.iter() {
|
||||||
if stacked.stacked_needs_set_visible() {
|
if stacked.stacked_needs_set_visible() {
|
||||||
stacked.stacked_set_visible(self.container_visible());
|
stacked.stacked_set_visible(self.float_visible());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.seat_state.set_visible(self, visible);
|
self.seat_state.set_visible(self, visible);
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ pub enum SimpleCommand {
|
||||||
ToggleSplit,
|
ToggleSplit,
|
||||||
Forward(bool),
|
Forward(bool),
|
||||||
EnableWindowManagement(bool),
|
EnableWindowManagement(bool),
|
||||||
|
SetFloatAboveFullscreen(bool),
|
||||||
|
ToggleFloatAboveFullscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,9 @@ impl ActionParser<'_> {
|
||||||
"consume" => Forward(false),
|
"consume" => Forward(false),
|
||||||
"enable-window-management" => EnableWindowManagement(true),
|
"enable-window-management" => EnableWindowManagement(true),
|
||||||
"disable-window-management" => EnableWindowManagement(false),
|
"disable-window-management" => EnableWindowManagement(false),
|
||||||
|
"enable-float-above-fullscreen" => SetFloatAboveFullscreen(true),
|
||||||
|
"disable-float-above-fullscreen" => SetFloatAboveFullscreen(false),
|
||||||
|
"toggle-float-above-fullscreen" => ToggleFloatAboveFullscreen,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(
|
return Err(
|
||||||
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)
|
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,12 @@ use {
|
||||||
keyboard::{Keymap, ModifiedKeySym},
|
keyboard::{Keymap, ModifiedKeySym},
|
||||||
logging::set_log_level,
|
logging::set_log_level,
|
||||||
on_devices_enumerated, on_idle, quit, reload, set_color_management_enabled,
|
on_devices_enumerated, on_idle, quit, reload, set_color_management_enabled,
|
||||||
set_default_workspace_capture, set_explicit_sync_enabled, set_idle, set_idle_grace_period,
|
set_default_workspace_capture, set_explicit_sync_enabled, set_float_above_fullscreen,
|
||||||
set_ui_drag_enabled, set_ui_drag_threshold,
|
set_idle, set_idle_grace_period, set_ui_drag_enabled, set_ui_drag_threshold,
|
||||||
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
|
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
|
||||||
switch_to_vt,
|
switch_to_vt,
|
||||||
theme::{reset_colors, reset_font, reset_sizes, set_font},
|
theme::{reset_colors, reset_font, reset_sizes, set_font},
|
||||||
|
toggle_float_above_fullscreen,
|
||||||
video::{
|
video::{
|
||||||
ColorSpace, Connector, DrmDevice, TransferFunction, connectors, drm_devices,
|
ColorSpace, Connector, DrmDevice, TransferFunction, connectors, drm_devices,
|
||||||
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
|
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
|
||||||
|
|
@ -96,6 +97,12 @@ impl Action {
|
||||||
SimpleCommand::EnableWindowManagement(bool) => {
|
SimpleCommand::EnableWindowManagement(bool) => {
|
||||||
B::new(move || s.set_window_management_enabled(bool))
|
B::new(move || s.set_window_management_enabled(bool))
|
||||||
}
|
}
|
||||||
|
SimpleCommand::SetFloatAboveFullscreen(bool) => {
|
||||||
|
B::new(move || set_float_above_fullscreen(bool))
|
||||||
|
}
|
||||||
|
SimpleCommand::ToggleFloatAboveFullscreen => {
|
||||||
|
B::new(|| toggle_float_above_fullscreen())
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Action::Multi { actions } => {
|
Action::Multi { actions } => {
|
||||||
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
|
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
|
||||||
|
|
|
||||||
|
|
@ -1281,7 +1281,10 @@
|
||||||
"forward",
|
"forward",
|
||||||
"none",
|
"none",
|
||||||
"enable-window-management",
|
"enable-window-management",
|
||||||
"disable-window-management"
|
"disable-window-management",
|
||||||
|
"enable-float-above-fullscreen",
|
||||||
|
"disable-float-above-fullscreen",
|
||||||
|
"toggle-float-above-fullscreen"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Status": {
|
"Status": {
|
||||||
|
|
|
||||||
|
|
@ -2891,6 +2891,20 @@ The string should have one of the following values:
|
||||||
|
|
||||||
Disables window management mode.
|
Disables window management mode.
|
||||||
|
|
||||||
|
- `enable-float-above-fullscreen`:
|
||||||
|
|
||||||
|
Enables floating windows showing above fullscreen windows.
|
||||||
|
|
||||||
|
By default, floating windows are hidden below fullscreen windows.
|
||||||
|
|
||||||
|
- `disable-float-above-fullscreen`:
|
||||||
|
|
||||||
|
Disables floating windows showing above fullscreen windows.
|
||||||
|
|
||||||
|
- `toggle-float-above-fullscreen`:
|
||||||
|
|
||||||
|
Toggles floating windows showing above fullscreen windows.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="types-Status"></a>
|
<a name="types-Status"></a>
|
||||||
|
|
|
||||||
|
|
@ -701,6 +701,17 @@ SimpleActionName:
|
||||||
- value: disable-window-management
|
- value: disable-window-management
|
||||||
description: |
|
description: |
|
||||||
Disables window management mode.
|
Disables window management mode.
|
||||||
|
- value: enable-float-above-fullscreen
|
||||||
|
description: |
|
||||||
|
Enables floating windows showing above fullscreen windows.
|
||||||
|
|
||||||
|
By default, floating windows are hidden below fullscreen windows.
|
||||||
|
- value: disable-float-above-fullscreen
|
||||||
|
description: |
|
||||||
|
Disables floating windows showing above fullscreen windows.
|
||||||
|
- value: toggle-float-above-fullscreen
|
||||||
|
description: |
|
||||||
|
Toggles floating windows showing above fullscreen windows.
|
||||||
|
|
||||||
|
|
||||||
Color:
|
Color:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue