aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2023-11-24 23:18:14 +0100
committerFederico Angelilli <code@fedang.net>2023-11-24 23:18:14 +0100
commit00c8952c86e27b873dc4020ed73ea3b038074f97 (patch)
treee5905009135b4fb372e6d9a9d576acace586eba4
parent7bb670a21a3e6234ac70a031ecc164159559285a (diff)
Update xshape mask only when resizing window
-rw-r--r--src/window.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/window.c b/src/window.c
index d6cf692..cadf891 100644
--- a/src/window.c
+++ b/src/window.c
@@ -205,24 +205,6 @@ void window_move(Window *win, int x, int y)
log_debug("Window updated position [x=%d, y=%d]", win->x, win->y);
}
-void window_resize(Window *win, int width, int height)
-{
- if (win->width == width && win->height == height) return;
-
- win->width = width;
- win->height = height;
-
- const uint32_t values[] = { width, height };
- xcb_configure_window(win->con->connection,
- win->window,
- XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
- values);
-
- log_debug("Window updated size [width=%d, height=%d]", win->width, win->height);
-
- wm_set_size(win);
-}
-
static void window_paint_corners(Window *win)
{
// TODO: Actually make this a parameter
@@ -272,6 +254,27 @@ static void window_paint_corners(Window *win)
xcb_free_pixmap(win->con->connection, bitmap);
}
+void window_resize(Window *win, int width, int height)
+{
+ if (win->width == width && win->height == height) return;
+
+ win->width = width;
+ win->height = height;
+
+ const uint32_t values[] = { width, height };
+ xcb_configure_window(win->con->connection,
+ win->window,
+ XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
+ values);
+
+ log_debug("Window updated size [width=%d, height=%d]", win->width, win->height);
+
+ wm_set_size(win);
+
+ // Update shape mask
+ window_paint_corners(win);
+}
+
void window_paint_surface(Window *win, cairo_surface_t *surface, int width, int height)
{
cairo_xcb_surface_set_size(win->surface, width, height);
@@ -281,8 +284,6 @@ void window_paint_surface(Window *win, cairo_surface_t *surface, int width, int
cairo_paint(win->cr);
cairo_show_page(win->cr);
- window_paint_corners(win);
-
xcb_circulate_window(win->con->connection, XCB_CIRCULATE_RAISE_LOWEST, win->window);
xcb_flush(win->con->connection);
}