Most X11 windows apparently have no name, and xdotool (done with version 2016, the previous / working one) returns a null pointer. x_do.cr however expects a string. This adds a null check so that window.name returns nil in that case instead of failing with Unhandled exception: Cannot create a string with a null pointer (ArgumentError).
Demo code:
require "x_do"
XDo.act do
wins = search do
window_name "" # all (regex)
end
puts wins.map &.name
end
Most X11 windows apparently have no name, and xdotool (done with version 2016, the previous / working one) returns a null pointer. x_do.cr however expects a string. This adds a null check so that
window.name
returnsnil
in that case instead of failing withUnhandled exception: Cannot create a string with a null pointer (ArgumentError)
.Demo code: