Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
Fix focus fight and side panel opacity flicker on window clicks
src/server/cursor.rs | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/server/cursor.rs b/src/server/cursor.rs
index 2d3181e..2471e58 100644
--- a/src/server/cursor.rs
+++ b/src/server/cursor.rs
@@ -802,10 +802,13 @@ unsafe extern "C" fn handle_button(listener: *mut ffi::wl_listener, data: *mut s
if let Some(result) = (*server).scene.at(lx, ly) {
match result.data {
SceneNodeDataVal::Window(window) => {
- seat.focus(Focus::Window(window));
- if !seat.object.is_null() && !(*window).object.is_null() {
- ffi::wl_resource_post_event(seat.object, 4, (*window).object);
- (*(*seat).server).wm.dirty_windowing();
+ if !seat.object.is_null() {
+ if !(*window).object.is_null() {
+ ffi::wl_resource_post_event(seat.object, 4, (*window).object);
+ (*(*seat).server).wm.dirty_windowing();
+ }
+ } else {
+ seat.focus(Focus::Window(window));
}
}
SceneNodeDataVal::LayerSurface(_) => {