Skip to content

Commit 53fcc4c

Browse files
committed
Fix unredirection for OpenGL Wine/Proton/Steam games and ignoreance of this setting
window.c: Allow FLIP unredirection for 1x1 windows by handling those with parent rectangles. window-x11.c: Fix breakage of unredirection in case window mode appears changed or OSD stuff appears shown over game window. meta-surface-actor-x11.c: Fix ignoreance of "Disable compositing for full-screen windows" setting in Cinnamon Settings app and/or in dconf(-editor).
1 parent 051b8d2 commit 53fcc4c

3 files changed

Lines changed: 36 additions & 24 deletions

File tree

src/compositor/meta-surface-actor-x11.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ meta_surface_actor_x11_is_opaque (MetaSurfaceActor *actor)
254254
gboolean
255255
meta_surface_actor_x11_should_unredirect (MetaSurfaceActorX11 *self)
256256
{
257+
if (!meta_prefs_get_unredirect_fullscreen_windows ())
258+
return FALSE;
259+
257260
MetaWindow *window = self->window;
258261

259262
if (meta_window_requested_dont_bypass_compositor (window))
@@ -277,7 +280,7 @@ meta_surface_actor_x11_should_unredirect (MetaSurfaceActorX11 *self)
277280
if (meta_window_is_override_redirect (window))
278281
return TRUE;
279282

280-
if (self->does_full_damage && meta_prefs_get_unredirect_fullscreen_windows ())
283+
if (self->does_full_damage)
281284
return TRUE;
282285

283286
return FALSE;

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)