summaryrefslogtreecommitdiff
path: root/src/core/window.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-12 17:04:27 +0100
committerinfirit <[email protected]>2014-11-12 17:04:27 +0100
commitad9db61aabc2cbf743a1157ddc42ff76127f3fab (patch)
tree9e5dedf1f2e09bfbde96fac54a92e92bea6020db /src/core/window.c
parente8b2d2156a6f530812d9958b3675e2402e44ecab (diff)
downloadmarco-ad9db61aabc2cbf743a1157ddc42ff76127f3fab.tar.bz2
marco-ad9db61aabc2cbf743a1157ddc42ff76127f3fab.tar.xz
Allow explicit raises from same client, not just same app
We currently allow XRaiseWindow when the same application (defined by the window group) is focused, but the kind of old applications that XRaiseWindow are frequently not setting the window group. Expand the check to allow the same X client (defined by the looking at client ID) to raise windows above the focus window. Based on metacity commit: 632d3983fbc402432c6ceae05bea8903ad2f11c0 From: "Owen W. Taylor" <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=567528
Diffstat (limited to 'src/core/window.c')
-rw-r--r--src/core/window.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/core/window.c b/src/core/window.c
index a811d668..d34845e8 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -47,6 +47,7 @@
#include "effects.h"
#include <X11/Xatom.h>
+#include <X11/Xlibint.h> /* For display->resource_mask */
#include <string.h>
#ifdef HAVE_SHAPE
@@ -78,6 +79,9 @@ static gboolean process_property_notify (MetaWindow *window,
static void meta_window_show (MetaWindow *window);
static void meta_window_hide (MetaWindow *window);
+static gboolean meta_window_same_client (MetaWindow *window,
+ MetaWindow *other_window);
+
static void meta_window_save_rect (MetaWindow *window);
static void save_user_window_placement (MetaWindow *window);
static void force_save_user_window_placement (MetaWindow *window);
@@ -4883,7 +4887,7 @@ meta_window_configure_request (MetaWindow *window,
window->desc);
}
else if (active_window &&
- !meta_window_same_application (window, active_window) &&
+ !meta_window_same_client (window, active_window) &&
XSERVER_TIME_IS_BEFORE (window->net_wm_user_time,
active_window->net_wm_user_time))
{
@@ -7856,6 +7860,23 @@ meta_window_same_application (MetaWindow *window,
group==other_group;
}
+/* Generally meta_window_same_application() is a better idea
+ * of "sameness", since it handles the case where multiple apps
+ * want to look like the same app or the same app wants to look
+ * like multiple apps, but in the case of workarounds for legacy
+ * applications (which likely aren't setting the group properly
+ * anyways), it may be desirable to check this as well.
+ */
+static gboolean
+meta_window_same_client (MetaWindow *window,
+ MetaWindow *other_window)
+{
+ int resource_mask = window->display->xdisplay->resource_mask;
+
+ return ((window->xwindow & ~resource_mask) ==
+ (other_window->xwindow & ~resource_mask));
+}
+
void
meta_window_refresh_resize_popup (MetaWindow *window)
{