Commit Graph

1414 Commits

Author SHA1 Message Date
Yuxuan Shui 3ce59930a4 More compiler warning flags 2018-09-10 13:46:22 +01:00
Yuxuan Shui 4940a93f03 c2.h cleanup
Move most of the static functions into c2.c itself, and
only keep the public functions in c2.h
2018-09-10 13:46:05 +01:00
Yuxuan Shui e875f7566f Bump to C11 2018-09-10 13:46:05 +01:00
Yuxuan Shui 98d4255aee Add editorconfig 2018-09-10 13:46:05 +01:00
Yuxuan Shui fcef5e706d Some cleanup work
* Remove NO_C2 option
* Split configuration related functions into their own file
* Drop support for libconfig < 1.4
* Fix dependencies in Makefile
2018-09-10 13:46:05 +01:00
Yuxuan Shui 265dc67717 Update github issue template 2018-09-10 12:27:02 +01:00
Yuxuan Shui ba780659be Add repo info to usage string 2018-09-10 12:08:45 +01:00
Yuxuan Shui c695d06263 Fix cflags for release build 2018-09-09 02:47:26 +01:00
Yuxuan Shui cac8094ce1 Update manpage 2018-08-14 11:05:28 +01:00
Yuxuan Shui c8bfbd6b11 Allow setting active/inactive opacity to 0 2018-08-14 11:05:28 +01:00
Yuxuan Shui 15e3c525e3 Expose opacity_is_set, has_opacity_prop over dbus 2018-08-14 11:05:28 +01:00
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