Commit Graph

1053 Commits

Author SHA1 Message Date
Yuxuan Shui bfead72d37 Honor opacity explicitly set by rules 2018-08-14 11:05:28 +01:00
Yuxuan Shui 58a0b9ec39 Honor wintype opacity if set explicitly
Also normalize wintype opacity value to [0, 1]
2018-08-14 11:05:28 +01:00
Yuxuan Shui 66785aae99 Honor opacity prop if set
If opacity prop is explicitly set on the window, active/inactive opacity
shouldn't kick in.
2018-08-14 11:05:28 +01:00
Yuxuan Shui 91ca387723 Unify opacity_prop and opacity_prop_client
Also keep track of whether opacity prop is present on the window
2018-08-14 11:05:28 +01:00
Yuxuan Shui a1afb76c44 Warn about fallthrough
And fix some fallthroughs
2018-08-14 10:59:09 +01:00
Yuxuan Shui 5e1411c5c6 More sanitizer options 2018-08-14 10:36:46 +01:00
Yuxuan Shui 9b24550814 Small clean up of the Makefile
CFG_DEV is replaced by BUILD_TYPE. Debug build is fixed,
set BUILD_TYPE to Debug to make a debug build.

Add an option to compile with sanitizers.
2018-05-21 14:25:56 +01:00
Yuxuan Shui 7844634853 Update README 2018-05-21 14:19:48 +01:00
Yuxuan Shui 27fc4a2af4 Clear compiler warnings
Thanks to chjj/compton#445
2018-05-17 12:50:22 +01:00
Yuxuan Shui af8a08e655 Remove blur limit
Thanks chjj/compton#414
2018-05-17 12:37:13 +01:00
Yuxuan Shui bf29b2dd37 Avoid using 10bit FBConfigs
Fix weird color issue with Mesa 18.0
2018-04-16 10:13:55 -04:00
Uli Schlachter 1125389910 Exit when compton loses the _NET_WM_CM_Sn selection
Again, this behaviour is required by ICCCM.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-04-16 10:13:55 -04:00
Uli Schlachter f8ea3e8668 Don't steal the _NET_WM_CM_Sn selection (#301)
Before becoming the selection owner for _NET_WM_CM_Sn, compton will now check if
that selection is already owned (which means that another composite manager is
already running). If this check fails, startup will be refused. This behaviour
is required by EWMH / ICCCM.

Because this should catch all composite managers, the error message that was
used before when another manager is already running is reworded to mention that
the other manager does not follow EWMH.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-04-16 10:13:55 -04:00
Yuxuan Shui cfdb946992 Avoid using window id as identifier in finish_destroy_win
Under extreme race conditions (window A close at the same time as window
B create), there can be multiple windows with same id in compton's window
list. If at this point window B closes itself as well, finish_destroy_win
might destroy a different window as what's passed to destroy_callback.

This can be a problem because someone can still hold a reference to that
window (e.g. 't' in paint_preprocess), and there's no way to clear that
reference. If finish_destroy_win always destroy the same window passed
to destroy_callback, this will not be a problem.
2018-04-16 10:13:55 -04:00
Yuxuan Shui f4f39d1989 Avoid changing fade_callback when window is destroyed
Fix assertion at src/compton.c:1261
2018-04-16 10:13:55 -04:00
Scott Leggett d458369f1d Replace "bashism" with POSIX syntax. 2018-04-16 10:13:55 -04:00
Yuxuan Shui 9770b2eee2 update readme 2018-04-16 10:13:55 -04:00
Richard Grenville 316eac0613 GitHub: Add an issue template
GitHub: Add a template for issues submitted, .github/issue_template.md.
I hope people could provide more needed information when reporting
issues after we provide a number of fields to fill and some extra
instructions in the template, to reduce the time wasted on the issues
because of insufficient information.

