* and also redraw the image, if any.
*
*/
-void handle_screen_resize(xcb_window_t win, uint32_t* last_resolution) {
+void handle_screen_resize() {
xcb_get_geometry_cookie_t geomc;
xcb_get_geometry_reply_t *geom;
geomc = xcb_get_geometry(conn, screen->root);
- if ((geom = xcb_get_geometry_reply(conn, geomc, 0)) == NULL) {
- return;
- }
+ if ((geom = xcb_get_geometry_reply(conn, geomc, 0)) == NULL)
+ return;
- if (last_resolution[0] == geom->width && last_resolution[1] == geom->height)
- return;
+ if (last_resolution[0] == geom->width &&
+ last_resolution[1] == geom->height) {
+ free(geom);
+ return;
+ }
last_resolution[0] = geom->width;
last_resolution[1] = geom->height;
+ free(geom);
+
#ifndef NOLIBCAIRO
redraw_screen();
#endif
}
if (type == XCB_CONFIGURE_NOTIFY) {
- handle_screen_resize(win, last_resolution);
+ handle_screen_resize();
continue;
}