Commit Graph

1272 Commits

Author SHA1 Message Date
Yuxuan Shui 5e6dacbabe
file_watch: use kqueue on *BSD platforms
Tested on FreeBSD 12

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-11 21:22:57 +00:00
Yuxuan Shui 9657d52cd7
test.h: sync with upstream
upstream commit: 4150ed1c1cce9e71a6b22024b9683ba4f2dc1bec

Unbreak build with GCC on FreeBSD

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-11 20:55:18 +00:00
Yuxuan Shui 7328b3f891
file_watch: only use inotify on linux
Fixes build on *BSD platforms.

Fixes #262, Closes #261

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-11 20:48:42 +00:00
Yuxuan Shui a1e6686455
man: document --max-brightness
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 22:22:01 +00:00
Yuxuan Shui 2651042070
core: don't watch config file when there is none
Stop picom from complaining about "Failed to watch file", when there is
no file to watch.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 21:55:38 +00:00
Yuxuan Shui 71ac1bfd30
core: use the logging system all the way
Add a log handler early so we don't need to use fprintf for early logs.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 19:12:16 +00:00
Yuxuan Shui 87e4e10f15
core: reinitialize logging after resets
deinit then init the logging system after resets, because otherwise
duplicated log handlers will be added by session_init, and we will
see duplicated logs.

Doing this also enables us to add log handlers for early logging.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 19:10:32 +00:00
Yuxuan Shui 0e5be97f94
core: watch for configuration file changes
Automatically reset picom and reload the configuration when a change in
the configuration file is detected.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 18:58:01 +00:00
Yuxuan Shui fe9fec84dc
core: check experimental_backends before using backend_list[backend]
Fixes #258

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 18:10:43 +00:00
Yuxuan Shui 30e9e2dc9f
core: check experimental_backend before accessing backend_list
backend_list[backend] is only guaranteed to be non-NULL if experimental
backends are used.

Fixes #258

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 05:07:03 +00:00
Yuxuan Shui 44a771cf76
core: move some config validation into options.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 05:04:10 +00:00
Yuxuan Shui 2848b24a57
options: reject invalid backend earlier
Unsupported backends were rejected when we try to initialize them, now
we reject them in the option parsing phase.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 05:03:17 +00:00
Yuxuan Shui 6efd88b82f
gl_common: use Rec. 709 for luminance calculation
This is however monitor dependent. But Rec. 709 is probably close to
what most people uses.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 03:37:11 +00:00
Yuxuan Shui 7dd843fe4f
options: max-brightness only works on the new glx backend
Print warning when the requirements aren't met.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 03:00:50 +00:00
Yuxuan Shui f6a51be234
gl_common: reuse texture for brightness estimation
Instead of allocating new textures everytime gl_average_texture_color is
called, we keep two textures per gl_image and reuse those.

Doing this significantly improves CPU usage on AMDGPU driver for some
reason. But in general, less texture allocation is always better.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 02:50:14 +00:00
Yuxuan Shui b11e11e682
backend: add missing header xcb/sync.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 02:31:55 +00:00
Yuxuan Shui 6c96e1f3c6
backend: add missing header x.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-10 02:30:56 +00:00
Yuxuan Shui 2c1fdefe3b
backend: enable xsync fence for nvidia users
This was already done in the legacy backends, this commit adds the same
thing to the new backends.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-11-09 20:01:38 +00:00
yshui c98e7fa39f
Merge pull request #247 from Jauler/dim_bright_windows
Brightness clamping
2019-11-09 17:43:38 +00:00
Rytis Karpuska ec76c5f286 parameterize max brightness limit 2019-11-09 17:56:38 +02:00
Rytis Karpuska e510814b7c implement bright window dimming 2019-11-09 17:54:57 +02:00
yshui c4da36839e
Merge pull request #259 from davidschlachter/next
Updated README
2019-11-08 11:23:11 +00:00
Rytis Karpuska 310b66d519 remove dual_texture from gl_compose as it is just unconditionally set to false. 2019-11-06 01:34:41 +02:00
David Schlachter 155ee835bd
Updated README
Rationale:
- "bug to be expected" -> "bugs to be expected". Usually the noun is plural in this expression (since more than one bug is likely to be found in the future).
- "because that seems to be unmaintained" -> "because it seems to be unmaintained". Using a demonstrative pronoun ("that") versus a personal pronoun ("it") suggests that we need to specify which of several Comptons is unmaintained.
- "features" -> "feature" and "stabilizes" -> "stabilize". The new backends are plural, should be conjugated without the trailing "s".
- "used" -> "use". The command used to launch picom has already been run. Changing to "use" indicates the command that habitually launches picom. Also changed "command line" (the interface, e.g. the prompt) to "command".
- "Rational" (adjective: based on reason) -> "Rationale" (noun: the reasons or logic that motivated an action)
- "when people searches" -> "when people search". Usually conjugated as plural [1](https://english.stackexchange.com/q/263046)
- "to solve aforementioned problems" -> "to solve the aforementioned problems". "Aforementioned" is preceded by a definite article when modifying a noun.
- "mentions to" (usually used in suggesting an 'honourable mention'/accolade regarding somebody) -> "mentions of" (instances of)
2019-11-04 20:43:18 +00:00
yshui 8e0d421ba6
Update README.md 2019-10-25 11:06:15 +01:00
Yuxuan Shui a2f816acb1
rename: fix the name of the modulemap file
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-24 19:41:35 +01:00
Yuxuan Shui 35db48b68a
core: fix reg_ignore calculation for window with transparent frame
Previously window with transparent frame is mistakenly treated like a
completely transparent window.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-24 19:36:19 +01:00
Yuxuan Shui a0712274ff
win: fix transparency detection for windows without a WM frame
Ping #233

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-24 19:30:11 +01:00
Yuxuan Shui c920082bff
Update config file path in the man page
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-24 19:26:25 +01:00
Yuxuan Shui 634903727a
Update links to git repo
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-24 19:24:38 +01:00
yshui 43b21731f8
Merge pull request #254 from yshui/rename
Rename
2019-10-23 20:30:34 +01:00
Yuxuan Shui 902ad5ddf9
rename: documentation changes
Update names in COPYING, LICENSE.spdx. Document information regarding
the rename in README.md

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-23 20:24:25 +01:00
Yuxuan Shui ed0e686f37
rename: update config file paths
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-23 20:24:25 +01:00
Yuxuan Shui 8ddbebb5d1
rename: replace "compton" in the codebase
leftovers:

1) config file path. Has to implement compatibility functionalities before
  we can change it.

