示例#1
0
文件: event.c 项目: kidanger/wmfs
static void
event_buttonpress(XEvent *e)
{
     XButtonEvent *ev = &e->xbutton;
     struct mousebind *m;
     struct barwin *b;
     struct client *c;

     screen_update_sel();
     status_flush_surface();

     SLIST_FOREACH(b, &W->h.barwin, next)
          if(b->win == ev->window)
          {
               W->last_clicked_barwin = b;

               SLIST_FOREACH(m, &b->mousebinds, next)
                    MOUSE_DO_BIND(m);

               SLIST_FOREACH(m, &b->statusmousebinds, next)
                    MOUSE_DO_BIND(m);

               break;
          }
     if((c = client_gb_win(ev->window)) && c != W->client
         && ev->button == 1 && W->cfocus & CFOCUS_CLICK)
          client_focus(c);
}
示例#2
0
文件: event.c 项目: kidanger/wmfs
static void
event_keypress(XEvent *e)
{
     XKeyPressedEvent *ev = &e->xkey;
     KeySym keysym = XKeycodeToKeysym(EVDPY(e), (KeyCode)ev->keycode, 0);
     struct keybind *k;

     screen_update_sel();
     status_flush_surface();

     SLIST_FOREACH(k, &W->h.keybind, next)
          if(k->keysym == keysym && KEYPRESS_MASK(k->mod) == KEYPRESS_MASK(ev->state))
               if(k->func)
                    k->func(k->cmd);
}
示例#3
0
文件: event.c 项目: HFT/wmfs
static void
event_buttonpress(XEvent *e)
{
     XButtonEvent *ev = &e->xbutton;
     struct mousebind *m;
     struct barwin *b;

     screen_update_sel();
     status_flush_surface();

     SLIST_FOREACH(b, &W->h.barwin, next)
          if(b->win == ev->window)
          {
               W->last_clicked_barwin = b;

               SLIST_FOREACH(m, &b->mousebinds, next)
                    MOUSE_DO_BIND(m);

               SLIST_FOREACH(m, &b->statusmousebinds, next)
                    MOUSE_DO_BIND(m);

               break;
          }
}