[fusion-commits] Compiz mirror: Changes to 'master' (8c54aa0bde9bfc6fb5257812657db30c4bf4eb10)
compiz at server.opencompositing.org
compiz at server.opencompositing.org
Wed Mar 26 17:20:04 CET 2008
New commits:
commit 8c54aa0bde9bfc6fb5257812657db30c4bf4eb10
Author: Danny Baumann <dannybaumann at web.de>
Date: Wed Mar 26 17:18:16 2008 +0100
If we couldn't get the timestamp for the window, try to get at least the timestamp of its transient parent for determining if the window should get focus or not.
src/window.c | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
Modified: compiz/src/window.c
===================================================================
--- compiz/src/window.c
+++ compiz/src/window.c
@@ -4713,6 +4713,22 @@ setWindowUserTime (CompWindow *w,
)
static Bool
+getUsageTimestampForWindow (CompWindow *w,
+ Time *timestamp)
+{
+ if (getWindowUserTime (w, timestamp))
+ return TRUE;
+
+ if (w->initialTimestampSet)
+ {
+ *timestamp = w->initialTimestamp;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static Bool
isWindowFocusAllowed (CompWindow *w,
Time timestamp)
{
@@ -4743,15 +4759,18 @@ isWindowFocusAllowed (CompWindow *w,
}
else
{
- if (getWindowUserTime (w, &wUserTime))
- {
- gotTimestamp = TRUE;
- }
- else if (w->initialTimestampSet)
- {
- wUserTime = w->initialTimestamp;
- gotTimestamp = TRUE;
- }
+ gotTimestamp = getUsageTimestampForWindow (w, &wUserTime);
+ }
+
+ /* if we got no timestamp for the window, try to get at least a timestamp
+ for its transient parent, if any */
+ if (!gotTimestamp && w->transientFor)
+ {
+ CompWindow *parent;
+
+ parent = findWindowAtScreen (w->screen, w->transientFor);
+ if (parent)
+ gotTimestamp = getUsageTimestampForWindow (parent, &wUserTime);
}
if (gotTimestamp && !wUserTime)
More information about the commits
mailing list