~kklimonda/ubuntu/lucid/rxvt-unicode/lp-514821

« back to all changes in this revision

Viewing changes to src/perl/kuake

  • Committer: Bazaar Package Importer
  • Author(s): Decklin Foster
  • Date: 2006-09-01 14:44:58 UTC
  • mfrom: (1.1.8 upstream) (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060901144458-98hrz8zg01w8a3vy
Tags: 7.9-2
* Edit the comments in the app-defaults file, and disable all settings by
  default. If font autoselection fails, I would prefer to open a new bug
  specifically for that. (Closes: #385481)
* Reorganize and edit README.Debian, pushing as much as possible into FAQ
  format (with resource setting issues first).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! perl
 
2
 
 
3
sub on_start {
 
4
   my ($self) = @_;
 
5
 
 
6
   $self->{key} = $self->{argv}[0] || "F10";
 
7
 
 
8
   $self->{keysym} = $self->XStringToKeysym ($self->{key})
 
9
      or urxvt::fatal "cannot convert requested kuake wake-up key '$self->{key}' to keysym, unable to continue.\n";
 
10
 
 
11
   $self->{keycode} = $self->XKeysymToKeycode ($self->{keysym})
 
12
      or urxvt::fatal "cannot convert requested kuake wake-up key '$self->{key}' to keycode, unable to continue.\n";
 
13
 
 
14
   $self->XGrabKey ($self->{keycode}, urxvt::AnyModifier, $self->DefaultRootWindow);
 
15
 
 
16
   $self->XUnmapWindow ($self->parent);
 
17
 
 
18
   $self->{unmap_me} = 1;
 
19
 
 
20
   ()
 
21
}
 
22
 
 
23
sub on_map_notify {
 
24
   my ($self) = @_;
 
25
 
 
26
   # suppress initial map event
 
27
   $self->XUnmapWindow ($self->parent)
 
28
      if delete $self->{unmap_me};
 
29
   
 
30
   ()
 
31
}
 
32
 
 
33
sub on_root_event {
 
34
   my ($self, $event) = @_;
 
35
 
 
36
   return unless $event->{type} == urxvt::KeyPress && $event->{keycode} == $self->{keycode};
 
37
 
 
38
   $self->mapped
 
39
      ? $self->XUnmapWindow ($self->parent)
 
40
      : $self->XMapWindow ($self->parent);
 
41
 
 
42
   1
 
43
}
 
44
 
 
45
sub on_destroy {
 
46
   my ($self) = @_;
 
47
 
 
48
   $self->XUngrabKey ($self->XKeysymToKeycode ($self->{keysym}), 0, $self->DefaultRootWindow)
 
49
      if $self->{keysym};
 
50
 
 
51
   ()
 
52
}