Commit Graph

41 Commits

Author SHA1 Message Date
Yuxuan Shui b18d46bcbd Revert "Remove xrender-sync and xrender-sync-fence"
This reverts commit 50e2259404.

Temporarily revert the removal until we have more information about this whole
thing.

Turns out a couple of drivers don't work properly without the sync fence,
including intel, llvmpipe and NVIDIA.

Although sync fence is needed, from the information I have gathered (looking
at old bug reports, protocol specifications, look at other compositors' code),
compton's usage of it is not proper. So we need to rewrite it in the future,
after we get more information from driver developers.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-08 18:07:18 +00:00
Yuxuan Shui 50e2259404 Remove xrender-sync and xrender-sync-fence
This was a dubious "fix" for a Nvidia driver problem. The problem was
never fully understood, and the then developers took a shotgun approach
and implemented xsync fences as a fix. Which somehow fixed the problem.
Again, I don't see any indication that the developers understood why
this "fix" worked.

(for details, see chjj/compton#152 and chjj/compton#181)

The driver problem should have been fixed almost 5 years ago. So this
shouldn't be needed anymore. In addition the way compton uses xsync fences
is apparently wrong according to the xsync spec (fences are attached to
screen, but compton uses them as if they were attached to drawables).

So, I will try removing it and see if anyone will complain. If there are
real concrete reasons why fences are needed, it will be brought back.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:36:55 +00:00
Yuxuan Shui cb4bab1cf6 Print deprecation warning for removed OpenGL options
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-09-30 21:07:29 +01:00
Brottweiler 1b5dc5e970 Fix some missing trailing semicolons 2016-09-04 19:24:24 +02:00
Richard Grenville 81c677f28b Feature: #183 custom window shader & #193 --no-fading-destroyed-argb
- Add --glx-fshader-win, which specifies a custom fragment shader for
  painting windows. compton-default-fshader-win.glsl is the shader with
  default behavior, and compton-fake-transparency-fshader-win.glsl
  provides a template of fake transparency. (#183)

- Add --force-win-blend to force all windows to be painted with
  blending.

- Add --no-fading-destroyed-argb, as a workaround of bugs in some WMs.
  (#193)
2014-05-16 15:18:17 +08:00
Richard Grenville ef58e4e417 Bug fix #191: Add rounded-corners detection to --unredir-if-possible
Add `bounding_shape` and `rounded_corners` as condition match target.
Deprecate --shadow-ignore-shaped. Add rounded-corners detection to
win_is_fullscreen(). Slightly modify win_rounded_corners() logic. Thanks
to tdryer for reporting. (#191)
2014-04-21 22:45:27 +08:00
Richard Grenville 9a99e7a0dd Misc: Try to avoid evaluating conditions after window unmap & others
- Try to avoid evaluating conditions after window unmap/destruction.
  Unfortunately, frequently this doesn't work due to the asynchronous
  nature of X.

- Add _GTK_FRAME_EXTENTS exclusion rules to compton.sample.conf. Thanks
  to memeplex, hexchain, and others for info. (#189)

- Add debugging option --show-all-xerrors, and other debugging changes.
  Doc update.
2014-04-19 19:41:26 +08:00
Richard Grenville 360da12d86 Misc: Add --xrender-sync{,-fence} as configuration file option
- Add --xrender-sync{,-fence} as configuration file option.

- Quit on encountering invalid opacity rule.

- Other small changes.
2014-03-26 22:27:25 +08:00
Richard Grenville 796e2c6fec Bug fix #149: --opacity-rule misbehaves on 32-bit systems & others
- Fix a bug that --opacity-rule misbehaves with a value higher than 50%
  on 32-bit systems. Thanks to mrinx for reporting. (#149)

- Fix a bug that opacity-rule in configuration file does not work.
2013-10-01 23:20:22 +08:00
Richard Grenville f202223572 Misc: Add cfg file options for --unredir-if-possible-*
Add configuration file options for
--unredir-if-possible-{delay,exclude}. (#140)
2013-09-24 20:41:50 +08:00
Richard Grenville 5d4ed8f43f Misc: Add missing configuration file options and switches
- Add "xinerama_shadow_crop" configuration option.

- Add long commandline switches corresponding to the short ones.

- Documentation update.
2013-08-26 22:00:53 +08:00
Richard Grenville 7417f0deee Misc: stoppaint_force & Documentation update
- Add stoppaint_force option, controlled via D-Bus, to stop painting
  completely, which may look better than unredirecting the screen,
  sometimes. (#41)

- Add x2, y2 matching targets.

- Update documentation.
2013-07-30 22:24:11 +08:00
Richard Grenville 85e7d18803 Improvement: --glx-swap-method & --fade-exclude
- GLX backend: Add --glx-swap-method, to reduce painting region if the
  driver uses exchange or copy buffer swaps. Untested.

- Add --fade-exclude, to disable fading on specific windows based on
  some conditions. Untested.

- Expose GLX backend options through configuration file. Add fetching of
  GLX backend options through D-Bus.

- Use NULL pointer instead of element count to delimit string arrays in
  parse_vsync()/parse_backend()/parse_glx_swap_method().

- Add documentation about "wintypes" section in configuration file.
2013-04-21 22:30:22 +08:00
Richard Grenville dfd4dd1122 Feature #4: Default active window opacity
- Add default active window opacity (--active-opacity). (#4)

- Add win_focusin and win_focusout D-Bus signals.
2013-03-30 12:27:27 +08:00
Richard Grenville 75912d23f3 Improvement: --blur-background-exclude #98 & MESA_swap_control & others
- Add --blur-background-exclude. (#98)

- Add `opengl-mswc` VSync, which uses MESA_swap_control instead of
  SGI_swap_control. I don't expect it to perform better than
  SGI_swap_control, though.

- Update CMakeLists.txt .

- Add a few targets for D-Bus `win_get`. Misc changes.

- Known issue: Apparently I've forgotten implementing --inactive-dim on
  GLX backend... Silly me.
2013-03-23 22:06:41 +08:00
Richard Grenville 66be1f2fe1 Bug fix: GLX backend incompatibility with mesa & others
- Fix a bug that glx_bind_pixmap() doesn't work with mesa drivers.
  Thanks to Janhouse and mkraemer for reporting. (#7)

- Use stencil buffer to attempt to eliminate potential double-paint
  issue in glx_render(). X Fixes doesn't guarantee the rectangles in a
  region do not overlap, and this may cause some regions to be painted
  twice, which would be a problem if we are painting transparent things.
  Now the target window must have a stencil buffer. Compiz uses its own
  region implementation to deal with this, but as a lightweight
  compositor we can't really do the same. It may have a positive or
  negative effort over performance. Callgrind result indicates basically
  no change in performance, but this may or may not be true.

- Correctly distinguish GL extensions and GLX extensions. Sorry. :-D

- Handle screen size. Thanks to tsmithe for reporting. (#7)

- Rename OpenGL backend to GLX backend, because, we might have a EGL
  backend someday.

- Add configuration file option `backend` to specify backend. Add
  `backend` to D-Bus `opts_get`.

- Add OpenGL shader compilation code, but currently unused.

- Minor adjustments.

- Known issue: Window content doesn't get updated in VirtualBox,
  probably because its OpenGL implementation requires constant rebinding
  of texture. But that's really slow...

- Known issue: Blur feature is still unimplemented in GLX backend.
2013-03-16 22:54:43 +08:00
Richard Grenville e3eca7ac61 Bug fix #91: Using pkg-config to find drm.h & OpenGL changes
- #91: Use pkg-config to find drm.h to avoid issues on FreeBSD. Thanks
  to hun7err for pointing out and providing patch.

- #89: Add default shadow exclusion rule for notify-osd. Thanks to
  DanielRS.

- Check for abundant positional arguments.

- Use paint target window (root window / overlay window) instead of
  ps->reg_win to create GLXContext. (May have negative effects on OpenGL
  VSync.) Add new OpenGL helpers functions, to prepare for the new
  OpenGL backend.

- Dump more info of a PropertyNotify with DEBUG_EVENTS.
2013-03-01 12:41:16 +08:00
Richard Grenville 6d36ef2d0f Feature #16: Advanced window matching
- Add advanced window matching system, capable of matching against
  arbitrary window properties as well as a series of internal
  properties, with 4 additional operators (>, <, >=, <=) useful for
  integer targets, and support of logical operators. The old matching
  system is removed, but compatibility with the format is retained.

- As the new matching system is pretty complicated, and I have no past
  experience in writing a parser, it's pretty possible that bugs are
  present. It also has inferior performance, but I hope it doesn't
  matter on modern CPUs.

- It's possible to disable matching system at compile time with NO_C2=1
  now.

- Add ps->o.config_file to track which config file we have actually
  read. Queryable via D-Bus.

- Parse -d in first pass in get_cfg() as c2 needs to query X to get
  atoms during condition parsing.

- Fix a bug in wid_get_prop_adv() that 0 == rformat is not handled
  correctly.

- Fix incompatibility with FreeBSD sed in dbus-examples/cdbus-driver.sh
  .

- Add recipe to generate .clang_complete in Makefile, used by Vim
  clang_complete plugin.

- Add DEBUG_C2 for debugging condition string parsing. DEBUG_WINMATCH is
  still used for match debugging.

- Rename win_on_wdata_change() to win_on_factor_change().

- Extra malloc() failure checks. Add const to matching cache members in
  session_t. Code clean-up. Documentation update.
2013-01-28 21:39:38 +08:00
Richard Grenville 2165c42d27 Feature #75: Invert window color
- Add window color inversion (--invert-color-include). It means 2-3
  times extra painting, so performance issues are likely to appear.  I
  hope I could find a faster way to invert colors.

- Rename some functions.

- Fix update of some window properties after window type/data change.
  Hopefully this will be helpful for #73.

- Split win_build_picture() from win_blur_background().

- Correct memory leak of ps->focus_blacklist during reinitialization.

- Add win_upd_t and win_upd_run(), to reduce duplicate window property
  updates. But is unused right now.

- Limited tests are done overall. Bugs to be expected.
2013-01-12 22:44:46 +08:00
Richard Grenville 1bfe21efb5 Improvement: Dynamic blur strength & improved frame blur performance
- Remove the region expansion design in win_blur_background(). I must be
  sleep-walking when I wrote that!

- Improve performance of blurring when a window is opaque but its frame
  is transparent.

- Adjust blur strength according to window opacity.
  --blur-background-fixed restores the old behavior.

- Add "use_offset" parameter to a few functions for convenience. Code
  clean-up.
2012-12-15 20:07:45 +08:00
Richard Grenville 22cabf7c89 Feature #69: Blur window background
- Add window background blur support (--blur-background &
  --blur-background-frame), with X Render convolution filter.
  The performance sucks. The performance when the window is opaque but
  frame is transparent could be improved, but there are two possible
  ways and I'm hesitating.

- Known issue: The blurring effect looks very ungraceful during fading.
  I could partially fix the problem, but it probably isn't easy to fix
  it completely.
2012-12-14 20:32:46 +08:00
Richard Grenville 848687b853 Feature #65: Auxiliary window detection
- Add auxiliary window detection (--detect-transient &
  --detect-client-leader). Thanks to SmilingHorse for inspiring me. The
  implementation is not too speed-efficient, and bugs are to be
  expected.

- Known issue: auxiliary window detection may not work too well with
  windows that are never mapped, for example as client leader.
2012-12-12 12:01:51 +08:00
Richard Grenville 33171e8933 Feature: Wintype-based focus exclusion
- Add "focus" to the wintypes settings in compton.conf, to mark windows
  of certain window types to be always focused. Replaces the ugly
  is_normal_win().

- Add a ON/OFF/UNSET switch_t type, but it's unused currently.

- Mark client_win if the window client detection hasn't been performed
  when we detect WM_STATE's presence in ev_property_notify(), for
  performance.
2012-12-10 10:38:28 +08:00
Richard Grenville 983803aa9f Bug fix: Dynamic inactive dim & client window changes
- Make inactive_dim opacity change according to window opacity by
  default, so it looks better when fading. --inactive-dim-fixed restores
  the old behavior.

- Make client window default to the window itself. Add w->wmwin to
  represent whether the window looks like a WM window instead. A side
  effect is, the window type of WM windows are changed from unknown to
  normal, making it necessary to use --mark-wmwin-active to avoid
  considering them unfocused.

- Add check of PointerRoot to recheck_focus() to avoid BadWindow errors
  when the root window is focused.

- Add a few macros to simplify debugging code.

- Add DEBUG_FRAME.
2012-12-05 15:28:37 +08:00
Richard Grenville 72c18b6219 Feature #65: --focus-exclude
- Add --focus-exclude, which should be used with a list of conditions to
  set certain windows to always be considered focused.

- Change focus determination process, with a newly added w->focused_real
  that reflects whether the window is actually focused, while w->focused
  represents whether compton considers it focused. The primary
  difference is now when a window considered focused because of
  --mark-wmwin-focused or --mark-ovredir-focused receives a FocusOut
  event, it's still considered focused by compton.

- Change opacity target and dim state calculation so that it's done at
  most once every paint.

- Split window opacity property fetching from calc_opacity() to a new
  function win_update_opacity_prop().

- Silence a warning in wid_get_prop_wintype().

- Rename a few functions. Code clean-up.

- My time is very limited currently, few tests are done, so this commit
  may very well introduce bugs.

- Known issue: Dim picture opacity does not change based on window
  opacity, causing somehow annoying effects when a window fades off.
2012-11-28 12:07:58 +08:00
Richard Grenville 9ca20e7e32 Bug fix: Wrong file path being displayed on config file parsing error
- Fix a bug that causes wrong file path being displayed on configuration
  file parsing error.

- Continue dropping unused parameters and silence clang warnings.

- Add conky shadow exclusion rule to compton.sample.conf.
2012-11-21 09:15:49 +08:00
Richard Grenville a92c2bd808 Misc: Code cleanup
- Form a function ev_window_name() for all window name detection in
  debugging code.

- Add unredir-if-possible to configuration file options.
2012-11-14 21:34:51 +08:00
Richard Grenville dc04a7d8ca Improvement: Add EWMH _NET_WM_ACTIVE_WINDOW support
- Add support for using _NET_WM_ACTIVE_WINDOW to track focus (rather
  than using FocusIn/Out events) as --use-ewmh-active-win.

- Add wid_get_attr() and use it in place of XGetWindowProperty() in
  various places.

- Remove dpy parameter from find_win() and find_toplevel() as it's unused.

- Fix a writing-to-freed-memory issue in paint_preprocess().
2012-11-04 18:45:39 +08:00
Richard Grenville 40178702ef Improvement: Change clear_shadow implementation
- Implement clear_shadow with painting region limitation instead of
  calculation in shadow image, to make it work correctly on windows with
  rounded corners, requested by funeral1988. This might cause more load
  on CPU, but could mean less load for GPU. The original implementation
  is kept but commented out.

- Code cleanup.
2012-10-28 17:02:07 +08:00
Richard Grenville f83ed19e14 Bug fix #57: Fix incorrect handling of InputOnly windows
- Stop rendering InputOnly windows. In the past I've misunderstood the
  whole thing, I guess, sorry. Thanks to garfilth and funeral1988 for
  reporting and providing valuable information.

- Fix a possible segfault in DDEBUG_EVENTS.

- Add "dbe" as a configuration file option.

- Attempt to slightly reduce the rendering delay after VSync in non-DBE
  mode. I don't think, however, that this would be greatly helpful for
  the tearing issue.
2012-10-27 21:52:26 +08:00
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