Skip to content

Commit 346f055

Browse files
ids1024Drakulix
authored andcommitted
focus: Check if X11 surface matches in KeyboardFocus::replace()
Tested on `SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=1 supertux2`, using XWayland. If the game starts with fullscreen configured, it minimizes immediately on start. But after this change, this no longer happens. This hopefully will improve behaviors with various X11/wine fullscreen clients. It may fix #1510, though looking at the video the behavior there may be a bit different.
1 parent 9e66bed commit 346f055

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/shell/focus/target.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
494494
}
495495
fn replace(
496496
&self,
497-
replaced: <State as smithay::input::SeatHandler>::KeyboardFocus,
497+
replaced: Self,
498498
seat: &Seat<State>,
499499
data: &mut State,
500500
keys: Vec<KeysymHandle<'_>>,
@@ -504,6 +504,9 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
504504
if !replaced
505505
.wl_surface()
506506
.is_some_and(|s| Some(s) == self.wl_surface())
507+
&& !replaced
508+
.x11_surface()
509+
.is_some_and(|s| Some(s) == self.x11_surface())
507510
{
508511
KeyboardTarget::leave(&replaced, seat, data, serial);
509512
KeyboardTarget::enter(self, seat, data, keys, serial);

0 commit comments

Comments
 (0)