Commit Graph

1364 Commits

Author SHA1 Message Date
Yuxuan Shui 71e1a8a06f
event: reparent: always detach window from its previous parent
Otherwise we might see a window becoming child of two different parent
windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 21:12:57 +01:00
Yuxuan Shui 53bb488530
win: rename find_toplevel2 to find_toplevel_nocache
So it is slightly clearer what is the difference to find_toplevel().

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 20:46:20 +01:00
Yuxuan Shui 397710ac27
tests: add testcase for #314
This should be fixed by merging #364.

Thanks @tryone144 for pointing out the root cause.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:52:12 +01:00
Yuxuan Shui 8e440af222
win: print more debug messages on opacity change
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:50:14 +01:00
Yuxuan Shui 969cbeaf17
config_libconfig: add force-win-blend option
It use to be a command line only option.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-05 02:32:54 +01:00
Yuxuan Shui 05e8d0f305
testcases: update comments in issue357.py
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-04 17:50:06 +01:00
Yuxuan Shui a23bac727c
new backend: assert blur_opacity is in [0, 1]
Related to: #314 #318

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-04 15:55:30 +01:00
Yuxuan Shui 0e158c508f
new backend: clear background if there is no wallpaper
So windows won't left a trail when you move them, because they are drawn
over previously drawn stuff.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-02 17:37:52 +01:00
yshui 85086bc984
Merge pull request #362 from Paradigm0001/patch-1
Invert script optimizations
2020-04-01 13:51:17 +01:00
Paradigm0001 1639605306
Update inverter.sh
Error verbose for lack of X Display variable now uses stderr function
2020-04-01 04:50:03 +00:00
Paradigm0001 7f52a4a582
Update inverter.sh
Missed a few more comptons in comments
2020-03-31 12:02:28 +00:00
Paradigm0001 32e0d1c095
Update inverter.sh
Missed a textual remnant of compton, whoops
2020-03-31 11:57:05 +00:00
Paradigm0001 e70803385d
Update inverter.sh
Removed unnecessary if statement and unnecessary /dev/null redirect on line 19
Line 26 can use argless printf rather than echo -n
Error verbose prints in red and to STDERR rather than to STDOUT
Textually replaced compton with picom where applicable.
Removed unnecessary semicolons after exit commands

I might've missed/screwed something but lets hope that isnt the case 😎
2020-03-31 11:52:13 +00:00
Yuxuan Shui c2a18f11d3
Fix nogl build
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 07:11:02 +01:00
Yuxuan Shui 2372127c0f
core: query glx extension in session_init
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 06:07:09 +01:00
Yuxuan Shui fd4d43aa02
x: fix glx error codes
compton was using wrong set of constants as glx error codes.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:59:44 +01:00
Yuxuan Shui bdf3aabb75
x: use xcb constants in _x_strerror as mush as possible
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:46:28 +01:00
Yuxuan Shui 9332cba8df core: delayed handling of root ConfigureNotify
Previously, root ConfigureNotify is handled immediately, by resetting
the backend, which in turn releases all the window images. This puts all
the windows into a state where they don't have images attached, which
they really should be in when the screen is redirected.

(To expand a little, a window without images should only exist if:
    * It's an unmanaged window.
    * Screen is unredirected.)

Normally, this kind of window could be fine, as the next render phase
will re-acquire images for them. However, if a window in this state is
destroyed with fading enabled, then the render phase won't try to
acquire images for it, causing it to go into the main rendering function
without images attached, and trigger an assertion.

This commit delays the handling of root ConfigureNotify until the render
phase. This way, the images will be immediately re-acquired after they
are released, thus prevent this problem from happening.

Also adds a testcase for this.

Fixes #357

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:20:56 +01:00
Yuxuan Shui 5a22fb0828 core: mark updates pending when a root flag is set
To make sure handle_root_flags will be called.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-31 05:20:56 +01:00
Yuxuan Shui b109526e15
tests: reduce some code duplication
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-30 11:49:38 +01:00
Yuxuan Shui 323a59b933
tests: add common functions useful for testing
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-30 11:16:56 +01:00
Yuxuan Shui 4c22d564b2
dbus: expose use_damage always
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:17:52 +01:00
Yuxuan Shui b6a5bf720d
dbus: unexpose track_wdata and track_leader
These are internal states.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:17:09 +01:00
Yuxuan Shui ee35bd873a
win: always track property changes
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-29 19:15:07 +01:00
Yuxuan Shui 3ba7a2aa4d
core: failed to ungrab server should be fatal
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-28 00:18:07 +00:00
Yuxuan Shui 23068c300c
Make some of the error logs more informative
Print the X error causing the error as well.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-28 00:15:45 +00:00
Yuxuan Shui 58582eb639
x: add function for converting x error to string
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 23:07:19 +00:00
Yuxuan Shui 574eca3c25
x: move redirection failure abort out of x_print_error
x_print_error aborts the program when it sees a redirect_subwindow
failure. A function called x_print_error really shouldn't cause the
program to terminate.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 21:03:37 +00:00
Yuxuan Shui b88d98d6b1
Re-acquire root pixmap after root reconfiguration
In configure_root, the root pixmap is freed by destroy_backend, and is
never acquired again.

