Skip to content

Commit

Permalink
fix setting last found window in IfWinActive/IfWinNotActive
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Jul 2, 2023
1 parent c3a6f2e commit 04f7115
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/control-flow/if-win-active.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Cmd::ControlFlow::IfWinActive < Cmd::Base
def run(thread, args)
active = false
Cmd::X11::Window::Util.match(thread, args, empty_is_last_found: true, a_is_active: false) do |win|
thread.settings.last_found_window = win
active = win == thread.runner.display.x_do.active_window
end
active
Expand Down
1 change: 1 addition & 0 deletions src/cmd/control-flow/if-win-not-active.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Cmd::ControlFlow::IfWinNotActive < Cmd::Base
def run(thread, args)
active = false
Cmd::X11::Window::Util.match(thread, args, empty_is_last_found: true, a_is_active: false) do |win|
thread.settings.last_found_window = win
active = win == thread.runner.display.x_do.active_window
end
! active
Expand Down

0 comments on commit 04f7115

Please sign in to comment.