summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2004-12-28 06:01:42 +0000
committerElijah Newren <newren@src.gnome.org>2004-12-28 06:01:42 +0000
commitc74ab35c6c3d4c345dcb93ea6f80cc4d70d6b008 (patch)
tree568d0150d8db8b093bfeeabc8869f0b683e13b82
parent0bf6bffb165f926346a525cea8248f1962d39ded (diff)
downloadmetacity-c74ab35c6c3d4c345dcb93ea6f80cc4d70d6b008.tar.gz
Focus windows that manually position themselves too (fixes #107347).
2004-12-27 Elijah Newren <newren@gmail.com> Focus windows that manually position themselves too (fixes #107347). * src/window.h (struct _MetaWindow): add a new showing_for_first_time flag * src/window.c (meta_window_new_with_attrs): initialize showing_for_first_time flag to !mapped, (meta_window_show): replace did_placement with showing_for_first_time in the section to decided whether to focus since did_placement isn't quite what we want
-rw-r--r--ChangeLog14
-rw-r--r--src/window.c9
-rw-r--r--src/window.h3
3 files changed, 25 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b68475d..aef0eafe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2004-12-27 Elijah Newren <newren@gmail.com>
+ Focus windows that manually position themselves too (fixes
+ #107347).
+
+ * src/window.h (struct _MetaWindow): add a new
+ showing_for_first_time flag
+
+ * src/window.c (meta_window_new_with_attrs): initialize
+ showing_for_first_time flag to !mapped, (meta_window_show):
+ replace did_placement with showing_for_first_time in the section
+ to decided whether to focus since did_placement isn't quite what
+ we want
+
+2004-12-27 Elijah Newren <newren@gmail.com>
+
* src/display.c (meta_display_set_input_focus_window,
meta_display_focus_the_no_focus_window): Spew warning if
CurrentTime is passed to the function, but don't exit prematurely.
diff --git a/src/window.c b/src/window.c
index cc44aab0..3a06eaf5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -438,6 +438,8 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->minimized = FALSE;
window->iconic = FALSE;
window->mapped = attrs->map_state != IsUnmapped;
+ /* if already mapped, no need to worry about focus-on-first-time-showing */
+ window->showing_for_first_time = !window->mapped;
/* if already mapped we don't want to do the placement thing */
window->placed = window->mapped;
if (window->placed)
@@ -1761,8 +1763,13 @@ meta_window_show (MetaWindow *window)
}
}
- if (did_placement)
+ /* We don't want to worry about all cases from inside
+ * implement_showing(); we only want to worry about focus if this
+ * window has not been shown before.
+ */
+ if (window->showing_for_first_time)
{
+ window->showing_for_first_time = FALSE;
if (takes_focus_on_map)
{
meta_window_focus (window,
diff --git a/src/window.h b/src/window.h
index dca7e6de..1d5ca2f2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -207,6 +207,9 @@ struct _MetaWindow
/* Have we placed this window? */
guint placed : 1;
+ /* Has this window not ever been shown yet? */
+ guint showing_for_first_time : 1;
+
/* Are we in meta_window_free()? */
guint unmanaging : 1;