Usually this doesn't seem to cause any problems, maybe because we
immediately receives a root damage notification. But under rare
circumstances we ended up not showing the wallpaper.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-27 20:51:40 +00:00
Yuxuan Shui 97db599fd8
win: always update frame extents
Frame extents are only updated when the window has frame_opacity < 1.
However, window frames can have inherent transparency, and not having
the frame extents information for those windows breaks blur-background-frame.

Fixes #345

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-22 16:55:45 +00:00
yshui 2523829f4c
Merge pull request #346 from mighty9245/unify-gd-definition
gl_common: unify gd definition
2020-03-22 02:24:26 +00:00
Yuxuan Shui 0fa0c35230
config: set a default value for blur_radius
Update the man page to include the default values of the blur config.

Fixes #347

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-21 17:00:51 +00:00
Maxim Solovyov 421404693b gl_common: unify gd definition 2020-03-21 18:18:02 +03:00
Yuxuan Shui 68de7b1fdf
Add trace log around rendering
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-21 15:00:05 +00:00
ಠ_ಠ 33a5cc604f
improved sample conf (#340)
* cover all options present in the manpage
* added some examples
* grouping and visual improvement
* minor clarification
2020-03-18 09:07:52 +00:00
Yuxuan Shui d332648d17
win: consolidate calls to win_update_focused
The focused state is a derivative state of the raw focused state (i.e.
whether the window is actually focused), with focus rules applied.

Here, we consolidate the calculation of the focused state into the
win_on_factor_change function, and replaced all calls to
win_update_focused with win_on_factor_change.

Also, the opacity update in win_update_focused is moved to
win_on_factor_change, as there could be opacity rules depending on the
focused state, so opacity must only be updated after
win_update_opacity_rule is called.

Related: #266 #317

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 19:54:20 +00:00
Yuxuan Shui 03895b711c
win: simplify win_on_factor_change
Always refresh derivative window states in win_on_factor_change, without
checking if there are rules set.

c2_match is a no-op when there is no rules set. And we want to
consolidate derivative window state updates to one place,
win_on_factor_change is a good choice for that.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 19:36:28 +00:00
Yuxuan Shui d2e323c985
win: clarify what win_is_focused_real means
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 19:19:13 +00:00
Yuxuan Shui fb3305fb9b
win: fix calculation of window frame region
The geometry returned by xcb_get_geometry doesn't include the window
border, so we have to include that when calculating the frame.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 18:32:34 +00:00
Yuxuan Shui cf3e95f0a4
gl_common: make viewport stateless
Also call glViewport before a draw call.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 18:02:53 +00:00
Yuxuan Shui d9b407c6b4
win: fix assertion failures in old backends
These asserts only hold when using the experimental backends.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-17 17:31:19 +00:00
Yuxuan Shui 36e9ccd5be
tmp 2020-03-15 20:24:30 +00:00
Yuxuan Shui 7de9494766
gl_common: apply alpha to the right target
In gl_image_apply_alpha, the call to _gl_fill uses 0 as the target
framebuffer, so the alpha is not applied to the target texture.

Fix that by using the correct framebuffer.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-15 20:08:27 +00:00
Yuxuan Shui b3590f934f
gl_common: reduce some code duplication
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-15 20:05:01 +00:00
Yuxuan Shui 0eca07d400
gl_common: zero initialize new image data in gl_image_decouple
Previously some fiedls of gl_texture allocated in gl_image_decouple are
not initialized.

This commit replaces cmalloc with ccalloc to make sure the allocated
gl_texture is zero initialized.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-15 19:55:16 +00:00
Yuxuan Shui 5d7ff7101e
picom: win::flags are properly updated in old backends too
Don't set win::flags to 0 in paint_preprocess, as that can break
assertions in other places. And there is also no need to do so as
win::flags are properly tracked regardless of the backend used.

Fixes #270

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-12 18:18:26 +00:00
Yuxuan Shui 93f89b8603
win: fix transparency detection
Previously, when frame_opacity is < 1, we consider windows with frames to be
WIN_FRAME_TRANS immediately, without even checking if the body of the window
is transparent. The result is a transparent window is seen as a opaque window
with only a transparent frame, causing its background to not be blurred.

Fixes #211
2020-03-11 21:00:47 +00:00
Yuxuan Shui d757d45d1e
picom: make sure --diagnostics works when another picom is running
Currently picom fails at register_cm(), which is before
print_diagnostics(), so we don't see anything.

This commit makes sure we keep going when there is another compositor
already running. However, in this case we need to be careful to not take
the overlay window, otherwise a poorly implemented compositor (for
example, picom) will stop working.

Also restructured the target window initialization logic and added some
comments explaining the logic.

Fixes #333
2020-03-11 19:15:26 +00:00
Ben Friesen 9547d7af70
Add time uniform to old glx glsl shaders (#330) 2020-03-10 07:29:38 +00:00
Yuxuan Shui def63f9a56
glx: make sure the context is really destroyed
GLX context is released when it's no longer current in any threads, so
we have to release the context before destroy it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-03-07 20:06:25 +00:00