Commit ed568839 authored by Pekka Paalanen's avatar Pekka Paalanen

xwm: split out weston_wm_window_set_pending_state_OR()

Having it in a separate function makes it more clear what it is, and
allows it to be called from elsewhere.

This really is the set_pending_state() alternative for override-redirect
windows, because OR windows do not get a frame window created. Also OR
windows will never hit the normal set_pending_state() because
weston_wm_window_schedule_repaint() special-cased windows without a
frame window and returned early without scheduling.
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
parent 83626b95
......@@ -1216,28 +1216,39 @@ weston_wm_window_do_repaint(void *data)
weston_wm_window_set_pending_state(window);
}
static void
weston_wm_window_set_pending_state_OR(struct weston_wm_window *window)
{
int width, height;
/* for override-redirect windows */
assert(window->frame_id == XCB_WINDOW_NONE);
if (!window->surface)
return;
weston_wm_window_get_frame_size(window, &width, &height);
pixman_region32_fini(&window->surface->pending.opaque);
if (window->has_alpha) {
pixman_region32_init(&window->surface->pending.opaque);
} else {
pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
width, height);
}
}
static void
weston_wm_window_schedule_repaint(struct weston_wm_window *window)
{
struct weston_wm *wm = window->wm;
int width, height;
if (window->frame_id == XCB_WINDOW_NONE) {
if (window->surface != NULL) {
/* Override-redirect windows go through here, but we
* cannot assert(window->override_redirect); because
* we do not deal with changing OR flag yet.
* XXX: handle OR flag changes in message handlers
*/
weston_wm_window_get_frame_size(window, &width, &height);
pixman_region32_fini(&window->surface->pending.opaque);
if (window->has_alpha) {
pixman_region32_init(&window->surface->pending.opaque);
} else {
pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
width, height);
}
}
/* Override-redirect windows go through here, but we
* cannot assert(window->override_redirect); because
* we do not deal with changing OR flag yet.
* XXX: handle OR flag changes in message handlers
*/
weston_wm_window_set_pending_state_OR(window);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment