Skip to content

Commit 68ba84f

Browse files
committed
Workaround 1x1 Wine window to allow unredirect.
1 parent 051b8d2 commit 68ba84f

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

src/core/window.c

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,25 +1100,30 @@ _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;
1119-
1120-
window->depth = attrs->depth;
1121-
window->xvisual = attrs->visual;
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+
1124+
window->depth = attrs->depth;
1125+
window->xvisual = attrs->visual;
1126+
}
11221127

11231128
window->title = NULL;
11241129
window->icon = NULL;

src/x11/window-x11.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3817,10 +3817,14 @@ meta_window_x11_configure_notify (MetaWindow *window,
38173817
g_assert (window->override_redirect);
38183818
g_assert (window->frame == NULL);
38193819

3820-
window->rect.x = event->x;
3821-
window->rect.y = event->y;
3822-
window->rect.width = event->width;
3823-
window->rect.height = event->height;
3820+
if (event->width != 1 &&
3821+
event->height != 1)
3822+
{
3823+
window->rect.x = event->x;
3824+
window->rect.y = event->y;
3825+
window->rect.width = event->width;
3826+
window->rect.height = event->height;
3827+
}
38243828

38253829
priv->client_rect = window->rect;
38263830
window->buffer_rect = window->rect;

0 commit comments

Comments
 (0)