Revert "Read all supplied lines from STDIN, not just first one."
This reverts commit 08bf20d43a. Do not
read whole STDIN as it somehow breaks whidow tracking feature.
This commit is contained in:
@@ -26,4 +26,3 @@ verbose = 8
|
|||||||
[-Modules::RequireVersionVar]
|
[-Modules::RequireVersionVar]
|
||||||
[-CodeLayout::RequireTidyCode]
|
[-CodeLayout::RequireTidyCode]
|
||||||
[-TestingAndDebugging::RequireUseWarnings]
|
[-TestingAndDebugging::RequireUseWarnings]
|
||||||
[-ControlStructures::ProhibitDeepNests]
|
|
||||||
|
|||||||
@@ -229,48 +229,48 @@ sub add_events () {
|
|||||||
fh => \*STDIN,
|
fh => \*STDIN,
|
||||||
poll => 'r',
|
poll => 'r',
|
||||||
cb => sub {
|
cb => sub {
|
||||||
while (my $msg = <>) {
|
my $msg = <>;
|
||||||
unless ($STDIN_FIRST_LINE_DROPPED) {
|
|
||||||
$STDIN_FIRST_LINE_DROPPED = 1;
|
unless ($STDIN_FIRST_LINE_DROPPED) {
|
||||||
next;
|
$msg = <>;
|
||||||
|
$STDIN_FIRST_LINE_DROPPED = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($msg) {
|
||||||
|
# drop leading ',' if present
|
||||||
|
if (substr ($msg, 0, 1) eq ',') {
|
||||||
|
$msg = substr $msg, 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($msg) {
|
my $j = eval { decode_json $msg };
|
||||||
# drop leading ',' if present
|
|
||||||
if (substr ($msg, 0, 1) eq ',') {
|
|
||||||
$msg = substr $msg, 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $j = eval { decode_json $msg };
|
if (defined $j) {
|
||||||
|
# left button click, without shift, ctrl, alt, etc
|
||||||
|
if (($j->{button} == 1) && ($#{$j->{modifiers}} < 0)) {
|
||||||
|
foreach (@{$CONF->{apps}}) {
|
||||||
|
unless (defined $_->{name}) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
if (defined $j) {
|
unless (defined $j->{name}) {
|
||||||
# left button click, without shift, ctrl, alt, etc
|
next;
|
||||||
if (($j->{button} == 1) && ($#{$j->{modifiers}} < 0)) {
|
}
|
||||||
foreach (@{$CONF->{apps}}) {
|
|
||||||
unless (defined $_->{name}) {
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
unless (defined $j->{name}) {
|
if ($j->{name} eq $_->{name}) {
|
||||||
next;
|
spawn ($_->{cmd});
|
||||||
}
|
last;
|
||||||
|
|
||||||
if ($j->{name} eq $_->{name}) {
|
|
||||||
spawn ($_->{cmd});
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (($j->{name} eq 'wallclock') && ($CONF->{clock}->{enabled})) {
|
if (($j->{name} eq 'wallclock') && ($CONF->{clock}->{enabled})) {
|
||||||
if ($CONF->{clock}->{left_click}->{enabled}) {
|
if ($CONF->{clock}->{left_click}->{enabled}) {
|
||||||
if (($j->{button} == 1) && ($#{$j->{modifiers}} < 0)) {
|
if (($j->{button} == 1) && ($#{$j->{modifiers}} < 0)) {
|
||||||
spawn ($CONF->{clock}->{left_click}->{cmd});
|
spawn ($CONF->{clock}->{left_click}->{cmd});
|
||||||
}
|
}
|
||||||
} elsif ($CONF->{clock}->{right_click}->{enabled}) {
|
} elsif ($CONF->{clock}->{right_click}->{enabled}) {
|
||||||
if (($j->{button} == 2) && ($#{$j->{modifiers}} < 0)) {
|
if (($j->{button} == 2) && ($#{$j->{modifiers}} < 0)) {
|
||||||
spawn ($CONF->{clock}->{right_click}->{cmd});
|
spawn ($CONF->{clock}->{right_click}->{cmd});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user