- Add patch for avoiding moving windows across workspaces This makes
clicking on links in firefox do what you want.
http://bugzilla.gnome.org/show_bug.cgi?id=482354
This commit is contained in:
parent
0993ce7738
commit
c659e03ad2
112
metacity-2.20.1-dont-move-windows.patch
Normal file
112
metacity-2.20.1-dont-move-windows.patch
Normal file
@ -0,0 +1,112 @@
|
||||
--- metacity-2.20.1/src/window.c 2007-11-17 15:11:01.000000000 -0500
|
||||
+++ metacity-2.20.1.patched/src/window.c 2007-11-28 11:43:28.000000000 -0500
|
||||
@@ -74,6 +74,9 @@
|
||||
static void meta_window_show (MetaWindow *window);
|
||||
static void meta_window_hide (MetaWindow *window);
|
||||
|
||||
+static void meta_window_set_demands_attention_internal (MetaWindow *window,
|
||||
+ MetaWorkspace *workspace);
|
||||
+
|
||||
static void meta_window_save_rect (MetaWindow *window);
|
||||
|
||||
static void meta_window_move_resize_internal (MetaWindow *window,
|
||||
@@ -2793,7 +2796,7 @@
|
||||
"last_user_time (%u) is more recent; ignoring "
|
||||
" _NET_ACTIVE_WINDOW message.\n",
|
||||
window->display->last_user_time);
|
||||
- meta_window_set_demands_attention(window);
|
||||
+ meta_window_set_demands_attention_internal (window, workspace);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2813,8 +2816,21 @@
|
||||
/* Get window on current or given workspace */
|
||||
if (workspace == NULL)
|
||||
workspace = window->screen->active_workspace;
|
||||
- if (!meta_window_located_on_workspace (window, workspace))
|
||||
- meta_window_change_workspace (window, workspace);
|
||||
+
|
||||
+ /* For non-transient windows, we just set up a pulsing indicator,
|
||||
+ rather than move windows or workspaces.
|
||||
+ See http://bugzilla.gnome.org/show_bug.cgi?id=482354 */
|
||||
+ if (window->xtransient_for == None && !meta_window_located_on_workspace (window, workspace))
|
||||
+ {
|
||||
+ meta_window_set_demands_attention_internal (window, workspace);
|
||||
+ return;
|
||||
+ }
|
||||
+ else if (window->xtransient_for != None)
|
||||
+ {
|
||||
+ /* Move transients to current workspace - preference dialogs should appear over
|
||||
+ the source window. */
|
||||
+ meta_window_change_workspace (window, workspace);
|
||||
+ }
|
||||
|
||||
if (window->shaded)
|
||||
meta_window_unshade (window, timestamp);
|
||||
@@ -7982,34 +7998,49 @@
|
||||
void
|
||||
meta_window_set_demands_attention (MetaWindow *window)
|
||||
{
|
||||
+ meta_window_set_demands_attention_internal (window, NULL);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+meta_window_set_demands_attention_internal (MetaWindow *window,
|
||||
+ MetaWorkspace *workspace)
|
||||
+{
|
||||
MetaRectangle candidate_rect, other_rect;
|
||||
GList *stack = window->screen->stack->sorted;
|
||||
MetaWindow *other_window;
|
||||
- gboolean obscured = FALSE;
|
||||
+ gboolean obscured;
|
||||
|
||||
+ if (!workspace)
|
||||
+ workspace = window->screen->active_workspace;
|
||||
+
|
||||
+ /* We count windows not located on the current workspace as obscured */
|
||||
+ obscured = !meta_window_located_on_workspace (window, workspace);
|
||||
+
|
||||
/* Does the window have any other window on this workspace
|
||||
* overlapping it?
|
||||
*/
|
||||
+ if (!obscured)
|
||||
+ {
|
||||
+ meta_window_get_outer_rect (window, &candidate_rect);
|
||||
|
||||
- meta_window_get_outer_rect (window, &candidate_rect);
|
||||
-
|
||||
- /* The stack is sorted with the top windows first. */
|
||||
+ /* The stack is sorted with the top windows first. */
|
||||
|
||||
- while (stack != NULL && stack->data != window)
|
||||
- {
|
||||
- other_window = stack->data;
|
||||
- stack = stack->next;
|
||||
-
|
||||
- if (other_window->on_all_workspaces ||
|
||||
- window->on_all_workspaces ||
|
||||
- other_window->workspace == window->workspace)
|
||||
+ while (stack != NULL && stack->data != window)
|
||||
{
|
||||
- meta_window_get_outer_rect (other_window, &other_rect);
|
||||
-
|
||||
- if (meta_rectangle_overlap (&candidate_rect, &other_rect))
|
||||
+ other_window = stack->data;
|
||||
+ stack = stack->next;
|
||||
+
|
||||
+ if (other_window->on_all_workspaces ||
|
||||
+ window->on_all_workspaces ||
|
||||
+ other_window->workspace == window->workspace)
|
||||
{
|
||||
- obscured = TRUE;
|
||||
- break;
|
||||
+ meta_window_get_outer_rect (other_window, &other_rect);
|
||||
+
|
||||
+ if (meta_rectangle_overlap (&candidate_rect, &other_rect))
|
||||
+ {
|
||||
+ obscured = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
Index: src/window.c
|
||||
===================================================================
|
||||
--- src/window.c (revision 3358)
|
||||
+++ src/window.c (working copy)
|
||||
@@ -2783,9 +2783,19 @@
|
||||
/* Get window on current or given workspace */
|
||||
if (workspace == NULL)
|
||||
workspace = window->screen->active_workspace;
|
||||
- if (!meta_window_located_on_workspace (window, workspace))
|
||||
- meta_window_change_workspace (window, workspace);
|
||||
-
|
||||
+ /* We only move non-normal windows; see http://bugzilla.gnome.org/show_bug.cgi?id=482354 */
|
||||
+ if (window->type == META_WINDOW_NORMAL
|
||||
+ && !meta_window_located_on_workspace (window, workspace))
|
||||
+ {
|
||||
+ window->wm_state_demands_attention = TRUE;
|
||||
+ set_net_wm_state (window);
|
||||
+ return;
|
||||
+ }
|
||||
+ else if (!meta_window_located_on_workspace (window, workspace))
|
||||
+ {
|
||||
+ meta_window_change_workspace (window, workspace);
|
||||
+ }
|
||||
+
|
||||
if (window->shaded)
|
||||
meta_window_unshade (window, timestamp);
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
Summary: Metacity window manager
|
||||
Name: metacity
|
||||
Version: %{metacity_version}
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
URL: http://download.gnome.org/sources/metacity/
|
||||
Source0: http://download.gnome.org/sources/metacity/2.21/%{metacity_filename}.tar.bz2
|
||||
Patch0: default-theme.patch
|
||||
# http://bugzilla.gnome.org/show_bug.cgi?id=482354
|
||||
Patch1: metacity-firefox-workaround-2.patch
|
||||
Patch1: metacity-2.20.1-dont-move-windows.patch
|
||||
License: GPLv2+
|
||||
Group: User Interface/Desktops
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
@ -67,7 +67,7 @@ API. This package exists purely for technical reasons.
|
||||
%prep
|
||||
%setup -q -n %{metacity_filename}
|
||||
%patch0 -p1 -b .default-theme
|
||||
%patch1 -p0 -b .firefox-workaround
|
||||
%patch1 -p1 -b .dont-move-windows
|
||||
|
||||
%build
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -154,6 +154,11 @@ fi
|
||||
%{_mandir}/man1/metacity-window-demo.1.gz
|
||||
|
||||
%changelog
|
||||
* Thu Dec 20 2007 Colin Walters <walters@redhat.com> - 2.21.5-2
|
||||
- Add patch for avoiding moving windows across workspaces
|
||||
This makes clicking on links in firefox do what you want.
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=482354
|
||||
|
||||
* Wed Dec 19 2007 Matthias Clasen <mclasen@redhat.com> - 2.21.5-1
|
||||
- Update to 2.21.5, including the new compositor
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user