xwayland: set output for override redirect windows
This commit is contained in:
parent
0dc1929bbd
commit
7ff7edaa8f
7 changed files with 13 additions and 15 deletions
|
|
@ -423,6 +423,9 @@ impl ToplevelNodeBase for Xwindow {
|
|||
if self.data.info.override_redirect.get() {
|
||||
self.data.state.damage(old);
|
||||
self.data.state.damage(*rect);
|
||||
let (x, y) = rect.center();
|
||||
let output = self.data.state.find_closest_output(x, y).0;
|
||||
self.x.surface.set_output(&output);
|
||||
} else {
|
||||
self.data
|
||||
.state
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ pub mod test_container_node_ext;
|
|||
pub mod test_expected_event;
|
||||
pub mod test_object_ext;
|
||||
pub mod test_ouput_node_ext;
|
||||
pub mod test_rect_ext;
|
||||
pub mod test_surface_ext;
|
||||
pub mod test_toplevel_node_ext;
|
||||
pub mod test_window;
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
use crate::rect::Rect;
|
||||
|
||||
pub trait TestRectExt {
|
||||
fn center(&self) -> (i32, i32);
|
||||
}
|
||||
|
||||
impl TestRectExt for Rect {
|
||||
fn center(&self) -> (i32, i32) {
|
||||
((self.x1() + self.x2()) / 2, (self.y1() + self.y2()) / 2)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{it::test_utils::test_rect_ext::TestRectExt, tree::ToplevelNode};
|
||||
use crate::tree::ToplevelNode;
|
||||
|
||||
pub trait TestToplevelNodeExt {
|
||||
fn center(&self) -> (i32, i32);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use {
|
||||
crate::{
|
||||
ifs::wl_seat::BTN_LEFT,
|
||||
it::{test_error::TestResult, test_utils::test_rect_ext::TestRectExt, testrun::TestRun},
|
||||
it::{test_error::TestResult, testrun::TestRun},
|
||||
tree::Node,
|
||||
},
|
||||
std::rc::Rc,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
it::{test_error::TestResult, test_utils::test_rect_ext::TestRectExt, testrun::TestRun},
|
||||
it::{test_error::TestResult, testrun::TestRun},
|
||||
tree::Node,
|
||||
},
|
||||
std::rc::Rc,
|
||||
|
|
|
|||
|
|
@ -236,4 +236,11 @@ impl Rect {
|
|||
pub fn size(&self) -> (i32, i32) {
|
||||
(self.width(), self.height())
|
||||
}
|
||||
|
||||
pub fn center(&self) -> (i32, i32) {
|
||||
(
|
||||
self.raw.x1 + self.width() / 2,
|
||||
self.raw.y1 + self.height() / 2,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue