Commit Graph

11 Commits

Author SHA1 Message Date
Richard Grenville 66e615775b Bug fix #7: Correct a possible issue in VSync
- I realized I might have fundamentally misunderstood VSync. This commit
  tries to fix the possible problem, or at least move the tearing line
  close to the top of the screen.

- Software VSync is replaced by --sw-opti (software optimization), as
  I guess it isn't possible at all to do VSync without driver support.

- Add "vsync" and "sw-opti" as configuration file options.
2012-10-26 11:28:38 +08:00
Richard Grenville 049621bed7 Improvement: Add painting on overlay support
- Add support for painting on X Composite overlay window instead of root
  window (--paint-on-overlay). I intended to use this to fix the
  conflict between conky (own-window off) and compton, but it's
  unsuccessful. Will have to ask somebody to figure out how to solve
  this problem.

- Rename a few variables to avoid confusion.

- Slightly change how root window content (wallpaper) change is
  detected.

- Slightly improve window name detection in DEBUG_EVENTS.
2012-10-24 10:23:26 +08:00
Richard Grenville 07e4420ab4 Improvement: Pregenerate alpha pictures
Pregenerate alpha pictures to save time when painting. Add --alpha-step
to control the step of alpha picture generation (the opacity difference
between two consecutively generated alpha pictures).
2012-10-13 19:11:25 +08:00
Richard Grenville b59e592588 Feature: #7: VSync
- Add VSync feature. 3 possible VSync methods available: "sw" (software,
  not too reliable, but at least you have something to fallback to),
  "drm" (using DRM_IOCTL_WAIT_VBLANK, should work only on DRI drivers),
  "opengl" (using SGI_swap_control extension OpenGL, might work on more
  drivers than the DRM method). "sw" and "opengl" are briefly tested,
  "drm" received utterly no test (because I use the nVidia binary blob).
  They are enabled with "--vsync sw" / "--vsync drm" / "--vsync opengl".

- Add --refresh-rate to let user specify a refresh rate for software
  VSync, in case the automatic refresh rate detection does not work
  well.

- Seemingly the automatic refresh rate detection using X RandR in
  software VSync detects refresh rate incorrectly. Need further investigation.

- Fix a few bugs in fading timing.

- Add a workaround for client window detection on Fluxbox, as Fluxbox
  (incorrectly?) sets the override-redirect flag upon all frame
  windows.

- Software VSync adds dependency on librt (a part of glibc) for
  nanosecond-level timing functions, and libXrandr for automatic refresh
  rate detection; DRM VSync adds dependency on libdrm to use its drm.h,
  but does not link to libdrm; OpenGL VSync adds dependency on libGL.

- Print timing information on DEBUG_REPAINT.
2012-10-08 10:36:28 +08:00
Richard Grenville 1306b1591f Improvement: Support reading _NET_WM_OPACITY from client windows
- Some WMs don't respect Keith Packard's proposal of
  _NET_WM_WINDOW_OPACITY, and do not copy _NET_WM_OPACITY attribute of a
  client window to its frame windows, thus cause opacity set by
  non-override-redirect windows to have no effect. This commit adds
  support for reading _NET_WM_OPACITY from client windows if running
  with --detect-client-opacity. Thanks to pvanek for reporting.

- Change Makefile logic to determine options from 3 variables
  (NO_LIBCONFIG, NO_REGEX_PCRE, NO_REGEX_PCRE_JIT) instead of CFG to
  ensure compatibility when we add new options. CFG variable is no
  longer been respected.
2012-10-03 21:21:43 +08:00
Richard Grenville 2f0417cd74 Feature: #27: Detect shaped windows and disable shadow on them
- Optionally detect shaped windows using X Shape extension and disable
  shadow on them with --shadow-ignore-shaped.

- Some windows are bounding-shaped just to support rounded corners, like
  Chromium windows (when system titlebar is disabled in its settings).
  Add --detect-rounded-corners to treat them as non-shaped windows (thus
  enable shadow on them). The algorithm I use is not perfect and wrong
  detection results are pretty possible to appear.

- Many windows don't use X Shape extensions to add shapes but use ARGB
  background instead. These windows could only be blacklisted with
  --shadow-blacklist.

- Rename a few functions. Code clean up.
2012-10-01 10:41:51 +08:00
Richard Grenville 9139d038c2 Bug fix: #48: Compilation failure with old libconfig/libpcre
- Fix compilation failure with <libpcre-8.20 and <libconfig-1.4. Tested
  with libpcre-8.12 and libconfig-1.3.2, but not extensively tested.
  libconfig-1.3* probably has more limitations on configuration file
  syntax (enforces comma at the end of a setting?) and does not support
  @include.

- Make it possible to turn off PCRE and libconfig support using
  environment variable "CFG". Not well tested. CMake might provide a
  better solution.
2012-09-28 09:19:53 +08:00
Richard Grenville 75ebe94bb6 Feature: --no-fading-openclose to partially simulate -F
-F hasn't being working for long. This commit adds a switch
--no-fading-openclose (and a configuration file option of the same name)
to simulate the behavior when only -F is enabled, which disables fading
when opening/closing windows, and makes -F an alias for -f.
2012-09-26 21:47:32 +08:00
Richard Grenville 8c0379180b Bug fix: Issue #46: Optionally mark override-redirect windows as active
Attempt to fix the transparency issue of Firefox and Chromium location
bar dropdown window by marking override_redirect windows as active. This
may not work completely and could have other side effects. Experimental.
Enable by using --mark-ovredir-focused.
2012-09-26 19:48:36 +08:00
Richard Grenville 564e55e22c Feature: Wintype-specific options in configuration files
- Add support of window-type-specific options (fade, shadow, and
  opacity) in configuration file parsing. Syntax shown in
  compton.sample.conf.

- Replace wintype_name() with an array of window type names. Code
  clean-up.
2012-09-25 21:08:54 +08:00
Richard Grenville ee9e90efec Feature: Configuration file parsing
- Add support for parsing configuration files using libconfig.
  (Dependency on libconfig could be made optional once we get some
  better building system.) Few tests has been done, bugs to be expected.
  compton searches for a configuration file mostly according to the XDG
  standard. Firstly the configuration file requested by --config, then
  $XDG_CONFIG_HOME/compton.conf (~/.config/compton.conf, usually), then
  ~/.compton.conf, then compton.conf under $XDG_DATA_DIRS (often
  /etc/xdg/compton.conf). A sample configuration file is supplied as
  compton.sample.conf. Configuration file syntax may change in the
  future.  Commandline switches has higher priority than configuration
  file, except for --shadow-exclude. Use --config /dev/null to
  temporarily disable configuration file.

- Fix a bug that causes windows to disappear or be partially rendered on
  opacity changes.

- Fix a bug that causes some windows to ignore -i (inactive_opacity) and
  --inactive-dim, caused by the default window type change in
  a5d9955ca4.
2012-09-25 10:32:41 +08:00