xwm: Don't repaint after destroying window

Kristian Høgsberg 13 years ago
parent d9931880c5
commit 176b471a8e
  1. 14
      src/xserver-launcher.c

@ -124,7 +124,7 @@ struct weston_wm_window {
struct weston_surface *surface; struct weston_surface *surface;
struct shell_surface *shsurf; struct shell_surface *shsurf;
struct wl_listener surface_destroy_listener; struct wl_listener surface_destroy_listener;
int repaint_scheduled; struct wl_event_source *repaint_source;
int properties_dirty; int properties_dirty;
char *class; char *class;
char *name; char *name;
@ -800,7 +800,7 @@ weston_wm_window_draw_decoration(void *data)
weston_wm_window_read_properties(window); weston_wm_window_read_properties(window);
window->repaint_scheduled = 0; window->repaint_source = NULL;
width = window->width + wm->border_width * 2; width = window->width + wm->border_width * 2;
height = window->height + wm->border_width * 2 + wm->title_height; height = window->height + wm->border_width * 2 + wm->title_height;
@ -846,12 +846,13 @@ weston_wm_window_schedule_repaint(struct weston_wm_window *window)
{ {
struct weston_wm *wm = window->wm; struct weston_wm *wm = window->wm;
if (window->repaint_scheduled) if (window->repaint_source)
return; return;
window->repaint_source =
wl_event_loop_add_idle(wm->server->loop, wl_event_loop_add_idle(wm->server->loop,
weston_wm_window_draw_decoration, window); weston_wm_window_draw_decoration,
window->repaint_scheduled = 1; window);
} }
static void static void
@ -1227,6 +1228,9 @@ weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event
fprintf(stderr, "XCB_DESTROY_NOTIFY, win %d (%p)\n", fprintf(stderr, "XCB_DESTROY_NOTIFY, win %d (%p)\n",
destroy_notify->window, window); destroy_notify->window, window);
if (window->repaint_source)
wl_event_source_remove(window->repaint_source);
hash_table_remove(wm->window_hash, window->id); hash_table_remove(wm->window_hash, window->id);
hash_table_remove(wm->window_hash, window->frame_id); hash_table_remove(wm->window_hash, window->frame_id);
xcb_destroy_window(wm->conn, window->frame_id); xcb_destroy_window(wm->conn, window->frame_id);

Loading…
Cancel
Save