summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-04 22:18:10 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-04 22:18:10 +0000
commit60f48e44ff78327e316a632a6f349a1f6993bd09 (patch)
tree7ec68a0ba5a6b7997b317f63ce3fb54be908a77d /src
parent501a60ab20f29bf7305a4655a707d14f2c8b232e (diff)
downloadmetacity-60f48e44ff78327e316a632a6f349a1f6993bd09.tar.gz
metacity-60f48e44ff78327e316a632a6f349a1f6993bd09.tar.bz2
set event mask on root window to 0 so other window managers (such as
2002-01-04 Havoc Pennington <hp@pobox.com> * src/screen.c (meta_screen_free): set event mask on root window to 0 so other window managers (such as ourselves restarting) can start up; addresses race condition on restart where the old WM still had RedirectMask when the new WM was trying to start up. * src/display.c (meta_display_close): free each screen * src/window.c (meta_window_show): always focus new windows in click-to-focus mode
Diffstat (limited to 'src')
-rw-r--r--src/display.c12
-rw-r--r--src/screen.c8
-rw-r--r--src/window.c5
3 files changed, 24 insertions, 1 deletions
diff --git a/src/display.c b/src/display.c
index ecebc26..1c2a713 100644
--- a/src/display.c
+++ b/src/display.c
@@ -433,6 +433,18 @@ meta_display_close (MetaDisplay *display)
event_callback,
display);
#endif
+
+ /* Free all screens */
+ tmp = display->screens;
+ while (tmp != NULL)
+ {
+ MetaScreen *screen = tmp->data;
+ meta_screen_free (screen);
+ tmp = tmp->next;
+ }
+
+ g_slist_free (display->screens);
+ display->screens = NULL;
/* Must be after all calls to meta_window_free() since they
* unregister windows
diff --git a/src/screen.c b/src/screen.c
index 6731af8..5168d14 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -242,7 +242,7 @@ meta_screen_new (MetaDisplay *display,
void
meta_screen_free (MetaScreen *screen)
-{
+{
meta_prefs_remove_listener (prefs_changed_callback, screen);
meta_screen_ungrab_keys (screen);
@@ -250,6 +250,12 @@ meta_screen_free (MetaScreen *screen)
meta_ui_free (screen->ui);
meta_stack_free (screen->stack);
+
+ meta_error_trap_push (screen->display);
+ XSelectInput (screen->display->xdisplay, screen->xroot, 0);
+ if (meta_error_trap_pop (screen->display) != Success)
+ meta_warning (_("Could not release screen %d on display '%s'\n"),
+ screen->number, screen->display->name);
g_free (screen->screen_name);
g_free (screen);
diff --git a/src/window.c b/src/window.c
index 06a5a3e..8954cd2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1108,6 +1108,11 @@ meta_window_show (MetaWindow *window)
meta_display_get_current_time (window->display));
}
}
+
+ /* Always focus new windows in click-to-focus */
+ if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
+ meta_window_focus (window,
+ meta_display_get_current_time (window->display));
}
}