Skip to content

Commit

Permalink
SteamOS compositor 1.12 with Bard's Tale, Long Live the Queen fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Plagman committed Sep 9, 2019
1 parent 1fc30b7 commit 967feaa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 17 deletions.
15 changes: 15 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
steamos-compositor (1.12) alchemist; urgency=low

* Only honor size hints if they specify the same min and max size, since
"Long Live the Queen" sets a maximum size of 4k X 4k.
* Listen for pointer motion on all children of the focus window.

-- Pierre-Loup A. Griffais <[email protected]> Wed, 13 Nov 2013 16:04:35 -0800

steamos-compositor (1.11) alchemist; urgency=low

* The Bard's Tale has a single override redirect window; allow using it but
always prefer regular windows if they're available.

-- Pierre-Loup A. Griffais <[email protected]> Wed, 13 Nov 2013 11:40:15 -0800

steamos-compositor (1.10) alchemist; urgency=low

* Monitor mouse input of the child window the legacy SDL1.2 fullscreen.
Expand Down
43 changes: 26 additions & 17 deletions src/steamcompmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ determine_and_apply_focus (Display *dpy)

unsigned long maxDamageSequence = 0;
unsigned long maxMapSequence = 0;
Bool usingOverrideRedirectWindow = False;

if (unredirectedWindow != None)
{
Expand All @@ -1045,14 +1046,23 @@ determine_and_apply_focus (Display *dpy)
focus = w;
}

// We allow using an override redirect window in some cases, but if we have
// a choice between two windows we always prefer the non-override redirect one.
Bool windowIsOverrideRedirect = w->a.override_redirect && !w->ignoreOverrideRedirect;

if (w->gameID && w->a.map_state == IsViewable &&
(w->damage_sequence > maxDamageSequence || w->map_sequence > maxMapSequence) &&
(!w->a.override_redirect || w->ignoreOverrideRedirect))
(!windowIsOverrideRedirect || !usingOverrideRedirectWindow))
{
focus = w;
gameFocused = True;
maxDamageSequence = w->damage_sequence;
maxMapSequence = w->map_sequence;

if (windowIsOverrideRedirect)
{
usingOverrideRedirectWindow = True;
}
}

if (w->isOverlay)
Expand Down Expand Up @@ -1133,10 +1143,20 @@ determine_and_apply_focus (Display *dpy)
XResizeWindow(dpy, focus->id, focus->requestedWidth, focus->requestedHeight);
}

if (focus->a.width > root_width || focus->a.height > root_height)
Window root_return = None, parent_return = None;
Window *children = NULL;
unsigned int nchildren = 0;
unsigned int i = 0;

XQueryTree (dpy, w->id, &root_return, &parent_return, &children, &nchildren);

while (i < nchildren)
{
XResizeWindow(dpy, focus->id, root_width, root_height);
XSelectInput(dpy, children[i], PointerMotionMask);
i++;
}

XFree (children);
}

/* Get prop from window
Expand Down Expand Up @@ -1172,16 +1192,13 @@ get_size_hints(Display *dpy, win *w)

XGetWMNormalHints(dpy, w->id, &hints, &hintsSpecified);

if (hintsSpecified & PMaxSize && hints.max_width * hints.max_height)
if (hintsSpecified & (PMaxSize | PMinSize) &&
hints.max_width * hints.max_height * hints.min_width * hints.min_height &&
hints.max_width == hints.min_width && hints.min_height == hints.max_height)
{
w->requestedWidth = hints.max_width;
w->requestedHeight = hints.max_height;

if (w->requestedWidth > root_width)
w->requestedWidth = root_width;
if (w->requestedHeight > root_height)
w->requestedHeight = root_height;

w->sizeHintsSpecified = True;
}
else
Expand Down Expand Up @@ -1217,17 +1234,9 @@ get_size_hints(Display *dpy, win *w)
w->requestedWidth = attribs.width;
w->requestedHeight = attribs.height;

if (w->requestedWidth > root_width)
w->requestedWidth = root_width;
if (w->requestedHeight > root_height)
w->requestedHeight = root_height;

XMoveWindow(dpy, children[0], 0, 0);

w->ignoreOverrideRedirect = True;

// Look for mouse motion in that child while we're at it.
XSelectInput(dpy, children[0], PointerMotionMask);
}
}

Expand Down

0 comments on commit 967feaa

Please sign in to comment.