mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 20:22:10 +00:00
Dont create the region unless actually needed
This commit is contained in:
parent
6c1a83ffd7
commit
494892c7e4
1 changed files with 12 additions and 10 deletions
22
glfw/wl_window.c
vendored
22
glfw/wl_window.c
vendored
|
|
@ -316,28 +316,30 @@ checkScaleChange(_GLFWwindow* window) {
|
|||
|
||||
static void
|
||||
update_regions(_GLFWwindow* window) {
|
||||
struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
|
||||
if (!region) return;
|
||||
wl_region_add(region, 0, 0, window->wl.width, window->wl.height);
|
||||
// Makes the surface considered as XRGB instead of ARGB.
|
||||
if (!window->wl.transparent) wl_surface_set_opaque_region(window->wl.surface, region);
|
||||
|
||||
if (!window->wl.transparent) {
|
||||
struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
|
||||
if (!region) return;
|
||||
wl_region_add(region, 0, 0, window->wl.width, window->wl.height);
|
||||
// Makes the surface considered as XRGB instead of ARGB.
|
||||
wl_surface_set_opaque_region(window->wl.surface, region);
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
// Set blur region
|
||||
if (_glfw.wl.org_kde_kwin_blur_manager) {
|
||||
// NULL means entire window
|
||||
if (window->wl.has_blur) {
|
||||
if (!window->wl.org_kde_kwin_blur)
|
||||
window->wl.org_kde_kwin_blur = org_kde_kwin_blur_manager_create(_glfw.wl.org_kde_kwin_blur_manager, window->wl.surface);
|
||||
if (window->wl.org_kde_kwin_blur)
|
||||
if (window->wl.org_kde_kwin_blur) {
|
||||
// NULL means entire window
|
||||
org_kde_kwin_blur_set_region(window->wl.org_kde_kwin_blur, NULL);
|
||||
org_kde_kwin_blur_commit(window->wl.org_kde_kwin_blur);
|
||||
org_kde_kwin_blur_commit(window->wl.org_kde_kwin_blur);
|
||||
}
|
||||
} else {
|
||||
org_kde_kwin_blur_manager_unset(_glfw.wl.org_kde_kwin_blur_manager, window->wl.surface);
|
||||
if (window->wl.org_kde_kwin_blur) { org_kde_kwin_blur_release(window->wl.org_kde_kwin_blur); window->wl.org_kde_kwin_blur = NULL; }
|
||||
}
|
||||
}
|
||||
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue