~ubuntu-branches/ubuntu/precise/easystroke/precise

« back to all changes in this revision

Viewing changes to grabber.cc

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Jaeger
  • Date: 2009-03-16 22:58:42 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090316225842-udrm7z2c3utcsy1y
Tags: 0.4.1.1-0ubuntu1
New upstream release (LP: #344040)

Show diffs side-by-side

added added

removed removed

Lines of Context:
504
504
void Grabber::XiDevice::update_pointer_mapping() {
505
505
        if (!xi_15)
506
506
                return;
507
 
#define MAX_BUTTONS 256
508
507
        unsigned char map[MAX_BUTTONS];
509
508
        int n = XGetDeviceButtonMapping(dpy, dev, map, MAX_BUTTONS);
510
509
        inv_map.clear();
611
610
                return prefs.button.get().button;
612
611
}
613
612
 
 
613
extern bool disable_root();
 
614
 
614
615
void Grabber::update() {
615
616
        wm_class = get_wm_class(current_window.get());
616
617
        std::map<std::string, RButtonInfo>::const_iterator i = prefs.exceptions.ref().find(wm_class);
623
624
                } else {
624
625
                        active = false;
625
626
                }
 
627
        } else {
 
628
                if (disable_root())
 
629
                        active = false;
626
630
        }
627
631
        const std::vector<ButtonInfo> &extra = prefs.extra_buttons.ref();
628
632
        if (grabbed_button == bi && buttons.size() == extra.size() + 1 &&
669
673
        if (verbosity >= 3)
670
674
                printf("fake xi %s: %d -> %d\n", press ? "press" : "release", b2, b);
671
675
        if (!xi_15)
672
 
                XTestFakeButtonEvent(dpy, b2, press, CurrentTime);
 
676
                fake_core_button(b2, press);
673
677
}
674
678
 
675
679
std::string Grabber::get_wm_class(Window w) {