Basically, don't ignore the reparent notify if the window is already a
client window. We already unmark it from its previous frame, so this
commit make sure it gets marked with its new frame.
Related: #299
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
We do nothing when a non-wm-frame window is destroyed. This will cause
trouble if a wm-frame window is reused (i.e. its child is destroyed then
a new child is reparented to it), because we didn't clear client_win.
So this commit adds a call to win_unmark_client for that case.
Related: #299
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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 😎
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>