workspace: use State::show_workspace2 to make workspaces visible
This commit is contained in:
parent
d12234b38b
commit
e85accf805
4 changed files with 23 additions and 33 deletions
|
|
@ -250,10 +250,10 @@ impl ExtWorkspaceManagerV1RequestHandler for ExtWorkspaceManagerV1 {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
let output = ws.output.get();
|
let output = ws.output.get();
|
||||||
output.show_workspace(&ws);
|
let seat = self.client.state.seat_queue.last().as_deref().cloned();
|
||||||
ws.flush_jay_workspaces();
|
self.client
|
||||||
output.schedule_update_render_data();
|
.state
|
||||||
self.client.state.tree_changed();
|
.show_workspace2(seat.as_ref(), &output, &ws);
|
||||||
}
|
}
|
||||||
WorkspaceChange::AssignWorkspace(w, o) => {
|
WorkspaceChange::AssignWorkspace(w, o) => {
|
||||||
let Some(ws) = w.get() else {
|
let Some(ws) = w.get() else {
|
||||||
|
|
|
||||||
20
src/state.rs
20
src/state.rs
|
|
@ -853,8 +853,12 @@ impl State {
|
||||||
node.node_do_focus(&seat, Direction::Unspecified);
|
node.node_do_focus(&seat, Direction::Unspecified);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show_workspace2(&self, seat: Option<&Rc<WlSeatGlobal>>, ws: &Rc<WorkspaceNode>) {
|
pub fn show_workspace2(
|
||||||
let output = ws.output.get();
|
&self,
|
||||||
|
seat: Option<&Rc<WlSeatGlobal>>,
|
||||||
|
output: &Rc<OutputNode>,
|
||||||
|
ws: &Rc<WorkspaceNode>,
|
||||||
|
) {
|
||||||
let mut pinned_is_focused = false;
|
let mut pinned_is_focused = false;
|
||||||
if let Some(seat) = seat {
|
if let Some(seat) = seat {
|
||||||
for pinned in output.pinned.iter() {
|
for pinned in output.pinned.iter() {
|
||||||
|
|
@ -876,12 +880,10 @@ impl State {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ws.flush_jay_workspaces();
|
ws.flush_jay_workspaces();
|
||||||
output.schedule_update_render_data();
|
if !output.is_dummy {
|
||||||
self.tree_changed();
|
output.schedule_update_render_data();
|
||||||
// let seats = self.globals.seats.lock();
|
self.tree_changed();
|
||||||
// for seat in seats.values() {
|
}
|
||||||
// seat.workspace_changed(&output);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show_workspace(&self, seat: &Rc<WlSeatGlobal>, name: &str) {
|
pub fn show_workspace(&self, seat: &Rc<WlSeatGlobal>, name: &str) {
|
||||||
|
|
@ -896,7 +898,7 @@ impl State {
|
||||||
output.create_workspace(name)
|
output.create_workspace(name)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
self.show_workspace2(Some(seat), &ws);
|
self.show_workspace2(Some(seat), &ws.output.get(), &ws);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn float_map_ws(&self) -> Rc<WorkspaceNode> {
|
pub fn float_map_ws(&self) -> Rc<WorkspaceNode> {
|
||||||
|
|
|
||||||
|
|
@ -1081,7 +1081,7 @@ impl OutputNode {
|
||||||
set_layer_visible!(self.layers[3], visible);
|
set_layer_visible!(self.layers[3], visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn button(self: Rc<Self>, id: PointerType) {
|
fn button(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, id: PointerType) {
|
||||||
if !self.state.show_bar.get() {
|
if !self.state.show_bar.get() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1105,10 +1105,7 @@ impl OutputNode {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
self.show_workspace(&ws);
|
self.state.show_workspace2(Some(seat), &self, &ws);
|
||||||
ws.flush_jay_workspaces();
|
|
||||||
self.schedule_update_render_data();
|
|
||||||
self.state.tree_changed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_presentation_type(&self) {
|
pub fn update_presentation_type(&self) {
|
||||||
|
|
@ -1628,7 +1625,7 @@ impl Node for OutputNode {
|
||||||
self.pointer_down.remove(&seat.id());
|
self.pointer_down.remove(&seat.id());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.button(PointerType::Seat(seat.id()));
|
self.button(seat, PointerType::Seat(seat.id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_on_axis_event(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, event: &PendingScroll) {
|
fn node_on_axis_event(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, event: &PendingScroll) {
|
||||||
|
|
@ -1658,15 +1655,7 @@ impl Node for OutputNode {
|
||||||
None => break,
|
None => break,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if !self.show_workspace(&ws) {
|
self.state.show_workspace2(Some(seat), &self, &ws);
|
||||||
return;
|
|
||||||
}
|
|
||||||
ws.flush_jay_workspaces();
|
|
||||||
ws.deref()
|
|
||||||
.clone()
|
|
||||||
.node_do_focus(seat, Direction::Unspecified);
|
|
||||||
self.schedule_update_render_data();
|
|
||||||
self.state.tree_changed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_on_leave(&self, seat: &WlSeatGlobal) {
|
fn node_on_leave(&self, seat: &WlSeatGlobal) {
|
||||||
|
|
@ -1730,7 +1719,7 @@ impl Node for OutputNode {
|
||||||
self.pointer_move(id, x, y);
|
self.pointer_move(id, x, y);
|
||||||
if let Some(changes) = changes {
|
if let Some(changes) = changes {
|
||||||
if changes.down == Some(true) {
|
if changes.down == Some(true) {
|
||||||
self.button(id);
|
self.button(tool.seat(), id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ impl Node for WorkspaceNode {
|
||||||
if self.is_dummy {
|
if self.is_dummy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.state.show_workspace2(None, &self);
|
self.state.show_workspace2(None, &self.output.get(), &self);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_on_pointer_focus(&self, seat: &Rc<WlSeatGlobal>) {
|
fn node_on_pointer_focus(&self, seat: &Rc<WlSeatGlobal>) {
|
||||||
|
|
@ -499,14 +499,13 @@ pub fn move_ws_to_output(
|
||||||
&& (config.make_visible_always
|
&& (config.make_visible_always
|
||||||
|| (config.make_visible_if_empty && target.workspace.is_none()));
|
|| (config.make_visible_if_empty && target.workspace.is_none()));
|
||||||
if make_visible {
|
if make_visible {
|
||||||
target.show_workspace(&ws);
|
ws.state.show_workspace2(None, target, &ws);
|
||||||
} else {
|
} else {
|
||||||
ws.set_visible(false);
|
ws.set_visible(false);
|
||||||
}
|
}
|
||||||
ws.flush_jay_workspaces();
|
ws.flush_jay_workspaces();
|
||||||
if let Some(ws) = new_source_ws {
|
if let Some(ws) = new_source_ws {
|
||||||
source.show_workspace(&ws);
|
ws.state.show_workspace2(None, &source, &ws);
|
||||||
ws.flush_jay_workspaces();
|
|
||||||
}
|
}
|
||||||
if !target.is_dummy {
|
if !target.is_dummy {
|
||||||
target.schedule_update_render_data();
|
target.schedule_update_render_data();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue