1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00
Commit graph

21 commits

Author SHA1 Message Date
Yuxuan Shui
6a01cec68a
Add prototype picom-inspect
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-20 13:51:37 +00:00
Yuxuan Shui
3e0fd094ab
c2: fix accidental mishandling of the "on client" flag ('@')
Despite being named "tgt_onframe" in the code, it actually means the
property should be found on the client window.

I accidentally break it during the refactoring. Fix it, and change all
the confusing variable names.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-19 13:09:35 +00:00
Yuxuan Shui
0613440645
c2: match using stored window properties
And removing the session_t parameter from c2_match.

As a side-effect, rules with mismatched types will stop working from this
commit onward. As was warned about in a previous commit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 19:38:43 +00:00
Yuxuan Shui
f2626cc930
c2: store tracked property values per-window
Store properties used in c2 conditions in the window state, so we don't
need to re-query them every time we evaluate the rules. First step to
remove the dependency on X connection from c2_match.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 19:38:42 +00:00
Yuxuan Shui
448dc7ac9d
c2: start to separate some state out of session_t
This is just the beginning, c2_match still needs session_t, everything
is just so tangled...

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-17 15:07:55 +00:00
Yuxuan Shui
654772b8cf
config: add options window-shader-fg and window-shader-fg-rules
Used for setting custom window shaders and rules for choosing custom
window shaders.

Added a "c2_userdata_free" parameter to c2_list_free, so allocated userdata
stored in nodes can be freed.

Signed-off-by: Bernd Busse <bernd@busse-net.de>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:28:48 +01:00
Yuxuan Shui
5d79da6387
c2: return if foreach function returned early
Useful for error handling.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 18:09:20 +01:00
Yuxuan Shui
23c56ab328
c2: add list iterating functions
Also renames free_wincondlst to c2_list_free and move it to c2.h.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 17:48:13 +01:00
Yuxuan Shui
bd4c242015
win: split struct win
Currently compton handles window creation event by immediately query all
the information it needs and create a window struct with that
information. However, this is prone to race conditions.

In the future, we want to react to window creation event by creating a
placeholder in the window stack, and only query window information in a
critical section where the X server is grabbed by us.

This commit split struct win into two struct, one as placeholder, the
other for holding actual window information.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:29 +01: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
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
471f6f90ff Remove some unnecessary macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-04 18:54:37 +00:00
Yuxuan Shui
7b755a3cf0 Fix typo in CONTRIBUTORS, move licenses around
Having a LICENSE file makes github happy
2018-10-03 22:24:12 +01:00
Yuxuan Shui
ee318582f5 Sort out license problems
IANAL, but I think I am allowed to add missing copyright notices for
someone else. And I did my best job using git history to figure out who
wrote which functions. So I hope everything is fine.
2018-10-03 22:14:51 +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
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
7417f0deee Misc: stoppaint_force & Documentation update
- Add stoppaint_force option, controlled via D-Bus, to stop painting
  completely, which may look better than unredirecting the screen,
  sometimes. (#41)

- Add x2, y2 matching targets.

- Update documentation.
2013-07-30 22:24:11 +08:00
Richard Grenville
c02b3fadf0 Misc: --paint-exclude & #119
- Add --paint-exclude to prevent certain windows from being painted, for
  debugging purposes.

- Add predefined matching target "x", "y", "width", "height", "widthb",
  "heightb", "border_width", and "fullscreen".

- Fix bug #119, wrong man page install dir in CMake configuration.
  Thanks to sstewartgallus for reporting.
2013-06-19 19:36:48 +08:00
Richard Grenville
75ebd56f74 Feature #113: Set opacity based on conditions
- Add --opacity-rule, which sets opacity based on conditions, as
  requested by zabbal. (#113)

- Add a data field for each condition.

- Correct the FAQ link in README.md. Silly me.

- Code clean-up.
2013-05-21 09:26:18 +08:00
Richard Grenville
aace60be59 Improvement: ARGB window matching & Enable track_focus with D-Bus
- Add predefined matching target "argb" to match ARGB windows.

- Make it possible to enable focus tracking on-the-fly with D-Bus
  method.
2013-03-10 18:45:54 +08:00
Richard Grenville
6d36ef2d0f Feature #16: Advanced window matching
- Add advanced window matching system, capable of matching against
  arbitrary window properties as well as a series of internal
  properties, with 4 additional operators (>, <, >=, <=) useful for
  integer targets, and support of logical operators. The old matching
  system is removed, but compatibility with the format is retained.

- As the new matching system is pretty complicated, and I have no past
  experience in writing a parser, it's pretty possible that bugs are
  present. It also has inferior performance, but I hope it doesn't
  matter on modern CPUs.

- It's possible to disable matching system at compile time with NO_C2=1
  now.

- Add ps->o.config_file to track which config file we have actually
  read. Queryable via D-Bus.

- Parse -d in first pass in get_cfg() as c2 needs to query X to get
  atoms during condition parsing.

- Fix a bug in wid_get_prop_adv() that 0 == rformat is not handled
  correctly.

- Fix incompatibility with FreeBSD sed in dbus-examples/cdbus-driver.sh
  .

- Add recipe to generate .clang_complete in Makefile, used by Vim
  clang_complete plugin.

- Add DEBUG_C2 for debugging condition string parsing. DEBUG_WINMATCH is
  still used for match debugging.

- Rename win_on_wdata_change() to win_on_factor_change().

- Extra malloc() failure checks. Add const to matching cache members in
  session_t. Code clean-up. Documentation update.
2013-01-28 21:39:38 +08:00