See: https://help.github.com/articles/creating-an-issue-template-for-your-repository/
2017-04-30 21:08:49 +08:00
Richard Grenville b7f43ee67a Merge pull request #375 from Brottweiler/config-sample-typo-fix
Fix some missing trailing semicolons
2016-09-07 16:23:44 +08:00
Brottweiler 1b5dc5e970 Fix some missing trailing semicolons 2016-09-04 19:24:24 +02:00
Richard Grenville f1cd308cde compton-convgen: Misc: Clean up
compton-convgen: Misc: Clean up. The commit brings no change to the
functionality of the script.

 - Partially fix PEP 8 compliance:

   - Place imports on separate lines.

   - Replace leading tabs with 4 spaces.

   - Add docstrings to classes and functions.

   - Surround top-level function and class definitions with two blank
     lines.

   - Remove spaces around keyword arguments.

   - Move all statements to separate lines.

   - Break some long lines into several lines.

 - Remove trailing semicolons after statements.

 - CGError: Use functionality from the base class Exception to store the
   description, instead of the custom logic.

 - CGInternal: Remove, as it is unused.

 - Hide the internal function gen_invalid() and args_readfactors() by
   prefixing their names with an underscore.

 - Move the module-level command-line handling code to two new
   functions, _main() and _parse_args(), and only execute if running in
   the main scope.
2016-08-10 23:53:41 +08:00
Richard Grenville 2343e4bbd2 Misc #308: Close config file after using it
Misc #308: Close the config file after using it, instead of leaving it
open forever. Thanks to SyedAmerGilani for the report.
2015-09-22 08:34:28 +08:00
Richard Grenville d7f95b56b1 Misc: Create directories for icons before installing them
Misc: Create directories for icons before installing them. This fixes
the install failure if the DESTDIR used when executing `make install`
does not contain the icon directories. It could appear when the user
does not wish to directly install the software to the system, like in
Gentoo ebuild or Arch Linux AUR building.
2015-09-20 17:16:54 +08:00
Richard Grenville 6deda6a95f Merge pull request #291 from nejsan/patch-1
Set icon to `compton` in compton.desktop
2015-09-20 16:41:58 +08:00
Nate Hart 0e7d4364e0 Added install rules for Compton logo 2015-09-17 21:57:11 -04:00
Nate Hart 7fe5512e91 Added 48x48px raster of initial Compton logo 2015-09-17 21:57:11 -04:00
Nate Hart 0b044a947f Added svg of initial Compton logo 2015-09-17 21:57:10 -04:00
Richard Grenville 20e996494b Misc: Modify function attributes
- Remove the const function attribute from get_time_*(), since the
   functions they call that actually get the time probably access global
   variables or have other behaviors unacceptable for const functions.

 - Change the const function attribute on win_has_frame() to pure, as it
   accesses memory its parameter points to, which is invalid for a const
   function.
2015-09-06 22:34:02 +08:00
Richard Grenville c156abb0e8 Bug fix #302: Use more EWMH-compliant way to determine frame extents
Bug fix: Select the larger of the X window border width and
_NET_FRAME_EXTENTS, instead of adding them together, when determining
the frame extents. (Supposedly) more EWMH compliant, as EWMH
_NET_FRAME_EXTENTS should include the X window border width already. We
did not choose to completely rely on _NET_FRAME_EXTENTS to remove the
need to keep track of whether there is a _NET_FRAME_EXTENTS, and
(hopefully) take care of some cases when it is wrong. The commit should
fix awesomeWM/awesome#425. Thanks to psychon for the information. (#302)

The commit fixes the bug in win_get_region_noframe() that the X window
border width is not considered when determining the width/height of the
window without frame, as well.
2015-09-06 22:19:19 +08:00
Richard Grenville 50317f75c7 Misc: Add some entries to .gitignore
Misc: Add Vim swap files for unnamed buffers (".sw[a-z]") and
YouCompleteMe configuration files (".ycm_extra_conf.py{,c}") to
.gitignore.
2015-09-06 20:54:14 +08:00
Richard Grenville 7d4d87d683 Misc: Add margin_t & Store frame extents with it & Misc
- Add margin_t, a structure that represents margins around a rectangle.

 - Store frame extents of a window with margin_t, replacing the 4
   fields ({left,right,top,bottom}_width) in struct _win.

 - Add two helper macros, cmemzero() and cmemzero_one(), that zero out a
   block of memory.
