Commit Graph

10 Commits

Author SHA1 Message Date
Yuxuan Shui 50e2259404 Remove xrender-sync and xrender-sync-fence
This was a dubious "fix" for a Nvidia driver problem. The problem was
never fully understood, and the then developers took a shotgun approach
and implemented xsync fences as a fix. Which somehow fixed the problem.
Again, I don't see any indication that the developers understood why
this "fix" worked.

(for details, see chjj/compton#152 and chjj/compton#181)

The driver problem should have been fixed almost 5 years ago. So this
shouldn't be needed anymore. In addition the way compton uses xsync fences
is apparently wrong according to the xsync spec (fences are attached to
screen, but compton uses them as if they were attached to drawables).

So, I will try removing it and see if anyone will complain. If there are
real concrete reasons why fences are needed, it will be brought back.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:36:55 +00:00
Yuxuan Shui 5694e75932 Fix build when opengl is disabled, again
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:09:42 +00:00
Yuxuan Shui 551d487836 Remove some unused parameters
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 1f95c74a68 Move struct win to win.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui aa2098eefd Move w->bounding_shape to local coordinates
This way we don't need to update the bounding region after window moves.

Also add some comments about the coordinate systems in compton.
Also change a few function that takes a `bool global` parameter to
always return region in local coordinates.
2018-10-13 01:24:52 +01:00
Yuxuan Shui 4f071ffc30 Fix infinite recursive calls
win_rounded_corners is called by win_updated_bounding_shape, so there is
no need for the former to call the later.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-12 23:37:02 +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 28a2cc62fa Convert XfixesRegion to pixman region
Re-did the painting logic, and document it.

It is unclear to me what is the previous painting logic. But the current
one is basically this:

1. Go through all windows top to bottom, and put visible windows (not
   unmapped, opacity > 0, etc) into a linked list, from bottom to top
2. Accumulate a region of ignore on each window, which is basically the
   region of screen that is obscured by all the windows above current
   one.
3. Paint all the visible windows from bottom to top. Subtract the region
   of ignore from the painting region. If we need to paint shadow, we
   subtract the body of the window from the shadow painting region too,
   because we don't want shadow behind the window.
4. region of ignore is invalidated when window stack change, an
   window on top moved or changed shape, when window changed between
   opaque and transparent, etc.

Notes:

It is unclear whether all the different shapes of a window (extents,
noframe, border, bounding shape, etc) are calculated correctly or not.

It is unclear if window shape related events are handled correctly or
not. Need more testing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-09-30 14:18:33 +01:00
Yuxuan Shui 90b6aa16ad Remove ARGB as a window mode
Instead use win_has_alpha to check for alpha channel, window mode is
reserved for determine if the window is possibly transparent.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-09-30 13:49:45 +01:00
Yuxuan Shui 2e39fc5618 Split out win related functions to win.c
Also move static function prototypes out of compton.h. Seems like the
previous developers didn't know what header files are for.

Seems to have bugs after the split.
2018-09-10 13:46:24 +01:00