diff --git a/ChangeLog b/ChangeLog index 9ff7ef360..18dcf36b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2003-09-19 Rob Adams + + Fix a bug with partial-width panel struts caused by incorrect + computation of rectangle widths, and another when using different + screen resolutions on xineramas. See #122404. Also fix a crash + bug with the MRU list when sticking and unsticking windows. See + #120809. + + * src/constraints.c (get_outermost_onscreen_positions): Fix + off-by-one error with partial-width struts. + + * src/window.c (meta_window_update_struts): Fix off-by-one error + with partial-width struts. + (meta_window_stick): assign back to GList after g_list_append + (meta_window_unstick): assign back to GList after g_list_append + + * src/workspace.c (ensure_work_areas_validated): For right and + bottom struts, compute strut relative to root window and not to + xinerama edge in compliance with EWMH recommendations. + + 2003-09-17 Fatih Demir * configure.in: Added "ta" (Tamil) to the languages' list. diff --git a/src/constraints.c b/src/constraints.c index 2bb295f19..416986de9 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -389,9 +389,9 @@ get_outermost_onscreen_positions (MetaWindow *window, * overlapping the strut rect. */ if (((current.y - info->fgeom.top_height >= rect->y) && - (current.y - info->fgeom.top_height <= rect->y + rect->height)) || + (current.y - info->fgeom.top_height < rect->y + rect->height)) || ((current.y >= rect->y) && - (current.y <= rect->y + rect->height))) + (current.y < rect->y + rect->height))) { *leftmost_x_p = MAX (*leftmost_x_p, rect->width); } @@ -420,9 +420,9 @@ get_outermost_onscreen_positions (MetaWindow *window, * overlapping the strut rect. */ if (((current.y - info->fgeom.top_height >= rect->y) && - (current.y - info->fgeom.top_height <= rect->y + rect->height)) || + (current.y - info->fgeom.top_height < rect->y + rect->height)) || ((current.y >= rect->y) && - (current.y <= rect->y + rect->height))) + (current.y < rect->y + rect->height))) { *rightmost_x_p = MIN (*rightmost_x_p, rect->x); } @@ -450,8 +450,8 @@ get_outermost_onscreen_positions (MetaWindow *window, /* here the strut matters if the titlebar is overlapping * the window horizontally */ - if ((current.x <= rect->x + rect->width) && - (current.x + current.width >= rect->x)) + if ((current.x < rect->x + rect->width) && + (current.x + current.width > rect->x)) { *topmost_y_p = MAX (*topmost_y_p, rect->height); } @@ -479,8 +479,8 @@ get_outermost_onscreen_positions (MetaWindow *window, /* here the strut matters if the titlebar is overlapping * the window horizontally */ - if ((current.x <= rect->x + rect->width) && - (current.x + current.width >= rect->x)) + if ((current.x < rect->x + rect->width) && + (current.x + current.width > rect->x)) { bottommost_y = MIN (bottommost_y, rect->y); } diff --git a/src/window.c b/src/window.c index 9bbb77474..9799ef775 100644 --- a/src/window.c +++ b/src/window.c @@ -3209,7 +3209,7 @@ meta_window_stick (MetaWindow *window) { workspace = (MetaWorkspace *) tmp->data; if (!g_list_find (workspace->mru_list, window)) - g_list_append (workspace->mru_list, window); + workspace->mru_list = g_list_append (workspace->mru_list, window); tmp = tmp->next; } @@ -3238,7 +3238,7 @@ meta_window_unstick (MetaWindow *window) { workspace = (MetaWorkspace *) tmp->data; if (!meta_workspace_contains_window (workspace, window)) - g_list_remove (workspace->mru_list, window); + workspace->mru_list = g_list_remove (workspace->mru_list, window); tmp = tmp->next; } @@ -4949,13 +4949,13 @@ meta_window_update_struts (MetaWindow *window) new_bottom.y = window->screen->height - new_bottom.height; new_left.y = struts[4]; - new_left.height = struts[5] - new_left.y; + new_left.height = struts[5] - new_left.y + 1; new_right.y = struts[6]; - new_right.height = struts[7] - new_right.y; + new_right.height = struts[7] - new_right.y + 1; new_top.x = struts[8]; - new_top.width = struts[9] - new_top.x; + new_top.width = struts[9] - new_top.x + 1; new_bottom.x = struts[10]; - new_bottom.width = struts[11] - new_bottom.x; + new_bottom.width = struts[11] - new_bottom.x + 1; meta_verbose ("_NET_WM_STRUT_PARTIAL struts %d %d %d %d for window %s\n", new_left.width, diff --git a/src/workspace.c b/src/workspace.c index dc73879f7..c16c2c119 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -453,14 +453,17 @@ ensure_work_areas_validated (MetaWorkspace *workspace) if ((i == 0) && (w->struts->right.width > 0)) { workspace->right_struts = g_slist_prepend (workspace->right_struts, - &w->struts->right); + &w->struts->right); } if (meta_screen_rect_intersects_xinerama (w->screen, &w->struts->right, i)) { - right_strut = MAX (right_strut, w->struts->right.width); + right_strut = MAX (right_strut, w->struts->right.width - + workspace->screen->width + + workspace->screen->xinerama_infos[i].width + + workspace->screen->xinerama_infos[i].x_origin); all_right_strut = MAX (all_right_strut, w->struts->right.width); } @@ -490,7 +493,10 @@ ensure_work_areas_validated (MetaWorkspace *workspace) &w->struts->bottom, i)) { - bottom_strut = MAX (bottom_strut, w->struts->bottom.height); + bottom_strut = MAX (bottom_strut, w->struts->bottom.height - + workspace->screen->height + + workspace->screen->xinerama_infos[i].height + + workspace->screen->xinerama_infos[i].y_origin); all_bottom_strut = MAX (all_bottom_strut, w->struts->bottom.height); } }