[PATCH weston] Fix some window frame related bugs

Trevor McCort tjmccort at gmail.com
Sat Oct 19 23:00:09 CEST 2013


In a few places window frame functions were being called on windows
without frames.

Signed-off-by: Trevor McCort <tjmccort at gmail.com>
---
 src/xwayland/window-manager.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index a889278..8e5a807 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -407,7 +407,6 @@ weston_wm_window_read_properties(struct weston_wm_window *window)
 					     props[i].atom,
 					     XCB_ATOM_ANY, 0, 2048);
 
-	window->decorate = !window->override_redirect;
 	window->size_hints.flags = 0;
 	window->motif_hints.flags = 0;
 	window->delete_window = 0;
@@ -496,7 +495,7 @@ weston_wm_window_get_frame_size(struct weston_wm_window *window,
 	if (window->fullscreen) {
 		*width = window->width;
 		*height = window->height;
-	} else if (window->decorate) {
+	} else if (window->frame) {
 		*width = frame_width(window->frame);
 		*height = frame_height(window->frame);
 	} else {
@@ -514,7 +513,7 @@ weston_wm_window_get_child_position(struct weston_wm_window *window,
 	if (window->fullscreen) {
 		*x = 0;
 		*y = 0;
-	} else if (window->decorate) {
+	} else if (window->frame) {
 		frame_interior(window->frame, x, y, NULL, NULL);
 	} else {
 		*x = t->margin;
@@ -693,12 +692,12 @@ weston_wm_window_activate(struct wl_listener *listener, void *data)
 				     XCB_TIME_CURRENT_TIME);
 	}
 
-	if (wm->focus_window) {
+	if (wm->focus_window && wm->focus_window->frame) {
 		frame_unset_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
 		weston_wm_window_schedule_repaint(wm->focus_window);
 	}
 	wm->focus_window = window;
-	if (wm->focus_window) {
+	if (wm->focus_window && wm->focus_window->frame) {
 		frame_set_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
 		weston_wm_window_schedule_repaint(wm->focus_window);
 	}
@@ -845,6 +844,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
 
 	window = hash_table_lookup(wm->window_hash, map_request->window);
 
+	window->decorate = 1;
 	weston_wm_window_read_properties(window);
 
 	if (window->frame_id == XCB_WINDOW_NONE)
@@ -928,7 +928,7 @@ weston_wm_window_draw_decoration(void *data)
 
 	if (window->fullscreen) {
 		/* nothing */
-	} else if (window->decorate) {
+	} else if (window->decorate && window->frame) {
 		if (wm->focus_window == window)
 			flags |= THEME_FRAME_ACTIVE;
 
-- 
1.8.4



More information about the wayland-devel mailing list