Commit Graph

207 Commits

Author SHA1 Message Date
Kevin Kelley 0e0b35a361 Plug XserverRegion leak. 2015-05-12 13:17:35 -07:00
Richard Grenville 663e1a1a04 Bug fix: --active-opacity state does not change correctly on `--focus-exclude`-ed windows
Fix the bug that --active-opacity state does not change
on `--focus-exclude`-ed windows correctly, since win_update_focused()
enables the WFLAG_OPCT_CHANGE flag on a window only if w->focused
changes, while --active-opacity depends on the output of
win_is_focused_real() instead of w->focused, which could be changed even
if w->focused does not change (e.g. when the window is
`--focus-exclude`-ed).
2015-02-24 21:08:29 +08:00
Richard Grenville 3b17fe15f0 Bug fix #263: Always redirect std{out,err} if --logpath is specified
Always redirect std{out,err} if --logpath is specified, instead of only
redirect after fork, to correct the inconsistent behavior of --logpath
when getppid() returns 1. (#263)
2015-01-26 21:28:48 +08:00
Richard Grenville e4ff1a5130 Misc: Update disabled-at-compile-time notes in the usage text
- Add disabled-at-compile-time note in usage text with NO_LIBCONFIG.

 - Fix the incorrect disabled-at-compile-time note for --backend.

 - Move position of the disabled-at-compile-time note of --dbus
   slightly.
2015-01-11 16:24:54 +08:00
Richard Grenville 03ebae4c33 Bug fix: Compilation failure with NO_VSYNC_OPENGL=1
Fix compilation failure with NO_VSYNC_OPENGL=1, caused by one
incorrectly placed "#endif" in "src/common.h".
2015-01-11 10:47:19 +08:00
Richard Grenville 65e655e3bc Bug fix: --no-fading-openclose doesn't work when fading out
- Fix the bug that --no-fading-openclose doesn not work when fading out
   by writing w->fade_last as well in win_determine_fade().

 - Write w->fade_last for applying w->fade_force, as well.
2014-11-30 15:39:07 +08:00
Richard Grenville 6d8fde457a Bug fix #244: Build failure with -DDEBUG_EVENTS
Fix build failure with -DDEBUG_EVENTS, caused by incorrect references to
X Sync macros. Thanks to blueyed for reporting. (#244)
2014-11-24 22:31:54 +08:00
Richard Grenville 5910dbae8a Misc #215: Reformat usage text & update docs
- Reformat usage text by adding a blank line between descriptions of
   two switches. (#215)

 - Update documentation for a bit. Correct some wrong statements and
   clarify some others.
2014-11-24 22:03:07 +08:00
Richard Grenville 651a66131f Bug fix #224: Flush after XUngrabServer()
Fix #224 by XFlush() after XUngrabServer(). Thanks to rathsky and smlx
for reporting.
2014-10-06 11:36:47 +08:00
Richard Grenville 8c88b4d6f1 Misc #204: Add glx_take_screenshot() & others
- Add glx_take_screenshot() for taking a screenshot. With ImageMagick
  the output data could be viewed in this way:

    display -size [SCREEN-WIDTH]x[SCREEN-HEIGHT] -depth 8 -flip
    rgb:[PATH]

  (#204)

- Add D-Bus command `opts_get string:paint_on_overlay_id` to get X
  Composite overlay window ID. (#204)

- Code cleanup.
2014-09-07 18:58:09 +08:00
Richard Grenville c5f45c8e3c Merge branch 'richardgv-dev' of github.com:chjj/compton into richardgv-dev 2014-09-07 16:07:26 +08:00
Richard Grenville 094b75eef7 Misc: Add --no-name-pixmap
Add --no-name-pixmap to disable the usage of
XCompositeNameWindowPixmap(), for debugging.
2014-09-07 16:05:14 +08:00
mæp 72301f9177 fix crash caused by free of uninitialized pointer 2014-08-06 20:42:57 +02:00
Richard Grenville 4f9050f53f Misc: Fix spelling mistakes
Still, "Guassian" -> "Gaussian". (#221)
2014-08-06 07:32:53 +08:00
Richard Grenville a801118c04 Bug fix: Fix X pixmap leakage in shadow_paint
- Fix X pixmap leakage in shadow_paint.

- Add the skeleton of a X resource leakage checker.
2014-08-03 19:40:40 +08:00
Richard Grenville 3cfbaac955 Misc: Fix compilation with NO_VSYNC_OPENGL_GLSL / NO_C2
Fix compilation with NO_VSYNC_OPENGL_GLSL / NO_C2.
2014-07-29 09:29:26 +08:00
Richard Grenville 4724c1f21a Misc #218: Warn about using --glx-no-rebind-pixmap on intel driver
Warn about using --glx-no-rebind-pixmap on xf86-video-intel. Thanks to
aktau for the info. (#218)
2014-07-28 16:54:02 +08:00
Richard Grenville 234e3e8cda Improvement: Separate GLX parts from session_t & Attempt to fix #217
- Separate GLX parts from session_t into glx_session_t.

- Add --rererdir-on-root-change and --glx-reinit-on-root-change, as
  possible solutions for #217. Thanks to jlindgren90 for reporting.
2014-07-28 12:50:15 +08:00
Richard Grenville 4e8ccea252 Misc: Add --version & --no-x-selection
- Add --version. (#206)

- Add --no-x-selection for debugging. (#207)
2014-07-13 09:34:38 +08:00
Michael Reed a29b7958cf whitespace cleanup 2014-07-04 06:27:13 -04:00
Richard Grenville 3a3e1387ac Misc #205: Add 2 long options & Update documentation
- Add two long variants of short options.

- Update documentation.
2014-06-15 11:51:59 +08: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 bb55706c05 Bug fix #195: Pointer incompatibility with libconfig-1.3*
Fix pointer incompatibility with libconfig-1.3*. Thanks to
sstewartgallus for reporting. (#195)
2014-05-10 12:21:23 +08:00
Richard Grenville 349af129b8 Bug fix #194: Fix assertion failure in some cases
Fix assertion failure when evaluating --unredir-if-possible-exclude or
--paint-exclude on unmapped windows. Thanks to ppuryear for reporting.
(#194)
2014-04-28 21:21:16 +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 15cd6aad38 Misc: Fix a possible assert() failure 2014-04-21 07:49:29 +08:00
Richard Grenville b7b043c3cc Bug fix #190: Copy shadow/fade state from last paint on unmapped wins
Copy shadow/fade/color-inversion/background-blur state from last paint
on unmapped windows. I hope it doesn't have unexpected side effects.
(#190)
2014-04-19 21:52:20 +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 e4f3a2d77a Bug fix #181: Add --xrender-sync{,-fence}
- Add --xrender-sync{,-fence} to deal with redraw lag issue on GLX
  backend. --xrender-sync-fence requires a sufficiently new xorg-server
  and libXext. NO_XSYNC=1 may be used to disable it at compile time.
  Thanks to tchebb for reporting and everybody else for testing. (#181)

- A bit code clean-up. Replace a few XSync() with XFlush() to minimize
  the latency.
2014-03-17 23:25:34 +08:00
Richard Grenville 9950d08ab7 Misc: xr-glx-hybrid alias & minor fixes
- Add "xr-glx-hybrid" as an alias of "xr_glx_hybrid". (#163)

- Clear damage history in expose_root() and when root window size
  changes. Unfortunately this doesn't fix #181.
2014-03-11 07:22:23 +08:00
Richard Grenville 8a5becf617 Bug fix: Fix -S
Fix the broken -S.
2014-02-27 22:08:30 +08:00
Richard Grenville aeda1482ce Bug fix: Fix access to freed memory due to invalid w->prev_trans
- Fix a bug that w->prev_trans sometimes points to freed memory.
  Probably related to #165.

- Add some more debugging printf()-s under DEBUG_EVENTS.
2014-01-21 22:13:06 +08:00
Richard Grenville f1f7b050af Bug fix #163: xr_glx_hybrid: Flickering issue
xr_glx_hybrid backend: Attempt to fix flickering issue. Thanks to cju
for testing.
2014-01-19 08:04:14 +08:00
Richard Grenville 3e783f3e1e Misc #163: Make usage of glFinish() optional
Make usage of glFinish() optional to avoid high CPU usage. (#163)
2013-12-26 20:43:06 +08:00
Richard Grenville 9e053910f2 Misc #152: Fix a spelling mistake
Fix a spelling mistake (xr_glx_hybird -> xr_glx_hybrid). Thanks to cju
for reporting.
2013-12-24 07:46:48 +08:00
Richard Grenville fbd70e146c Feature: Add XRender-GLX hybird backend
- Add new backend "xr_glx_hybird", which uses X Render for all
  compositing but GLX on the last step of rendering to screen.  This
  makes GLX-backend-specific VSync methods usable while may avoid
  certain bugs with GLX backend. The idea comes from ali1234.
  Experimental.

- GLX backend: Stop using or rendering to depth buffer.

- Use glFinish() instead of glFlush() before VSync. It probably uses
  more CPU but could be more reliable than glFlush().
2013-12-10 22:06:02 +08:00
Richard Grenville c02a867e6f Misc: Add properties to the registration window
Add WM_CLASS, COMPTON_VERSION, and _NET_WM_PID properties to the
registration window, to ease the development of pcman's compton-conf.
2013-11-10 10:13:18 +08:00
Richard Grenville 46e6abdd2a Misc: --write-pid-path & small changes
- Add --write-pid-path to write process ID to a file, to help
  determining compton's process ID when -b is used.

- Add a few extra targets to query through D-Bus opts_get (version, pid,
  etc.) and through win_get, primarily for debugging.

- Add helper macros likely(), unlikely(), cmalloc(), ccalloc(),
  crealloc().

- Change w->opacity_set to opacity_t. Determine display_repr in
  session_init(), etc.
2013-11-09 21:38:31 +08:00
Richard Grenville d8977408fd Bug fix #153: Possible fix for a rare timing issue
Possible fix for a very rare timing issue in focus detection. Compton
may fail to detect the currently focused window, when a window newly
mapped gets focused, we failed to listen to events and get FocusIn from
it in time, and a series of focus change events before it happens stay
in the event queue and puzzled compton. My choice is to force focus
recheck on all focus-related events. More roundtrips to X, but not
necessarily worse performance, due to the high cost of focus flipping
especially when there's a lot of conditions. Thanks to SlackBox for
reporting.  (#153)
2013-10-21 22:17:01 +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 fc8ec8851f Misc: Typo in vsync_opengl_init()
I typed ps->glXGetVideoSyncSGI as ps->glXWaitVideoSyncSGI...
2013-09-26 07:41:11 +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 4bd3db2bc7 Bug fix #99: Rewrite focus detection logic
- Rewrite focus detection logic. Remove w->focused_real and use
  ps->active_win to identify focused window uniformly. Use a more
  expensive way to filter FocusIn/Out events to improve reliability.
  Only limited tests are done, and bugs are likely to be introduced.
  (#99)

- Known issue: Under fvwm, compton sometimes does not consistently
  report the window input gets sent to. But there's something wrong in
  that case: XGetInputFocus() shows the root window is focused but
  another window is receiving input.
2013-09-18 22:41:40 +08:00
Richard Grenville 747ffaef0f Bug fix #144: Workaround for insane window type changes
Dynamically detect window type as a workaround to insane applications.
Thanks to Feltzer for reporting. (#144)
2013-09-15 11:07:49 +08:00
Richard Grenville 926ae379ba Bug fix #143: GLSL shader error on European locales
Set LC_NUMERIC=C when generating GLSL shader strings to avoid decimal
point issues on European locales. Thanks to hiciu for reporting.
2013-09-15 08:56:53 +08:00
Richard Grenville 5da802634a Bug fix #143: Move setlocale(LC_NUMERIC, "C")
Move setlocale(LC_NUMERIC, "C") to a better place, in hope to fix #143.
Thanks to hiciu for reporting!
2013-09-14 10:04:38 +08:00
Richard Grenville e9d187f03e Bug fix #140: Possible fix for CPU usage with --unredir-possible-delay
- Possible fix for high CPU usage with a low --unredir-possible-delay.
  Thanks to Feltzer for reporting. (#140)

- Rewrite some parts to (hopefully) increase performance, especially
  with --unredir-if-possible.

- Known issue: With GTX 670 and x11-drivers/nvidia-drivers-325.15, and
  compton --unredir-if-possible --config /dev/null, if you send a
  SIGUSR1 to compton when a full-screen solid window is there, in which
  case compton either redirects then immediately unredirects the screen,
  or just don't redirect it altogether, X freezes after compton
  unredirects the screen. Requests sent by other X clients are not
  responded until compton is killed, which indicates the possibility of
  a bug in X.  Attaching to X process shows X is on ./os/waitFor.c.
  Backend does not matter. --paint-on-overlay fixes the issue somehow.
  compton-git-v0.1_beta1-5-g4600f43-2013-08-28 doesn't exhibit the
  issue, but it's probably timing-related.
2013-09-12 21:23:20 +08:00
Richard Grenville 4acbd56722 Improvement: --unredir-if-possible-exclude & --unredir-if-possible-delay
- Add --unredir-if-possible-exclude, to exclude certain windows when
  evaluating --unredir-if-possible. (#140)

- Add --unredir-if-possible-delay, to add some delay before
  unredirecting screen. (#138, #140)

- Code clean-up.
2013-09-04 22:00:51 +08:00
Richard Grenville 5350127b72 Misc: GLX: Avoid using multi-sampling visuals
Avoid using multi-sampled visuals, like the cogl patch:
http://people.freedesktop.org/~glisse/0001-glx-do-not-use-multisample-visual-config-for-front-o.patch
2013-09-03 21:14:40 +08:00