[gtk+/client-side-windows: 223/284] Apply non-click-through policy on unfocused windows even if the app is active
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+/client-side-windows: 223/284] Apply non-click-through policy on unfocused windows even if the app is active
- Date: Thu, 2 Apr 2009 14:18:40 -0400 (EDT)
commit e8d6ac71b72bd7e2a97d5828df3763f8833926c6
Author: Richard Hult <richard imendio com>
Date: Sat Jan 31 21:25:41 2009 +0100
Apply non-click-through policy on unfocused windows even if the app is active
---
gdk/quartz/gdkevents-quartz.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 58eeadf..a24ea45 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -1526,15 +1526,20 @@ gdk_event_translate (GdkEvent *event,
}
/* We only activate the application on click if it's not already active,
- * this matches most use cases of native apps (no click-through).
+ * or if it's active but the window isn't focused. This matches most use
+ * cases of native apps (no click-through).
*/
if ((event_type == NSRightMouseDown ||
event_type == NSOtherMouseDown ||
- event_type == NSLeftMouseDown) && ![NSApp isActive])
+ event_type == NSLeftMouseDown))
{
- [NSApp activateIgnoringOtherApps:YES];
- return_val = FALSE;
- goto done;
+ GdkWindowObject *private = (GdkWindowObject *)window;
+ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
+
+ if (![NSApp isActive])
+ return FALSE;
+ else if (![impl->toplevel isMainWindow])
+ return FALSE;
}
current_event_mask = get_event_mask_from_ns_event (nsevent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]