Commit Graph

30 Commits

Author SHA1 Message Date
Yuxuan Shui 7d8a3e09be
core: just enable track_focuse
It's not an intensive task.

Simplifies logic.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-25 00:02:25 +01:00
Yuxuan Shui 0037b7e5fb
Eliminate implicit conversions
Use explicit conversions everywhere. Adding bounds check assertions when
necessary.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui df15526722
options: print warning for --vsync-aggressive
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:23 +01:00
Yuxuan Shui dd240d0576
Deprecate --glx-swap-method
Setting glx-swap-method to value other than "undefined" and "buffer-age"
could potentially cause rendering problems. So remove them, the meaning
of the remaining options can be more precisely captured by "use-damage",
so create a new option under that name.

--glx-swap-method is deprecated in favor of the new option --use-damage.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-12 00:35:47 +00:00
Yuxuan Shui 17d1281594
Remove options deprecated in v3
Specifically, use --glx-copy-from-front and --glx-use-copysubbuffermesa
are now hard errors.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-11 23:56:58 +00:00
Yuxuan Shui cebe1b18d6
vsync: choose vsync method automatically
Choose the best vsync method for the user, instead of asking them to
frustratingly try every one of the options to see what works.

With this commit, the `vsync` option will take only a boolean value.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-10 15:00:56 +00:00
Yuxuan Shui e7de44260b
Deprecate --vsync-aggressive
Original developer's word in man page: "Reported to work pretty terribly".

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-10 13:59:22 +00:00
Yuxuan Shui 472fe6c6bd
options: remove mentions of some deprecated options
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-10 03:04:43 +00:00
Yuxuan Shui 710ff2fd42
Deprecate --glx-use-gpushader4
Original develop commented in the man page: My tests ... show no noticeable
effect.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-09 18:29:01 +00:00
Yuxuan Shui 7e7c54761e
Remove an undocumented option
Removed --glx-reinit-on-root-change.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-25 21:18:48 +00:00
Yuxuan Shui 59ca5c9628
Remove one undocumented option
Removed --reredir-on-root-change

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-25 00:26:54 +00:00
Yuxuan Shui e82bc0ca23
Silence a warning in release build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-21 14:15:25 +00:00
Yuxuan Shui b0c5db9f5a
Let old/new backends co-exist
Now both the old and the new backends are compiled in, the user can
choose which one to use with a command line switch.

Lower the barrier for testing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-20 17:52:24 +00:00
Yuxuan Shui 2e2e8e3ce0
Use struct conv for blur kernel as well
Instead of storing them as an array of xfixed.

Might cause some performance overhead for the new backend, because
it is allocating a buffer to do the conversion every frame. Will fix
later.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-20 01:39:43 +00:00
Yuxuan Shui 2a41847aa6
Make xinerama mandatory
Fixes #116

Also tweaks the usage message a bit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-18 21:05:12 +00:00
Yuxuan Shui a826e0ce79
Window state tracking refactor
Window state tracking is basically the back bond of window fading. We
add a new enum field to the win struct to track the state of the window,
instead of using a set of boolean variables. We also remove the fading
callbacks, since it is only used for fading, so the potential of code
reuse is lost. And it makes the code slightly harder to understand.

Also fixed a problem that --no-fading-openclose is not behaving as
advertised (from my observation, enabling this flag disables fading
entirely, instead of just diabling it for open/close).

Also uses double for opacity everywhere internally. Use opacity_t only
when setting X opacity prop.

TODO: Remove win::*_last

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-17 16:37:28 +00:00
Yuxuan Shui 1a327b06ab
Fix abort because we used log too early
Can't use log in get_early_config.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 22:46:28 +00:00
Yuxuan Shui 5fffb6f3f6
Fork as early as possible
If fork is requested, we fork as early as possible, way before anything
is initialized. This way, we don't need to do the gymnastics to make
OpenGL work properly across fork.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-08 01:33:42 +00:00
Yuxuan Shui 205427d7da
Exit with exit code 1 when argument parsing failed
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-30 22:19:05 +00:00
Yuxuan Shui 9d64decf2a
`compton -h` should quit after printing help
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-29 23:36:34 +00:00
Yuxuan Shui f649a949e2
Even more includes
Expand the modulemap to cover some of the system headers too.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-20 22:09:22 +00:00
Yuxuan Shui 916e23861a
Improve the header includes, cont'd
Also check in the modulemap file, and add a option to build with clang's
-fmodules.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-20 17:10:06 +00:00
Yuxuan Shui 80847dd3fa
Refactor the XSync fence code
Use a temporary fence everytime. Convert the Xlib XSync functions to use
xcb_sync_*.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-30 07:06:47 +00:00
Yuxuan Shui 4f1dddd072
-C and -G *disables* shadow, not enabling them
Well, I made a mistake.

Fixes #79

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-24 19:58:25 +00:00
Yuxuan Shui f41765fca5
Refactor setting the default winopts
Move filling winopts with default values to after command line options have
been parsed, not after parsing the config file. This is more intuitive.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-24 19:57:16 +00:00
Yuxuan Shui f8c86d51b3
Mark fallthrough switch case
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 23:04:51 +00:00
Yuxuan Shui 8bb7027393
Fix memory leak in get_cfg
When setting --shadow-exclude-reg from both the config file and the
command line, one of the strings is not freed.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 22:59:28 +00:00
Yuxuan Shui 7915ade1be
Make --logpath work again
Also add a new option "log-file" to config file and command line, it
doesn the same thing as --logpath.

--logpath was never documented, and "log-file" is more consistent with
the naming of options.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 22:59:21 +00:00
Yuxuan Shui cb7d852b0f
Clean up options/config file parsing
* Pass a options_t, not session_t
* Slightly improve error handling when setting vsync method via dbus

The goal here is to limit the scope of what a given function can access.
And session_t contains basically everything, so don't pass it around.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 17:21:52 +00:00
Yuxuan Shui ee2be09958
Rename argparse.* to options.*
Seems to be a more appropriate name.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-21 13:10:49 +00:00