Skip to content

Commit 86c4b0b

Browse files
committed
window.c: Do not override rectangles if those are bugged.
1 parent 79e93b1 commit 86c4b0b

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

src/core/window.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,22 +1100,27 @@ _meta_window_shared_new (MetaDisplay *display,
11001100
/* avoid tons of stack updates */
11011101
meta_stack_freeze (window->display->stack);
11021102

1103-
window->rect.x = attrs->x;
1104-
window->rect.y = attrs->y;
1105-
window->rect.width = attrs->width;
1106-
window->rect.height = attrs->height;
1107-
1108-
/* size_hints are the "request" */
1109-
window->size_hints.x = attrs->x;
1110-
window->size_hints.y = attrs->y;
1111-
window->size_hints.width = attrs->width;
1112-
window->size_hints.height = attrs->height;
1113-
/* initialize the remaining size_hints as if size_hints.flags were zero */
1114-
meta_set_normal_hints (window, NULL);
1115-
1116-
/* And this is our unmaximized size */
1117-
window->saved_rect = window->rect;
1118-
window->unconstrained_rect = window->rect;
1103+
if (attrs->width != 1 &&
1104+
attrs->height != 1)
1105+
{
1106+
window->rect.x = attrs->x;
1107+
window->rect.y = attrs->y;
1108+
window->rect.width = attrs->width;
1109+
window->rect.height = attrs->height;
1110+
1111+
/* size_hints are the "request" */
1112+
window->size_hints.x = attrs->x;
1113+
window->size_hints.y = attrs->y;
1114+
window->size_hints.width = attrs->width;
1115+
window->size_hints.height = attrs->height;
1116+
1117+
/* initialize the remaining size_hints as if size_hints.flags were zero */
1118+
meta_set_normal_hints (window, NULL);
1119+
1120+
/* And this is our unmaximized size */
1121+
window->saved_rect = window->rect;
1122+
window->unconstrained_rect = window->rect;
1123+
}
11191124

11201125
window->depth = attrs->depth;
11211126
window->xvisual = attrs->visual;

0 commit comments

Comments
 (0)