mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-11 13:29:49 -05:00
Redraw window in idle handler.
This commit is contained in:
parent
2d9cd1ee51
commit
35370f8073
1 changed files with 6 additions and 1 deletions
7
window.c
7
window.c
|
|
@ -74,6 +74,7 @@ struct window {
|
||||||
int state;
|
int state;
|
||||||
uint32_t name;
|
uint32_t name;
|
||||||
int fd;
|
int fd;
|
||||||
|
int need_redraw;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|
@ -185,7 +186,7 @@ void event_handler(struct wl_display *display,
|
||||||
case WINDOW_RESIZING_LOWER_RIGHT:
|
case WINDOW_RESIZING_LOWER_RIGHT:
|
||||||
window->width = window->drag_x + arg1;
|
window->width = window->drag_x + arg1;
|
||||||
window->height = window->drag_y + arg2;
|
window->height = window->drag_y + arg2;
|
||||||
draw_window(window);
|
window->need_redraw = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -268,6 +269,10 @@ int main(int argc, char *argv[])
|
||||||
mask |= WL_CONNECTION_WRITABLE;
|
mask |= WL_CONNECTION_WRITABLE;
|
||||||
if (mask)
|
if (mask)
|
||||||
wl_display_iterate(display, mask);
|
wl_display_iterate(display, mask);
|
||||||
|
if (window.need_redraw) {
|
||||||
|
draw_window(&window);
|
||||||
|
window.need_redraw = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue