|
I found (what I think is) a problem in X11::WMCtrl. The function get_windows was returning the hostname and window name in the title field. I believe this was caused because my version of the wmctrl program was returning two spaces between the ID and hostname, for example:
x0340007a 0 simon My Yahoo! - Mozilla Firefox
I re-wrote the get_windows function to take this into account:
sub get_windows {
my $self = shift;
my $data = $self->wmctrl('-l');
my @windows;
foreach my $line (split(/\n/, $data)) {
if($line =~ /^([^ ]*) *([^ ]*) *([^ ]*) *(.*)/)
{
push(@windows, {
id => $1,
workspace => $2,
host => $3,
title => $4,
});
}
}
return @windows;
}
|