Commit Graph

30 Commits

Author SHA1 Message Date
Richard Grenville dfde67255f Improvement: Change generating process of alpha_pict, etc.
- Change how w->alpha_pict is generated, in hope to boost performance,
  slightly, and as a step to eventually move handling code of most resources
  used when painting to paint_preprocess().

- Remove alpha_pict parameter of shadow_picture() as it's not
  necessary.

- Let window opacity affect frame opacity.

- Rename some members of struct _win.
2012-09-17 12:41:41 +08:00
Richard Grenville 64d53f6534 Misc: Clean up
- Add 4 helper free functions that free XserverRegion, Damage, Picture,
  and Pixmap.

- Rename w->shadow to w->shadow_pict. Add a bool member w->shadow to
  prepare for a future change.
2012-09-16 23:17:34 +08:00
Richard Grenville 4293a4626a Bug fix: Issue #43, better client window lookup
More details on the issue report.

- Look up the client window of a WM frame when it's mapped instead of when
  it's created, for better reliability.

- Fix a warning when building.
2012-09-14 11:51:46 +08:00
Christopher Jeffrey 0d4c6fc5cc fix code duplication resulting from rebase 2012-09-13 10:28:27 -05:00
Christopher Jeffrey e2c14ee545 fix determine_evmask warnings 2012-09-13 10:24:37 -05:00
Christopher Jeffrey 0064894bf6 more style changes 2012-09-13 10:24:14 -05:00
Christopher Jeffrey 5bcbf87f32 stay consistent with code style 2012-09-13 10:00:57 -05:00
Christopher Jeffrey 5112f91c48 whitespace 2012-09-13 09:59:50 -05:00
Richard Grenville 271d894eae Bug fix: Segfault when meeting FocusIn/Out from destoryed windows
I found compton segfaults sometimes when starting from .xinitrc.
Debugging reveals my conky window was just reparented to a fvwm's
frame window before compton picked up a FocusOut event on this conky
window that has just been destroyed in the event queue. find_win()
call in ev_focus_in/out() returned a NULL pointer. When it tried to
use the pointer segfault happens.

- Add extra check to ev_focus_in/out() to stop the segfault.

- Reset window event mask on window reparenting to a non-root window to
  minimize wrong events.

- More abstraction for determining window event mask.
2012-09-13 22:30:18 +08:00
Richard Grenville 18b3a96d0b Improvement: Use find_toplevel() to find WM frame
Use find_toplevel() to find out the WM frame of a client window. I
didn't noticed it beforehand. Fallback to the old method as compton does
not always get correct client windows.

- Clean up find_client_win() a bit. A BFS search algorithm could be more
  optimal yet it requires a queue implementation.
2012-09-13 21:38:55 +08:00
Richard Grenville d0399313fc Improvement: Do not track focus changes unless necessary
Stop tracking focus changes unless either inactive_opacity or
inactive_dim is enabled, small performance boost in certain cases.
2012-09-13 11:47:31 +08:00
Richard Grenville 3abeb58690 Bug fix: Issue #40: -z does not work as expected
More information in the issue report.

- Let window opacity affect the opacity of its shadow and frames even if
  -z is enabled.

- Check for the range of -o to eliminate potential segfault.
2012-09-12 21:01:06 +08:00
Richard Grenville 6f079af2f0 Bug fix: Double free when XQueryTree() fails
Take care of failure of XQueryTree() to prevent it from causing a
double-free crash. This usually happens when X is initializing and windows
are constantly changing.
2012-09-12 12:14:24 +08:00
Richard Grenville 35f7d45130 Bug fix: Issue #39: Render windows just mapped && focused incorrectly
More info in the issue description. This also fixes the problem for
--inactive-dim.
2012-09-12 11:06:16 +08:00
Richard Grenville e9cfa49c86 Feature: Issue #2: Support dim inactive windows
- Add a switch --inactive-dim that dims inactive windows.

- The window dimming feature is implemented in a pretty ugly way.
  Improve it if possible.
2012-09-12 10:52:52 +08:00
Richard Grenville f280750a03 Debug: Enhanced debugging capability
- Change all #if DEBUG_XXX directives to #ifdef, thus making it
  possible to directly enable debugging options with CFLAGS
  (-DDEBUG_XXX).

- Print timestamp before event debugging messages.
2012-09-12 09:08:15 +08:00
Richard Grenville c905c882b4 Bug fix: Segfault when encountering invalid long option
I didn't read the documentation of getopt_long() carefully.
2012-09-11 23:11:23 +08:00
Richard Grenville 129115171a Bug fix: Issue #37, fix 5 opacity-related bugs
More details in the bug report.

- Rewritten much of the opacity calculation, code cleanup.

- Commandline switch --inactive_opacity_override to restore the old
  behavior in which inactive_opacity has higher priority than
  _NET_WM_OPACITY.
2012-09-11 22:22:58 +08:00
Richard Grenville deaaf5c5cf Feature: Issue #35, Add colored shadows
- Use getopt_long() instead of getopt() for argument parsing, making
  long options possible.

- Add support of colored shadows with 3 commandline switches.
2012-09-11 21:57:50 +08:00
Richard Grenville f5aed89a67 Bug fix: Issue #36: Chromium window painting problems
More descriptions on issue #36.

- Listens ShapeNotify event to get around the Chromium window painting
  issues.

- Adds dependency on X Shape extension.

- Adds a few functions for convenience, so a bit code clean up.

- Better event debug support, adds restack_win() debug.
2012-09-11 21:33:03 +08:00
Richard Grenville 8628371a83 Bug fix: Issue #38, fixes painting specially-shaped semi-transparent windows
Fix taken from xcompmgr.
2012-09-11 21:11:06 +08:00
Christopher Jeffrey eb3b13145d avoid allocating a new win struct if possible 2012-09-08 21:13:56 -05:00
Christopher Jeffrey 02e2deea54 add richardgv's patch. see #31. 2012-09-08 21:04:44 -05:00
Christopher Jeffrey 94efff0bb2 apply patch from richardgv. fixes #5. 2012-09-07 11:51:08 -05:00
Christopher Jeffrey f358eb5962 rename, refactor again. 2012-06-03 12:35:33 -05:00
Christopher Jeffrey 3dfaea3698 refactor, rename 2012-06-03 11:08:50 -05:00
Tim van Dalen 1584805ea7 Fixed a (very) small 'bug' in the usage text, -f wasn't printed on a new line. 2012-03-17 19:01:28 +01:00
Christopher Jeffrey 674ac5b6cd stop listening for property events on client window after unmap 2012-02-28 01:52:41 -06:00
Christopher Jeffrey b01cfea5c6 minor changes 2012-02-27 10:41:12 -06:00
Christopher Jeffrey 8f4eafaf79 reorganize tree 2012-02-27 05:22:33 -06:00