1
0
Fork 0
forked from wry/wry

autocommit 2022-04-08 00:04:55 CEST

This commit is contained in:
Julian Orth 2022-04-08 00:04:55 +02:00
parent 26f8c1aeb6
commit 0bd9a70e69
10 changed files with 35 additions and 12 deletions

View file

@ -160,6 +160,7 @@ fn main_(forker: Rc<ForkerProxy>, logger: Arc<Logger>, _args: &RunArgs) -> Resul
seat_state: Default::default(),
name: "dummy".to_string(),
output_link: Default::default(),
visible: Cell::new(false),
});
dummy_workspace.output_link.set(Some(
dummy_output.workspaces.add_last(dummy_workspace.clone()),

View file

@ -452,9 +452,8 @@ impl WlSeatGlobal {
impl WlSeatGlobal {
pub fn enter_toplevel(self: &Rc<Self>, n: Rc<dyn ToplevelNode>) {
if n.accepts_keyboard_focus() {
log::info!("does not accept input focus");
self.focus_toplevel(n);
}
self.focus_toplevel(n);
}
pub fn enter_popup(self: &Rc<Self>, _n: &Rc<XdgPopup>) {

View file

@ -253,7 +253,7 @@ impl WlSurface {
pub fn accepts_kb_focus(&self) -> bool {
match self.toplevel.get() {
Some(tl) => true,
Some(tl) => tl.accepts_keyboard_focus(),
_ => self.ext.get().accepts_kb_focus(),
}
}

View file

@ -1,3 +1,4 @@
use std::ops::Not;
use {
crate::{
client::Client,
@ -448,7 +449,7 @@ impl ToplevelNode for Xwindow {
}
fn accepts_keyboard_focus(&self) -> bool {
self.data.info.input_model.get() != XInputModel::None
self.data.info.never_focus.get().not() && self.data.info.input_model.get() != XInputModel::None
}
fn default_surface(&self) -> Rc<WlSurface> {

View file

@ -322,6 +322,8 @@ xkb_keymap {
key <94> { [ equal , asterisk ] };
key <124> { [ at , asciicircum ] };
key <92> { [ numbersign , grave ] };
modifier_map Mod1 { Alt_L, Alt_R };
};
};

View file

@ -69,22 +69,32 @@ impl Renderer<'_> {
if let Some(ws) = output.workspace.get() {
self.render_workspace(&ws, x, y + th);
}
render_layer!(output.layers[2]);
render_layer!(output.layers[3]);
for stacked in self.state.root.stacked.iter() {
if let Some(ws) = stacked.get_workspace() {
if ws.visible.get() {
let pos = stacked.absolute_position();
if pos.intersects(&opos) {
let (x, y) = opos.translate(pos.x1(), pos.y1());
stacked.render(self, x, y);
}
}
}
}
for stacked in self.state.root.xstacked.iter() {
let pos = stacked.absolute_position();
stacked.render(self, x + pos.x1(), y + pos.y1());
if pos.intersects(&opos) {
let (x, y) = opos.translate(pos.x1(), pos.y1());
stacked.render(self, x, y);
}
}
render_layer!(output.layers[2]);
render_layer!(output.layers[3]);
}
pub fn render_workspace(&mut self, workspace: &WorkspaceNode, x: i32, y: i32) {
if let Some(node) = workspace.container.get() {
self.render_container(&node, x, y)
}
for stacked in workspace.stacked.iter() {
let pos = stacked.absolute_position();
stacked.render(self, pos.x1(), pos.y1());
}
}
fn x_to_f(&self, x: i32) -> f32 {

View file

@ -248,6 +248,7 @@ impl State {
seat_state: Default::default(),
name: name.to_string(),
output_link: Cell::new(None),
visible: Cell::new(false),
});
workspace
.output_link

View file

@ -1,3 +1,4 @@
use std::cell::Cell;
use {
crate::{
backend::Mode,
@ -106,6 +107,7 @@ impl OutputNode {
seat_state: Default::default(),
name: name.clone(),
output_link: Default::default(),
visible: Cell::new(false),
});
self.state.workspaces.set(name, workspace.clone());
workspace
@ -117,7 +119,12 @@ impl OutputNode {
}
pub fn show_workspace(&self, ws: &Rc<WorkspaceNode>) {
self.workspace.set(Some(ws.clone()));
ws.visible.set(true);
if let Some(old) = self.workspace.set(Some(ws.clone())) {
if old.id != ws.id {
old.visible.set(false);
}
}
ws.clone().change_extents(&self.workspace_rect());
}

View file

@ -27,6 +27,7 @@ pub struct WorkspaceNode {
pub seat_state: NodeSeatState,
pub name: String,
pub output_link: Cell<Option<LinkedNode<Rc<WorkspaceNode>>>>,
pub visible: Cell<bool>,
}
impl WorkspaceNode {

View file

@ -677,6 +677,7 @@ impl Wm {
log::error!("Could not retrieve WM_HINTS property: {}", ErrorFmt(e));
}
data.info.icccm_hints.input.set(true);
self.compute_input_model(data);
return;
}
let mut values = [0; 9];