2) links in man pages. Has to migrate the repo first.

3) _COMPTON_SHADOW, it has become a defacto standard, so we have to keep
   supporting it.

4) dbus names, undecided whether we should/could change it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-23 20:24:20 +01:00
Yuxuan Shui ed6a96dae9
options: add --no-vsync command line option
Otherwise there is no way to override the settings in the config file.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-23 20:23:21 +01:00
Yuxuan Shui d9aa32b40a
Remove unused shell scripts
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-22 20:48:03 +01:00
Yuxuan Shui 2d28ab6032
options: remove --respect-prop-shadow
A quick search on GitHub showing the _COMPTON_SHADOW is actively being
used (most noteably, by polybar). It is not a difficult thing to support,
and it doesn't have that much runtime overhead. So remove the option
that guards this feature, make it enabled by default.

(Side note, I saw lots of people putting this option in their config
files, but this is actually a command line only option.)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-22 20:45:21 +01:00
Yuxuan Shui cdcdda8ed8
Remove compton-convgen.py
We have better blur configuration built into the compositor by now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-22 20:32:43 +01:00
Yuxuan Shui f227e6c8c7
ci: enable more build types
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-12 15:17:28 +01:00
Yuxuan Shui 9f136ca2e4
ci: add more build types
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-12 15:15:42 +01:00
Yuxuan Shui 583cf35bed
Fix compiler warnings in release builds
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-12 15:12:17 +01:00
Yuxuan Shui 065f9ffd4d
test.h: update to yshui/test.h@9e5fc7b
Fix unit tests on *BSD systems

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-12 14:56:59 +01:00
yshui 2d1621aee4
Merge pull request #250 from jbeich/no_opengl
Unbreak build without OpenGL
2019-10-12 14:46:51 +01:00
Jan Beich bd5a5fb568 Unbreak -Dopengl=false clean build
In file included from ../src/x.c:17:
../src/backend/gl/glx.h:10:10: fatal error: 'GL/glx.h' file not found
 #include <GL/glx.h>
         ^~~~~~~~~~
2019-10-12 13:29:10 +00:00
Yuxuan Shui 945dc179f5
meson.build: make sure xcb packages are recent enough
Fixes #248

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-11 18:11:45 +01:00
Yuxuan Shui 1ca01ec456
Make sure window cannot enter fading when unredirected
Firstly, this breaks the assumption that when we redirect the screen,
all window is either mapped or unmapped, causing a assertion failure.

Secondly, if transition window into fading when the screen is not
redirected, the fading will not progress until the screen is redirected,
probably not the desired result.

Fixes #246

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-11 18:01:13 +01:00
Yuxuan Shui 93f0d80572
options: enable use-damage by default
Since user reports indicate it has real performance benefits.

Also add a command line flag for turning use-damage off.

Fixes #242

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-29 00:52:07 +01:00
Yuxuan Shui a69ed89114
Treat first frame after redirection differently
Because first frame no window has their pixmap bound, which doesn't
happen in frames after the first. If a window is unmapped in that frame,
the compositor will try to render a window with no pixmap bound if
fading is enabled.

Now we keep track if we are in the first frame, and if that's the case
we skip fading in unmap/destroy.

Fixes #239, bug number 2

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-29 00:40:09 +01:00
Yuxuan Shui f493447b33
win: clear PIXMAP_STALE in {unmap,destroy}_win_start
Also make sure unmapped/destroyed windows don't have PIXMAP_STALE flag
set.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-29 00:09:40 +01:00
Yuxuan Shui 0fc6f9aee2
core: bind shadow immediate in initialize_backend
This simplifies the logic a bit since we know a shadow is always bound
(if needed) when the screen is redirected.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-29 00:04:09 +01:00