Skip to content

Commit

Permalink
FocusManager: Make sure to never reuse a freed Window (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
tintou authored May 21, 2024
1 parent d00d48c commit a3dcd33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions wingpanel-interface/FocusManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/

public class WingpanelInterface.FocusManager : Object {
private unowned Meta.Workspace? current_workspace = null;
private unowned Meta.Window? last_focused_window = null;
private unowned Meta.Window? last_focused_dialog_window = null;
private Meta.Workspace? current_workspace = null;
private Meta.Window? last_focused_window = null;
private Meta.Window? last_focused_dialog_window = null;

public FocusManager () {
unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager ();
Expand Down Expand Up @@ -83,6 +83,10 @@ public class WingpanelInterface.FocusManager : Object {
void window_unmanaged (Meta.Window window) {
window.focused.disconnect (window_focused);
window.unmanaged.disconnect (window_unmanaged);

if (last_focused_window == window) {
last_focused_window = null;
}
}

public bool begin_grab_focused_window (int x, int y, int button, uint time, uint state) {
Expand Down

0 comments on commit a3dcd33

Please sign in to comment.