Advertisement
Guest User

Untitled

a guest
Jan 17th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. diff --git a/usr_sbin/editpolicy.c b/usr_sbin/editpolicy.c
  2. index 45dd0ef..09e3b10 100644
  3. --- a/usr_sbin/editpolicy.c
  4. +++ b/usr_sbin/editpolicy.c
  5. @@ -2270,6 +2270,21 @@ static void ccs_show_list(void)
  6. }
  7.  
  8. /**
  9. + * ccs_click1 - Callback for clicking the left mouse button
  10. + *
  11. + * Returns nothing.
  12. + */
  13. +static void ccs_click1(MEVENT mevent)
  14. +{
  15. + struct ccs_screen *ptr = &ccs_screen[ccs_current_screen];
  16. + /* header is 3 tall */
  17. + if (mevent.y < 3)
  18. + return;
  19. + ptr->y = mevent.y - 3;
  20. + ccs_show_current();
  21. +}
  22. +
  23. +/**
  24. * ccs_resize_window - Callback for resize event.
  25. *
  26. * Returns nothing.
  27. @@ -3222,6 +3237,8 @@ static enum ccs_screen_type ccs_generic_list_loop(void)
  28. ptr->current = saved_cursor[ccs_current_screen].current;
  29. ptr->y = saved_cursor[ccs_current_screen].y;
  30. }
  31. + MEVENT mevent;
  32. + mousemask(ALL_MOUSE_EVENTS, NULL);
  33. start:
  34. if (ccs_current_screen == CCS_SCREEN_DOMAIN_LIST) {
  35. if (!ccs_domain_sort_type) {
  36. @@ -3281,6 +3298,13 @@ start2:
  37. if (c == ERR)
  38. continue; /* Ignore invalid key. */
  39. switch (c) {
  40. + case KEY_MOUSE:
  41. + if (getmouse(&mevent) == OK) {
  42. + if (mevent.bstate & BUTTON1_CLICKED) {
  43. + ccs_click1(mevent);
  44. + }
  45. + }
  46. + break;
  47. case KEY_RESIZE:
  48. ccs_resize_window();
  49. ccs_show_list();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement