wm: Screenshot user-selectable region on Ctrl-Shift-F5.

I am tired of scp-ing screenshots and running Gimp to crop
them whenever I'm filing a bug.  This adds a --region flag
to the screenshot program, triggering an interactive mode
where a box can be dragged to take a screenshot.  Escape
aborts.

I think that the usual way to do rubber-banding is by
grabbing the server and painting on the root window with an
inverting GC, but I don't think that that'll work with a
compositing window manager.  This code just uses four
windows to draw black and white borders around the region
instead.

BUG=none
TEST=manual

Change-Id: If6ebc4efe09413542a8d8f7b131dae8111c5c814
Reviewed-on: http://gerrit.chromium.org/gerrit/4198
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
4 files changed
tree: 58a36383e3f9c7fc60e6655db109f478b7657318
  1. bin/
  2. compositor/
  3. data/
  4. layout2/
  5. login/
  6. panels/
  7. tools/
  8. x11/
  9. .gitignore
  10. atom_cache.cc
  11. atom_cache.h
  12. callback.h
  13. chrome_watchdog.cc
  14. chrome_watchdog.h
  15. chrome_watchdog_test.cc
  16. dbus_interface.h
  17. event_consumer.h
  18. event_consumer_registrar.cc
  19. event_consumer_registrar.h
  20. event_loop.cc
  21. event_loop.h
  22. event_loop_test.cc
  23. focus_manager.cc
  24. focus_manager.h
  25. focus_manager_test.cc
  26. geometry.cc
  27. geometry.h
  28. image_container.cc
  29. image_container.h
  30. image_enums.h
  31. image_grid.cc
  32. image_grid.h
  33. image_grid_test.cc
  34. inherit-review-settings-ok
  35. key_bindings.cc
  36. key_bindings.h
  37. key_bindings_test.cc
  38. LICENSE
  39. main.cc
  40. make_shaders.py
  41. make_tests.sh
  42. math_types.h
  43. mock_chrome.cc
  44. mock_chrome.h
  45. mock_dbus_interface.cc
  46. mock_dbus_interface.h
  47. modality_handler.cc
  48. modality_handler.h
  49. modality_handler_test.cc
  50. motion_event_coalescer.cc
  51. motion_event_coalescer.h
  52. motion_event_coalescer_test.cc
  53. pointer_position_watcher.cc
  54. pointer_position_watcher.h
  55. pointer_position_watcher_test.cc
  56. profiler.cc
  57. profiler.h
  58. profiler_data.h
  59. real_dbus_interface.cc
  60. real_dbus_interface.h
  61. resize_box.cc
  62. resize_box.h
  63. run_in_xephyr.sh
  64. SConstruct
  65. screen_locker_handler.cc
  66. screen_locker_handler.h
  67. screen_locker_handler_test.cc
  68. screenshot.cc
  69. shadow.cc
  70. shadow.h
  71. shadow_test.cc
  72. stacking_manager.cc
  73. stacking_manager.h
  74. stacking_manager_test.cc
  75. start_test_wm.sh
  76. test_lib.cc
  77. test_lib.h
  78. transient_window_collection.cc
  79. transient_window_collection.h
  80. transient_window_collection_test.cc
  81. util.cc
  82. util.h
  83. util_test.cc
  84. WATCHLISTS
  85. window.cc
  86. window.h
  87. window_manager.cc
  88. window_manager.h
  89. window_manager_test.cc
  90. window_test.cc
  91. wm_ipc.cc
  92. wm_ipc.h
  93. wm_ipc_test.cc
  94. xinit.sh
  95. xlib_header_test.cc