Commit Graph

12 Commits

Author SHA1 Message Date
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 9b121447b9
Remove a couple of unwanted options
* -d: because the standard way is to use $DISPLAY
* no-name-pixmap: undocumented debugging option
* -S: debugging option, not very useful

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 23:44:38 +00:00
Yuxuan Shui 4ff9e810ff
Sort out the dbus function prototypes
* Moved dbus prototypes from common.h to dbus.h
* Removed private function prototypes from dbus.h
* Removed private macros from dbus.h
* Hide dbus types from common.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-20 23:12:27 +00:00
Yuxuan Shui 0cebbc370a
Function movements
* string functions mstr*() are moved to string_utils.c
* allocation wrappers are moved to utils.h
* printf_* functions are moved to log.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-15 17:43:36 +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 2a4fed50f4 Use libev for inputs and timeouts
Bugs:

* There seems to be a noticeable frame loss when window
  is being opened/closed. But the same problem also exists
  in master/next, so this is not a regression.
* Using --sw-opti and --benchmark at the same time causing
  compton to draw more frequently than permitted by the
  arguments. That is because the sleep interval calculation
  is flawed. Not really a regression either.

Verified still working:

* Usual painting
* Fade
* Benchmark mode
* --sw-opti (with or without benchmark mode)
* DBus
* Unredir delay

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-03 01:05:32 +01:00
Yuxuan Shui 27fc4a2af4 Clear compiler warnings
Thanks to chjj/compton#445
2018-05-17 12:50:22 +01:00
Richard Grenville 46e6abdd2a Misc: --write-pid-path & small changes
- Add --write-pid-path to write process ID to a file, to help
  determining compton's process ID when -b is used.

- Add a few extra targets to query through D-Bus opts_get (version, pid,
  etc.) and through win_get, primarily for debugging.

- Add helper macros likely(), unlikely(), cmalloc(), ccalloc(),
  crealloc().

- Change w->opacity_set to opacity_t. Determine display_repr in
  session_init(), etc.
2013-11-09 21:38:31 +08:00
Richard Grenville 8e34736c19 Improvement: Change VSync mode with D-Bus & Makefile update & Misc
- Add on-the-fly VSync option modification via D-Bus, as requested by
  kunitoki (#80). Expose parse_vsync(), create vsync_init() and
  ensure_glx_context().

- Change default value of ps->drm_fd to -1.

- Update Makefile. Change the install/uninstall rules and add doc
  installation, requested by hasufell in #85.

- Mark window not damaged in map_win(). It helps in reducing flickering
  with inverted window color, but I'm not completely sure if it's safe.

- Avoid modifying w->invert_color when window is unmapped.

- Update documentation. Thanks to hasufell for pointing out.
2013-01-31 22:56:54 +08:00
Richard Grenville 00424b1082 Bug fix #84: Root window not repainted sometimes on wallpaper change
- Fix a bug that root window is not repainted on wallpaper change unless
  an Expose X event is received. Seemingly, if there's no mapped window
  on a screen, X will not send an Expose event when the wallpaper
  changes. Thanks to baskerville for reporting.

- Fix a X Pixmap leak when there's no existing wallpaper pixmap found.

- Fix a bug in mstrncpy() that null character is not added to the end of
  the copied string.

- Make VSYNC_STRS public, for use in src/dbus.c. Adjust the type of
  WINTYPES array. Add NUM_VSYNC.

- Add more targets for various D-Bus methods. Add "bad_target" D-Bus
  error. Improve error handling. Add more helper functions to append
  arguments to a D-Bus message. Add Introspect method to D-Bus
  introspection reply.

- Add public declarations of things in the new condition format code to
  common.h. Move definitions of some inline functions from compton.h to
  common.h. Make some functions public. Move wid_get_prop_adv() to
  compton.c. The primary code files of the new format src/c2.{c,h} will
  be published when ready.

- Add support for dumping version string in Makefile (make version), to
  make snapshot generation easier.

- Add repeated inclusion protection to common.h.

- Update documentation.

- Use gsed instead of sed in dbus-examples/cdbus-driver.sh if possible,
  as some BSD systems does not come with GNU sed by default. Thanks to
  DaChiChang for reporting.

- Code clean-up. Small type changes in register_cm() to silence
  warnings. Quit on failure in parse_vsync(). Apply stricter checks in
  force_repaint().
2013-01-24 13:38:03 +08:00
Richard Grenville 58c0ecec40 Feature #80: D-Bus support
- Add D-Bus support. Currently 7 methods are available: "reset" (same as
  SIGUSR1), "list_win" (list the windows compton manages), "win_get"
  (get a property of the window), "win_set" (set a property of the
  window), "find_win" (find window based on client window / focus),
  "opts_get" (get the value of a compton option), and "opts_set" (set
  the value of a compton option), together with 4 signals: "win_added",
  "win_destroyed", "win_mapped", "win_unmapped".

- D-Bus support depends on libdbus.

- As there are many items and my time is tight, no much tests are done.
  Bugs to be expected.

- Create a new header file `common.h` that contains shared content.

- Fix some bugs in timeout handling.

- Update file headers in all source files.

- Re-enable --unredir-if-possible on multi-screen set-ups, as the user
  could turn if off manually anyway.

- Check if the window is mapped in `repair_win()`.

- Add ps->track_atom_lst and its handlers, to prepare for the new
  condition format.

- Known issue 1: "win_get", "win_set", "opts_get", "opts_set" support a
  very limited number of targets only. New ones will be added gradually.

- Known issue 2: Accidental drop of D-Bus connection is not handled.

- Known issue 3: Introspection does not reveal all available methods,
  because some methods have unpredictable prototypes. Still hesitating
  about what to do...

- Known issue 4: Error handling is not finished yet. Compton does not
  always reply with the correct error message (but it does print out the
  correct error message, usually).
2013-01-19 20:20:27 +08:00