2015-09-06 20:53:07 +08:00
Richard Grenville 86266e00e2 Merge branch 'master' into richardgv-dev 2015-08-23 20:41:43 +08:00
Richard Grenville 10517b2b31 Merge pull request #285 from kelleyk/upstream-patchqueue
Plug XserverRegion leak.
2015-08-23 20:39:18 +08:00
Nate Hart de3199b138 Set icon to `compton` in compton.desktop 2015-06-05 17:14:46 -05:00
Kevin Kelley 0e0b35a361 Plug XserverRegion leak. 2015-05-12 13:17:35 -07:00
Richard Grenville 86e88bdf71 Misc: Update the descriptions of --backend in compton man page
Misc: Update the descriptions of --backend in the compton man page.
Mention `xr_glx_hybrid` backend, and add more descriptions of the
operation and characteristics of the backends. Thanks to @onodera-punpun
in the Gitter room for telling me about the missing documentation of the
`xr_glx_hybrid` backend.
2015-04-26 16:28:05 +08:00
Richard Grenville b1889c1245 Merge pull request #280 from pmattern/man-pages
minor fix in man (1) compton
2015-04-20 08:07:59 +08:00
Peter Mattern a8061c8bbe man (1) compton: fix $XDG_CONFIG_DIRS 2015-04-16 19:48:11 +02:00
Richard Grenville 5a00adad39 Merge pull request #273 from Corax26/trans-c-fix
Fix compton-trans -c
2015-03-29 18:34:15 +08:00
Corax26 e4c0b8301d Fix compton-trans -c
The pipeline used to retrieve the WID of the active window returns a bad WID because xprop returns several hex numbers and ".*" in the sed regex is greedy. For instance, running "xprop -root -notype _NET_ACTIVE_WINDOW" gives me:
_NET_ACTIVE_WINDOW: window id # 0x1a0003d, 0x0
Filtering this output with the sed substitution then gives "0x0", since the first ".*" matches everything up to *the last* hex number.

The fix is simply to grep hex numbers instead of using a sed substitution, and then choose the first one.
2015-03-26 01:31:00 +01: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 0ab80bd3e7 Merge pull request #264 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-02-24 20:31:49 +08:00
The Gitter Badger 2aec99142d Added Gitter badge 2015-02-17 03:44:14 +00: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 64b4fe2c72 Misc #262: Allow `make install` w/o docs
Allow `make install` w/o documentations, as `make MANPAGES= install`.
(#262)
2015-01-25 10:46:22 +08:00
Richard Grenville 23d1dd1c0e Misc: Add two test scripts
Add two scripts for testing build.
2015-01-11 16:30:41 +08:00
Richard Grenville 25b217ff52 Misc: Move shared functions out of make-release.sh
- Move shared functions in make-release.sh to a separate file,
   functions.sh .

 - Add more comments to make-release.sh and functions.sh .
2015-01-11 16:26:36 +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 4d0c663ad2 Misc: Add comments of options in Makefile
Add comments about compile-time options in Makefile.
2015-01-11 16:17:30 +08:00
Richard Grenville 44ccbfab9f Misc: Update CMakeLists.txt
- CMakeLists.txt: add remaining non-debugging compile-time options
   present in Makefile but not here: CONFIG_VSYNC_OPENGL_{FBO,VBO},
   CONFIG_DBUS, and CONFIG_XSYNC.

 - CMakeLists.txt: Use CMakeDependentOption for option dependency.

 - CMakeLists.txt: Remove quotes around library CFLAGS and LDFLAGS to
   allow multiple values.
2015-01-11 11:01:37 +08:00