1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | sub on_osc_seq { |
|
|
4 | my ($self, $op, $args) = @_; |
|
|
5 | |
|
|
6 | if ($op == 20) { |
|
|
7 | my ($pic, $commands) = split(/;/, $args, 2); |
|
|
8 | if ($pic !~ /^$/ && $commands !~ /[+\-]/) { |
|
|
9 | my ($x, $y) = $self->XTranslateCoordinates ( |
|
|
10 | $self->vt, $self->DefaultRootWindow, |
|
|
11 | 0, 0 |
|
|
12 | ); |
|
|
13 | $self->cmd_parse ("\033]20;$pic;=+$x+$y\007"); |
|
|
14 | return 1; |
|
|
15 | } |
|
|
16 | } |
|
|
17 | |
|
|
18 | () |
|
|
19 | } |
2 | |
20 | |
3 | sub on_configure_notify { |
21 | sub on_configure_notify { |
4 | my ($self, $event) = @_; |
22 | my ($self, $event) = @_; |
5 | |
23 | |
6 | my ($x, $y); |
|
|
7 | |
|
|
8 | if ($event->{send_event}) { |
|
|
9 | ($x, $y) = ($event->{x}, $event->{y}); |
|
|
10 | } else { |
|
|
11 | ($x, $y) = $self->XTranslateCoordinates ( |
24 | my ($x, $y) = $self->XTranslateCoordinates ( |
12 | $self->vt, $self->DefaultRootWindow, |
25 | $self->vt, $self->DefaultRootWindow, |
13 | 0, 0 |
26 | 0, 0 |
14 | ); |
27 | ); |
15 | } |
|
|
16 | |
28 | |
17 | $self->cmd_parse ("\033]20;;=+$x+$y\007"); |
29 | $self->cmd_parse ("\033]20;;=+$x+$y\007"); |
18 | } |
30 | } |